:root {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    --surface: #ffffff;
    --background: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --error: #ef4444;
    --success: #10b981;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --transition: all 0.25s ease-in-out;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(2, 132, 199, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(14, 165, 233, 0.03) 0%, transparent 40%);
}

/* Estilo específico para página de login */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(2, 132, 199, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(14, 165, 233, 0.05) 0%, transparent 40%);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand-header {
    text-align: center;
    margin-bottom: 24px;
}

.brand-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 1.5px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
    margin-bottom: 12px;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.auth-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.family-section {
    margin-bottom: 24px;
}

.family-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
}

.avatars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.avatar-btn {
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.avatar-btn:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.avatar-btn.selected {
    border-color: var(--primary);
    background-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: var(--primary-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.avatar-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span {
    padding: 0 10px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 12px 14px 12px 42px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.toggle-password {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--text-main);
}

.error-message {
    color: var(--error);
    font-size: 0.78rem;
    margin-top: 4px;
    display: none;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.checkbox-label input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
}

.btn-submit:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 360px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transform: scale(0.96) translateY(6px);
    transition: var(--transition);
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin: 0 auto 14px auto;
}

.modal-icon.success {
    background-color: #d1fae5;
    color: var(--success);
}

.modal-icon.error {
    background-color: #fee2e2;
    color: var(--error);
}

.modal-icon.confirm {
    background-color: #fef3c7;
    color: #b45309;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.modal-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 18px;
}

.modal-btn {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--primary);
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.modal-btn:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.footer-credits {
    text-align: center;
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* App Layout */
.app-layout {
    width: 100%;
    position: relative;
}

/* Navigation Styles */
.main-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-container {
    max-width: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    object-fit: cover;
}

.nav-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 8px;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.user-info:hover {
    background: var(--primary-light);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    overflow: hidden;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.85rem;
}

.user-level {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.user-menu-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.user-info:hover .user-menu-arrow {
    transform: rotate(180deg);
}

.user-submenu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.user-submenu[style*="display: flex"] {
    visibility: visible;
    opacity: 1;
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
    font-size: 0.9rem;
}

.submenu-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.submenu-item i {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.submenu-item:hover i {
    color: var(--primary);
}

.submenu-item.logout {
    color: var(--error);
}

.submenu-item.logout:hover {
    background: #fee2e2;
    color: var(--error);
}

.submenu-item.logout i {
    color: var(--error);
}

.submenu-item.logout:hover i {
    color: var(--error);
}

/* Main Content */
.main-content {
    margin-left: 0;
    padding: 30px;
    min-height: calc(100vh - 60px);
    position: relative;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Responsive Navigation */
@media (max-width: 1024px) {
    .main-nav {
        padding: 0 20px;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-link span {
        display: none;
    }

    .nav-link i {
        font-size: 1.2rem;
    }

    .user-details {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .nav-brand .nav-title {
        font-size: 1rem;
    }

    .nav-logo {
        width: 40px;
        height: 40px;
    }
}

/* Login — composição em duas colunas */
body.login-page { min-height:100vh; padding:28px; background:#eff6ff; background-image:radial-gradient(circle at 8% 15%,rgba(14,165,233,.22),transparent 25%),radial-gradient(circle at 93% 85%,rgba(56,189,248,.16),transparent 28%); }
.login-shell { width:min(1120px,100%); min-height:680px; display:grid; grid-template-columns:minmax(360px,1.04fr) minmax(400px,.96fr); overflow:hidden; border:1px solid rgba(148,163,184,.35); border-radius:24px; background:var(--surface); box-shadow:0 28px 65px rgba(15,23,42,.18); }
.login-showcase { position:relative; isolation:isolate; display:flex; flex-direction:column; padding:42px; color:#f8fafc; background:linear-gradient(145deg,#075985 0%,#0284c7 55%,#0ea5e9 100%); overflow:hidden; }
.login-showcase::before,.login-showcase::after { content:""; position:absolute; z-index:-1; border-radius:50%; border:1px solid rgba(255,255,255,.18); }.login-showcase::before { width:440px; height:440px; right:-190px; bottom:-190px; box-shadow:0 0 0 46px rgba(255,255,255,.06),0 0 0 92px rgba(255,255,255,.04); }.login-showcase::after { width:250px; height:250px; left:-140px; top:-100px; }
.showcase-brand { display:flex; align-items:center; gap:11px; font-size:.98rem; font-weight:700; letter-spacing:-.02em; }.showcase-logo { width:38px; height:38px; object-fit:cover; border-radius:11px; border:2px solid rgba(255,255,255,.7); }.showcase-copy { margin:auto 0 30px; }.showcase-eyebrow,.login-kicker { margin-bottom:10px; font-size:.75rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }.showcase-eyebrow { color:#bae6fd; }.showcase-copy h1 { margin:0; font-size:clamp(2rem,4vw,3.2rem); line-height:1.1; letter-spacing:-.055em; }.showcase-copy p:not(.showcase-eyebrow) { max-width:390px; margin-top:20px; color:#e0f2fe; font-size:.98rem; line-height:1.65; }.showcase-features { display:grid; gap:12px; }.showcase-features span { display:flex; align-items:center; gap:10px; font-size:.86rem; font-weight:500; color:#e0f2fe; }.showcase-features i { display:grid; place-items:center; width:28px; height:28px; border-radius:8px; background:rgba(255,255,255,.15); color:#fff; }.showcase-footer { margin-top:34px; font-size:.75rem; color:#bae6fd; }
.login-shell .auth-container { width:100%; max-width:none; display:flex; flex-direction:column; justify-content:center; padding:42px clamp(30px,5vw,62px); animation:fadeIn .55s ease-out; }.login-shell .brand-header { margin-bottom:26px; text-align:left; }.login-shell .brand-logo-badge { width:43px; height:43px; margin:0 0 17px; border-radius:13px; font-size:1rem; box-shadow:none; }.login-kicker { color:var(--primary); }.login-shell .brand-title { font-size:1.75rem; letter-spacing:-.045em; }.login-shell .brand-subtitle { margin-top:7px; }.login-shell .auth-card { padding:0; border:0; border-radius:0; box-shadow:none; overflow:visible; }.login-shell .family-section { margin-bottom:22px; }.login-shell .family-section-title { text-align:left; font-size:.72rem; letter-spacing:.09em; }.login-shell .avatars-grid { gap:9px; }.login-shell .avatar-btn { min-height:82px; padding:9px 5px; border-radius:12px; background:#f8fafc; }.login-shell .avatar-circle { width:35px; height:35px; margin-bottom:5px; background:#e0f2fe; }.login-shell .avatar-btn:nth-child(2) .avatar-circle { background:#f3e8ff; color:#7e22ce; }.login-shell .avatar-btn:nth-child(3) .avatar-circle { background:#dcfce7; color:#15803d; }.login-shell .divider { margin:19px 0; }.login-shell .form-group { margin-bottom:16px; }.login-shell .form-label { font-size:.82rem; font-weight:600; }.login-shell .form-control { height:46px; padding-top:0; padding-bottom:0; border-radius:11px; }.login-shell .toggle-password { position:absolute; right:9px; display:grid; place-items:center; width:34px; height:34px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--text-muted); cursor:pointer; }.login-shell .toggle-password:hover { background:var(--primary-light); color:var(--primary); }.login-shell .form-options { margin:19px 0 22px; font-size:.8rem; }.login-shell .btn-submit { display:flex; align-items:center; justify-content:center; gap:11px; min-height:47px; border-radius:11px; background:linear-gradient(135deg,#0284c7,#0369a1); box-shadow:0 8px 16px rgba(2,132,199,.2); }.login-shell .btn-submit:hover { box-shadow:0 11px 20px rgba(2,132,199,.28); }.login-shell .footer-credits { margin-top:26px; }
.login-shell .avatar-profile-image { display:block; width:100%; height:100%; border-radius:50%; object-fit:cover; }
@media (max-width:820px) { body.login-page { align-items:flex-start; padding:16px; }.login-shell { display:block; min-height:0; max-width:540px; }.login-showcase { min-height:260px; padding:28px; }.showcase-copy { margin:34px 0 0; }.showcase-copy h1 { font-size:2rem; }.showcase-copy p:not(.showcase-eyebrow),.showcase-features,.showcase-footer { display:none; }.login-shell .auth-container { padding:34px 28px; } }
@media (max-width:420px) { body.login-page { padding:0; }.login-shell { min-height:100vh; border:0; border-radius:0; }.login-showcase { min-height:210px; }.login-shell .auth-container { padding:30px 22px; }.login-shell .brand-title { font-size:1.5rem; } }

/* Main Content */
.main-content {
    max-width: 100%;
    margin: 0;
    padding: 20px 30px;
}



/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--primary-light);
    color: var(--primary-hover);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Form Buttons */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Footer */
.main-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 20px 30px;
    text-align: center;
    position: relative;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .avatars-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-footer {
        margin-left: 0;
        padding: 20px;
    }

    .main-footer.expanded {
        margin-left: 0;
    }
}

/* Confirmação global reutilizável */
.confirm-card { text-align: left; }
.confirm-card .modal-icon { margin: 0 0 16px; }
.modal-icon.confirm { background: #fee2e2; color: var(--error); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.confirm-cancel, .confirm-accept { padding: 10px 16px; border: 0; border-radius: var(--radius-md); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.confirm-cancel { background: #e2e8f0; color: var(--text-main); }
.confirm-cancel:hover { background: #cbd5e1; }
.confirm-accept { background: var(--error); color: #fff; }
.confirm-accept:hover { background: #dc2626; }

/* Sidebar de navegação */
body { --sidebar-width: 270px; --sidebar-collapsed-width: 82px; }

.main-nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 12px rgba(15, 23, 42, .05);
    transition: width .25s ease, transform .25s ease;
    overflow: visible;
}

.nav-container { height: 100%; padding: 22px 14px; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 28px; }
.nav-brand { min-height: 46px; padding: 0 8px; gap: 11px; white-space: nowrap; }
.nav-logo { flex: 0 0 42px; width: 42px; height: 42px; }
.nav-title { display: block; flex: 1; min-width: 0; overflow: hidden; transition: opacity .15s ease; }
.nav-title-marquee { display: inline-block; white-space: nowrap; animation: title-marquee 3.5s ease-in-out infinite alternate; }
@keyframes title-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-22px); }
}
@media (prefers-reduced-motion: reduce) {
    .nav-title-marquee { animation: none; }
}
.sidebar-toggle { margin-left: auto; width: 32px; height: 32px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); border-radius: 8px; cursor: pointer; transition: var(--transition); }
.sidebar-toggle:hover { color: var(--primary); border-color: var(--primary); }
.mobile-sidebar-toggle, .sidebar-backdrop { display: none; }
.nav-links { display: flex; flex-direction: column; gap: 6px; }
.nav-link { min-height: 46px; padding: 11px 12px; border-radius: 9px; white-space: nowrap; }
.nav-link i { width: 20px; text-align: center; font-size: 1rem; }
.nav-link span { overflow: hidden; }
.nav-user { margin-top: auto; display: block; }
.user-info { width: 100%; border: 0; background: transparent; text-align: left; padding: 8px; }
.user-submenu { position: absolute; bottom: calc(100% + 8px); top: auto; left: 0; right: 0; min-width: auto; }
.user-submenu[hidden] { display: none; }
.user-submenu:not([hidden]) { display: flex; visibility: visible; opacity: 1; }
.app-layout, .main-footer {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: margin-left .25s ease, width .25s ease;
}
.main-content { min-height: calc(100vh - 43px); padding: 20px 28px; }

body.sidebar-collapsed .main-nav { width: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .app-layout, body.sidebar-collapsed .main-footer {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}
body.sidebar-collapsed .nav-container { padding-left: 14px; padding-right: 14px; }
body.sidebar-collapsed .nav-brand { padding: 0 5px; }
body.sidebar-collapsed .nav-title, body.sidebar-collapsed .nav-link span, body.sidebar-collapsed .user-details, body.sidebar-collapsed .user-menu-arrow { display: none; }
body.sidebar-collapsed .sidebar-toggle i { transform: rotate(180deg); }
body.sidebar-collapsed .nav-link, body.sidebar-collapsed .user-info { justify-content: center; padding-left: 8px; padding-right: 8px; }
body.sidebar-collapsed .user-submenu { left: calc(100% + 8px); right: auto; bottom: 0; width: 190px; }

@media (max-width: 768px) {
    .main-nav { width: min(280px, 82vw); transform: translateX(-100%); z-index: 2000; }
    .main-nav.mobile-open { transform: translateX(0); }
    .nav-container { padding: 22px 14px; }
    .sidebar-toggle:not(.mobile-sidebar-toggle) { display: none; }
    .mobile-sidebar-toggle { display: grid; place-items: center; position: fixed; top: 14px; left: 14px; z-index: 1900; margin: 0; width: 42px; height: 42px; box-shadow: var(--shadow-md); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 1900; background: rgba(15, 23, 42, .38); opacity: 0; visibility: hidden; transition: var(--transition); }
    .sidebar-backdrop.active { display: block; opacity: 1; visibility: visible; }
    .app-layout, .main-footer, body.sidebar-collapsed .app-layout, body.sidebar-collapsed .main-footer { margin-left: 0; width: 100%; }
    .main-content { padding: 76px 20px 24px; }
    .nav-title, .nav-link span, .user-details, .user-menu-arrow { display: initial; }
}

/* ===== Sistema de Toasts (Notificações flutuantes) — alinhado ao design do Dashboard ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(.22,.84,.42,1), opacity 0.25s ease, box-shadow var(--transition);
    position: relative;
}

.toast:hover {
    box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.18), 0 10px 16px -8px rgba(15, 23, 42, 0.08);
}

.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.toast-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.toast-header-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
    margin: 1px 0 2px 0;
    letter-spacing: -0.2px;
}

.toast-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.3;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-message {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-line;
}

.toast-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.toast-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--background);
    border-radius: var(--radius-md);
    gap: 10px;
}

.toast-list-info { flex: 1; min-width: 0; }

.toast-list-title {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.85rem;
    margin-bottom: 3px;
    line-height: 1.3;
}

.toast-list-value {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.toast-list-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
    background: var(--primary-light);
    color: var(--primary);
}

.toast-list-badge.urgent {
    background: #fee2e2;
    color: var(--error);
}

.toast-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: 1px solid var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.toast-action:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
    text-decoration: none;
}

.toast-action.secondary {
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--border);
}

.toast-action.secondary:hover {
    border-color: var(--primary);
    color: var(--primary-hover);
}

.toast-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
    padding: 0;
}

.toast-close:hover { background: var(--background); color: var(--text-main); }

/* Variantes — alinhadas aos stat-icons do dashboard */
.toast-info .toast-icon        { background: var(--primary-light); color: var(--primary); }
.toast-info .toast-action      { background: var(--primary); border-color: var(--primary); }
.toast-info .toast-list-badge  { background: var(--primary-light); color: var(--primary); }

.toast-success .toast-icon     { background: #d1fae5; color: var(--success); }

.toast-warning .toast-icon     { background: #fef3c7; color: #b45309; }
.toast-warning .toast-title    { color: #78350f; }
.toast-warning .toast-subtitle { color: #92400e; }
.toast-warning .toast-message  { color: #92400e; }
.toast-warning .toast-action   { background: #f59e0b; border-color: #f59e0b; color: white; }
.toast-warning .toast-action:hover { background: #d97706; border-color: #d97706; }

.toast-error .toast-icon       { background: #fee2e2; color: var(--error); }
.toast-error .toast-title      { color: #991b1b; }
.toast-error .toast-subtitle   { color: #7f1d1d; }
.toast-error .toast-message    { color: #7f1d1d; }
.toast-error .toast-action     { background: var(--error); border-color: var(--error); }
.toast-error .toast-action:hover { background: #dc2626; border-color: #dc2626; }

@media (max-width: 768px) {
    .toast-container {
        top: 14px;
        right: 14px;
        left: 14px;
        max-width: none;
        width: auto;
    }
}
