@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --panel: rgba(255, 255, 255, 0.9);
    --line:  rgba(148, 163, 184, 0.18);
    --sky:   #38bdf8;
    --sky-bg: rgba(14, 165, 233, 0.08);
}

body {
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 24%),
        linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
    color: #0f172a;
}

.app-shell { min-height: 100vh; }

/* ══════════════════════════════════════════════
   GLASS PANEL
══════════════════════════════════════════════ */
.glass-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
}

/* ══════════════════════════════════════════════
   BOTÕES
══════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.6rem 1.25rem;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
    transition: all .15s ease;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
    background: #0f172a;
    color: #f8fafc;
    border-color: #0f172a;
}
.btn-primary:hover { background: #1e293b; border-color: #1e293b; }

.btn-secondary {
    background: transparent;
    color: #475569;
    border-color: #e2e8f0;
}
.btn-secondary:hover { background: #f8fafc; color: #0f172a; border-color: #cbd5e1; }

.btn-danger {
    background: transparent;
    color: #be123c;
    border-color: #fecdd3;
}
.btn-danger:hover { background: #fff1f2; border-color: #fda4af; }

.btn-ghost {
    background: transparent;
    color: #64748b;
    border-color: transparent;
}
.btn-ghost:hover { color: #0f172a; background: #f1f5f9; }

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    border-radius: 0.75rem;
}
.btn-sm svg { width: 14px; height: 14px; }

/* ══════════════════════════════════════════════
   INPUTS
══════════════════════════════════════════════ */
.input {
    width: 100%;
    border-radius: 0.875rem;
    border: 1px solid #e2e8f0;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-family: 'Manrope', sans-serif;
    color: #1e293b;
    background: white;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    appearance: none;
}
.input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.input.error {
    border-color: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
}
.input::placeholder { color: #cbd5e1; }

/* ══════════════════════════════════════════════
   FLASH MESSAGES
══════════════════════════════════════════════ */
.flash {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 1rem;
    border: 1px solid;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: flash-in 0.2s ease;
}
@keyframes flash-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.flash svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.flash-text { flex: 1; }
.flash-close {
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.45;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    line-height: 1;
}
.flash-close:hover { opacity: 1; }
.flash-close svg { width: 16px; height: 16px; margin-top: 0; }

.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.flash-error   { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.flash-info    { background: #f0f9ff; border-color: #bae6fd; color: #0369a1; }

/* ══════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════ */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    border-left: 3px solid transparent;
    transition: all .15s ease;
    text-decoration: none;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-link:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-left-color: #cbd5e1;
}
.sidebar-link.active {
    background: var(--sky-bg);
    color: #0369a1;
    border-left-color: var(--sky);
    font-weight: 700;
}

.nav-section-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 0.75rem 1rem 0.25rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #0f172a;
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.role-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
}

/* Overlay mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 29;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}
.sidebar-overlay.open { display: block; }

/* Sidebar mobile: off-screen by default */
@media (max-width: 1023px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
}

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.modal-backdrop {
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(7px);
}

/* ══════════════════════════════════════════════
   TIMELINE
══════════════════════════════════════════════ */
.timeline-line {
    position: absolute;
    left: 11px;
    top: 24px;
    bottom: -24px;
    width: 2px;
    background: linear-gradient(180deg, #cbd5e1 0%, rgba(203, 213, 225, 0) 100%);
}

.timeline-dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: white;
    border: 6px solid #38bdf8;
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.12);
}

/* ══════════════════════════════════════════════
   TABELA
══════════════════════════════════════════════ */
.table-hover tbody tr:hover {
    background: rgba(248, 250, 252, 0.88);
}

/* ══════════════════════════════════════════════
   NOTIFICAÇÕES
══════════════════════════════════════════════ */

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #f43f5e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid white;
    pointer-events: none;
    animation: badge-pop .2s ease;
}

@keyframes badge-pop {
    from { transform: scale(.6); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}

.notif-item {
    border-left: 3px solid transparent;
    transition: background .12s;
}

.notif-item.notif-unread {
    background: rgba(14, 165, 233, .05);
    border-left-color: #38bdf8;
}

