@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    /* Paleta Institucional SYSPERR — SYSPERR Copiloto RH */
    --bg-main: #f3f7f6;
    --bg-sidebar: #091c1e;
    --bg-sidebar-elev: #0f2b2e;
    --bg-card: #ffffff;

    --primary: #0f766e;
    --primary-light: #14b8a6;
    --primary-soft: rgba(15, 118, 110, 0.12);
    --primary-glow: rgba(15, 118, 110, 0.28);
    --primary-hover: #0d5f59;

    --accent: #d97706;
    --accent-glow: rgba(217, 119, 6, 0.28);

    --success: #059669;
    --success-glow: rgba(5, 150, 105, 0.28);

    --warning: #d97706;
    --warning-glow: rgba(217, 119, 6, 0.28);

    --purple: #6366f1;
    --purple-glow: rgba(99, 102, 241, 0.28);

    --danger: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.28);

    --text-main: #0f2224;
    --text-muted: #52686b;
    --text-light: #8ba0a3;

    --border: #dce6e5;
    --border-dark: rgba(255, 255, 255, 0.08);

    --shadow-sm: 0 2px 6px rgba(9, 28, 30, 0.05);
    --shadow-md: 0 12px 26px -6px rgba(9, 28, 30, 0.10), 0 6px 10px -6px rgba(9, 28, 30, 0.05);
    --shadow-lg: 0 22px 38px -12px rgba(9, 28, 30, 0.18);
    --radius: 16px;
    --radius-sm: 10px;
}

/* --- RESET & GERAL --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

code, pre, .json-box {
    font-family: 'JetBrains Mono', monospace;
}

/* Scrollbar discreta */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #c5d4d3;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9db4b2;
}

/* --- TELA DE LOGIN INSTITUCIONAL (COPILOTO RH) --- */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 20%, rgba(20, 184, 166, 0.24) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(217, 119, 6, 0.20) 0%, transparent 45%),
        linear-gradient(145deg, #061517 0%, #0d2b2e 55%, #091d20 100%);
    position: relative;
    overflow: hidden;
}

body.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.login-box {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    padding: 44px 40px 38px;
    border-radius: 24px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.55);
    width: 100%;
    max-width: 440px;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.35);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #0f766e, #14b8a6, #d97706);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo-icon {
    width: 66px;
    height: 66px;
    background: linear-gradient(135deg, #0f766e, #0d9488);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #ffffff;
    box-shadow: 0 12px 26px -6px rgba(15, 118, 110, 0.45);
    margin-bottom: 14px;
}

.login-header h2 {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: var(--text-main);
}

.login-org-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.login-footer-note {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- ESTRUTURA DO DASHBOARD (SIDEBAR + CONTEÚDO) --- */
.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 268px;
    background: linear-gradient(180deg, #091c1e 0%, #0c2629 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed !important;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 50;
    border-right: 1px solid var(--border-dark);
    transition: width 0.3s ease;
    box-shadow: 6px 0 24px rgba(6, 21, 23, 0.14);
}

.sidebar > div:first-of-type {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-dark);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(20, 184, 166, 0.35);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.1;
    background: linear-gradient(to right, #ffffff, #99f6e4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.sidebar-sub {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #5eead4;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    padding: 18px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: #6f9498;
    margin: 14px 10px 6px 10px;
    font-weight: 800;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 15px;
    border-radius: 12px;
    color: #c7dddf;
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-left: 3px solid transparent;
}

.nav-item i {
    font-size: 1.08rem;
    width: 22px;
    text-align: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.nav-item:hover i {
    transform: translateX(2px);
    color: #5eead4;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.22), rgba(20, 184, 166, 0.04));
    border-left-color: #2dd4bf;
    color: #ffffff;
}

.nav-item.active i {
    color: #2dd4bf;
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--border-dark);
    background: rgba(0, 0, 0, 0.22);
}

.user-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0f766e, #115e59);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.9rem;
}

.user-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: #99b8bc;
    font-weight: 600;
}

/* Botão de recolher/expandir Sidebar */
.sidebar-toggle {
    position: absolute;
    top: 26px;
    right: -15px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #ffffff;
    border: 2px solid var(--bg-main);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(9, 28, 30, 0.22);
    z-index: 100;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.sidebar-toggle:hover {
    filter: brightness(1.08);
    transform: scale(1.08);
}

/* Estado Recolhido da Sidebar */
.sidebar.collapsed {
    width: 82px;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 0;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .nav-item i {
    margin: 0;
    font-size: 1.3rem;
}

.sidebar.collapsed .user-profile {
    flex-direction: column;
    align-items: center;
    padding: 10px 4px;
    gap: 8px;
}

/* --- CONTEÚDO PRINCIPAL --- */
.main-wrapper {
    flex: 1;
    margin-left: 268px;
    width: calc(100% - 268px);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed ~ .main-wrapper {
    margin-left: 82px;
    width: calc(100% - 82px);
}

.top-navbar {
    height: 72px;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.org-tag-nav {
    font-size: 0.72rem;
    font-weight: 700;
    color: #0f766e;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 4px 10px;
    border-radius: 999px;
}

.top-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.main-content {
    padding: 30px 36px 40px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

/* --- BANNER DE BOAS-VINDAS (MENU) --- */
.hero-welcome {
    background: linear-gradient(135deg, #091c1e 0%, #0f3d3e 55%, #0f766e 100%);
    color: #ffffff;
    border-radius: 20px;
    padding: 30px 34px;
    margin-bottom: 26px;
    box-shadow: 0 18px 36px -14px rgba(9, 28, 30, 0.38);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.hero-welcome::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.hero-welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.20);
    color: #ccfbf1;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.hero-welcome h2 {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-bottom: 6px;
    color: #ffffff;
}

.hero-welcome p {
    color: #d1fae5;
    font-size: 0.94rem;
    max-width: 680px;
    line-height: 1.5;
}

/* --- CARDS E DASHBOARD GRID --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 22px;
    margin-top: 20px;
}

.system-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 26px 24px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.dashboard-grid .system-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #b9cfcd;
}

.card-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 20px;
    transition: transform 0.28s ease;
}

.dashboard-grid .system-card:hover .card-icon-wrapper {
    transform: scale(1.08) rotate(3deg);
}

.system-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}

.system-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 24px;
}

/* Variações de Cards */
.card-teal { border-top-color: #0f766e; }
.card-teal .card-icon-wrapper { background: rgba(15, 118, 110, 0.12); color: #0f766e; }
.card-teal .btn-card { background: #0f766e; box-shadow: 0 6px 14px -4px rgba(15, 118, 110, 0.4); }

.card-amber { border-top-color: #d97706; }
.card-amber .card-icon-wrapper { background: rgba(217, 119, 6, 0.12); color: #d97706; }
.card-amber .btn-card { background: #d97706; box-shadow: 0 6px 14px -4px rgba(217, 119, 6, 0.4); }

.card-emerald { border-top-color: #059669; }
.card-emerald .card-icon-wrapper { background: rgba(5, 150, 105, 0.12); color: #059669; }
.card-emerald .btn-card { background: #059669; box-shadow: 0 6px 14px -4px rgba(5, 150, 105, 0.4); }

.card-blue .card-icon-wrapper { background: rgba(2, 132, 199, 0.12); color: #0284c7; }
.card-blue .btn-card { background: #0284c7; box-shadow: 0 6px 14px -4px rgba(2, 132, 199, 0.38); }

/* --- BOTÕES --- */
.btn-primary, .btn-card {
    background: linear-gradient(135deg, var(--primary), #0d9488);
    color: #ffffff;
    border: none;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 6px 14px -4px var(--primary-glow);
}

.btn-primary:hover, .btn-card:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
}

.btn-primary:disabled, .btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f1f6f5;
    border-color: #b7cbca;
}

/* --- COMPONENTES DA UI & TABELAS --- */
.upload-section {
    background: var(--bg-card);
    padding: 34px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    margin-bottom: 28px;
    border: 2px dashed #bdd1cf;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.upload-section:hover {
    border-color: var(--primary);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 18px;
    overflow-x: auto;
    width: 100%;
    margin: 0 auto;
}

.data-table, .log-table, table.dataTable {
    width: 100% !important;
    margin: 0 auto !important;
    border-collapse: collapse;
}

.data-table th,
.log-table th,
table.dataTable thead th,
table.dataTable thead td {
    background-color: #f4f8f7;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 13px 16px !important;
    text-align: center !important;
    vertical-align: middle !important;
    border-bottom: 2px solid var(--border) !important;
}

.data-table td,
.log-table td,
table.dataTable tbody td {
    padding: 13px 16px !important;
    text-align: center !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #edf3f2;
    font-size: 0.88rem;
    color: var(--text-main);
}

.data-table tr:last-child td,
.log-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover,
.log-table tbody tr:hover,
table.dataTable tbody tr:hover {
    background-color: #f3f8f7 !important;
}

/* Badges utilitárias */
.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    display: inline-block;
    white-space: nowrap;
}
.badge-primary { background: #ccfbf1; color: #0f766e; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }

/* --- CONTROLES DATATABLES --- */
.dataTables_wrapper {
    width: 100%;
    font-size: 0.88rem;
    color: var(--text-main);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-muted) !important;
    font-weight: 600;
    margin: 6px 0;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 9px;
    margin-left: 8px;
    background: #f8fbfa;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.dataTables_wrapper .dataTables_length select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f8fbfa;
    color: var(--text-main);
    font-weight: 600;
    margin: 0 6px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    padding: 6px 12px !important;
    margin: 0 2px !important;
    border: 1px solid var(--border) !important;
    background: #ffffff !important;
    color: var(--text-main) !important;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled) {
    background: #ecfdf5 !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.45;
    cursor: not-allowed !important;
}

table.dataTable.no-footer {
    border-bottom: 1px solid var(--border) !important;
}

/* --- FORMULÁRIOS --- */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    font-size: 0.83rem;
    color: var(--text-main);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.93rem;
    font-family: inherit;
    color: var(--text-main);
    transition: all 0.2s;
    background: #f8fbfa;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
}

/* --- MODAIS --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(9, 28, 30, 0.62);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content.lg {
    max-width: 1060px;
}

.close {
    position: absolute;
    right: 22px;
    top: 22px;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f6f5;
}

.close:hover {
    color: var(--danger);
    background: #fee2e2;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
    color: var(--text-muted);
}

.perm-hidden {
    display: none !important;
}

/* --- NOTIFICAÇÕES TOAST --- */
#sysperr-toast-container {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 410px;
    pointer-events: none;
}

.sysperr-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 12px;
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    box-shadow: 0 14px 30px -6px rgba(9, 28, 30, 0.22);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    animation: toastSlideIn 0.25s ease-out;
}

.sysperr-toast.toast-success { border-left-color: var(--success); }
.sysperr-toast.toast-success .toast-icon { color: var(--success); }

.sysperr-toast.toast-error { border-left-color: var(--danger); }
.sysperr-toast.toast-error .toast-icon { color: var(--danger); }

.sysperr-toast.toast-warning { border-left-color: var(--warning); }
.sysperr-toast.toast-warning .toast-icon { color: var(--warning); }

.sysperr-toast.toast-info { border-left-color: var(--primary); }
.sysperr-toast.toast-info .toast-icon { color: var(--primary); }

.sysperr-toast .toast-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.sysperr-toast .toast-msg {
    flex: 1;
    word-break: break-word;
}

.sysperr-toast .toast-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.9rem;
}

.sysperr-toast .toast-close:hover {
    color: var(--text-main);
}

.sysperr-toast.toast-leaving {
    animation: toastSlideOut 0.25s ease-in forwards;
}

@keyframes toastSlideIn {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(30px); opacity: 0; }
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 1024px) {
    .sidebar { width: 82px; }
    .sidebar-brand-text, .nav-item span, .user-name, .user-role, .nav-label { display: none; }
    .sidebar-header { justify-content: center; padding: 20px 0; }
    .nav-item { justify-content: center; padding: 14px 0; }
    .main-wrapper { margin-left: 82px; width: calc(100% - 82px); }
    .user-profile { justify-content: center; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-wrapper, .sidebar.collapsed ~ .main-wrapper { margin-left: 0; width: 100%; }
    .top-navbar { padding: 0 18px; }
    .main-content { padding: 18px; }
    .hero-welcome { padding: 22px; }
    #sysperr-toast-container { left: 16px; right: 16px; max-width: none; }
}
