/* Portcall Painel - Template C (menu lateral clean) */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-body: #020617;
    --bg-sidebar: #020617;
    --bg-sidebar-active: #0f172a;
    --bg-main: #020617;
    --bg-card: #020617;
    --border-card: #1e293b;
    --accent: #38bdf8;
    --accent-soft: rgba(56,189,248,0.12);
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --danger: #f97373;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-main);
    background: radial-gradient(circle at top left, #0f172a 0, #020617 40%, #020617 100%);
    color: var(--text-main);
}

/* LOGIN */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-panel {
    background: radial-gradient(circle at top left, #0b1120 0, #020617 60%);
    border-radius: 18px;
    padding: 32px 28px 28px;
    border: 1px solid rgba(148,163,184,0.2);
    box-shadow: 0 24px 80px rgba(15,23,42,0.9);
}

.login-brand .brand-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.login-brand .brand-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.login-form {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* APP SHELL */

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
    background: var(--bg-body);
}

/* SIDEBAR */

.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(15,23,42,0.85);
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-brand {
    padding: 6px 4px 10px;
}

.sidebar-brand .brand-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.sidebar-brand .brand-subtitle {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.12em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.18s ease;
}

.nav-item.active {
    background: var(--bg-sidebar-active);
    color: var(--accent);
    box-shadow: 0 0 0 1px rgba(56,189,248,0.18);
}

.nav-item:hover {
    background: rgba(15,23,42,0.9);
    color: #e5e7eb;
}

.nav-section {
    margin-top: 14px;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(15,23,42,0.9);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-block .user-name {
    font-size: 14px;
    font-weight: 500;
}

.user-block .user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-logout {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid rgba(148,163,184,0.4);
    color: var(--text-muted);
    transition: all 0.18s ease;
}

.btn-logout:hover {
    background: rgba(248,113,113,0.12);
    color: #fecaca;
    border-color: rgba(248,113,113,0.6);
}

/* MAIN AREA */

.app-main {
    background: radial-gradient(circle at top, #020617 0, #020617 55%, #000 100%);
    padding: 22px 26px 26px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.page-body {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* CARDS / TABLES */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px 18px;
    border: 1px solid var(--border-card);
}

.card.summary {
    background: radial-gradient(circle at top left, #0f172a 0, #020617 60%);
}

.card-label {
    font-size: 13px;
    color: var(--text-muted);
}

.card-value {
    margin-top: 6px;
    font-size: 28px;
    font-weight: 600;
}

/* FORMS */

.card-form {
    max-width: 880px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.field span {
    font-size: 13px;
}

.field input,
.field select {
    background: #020617;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.45);
    padding: 7px 11px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: all 0.17s ease;
}

.field input:focus,
.field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(56,189,248,0.4);
}

.field.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.field.checkbox input {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.form-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}

/* BUTTONS */

.btn-primary {
    background: linear-gradient(to right, #0ea5e9, #6366f1);
    color: #0b1120;
    border-radius: 999px;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 10px 30px rgba(37,99,235,0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 16px 40px rgba(37,99,235,0.6);
}

.btn-secondary {
    border-radius: 999px;
    padding: 8px 16px;
    border: 1px solid rgba(148,163,184,0.5);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}

.btn-full {
    width: 100%;
}

/* TABLE */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th,
.table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(30,64,175,0.55);
}

.table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.link,
.link-back {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
}

.link-back {
    margin-bottom: 10px;
    display: inline-block;
}

/* CONDO GRID */

.condo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.condo-card {
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(148,163,184,0.5);
    text-decoration: none;
    color: var(--text-main);
    background: radial-gradient(circle at top left, #020617 0, #020617 60%);
    transition: all 0.18s ease;
}

.condo-card:hover {
    border-color: rgba(56,189,248,0.8);
    box-shadow: 0 14px 30px rgba(15,23,42,0.9);
    transform: translateY(-1px);
}

.condo-name {
    font-weight: 500;
}

.condo-login {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ALERTS */

.alert {
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    margin-top: 14px;
}

.alert-error {
    background: rgba(248,113,113,0.12);
    border: 1px solid rgba(248,113,113,0.8);
    color: #fecaca;
}

/* TOOLBAR */

.toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

/* RESPONSIVE */

@media (max-width: 880px) {
    .app-shell {
        grid-template-columns: 220px minmax(0,1fr);
    }
}

@media (max-width: 720px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    .sidebar-footer {
        margin-top: 0;
        margin-left: auto;
        border-top: none;
    }
}

/* ── SEÇÕES DE FORMULÁRIO ── */
.form-section {
    margin-bottom: 24px;
}
.form-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #888;
    padding: 6px 0 8px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 14px;
}

/* linha com número + tempo lado a lado */
.field-inline {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}
.field-inline .field {
    margin-bottom: 0;
}
.field-tempo {
    flex: 0 0 100px;
}
