/* ============================================================
   INTRANET PESSOAL — Estilo Apple-inspired
   Fonte: DM Sans | Cor principal: #095B90
   ============================================================ */

/* ===== Variaveis ===== */
:root {
    --azul: #095B90;
    --azul-hover: #074a75;
    --azul-light: rgba(9, 91, 144, 0.10);
    --azul-light2: rgba(9, 91, 144, 0.06);
    --verde: #34C759;
    --vermelho: #FF3B30;
    --laranja: #FF9500;
    --roxo: #AF52DE;
    --rosa: #FF2D55;
    --ciano: #5AC8FA;

    --bg: #F5F5F7;
    --bg-sidebar: rgba(245, 245, 247, 0.80);
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.60);
    --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --card-radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;

    --texto: #1D1D1F;
    --texto-sec: #6E6E73;
    --texto-ter: #AEAEB2;
    --borda: rgba(0, 0, 0, 0.06);

    --sidebar-w: 240px;
    --topbar-h: 60px;

    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition: 0.25s var(--ease);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--texto);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== Tela de Login ===== */
.login-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #F5F5F7 0%, #E8E8ED 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.login-screen.hidden { display: none; }

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 48px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--glass-shadow);
    text-align: center;
}

.login-icon {
    width: 64px;
    height: 64px;
    background: var(--azul-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.login-icon svg {
    width: 28px;
    height: 28px;
    color: var(--azul);
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--texto);
    margin-bottom: 6px;
}

.login-subtitle {
    color: var(--texto-sec);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.login-field {
    margin-bottom: 18px;
    text-align: left;
}

.login-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--texto-sec);
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--borda);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--texto);
    background: rgba(255, 255, 255, 0.60);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.login-field input:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(9, 91, 144, 0.12);
}

.login-google-wrap {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.login-error {
    color: var(--vermelho);
    font-size: 0.85rem;
    margin-top: 14px;
    min-height: 20px;
    opacity: 0;
    transition: opacity var(--transition);
}

.login-error.visible { opacity: 1; }

.login-hint {
    color: var(--texto-ter);
    font-size: 0.8rem;
    margin-top: 8px;
    min-height: 18px;
}

.login-setup {
    margin-top: 20px;
    text-align: center;
}

.login-setup-toggle {
    background: none;
    border: none;
    color: var(--texto-ter);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color var(--transition);
}

.login-setup-toggle:hover { color: var(--azul); }

.login-setup-form {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.login-setup-input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--borda);
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    color: var(--texto);
    background: rgba(255, 255, 255, 0.60);
    outline: none;
    transition: border-color var(--transition);
}

.login-setup-input:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(9, 91, 144, 0.10);
}

.login-setup .btn-primary {
    font-size: 0.82rem;
    padding: 9px 14px;
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.app-container.locked { display: none; }

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-right: 1px solid var(--borda);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 16px;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: var(--azul);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--texto);
}

.sidebar-nav {
    flex: 1;
    padding: 4px 8px;
    overflow-y: auto;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--texto-sec);
    transition: background var(--transition), color var(--transition);
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--texto);
}

.nav-item.active {
    background: var(--azul-light);
    color: var(--azul);
    font-weight: 500;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 8px;
    border-top: 1px solid var(--borda);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Submenu group */
.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-group-toggle {
    position: relative;
}

.nav-chevron {
    width: 14px;
    height: 14px;
    margin-left: auto;
    transition: transform var(--transition);
    flex-shrink: 0;
    opacity: 0.5;
}

.nav-group.open .nav-chevron {
    transform: rotate(90deg);
}

.nav-submenu {
    display: none;
    flex-direction: column;
    gap: 1px;
    padding-left: 12px;
    overflow: hidden;
}

.nav-group.open .nav-submenu {
    display: flex;
}

.nav-sub-item {
    font-size: 0.85rem;
    padding: 8px 12px;
}

/* ===== Sidebar overlay (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ===== Topbar ===== */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    height: var(--topbar-h);
    flex-shrink: 0;
    background: rgba(245, 245, 247, 0.80);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--borda);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 6px;
    border-radius: var(--radius-xs);
    color: var(--texto-sec);
    transition: background var(--transition);
}

.menu-toggle:hover { background: rgba(0, 0, 0, 0.05); }
.menu-toggle svg { width: 22px; height: 22px; }

.page-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--texto);
}

/* ===== Content Area ===== */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    scroll-behavior: smooth;
}

.page { display: none; }
.page.active {
    display: block;
    animation: fadeIn 0.3s var(--ease);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Glass Card ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow);
    padding: 24px;
}

/* ===== Componentes de formulario ===== */
.form-group {
    margin-bottom: 18px;
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--texto-sec);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.select-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--borda);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    color: var(--texto);
    background: rgba(255, 255, 255, 0.60);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.select-field:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(9, 91, 144, 0.10);
}

.form-row {
    display: flex;
    gap: 14px;
}

/* ===== Botoes ===== */
.btn-primary {
    padding: 10px 20px;
    background: var(--azul);
    color: #fff;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    font-weight: 600;
    transition: background var(--transition), transform var(--transition);
    white-space: nowrap;
}

.btn-primary:hover { background: var(--azul-hover); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
    padding: 10px 20px;
    background: transparent;
    color: var(--texto-sec);
    border: 1px solid var(--borda);
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    font-weight: 500;
    transition: background var(--transition);
}

.btn-secondary:hover { background: rgba(0, 0, 0, 0.04); }

.btn-danger {
    padding: 6px 12px;
    background: rgba(255, 59, 48, 0.10);
    color: var(--vermelho);
    border: none;
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    font-weight: 500;
    transition: background var(--transition);
}

.btn-danger:hover { background: rgba(255, 59, 48, 0.18); }

.btn-icon {
    background: none;
    border: none;
    padding: 6px;
    border-radius: var(--radius-xs);
    color: var(--texto-sec);
    transition: background var(--transition), color var(--transition);
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--texto);
}

.btn-icon svg { width: 18px; height: 18px; }

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s var(--ease);
}

.modal {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--texto-ter);
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: background var(--transition), color var(--transition);
    line-height: 1;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--texto);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

/* ===== Toolbar de pagina ===== */
.page-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--borda);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    color: var(--texto);
    background: rgba(255, 255, 255, 0.60);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(9, 91, 144, 0.10);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--texto-ter);
}

.empty-state {
    text-align: center;
    color: var(--texto-ter);
    padding: 48px 20px;
    font-size: 0.95rem;
}

/* ===== DASHBOARD ===== */
.dash-greeting {
    margin-bottom: 24px;
}

.dash-greeting h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.dash-date {
    color: var(--texto-sec);
    font-size: 0.95rem;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Relogio */
.dash-clock-card {
    display: flex;
    align-items: baseline;
    gap: 6px;
    justify-content: center;
    padding: 32px 24px;
}

.dash-clock {
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--texto);
    letter-spacing: -2px;
    line-height: 1;
}

.dash-clock-sec {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--texto-ter);
}

/* Clima */
.dash-weather-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dash-weather {
    width: 100%;
}

.weather-loading {
    color: var(--texto-ter);
    font-size: 0.9rem;
    text-align: center;
}

.weather-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.weather-temp {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--texto);
    line-height: 1;
}

.weather-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.weather-desc {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--texto);
    text-transform: capitalize;
}

.weather-city {
    font-size: 0.8rem;
    color: var(--texto-sec);
}

.weather-extra {
    font-size: 0.78rem;
    color: var(--texto-ter);
}

.weather-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.weather-no-key {
    text-align: center;
    font-size: 0.85rem;
    color: var(--texto-ter);
    line-height: 1.5;
}

.weather-no-key a {
    color: var(--azul);
    text-decoration: underline;
    cursor: pointer;
}

/* Cards de resumo */
.dash-summary-card {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.dash-summary-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.summary-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-icon svg {
    width: 22px;
    height: 22px;
}

.summary-icon-notas { background: rgba(90, 200, 250, 0.15); color: var(--ciano); }

.summary-info {
    display: flex;
    flex-direction: column;
}

.summary-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--texto);
    line-height: 1.2;
}

.summary-label {
    font-size: 0.82rem;
    color: var(--texto-sec);
}

/* ===== NOTAS ===== */
.notas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.nota-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow);
    padding: 20px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nota-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.nota-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.nota-card-titulo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--texto);
    line-height: 1.3;
}

.nota-card-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.nota-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
    background: var(--azul-light);
    color: var(--azul);
}

.nota-tag.cat-Trabalho { background: rgba(255, 149, 0, 0.12); color: var(--laranja); }
.nota-tag.cat-Estudo { background: rgba(175, 82, 222, 0.12); color: var(--roxo); }
.nota-tag.cat-Ideias { background: rgba(52, 199, 89, 0.12); color: var(--verde); }
.nota-tag.cat-Outros { background: rgba(110, 110, 115, 0.12); color: var(--texto-sec); }

.nota-card-corpo {
    font-size: 0.85rem;
    color: var(--texto-sec);
    line-height: 1.5;
    max-height: 72px;
    overflow: hidden;
}

.nota-card-data {
    font-size: 0.75rem;
    color: var(--texto-ter);
}

/* Editor de notas */
.nota-cat-row {
    display: flex;
    gap: 8px;
}

.nota-cat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--borda);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    color: var(--texto);
    background: rgba(255, 255, 255, 0.60);
    outline: none;
    transition: border-color var(--transition);
}

.nota-cat-input:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(9, 91, 144, 0.10);
}

.editor-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.editor-btn {
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--texto-sec);
    transition: background var(--transition), color var(--transition);
}

.editor-btn:hover {
    background: var(--azul-light);
    color: var(--azul);
}

.editor-area {
    min-height: 140px;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid var(--borda);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    color: var(--texto);
    background: rgba(255, 255, 255, 0.60);
    outline: none;
    line-height: 1.6;
    transition: border-color var(--transition);
}

.editor-area:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(9, 91, 144, 0.10);
}

.editor-area:empty::before {
    content: attr(placeholder);
    color: var(--texto-ter);
}

/* ===== CONFIGURACOES ===== */
.config-card {
    max-width: 480px;
    margin-bottom: 20px;
}

.config-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.config-card > p {
    font-size: 0.88rem;
    color: var(--texto-sec);
    margin-bottom: 22px;
}

.config-msg {
    margin-top: 14px;
    font-size: 0.85rem;
    min-height: 20px;
    opacity: 0;
    transition: opacity var(--transition);
}

.config-msg.visible { opacity: 1; }
.config-msg.sucesso { color: var(--verde); }
.config-msg.erro { color: var(--vermelho); }

/* Conta conectada */
.config-user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

.config-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--azul-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--azul);
    flex-shrink: 0;
    overflow: hidden;
}

.config-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.config-user-details {
    display: flex;
    flex-direction: column;
}

.config-user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--texto);
}

.config-user-email {
    font-size: 0.82rem;
    color: var(--texto-sec);
}

/* Permissoes */
.perm-add-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 20px;
    margin-bottom: 4px;
}

.perm-add-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--borda);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    color: var(--texto);
    background: rgba(255, 255, 255, 0.60);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.perm-add-form input:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(9, 91, 144, 0.10);
}

.perm-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perm-item-card {
    background: var(--azul-light2);
    border-radius: var(--card-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.perm-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.perm-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.perm-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.perm-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--azul-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--azul);
    flex-shrink: 0;
    text-transform: uppercase;
}

.perm-item-email {
    font-size: 0.88rem;
    color: var(--texto);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.perm-item-tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(52, 199, 89, 0.12);
    color: var(--verde);
    white-space: nowrap;
}

.perm-item-tag.admin {
    background: rgba(255, 149, 0, 0.12);
    color: var(--laranja);
}

/* Checkboxes de menus */
.perm-menus {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--borda);
}

.perm-menus-admin {
    font-size: 0.78rem;
    color: var(--texto-ter);
    font-style: italic;
    padding-top: 4px;
}

.perm-menu-check {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.50);
    border: 1px solid var(--borda);
    transition: background var(--transition), border-color var(--transition);
}

.perm-menu-check:hover {
    background: rgba(255, 255, 255, 0.80);
}

.perm-menu-check:has(input:checked) {
    background: var(--azul-light);
    border-color: rgba(9, 91, 144, 0.25);
}

.perm-menu-input {
    width: 14px;
    height: 14px;
    accent-color: var(--azul);
    cursor: pointer;
}

.perm-menu-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--texto-sec);
    white-space: nowrap;
}

/* Snake game container */
.snake-container {
    width: 100%;
    height: calc(100vh - var(--topbar-h) - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111116;
    border-radius: var(--card-radius);
    overflow: hidden;
}

/* ===== Responsivo ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .topbar {
        padding: 0 16px;
    }

    .content-area {
        padding: 16px;
    }

    .dash-grid {
        grid-template-columns: 1fr;
    }

    .dash-clock {
        font-size: 2.4rem;
    }

    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .page-toolbar .search-box {
        min-width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .notas-grid {
        grid-template-columns: 1fr;
    }

    .nota-cat-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .dash-greeting h2 {
        font-size: 1.3rem;
    }

    .modal {
        padding: 20px;
    }
}
