:root {
    /* Premium Slate/Zinc Palette */
    --primary: #0F172A;
    --primary-light: #334155;
    --accent: #3B82F6; /* Vibrant Blue */
    --secondary: #1E293B;
    
    --bg-app: #F8FAFC;
    --bg-content: #FFFFFF;
    
    --text-main: #0F172A;
    --text-muted: #64748B;
    
    --border: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(15, 23, 42, 0.15);
    
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.04);
    --card-shadow-hover: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
    
    --sidebar-bg: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] {
    --primary: #F8FAFC;
    --primary-light: #CBD5E1;
    --accent: #38BDF8; /* Neon Blue Accent */
    --secondary: #F1F5F9;
    
    --bg-app: #020617; /* Deepest Slate */
    --bg-content: #0F172A;
    
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --card-bg: rgba(15, 23, 42, 0.6);
    --card-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.5);
    --card-shadow-hover: 0 12px 32px -4px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(56, 189, 248, 0.3);
    
    --sidebar-bg: rgba(15, 23, 42, 0.85);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow: hidden;
    background-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.04), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(124, 58, 237, 0.04), transparent 25%);
}

[data-theme="dark"] body {
    background-image: radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.05), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.05), transparent 25%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.2);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.4);
}

.app-container {
    display: flex;
    height: 100dvh; /* dvh takes dynamic browser toolbars into account on mobile */
    min-height: 100vh; /* fallback */
}

/* Sidebar */
.sidebar {
    width: 290px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 50;
    overflow: hidden;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s ease,
                opacity 0.25s ease;
}

/* Desktop collapsed state */
.app-container.sidebar-collapsed .sidebar {
    width: 0;
    border-right-color: transparent;
    opacity: 0;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}

.logo-circle {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-color: #0f224a;
}

.logo-text h2 {
    font-size: 1.15rem;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-text p {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Search Box */
.search-container {
    padding: 16px 24px;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.search-container input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-app);
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
}

.search-container input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.search-icon {
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.15rem;
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.nav-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    margin: 20px 0 8px 12px;
    letter-spacing: 1.2px;
}

body.admin-active .nav-label {
    position: relative;
    padding-right: 70px;
}

body.admin-active .nav-label .add-page-btn {
    opacity: 1 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background-color: #10B981 !important;
    color: white !important;
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

body.admin-active .nav-label .add-page-btn .material-icons {
    font-size: 16px;
}

body.admin-active .nav-label .edit-overlay:not(.add-page-btn) {
    opacity: 1 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

body.admin-active .nav-label .edit-overlay:not(.add-page-btn) .material-icons {
    font-size: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.2s;
    margin-bottom: 4px;
    white-space: nowrap;
}

.nav-item .material-icons {
    font-size: 1.2rem;
    color: inherit;
}

.nav-item:hover {
    background: var(--border);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.top-header {
    height: 70px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 30px;
    z-index: 40;
}

.banner-logo {
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

[data-theme="dark"] .banner-logo {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)) brightness(1.2);
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--border);
    color: var(--text-main);
}

.content-wrapper {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Page Transitions */
.page-section {
    display: none;
    max-width: 1040px;
    margin: 0 auto;
}

.page-section.active {
    display: block;
}

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

/* Welcome Banner (Vercel Style / Corporate) */
.welcome-banner {
    background: url('assets/corporate_blue_banner.png') center/cover no-repeat;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.welcome-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 34, 74, 0.4);
    z-index: 0;
}

.welcome-banner * {
    position: relative;
    z-index: 1;
}

.welcome-banner h1 {
    font-size: 2.2rem;
    color: #FFFFFF;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.welcome-banner p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    max-width: 750px;
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Headers */
.section-header-tag {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.section-header-tag .material-icons {
    font-size: 2rem;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

h1 {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: -0.5px;
}

h2.section-title {
    font-size: 1.3rem;
    color: var(--primary);
    margin: 32px 0 20px;
    font-weight: 700;
}

h3 {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 14px;
}

p, li {
    line-height: 1.6;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Cards & Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    align-items: stretch;
    margin-top: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: stretch;
    margin-top: 16px;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.card, .quick-card, .info-card {
    /* Glass UI: gradient de luz diagonal + blur forte */
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.88) 0%,
        rgba(255, 255, 255, 0.55) 100%
    );
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 0; /* Let grid gap handle spacing */
    /* Removed break-inside for standard grid */
    box-shadow:
        0 4px 24px -4px rgba(15, 23, 42, 0.07),
        0 1px 3px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(15, 23, 42, 0.04);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark mode glass */
[data-theme="dark"] .card,
[data-theme="dark"] .quick-card,
[data-theme="dark"] .info-card {
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.04) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow:
        0 4px 24px -4px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.quick-card {
    text-align: left;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    margin-bottom: 0; /* Grid gap handles spacing */
    /* break-inside: avoid; */
}

/* Make sure inner contents push apart if card stretches */
.quick-card {
    justify-content: space-between;
}

/* Forms page description hiding/hover effect */
.quick-card p {
    max-height: 0;
    opacity: 0;
    margin: 0;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.quick-card:hover p {
    max-height: 120px;
    opacity: 1;
    margin-top: 8px;
}

.quick-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 32px -4px rgba(15, 23, 42, 0.11),
        0 4px 12px -2px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(15, 23, 42, 0.04);
    border-color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .quick-card:hover {
    box-shadow:
        0 12px 32px -4px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(56, 189, 248, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border-color: rgba(56, 189, 248, 0.25);
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: var(--bg-app);
    border: 1px solid var(--border);
}

.card-icon .material-icons {
    font-size: 1.4rem;
    color: var(--text-main);
}

/* Sophisticated subdued icon colors instead of bright blocks */
.card-icon.blue { background: rgba(59, 130, 246, 0.1) !important; border-color: rgba(59, 130, 246, 0.25) !important; }
.card-icon.blue .material-icons { color: #3B82F6 !important; }

.card-icon.green { background: rgba(16, 185, 129, 0.1) !important; border-color: rgba(16, 185, 129, 0.25) !important; }
.card-icon.green .material-icons { color: #10B981 !important; }

.card-icon.teal { background: rgba(20, 184, 166, 0.1) !important; border-color: rgba(20, 184, 166, 0.25) !important; }
.card-icon.teal .material-icons { color: #14B8A6 !important; }

.card-icon.purple { background: rgba(139, 92, 246, 0.1) !important; border-color: rgba(139, 92, 246, 0.25) !important; }
.card-icon.purple .material-icons { color: #8B5CF6 !important; }

.card-icon.orange { background: rgba(245, 158, 11, 0.1) !important; border-color: rgba(245, 158, 11, 0.25) !important; }
.card-icon.orange .material-icons { color: #F59E0B !important; }

.card-icon.danger { background: rgba(239, 68, 68, 0.1) !important; border-color: rgba(239, 68, 68, 0.25) !important; }
.card-icon.danger .material-icons { color: #EF4444 !important; }

.quick-card h3 {
    margin-bottom: 8px;
    font-size: 1rem;
    letter-spacing: -0.2px;
}

.quick-card p {
    font-size: 0.85rem;
    margin: 0;
}

/* Link Lists */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.list-link .material-icons {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.list-link:hover {
    background: var(--border);
    border-color: var(--border-hover);
}

.list-link:hover .material-icons {
    color: var(--accent);
}

/* Contacts Widget */
.contacts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.contact-item {
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.88) 0%,
        rgba(255, 255, 255, 0.55) 100%
    );
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 300px;
    box-shadow:
        0 4px 16px -4px rgba(15, 23, 42, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .contact-item {
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.04) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow:
        0 4px 16px -4px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.contact-item .material-icons {
    background: var(--bg-app);
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 12px;
    border-radius: 50%;
    font-size: 1.2rem;
}

.contact-item strong {
    color: var(--primary);
    font-size: 0.95rem;
}

.contact-item span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.88) 0%,
        rgba(255, 255, 255, 0.55) 100%
    );
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 4px 24px -4px rgba(15, 23, 42, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

[data-theme="dark"] .data-table {
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.04) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow:
        0 4px 24px -4px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.data-table th, .data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-main);
}

.data-table th {
    background: rgba(15, 23, 42, 0.02);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .data-table th {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover {
    background: var(--border);
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.sector-tag {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sector-tag:hover {
    background: var(--border);
    border-color: var(--border-hover);
    color: var(--accent);
}

/* Accordion */
.accordion { margin-top: 20px; }
.accordion-item {
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.88) 0%,
        rgba(255, 255, 255, 0.55) 100%
    );
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow:
        0 2px 12px -2px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(15, 23, 42, 0.03);
}

[data-theme="dark"] .accordion-item {
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.04) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow:
        0 2px 12px -2px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.accordion-header {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 16px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header::after {
    content: "expand_more";
    font-family: "Material Icons";
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.accordion-header.active::after { transform: rotate(180deg); }

.accordion-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
    padding: 0 20px 20px;
    max-height: 1000px;
}

/* Utils */
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.close-sidebar { display: none; }

/* Toggle button visible on ALL screen sizes */
.open-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    margin-right: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.open-sidebar:hover {
    background: var(--border);
    color: var(--text-main);
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        /* On mobile, sidebar uses transform instead of width for slide-in/out */
        width: 290px !important;
        opacity: 1 !important;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    /* On mobile, the desktop collapse class has no effect */
    .app-container.sidebar-collapsed .sidebar {
        width: 290px !important;
        opacity: 1 !important;
        border-right-color: var(--border) !important;
    }

    .close-sidebar {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 16px; top: 24px;
        border: none;
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        padding: 6px;
        border-radius: 6px;
    }
    .close-sidebar:hover { background: var(--border); color: var(--text-main); }

    .grid-2 { grid-template-columns: 1fr; }
    .content-wrapper { padding: 24px; }
}

/* ═══════════════════════════════════════════════
   CLASSES FALTANTES — Botões, Alertas, Modal, Admin
   ═══════════════════════════════════════════════ */

/* Lead paragraph */
.lead {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.7;
    max-width: 760px;
}

/* Welcome banner — remove borda estranha */
.welcome-banner {
    border: none !important;
}

/* Dark mode — links azuis ficam legíveis */
[data-theme="dark"] a:not(.nav-item):not(.list-link):not(.quick-card):not(.btn):not(.sector-tag) {
    color: var(--accent);
}
[data-theme="dark"] a:not(.nav-item):not(.list-link):not(.quick-card):not(.btn):not(.sector-tag):hover {
    color: #7dd3fc;
    text-decoration: underline;
}

/* Utils */
.border-bottom { border-bottom: 1px solid var(--border); }
.pb-2          { padding-bottom: 0.5rem; }
h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    margin: 16px 0 8px;
}

/* Code elements */
code {
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.88em;
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent);
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid rgba(59, 130, 246, 0.15);
}
[data-theme="dark"] code {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.2);
}

/* ── Botões (.btn) ────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    line-height: 1;
}
.btn-sm { padding: 7px 14px; font-size: 0.8rem; border-radius: 6px; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline:hover {
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-outline {
    border-color: var(--accent);
    color: var(--accent);
}
[data-theme="dark"] .btn-outline:hover {
    background: rgba(56, 189, 248, 0.12);
}

/* ── Alertas ──────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
}
p {
    line-height: 1.6;
    margin-bottom: 16px;
    color: var(--text-secondary);
    text-align: justify;
}

/* Let's make sure card texts are justified */
.card p, .quick-card p, .info-card p {
    text-align: justify;
}
.alert {
    border-left: 3px solid;
    margin: 16px 0;
}
.alert.info {
    background: rgba(59, 130, 246, 0.07);
    border-color: var(--accent);
    color: var(--text-main);
}
.alert.warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: #F59E0B;
    color: var(--text-main);
}
[data-theme="dark"] .alert.info    { background: rgba(56, 189, 248, 0.08); }
[data-theme="dark"] .alert.warning { background: rgba(245, 158, 11, 0.1); }

/* ── Sidebar Footer + Botão Admin ─────────────── */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.btn-admin {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-admin:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--accent);
    color: var(--accent);
}
.btn-admin.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10B981;
    color: #10B981;
}

/* ── Admin Action Bar (topo) ──────────────────── */
.admin-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: linear-gradient(90deg, #064e3b, #065f46);
    color: #fff;
    font-size: 0.875rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
body.admin-active .app-container {
    padding-top: 44px;
}
.admin-bar-actions {
    display: flex;
    gap: 10px;
}
.btn-save-cloud, .btn-export, .btn-exit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.btn-save-cloud {
    background: #10B981; /* Emerald/Green representing cloud upload/save */
    color: #fff;
}
.btn-save-cloud:hover {
    background: #059669;
}
.rotating {
    animation: spin 1s linear infinite;
    display: inline-block;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.btn-export {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}
.btn-export:hover { background: rgba(255,255,255,0.3); }
.btn-exit {
    background: rgba(239,68,68,0.8);
    color: #fff;
}
.btn-exit:hover { background: rgba(220,38,38,0.9); }

/* ── Edit Overlay (admin mode) ────────────────── */
.edit-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s;
    opacity: 0;
}
.edit-overlay .material-icons { font-size: 1rem; }
.form-card:hover .edit-overlay,
.list-link:hover .edit-overlay {
    opacity: 1;
}
/* Ensure parent has position relative for overlay placement */
.form-card, .list-link { position: relative; }

/* ── Modal de Edição ──────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-content {
    background: var(--bg-content, #fff);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: fadeIn 0.2s ease;
}
[data-theme="dark"] .modal-content {
    background: #0f172a;
}
.modal-content h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.form-group input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-app);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: flex-end;
}
.btn-save {
    padding: 9px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.btn-save:hover { opacity: 0.9; }
.btn-delete {
    padding: 9px 20px;
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.btn-delete:hover { background: rgba(239,68,68,0.2); }
.btn-cancel {
    padding: 9px 20px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.btn-cancel:hover { background: var(--border); color: var(--text-main); }

/* ══════════════════════════════════════════════════════
   LIQUID GLASS UI — Background, Surface & Animation
   ══════════════════════════════════════════════════════ */

/* ── Base colors ─────────────────────────────────────── */
:root   { --bg-base: #e8f0fc; }
[data-theme="dark"] { --bg-base: #030c1f; }

/* Remove static gradient from body, let bg-scene handle it */
body {
    background-color: var(--bg-base) !important;
    background-image: none !important;
}
[data-theme="dark"] body {
    background-color: var(--bg-base) !important;
    background-image: none !important;
}

/* ── Animated blob background ─────────────────────────── */
.bg-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg-base);
}

/* App content must sit above bg-scene */
.app-container {
    position: relative;
    z-index: 1;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
}

/* Light mode blobs */
.blob-1 {
    width: 60vw; height: 60vw;
    top: -20%; left: -15%;
    background: radial-gradient(circle at center,
        rgba(59,130,246,0.25) 0%,
        rgba(14,165,233,0.15) 40%,
        transparent 70%);
    animation: blobFloat1 22s ease-in-out infinite alternate;
}
.blob-2 {
    width: 50vw; height: 50vw;
    bottom: -20%; right: -10%;
    background: radial-gradient(circle at center,
        rgba(14,165,233,0.20) 0%,
        rgba(56,189,248,0.15) 40%,
        transparent 70%);
    animation: blobFloat2 28s ease-in-out infinite alternate;
}
.blob-3 {
    width: 38vw; height: 38vw;
    top: 35%; left: 35%;
    background: radial-gradient(circle at center,
        rgba(59,130,246,0.18) 0%,
        transparent 65%);
    animation: blobFloat3 19s ease-in-out infinite alternate;
}
.blob-4 {
    width: 45vw; height: 45vw;
    top: 10%; right: 10%;
    background: radial-gradient(circle at center,
        rgba(2,132,199,0.15) 0%,
        transparent 65%);
    animation: blobFloat1 26s ease-in-out infinite alternate-reverse;
}

/* Dark mode blobs — more saturated for depth */
[data-theme="dark"] .blob-1 {
    background: radial-gradient(circle at center,
        rgba(30,58,138,0.75) 0%,
        rgba(30,64,175,0.55) 40%,
        transparent 70%);
}
[data-theme="dark"] .blob-2 {
    background: radial-gradient(circle at center,
        rgba(15,23,42,0.70) 0%,
        rgba(30,58,138,0.45) 40%,
        transparent 70%);
}
[data-theme="dark"] .blob-3 {
    background: radial-gradient(circle at center,
        rgba(2,132,199,0.40) 0%,
        transparent 65%);
}
[data-theme="dark"] .blob-4 {
    background: radial-gradient(circle at center,
        rgba(30,64,175,0.45) 0%,
        transparent 65%);
}

@keyframes blobFloat1 {
    0%   { transform: translate(0,0) scale(1); }
    33%  { transform: translate(40px,-30px) scale(1.07); }
    66%  { transform: translate(-15px, 45px) scale(0.95); }
    100% { transform: translate(25px,-15px) scale(1.03); }
}
@keyframes blobFloat2 {
    0%   { transform: translate(0,0) scale(1); }
    33%  { transform: translate(-55px,20px) scale(1.06); }
    66%  { transform: translate(30px,-50px) scale(0.93); }
    100% { transform: translate(-20px,35px) scale(1.04); }
}
@keyframes blobFloat3 {
    0%   { transform: translate(0,0) rotate(0deg) scale(1); }
    50%  { transform: translate(-25px,-30px) rotate(12deg) scale(1.1); }
    100% { transform: translate(30px,25px) rotate(-8deg) scale(0.9); }
}

/* ── Film grain overlay ───────────────────────────────── */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    opacity: 0.032;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}
[data-theme="dark"] .grain-overlay { opacity: 0.055; }

/* ── Glass surfaces — stronger transparency ───────────── */
.sidebar {
    background: rgba(235, 245, 255, 0.62) !important;
    backdrop-filter: blur(36px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(36px) saturate(180%) !important;
    border-right: 1px solid rgba(255,255,255,0.5) !important;
    box-shadow: 4px 0 24px rgba(59,130,246,0.06) !important;
}
[data-theme="dark"] .sidebar {
    background: rgba(4, 12, 38, 0.68) !important;
    backdrop-filter: blur(36px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(36px) saturate(140%) !important;
    border-right: 1px solid rgba(255,255,255,0.06) !important;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4) !important;
}

.card, .quick-card, .form-card {
    background: rgba(255,255,255,0.58) !important;
    backdrop-filter: blur(22px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
    border: 1px solid rgba(255,255,255,0.65) !important;
    box-shadow:
        0 4px 24px rgba(59,130,246,0.06),
        inset 0 1px 0 rgba(255,255,255,0.8) !important;
}
[data-theme="dark"] .card,
[data-theme="dark"] .quick-card,
[data-theme="dark"] .form-card {
    background: rgba(8, 20, 60, 0.60) !important;
    backdrop-filter: blur(22px) saturate(130%) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    box-shadow:
        0 4px 24px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.06) !important;
}

/* ── Top Header — dark, matches banner image ──────────── */
.top-header {
    background: #232c77 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.07) !important;
    padding: 0 20px 0 12px !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.35) !important;
    overflow: hidden;
}

/* Banner logo fills full header height */
.banner-logo {
    height: 100% !important;
    width: auto !important;
    max-width: none !important;
    object-fit: contain !important;
    object-position: left center !important;
    flex: 1 !important;
    filter: none !important;
    display: block;
    padding: 4px 0;
}

/* Buttons inside dark header */
.top-header .open-sidebar,
.top-header #openSidebar,
.open-sidebar {
    color: rgba(255,255,255,0.80) !important;
    background: transparent !important;
    border: none;
    flex-shrink: 0;
}
.open-sidebar:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.12) !important;
    border-radius: 8px;
}
.top-header .theme-toggle,
.theme-toggle {
    color: rgba(255,255,255,0.70) !important;
    border-color: rgba(255,255,255,0.15) !important;
    background: transparent !important;
}
.theme-toggle:hover {
    background: rgba(255,255,255,0.12) !important;
    color: #fff !important;
}

/* ══════════════════════════════════════════════════════
   ADMIN MODE — Edição de Texto Inline
   ══════════════════════════════════════════════════════ */

/* Hint: all page-section headings/paragraphs show editable outline */
body.admin-active .page-section h1,
body.admin-active .page-section h2,
body.admin-active .page-section h3,
body.admin-active .page-section > p,
body.admin-active .page-section .card > p,
body.admin-active .page-section .lead,
body.admin-active .accordion-header,
body.admin-active .contact-item strong,
body.admin-active .contact-item span,
body.admin-active .data-table td,
body.admin-active .data-table th,
body.admin-active .alert strong,
body.admin-active .alert {
    cursor: text;
    outline: 1px dashed rgba(245, 158, 11, 0.30);
    outline-offset: 2px;
    border-radius: 4px;
    transition: outline-color 0.2s, background 0.2s;
}
body.admin-active .page-section h1:hover,
body.admin-active .page-section h2:hover,
body.admin-active .page-section h3:hover,
body.admin-active .page-section > p:hover,
body.admin-active .page-section .card > p:hover,
body.admin-active .page-section .lead:hover,
body.admin-active .accordion-header:hover,
body.admin-active .contact-item strong:hover,
body.admin-active .contact-item span:hover,
body.admin-active .data-table td:hover,
body.admin-active .data-table th:hover,
body.admin-active .alert strong:hover,
body.admin-active .alert:hover {
    outline-color: rgba(245, 158, 11, 0.70);
    background: rgba(245, 158, 11, 0.04);
}
body.admin-active [contenteditable="true"] {
    outline: 2px solid #f59e0b !important;
    outline-offset: 2px;
    background: rgba(245, 158, 11, 0.07) !important;
    border-radius: 4px;
}

/* ══════════════════════════════════════════════════════
   FAB (+) Button — Modo Admin
   ══════════════════════════════════════════════════════ */
.admin-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1500;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(99,102,241,0.45), 0 2px 8px rgba(0,0,0,0.25);
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
    backdrop-filter: blur(10px);
}
.admin-fab:hover {
    transform: scale(1.12);
    box-shadow: 0 10px 32px rgba(99,102,241,0.55), 0 4px 12px rgba(0,0,0,0.3);
}
.admin-fab.open { transform: rotate(45deg) scale(1.05); }
.admin-fab .material-icons { font-size: 1.6rem; }

.fab-menu {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 1500;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.1);
    animation: fadeIn 0.18s ease;
}
[data-theme="dark"] .fab-menu {
    background: rgba(10, 20, 55, 0.88);
    border-color: rgba(255,255,255,0.08);
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.fab-menu-item:not(:last-child) { border-bottom: 1px solid var(--border); }
.fab-menu-item:hover { background: rgba(59,130,246,0.08); color: var(--accent); }

/* ── DRAG AND DROP VISUALS ───────────────────── */
.dragging {
    opacity: 0.4 !important;
    transform: scale(0.98);
    box-shadow: 0 0 0 2px var(--accent) !important;
}

[draggable="true"] {
    cursor: grab;
}
[draggable="true"]:active {
    cursor: grabbing;
}
.fab-menu-item .material-icons { font-size: 1.1rem; }

/* Ensure admin-bar sits above bg-scene */
.admin-bar { z-index: 1001 !important; }
.grain-overlay { z-index: 1002 !important; }

/* ── Top header spacer collapse (banner fills all space) ── */
.top-header > div { flex: 0 !important; width: 0 !important; }
.open-sidebar { flex-shrink: 0 !important; margin-right: 4px; }
.theme-toggle  { flex-shrink: 0 !important; }

/* Prevent horizontal overflow scrolling globally */
html, body, .app-container {
    overflow-x: hidden !important;
}

/* ── PHONE PORTRAIT OPTIMIZATIONS (screens under 576px) ── */
@media (max-width: 576px) {
    .content-wrapper {
        padding: 16px !important;
    }
    .welcome-banner {
        padding: 20px 16px !important;
        margin-bottom: 20px !important;
    }
    .welcome-banner h1 {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
        letter-spacing: -0.5px !important;
    }
    .welcome-banner p {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }
    .card, .quick-card, .info-card {
        padding: 16px !important;
        min-width: 0 !important; /* Fix CSS Grid implicit min-width: auto bug */
        word-break: break-word !important; /* Allow text to wrap safely */
    }
    .cards-grid, .grid-2 {
        gap: 12px !important;
        grid-template-columns: repeat(2, 1fr) !important; /* Força 2 colunas no mobile para melhor aproveitamento */
    }
    .lead {
        font-size: 0.88rem !important;
        margin-bottom: 16px !important;
        line-height: 1.5 !important;
    }
    h2 {
        font-size: 1.25rem !important;
    }
    .top-header {
        padding: 0 12px !important;
        height: 60px !important;
    }
    .top-header .banner-logo {
        height: auto !important;
        max-height: 48px !important;
        max-width: calc(100vw - 120px) !important; /* Previne que o logo expanda a tela */
    }
    
    /* ── BOAS PRÁTICAS: Quebra de Palavras e Flexbox Responsivo ── */
    /* Garante que itens com texto longo (como e-mails) não vazem a tela */
    .contact-item {
        min-width: 0 !important; /* Remove largura mínima que quebrava o layout */
        width: 100% !important;
        padding: 16px !important;
        /* Em telas pequenas, é melhor empilhar ícones e textos para ganhar espaço horizontal */
        flex-direction: column !important;
        text-align: center !important;
        gap: 8px !important;
    }
    .contact-item div {
        width: 100%;
        /* break-word força o texto (como e-mails longos) a quebrar linha em vez de esticar a tela */
        word-break: break-word; 
    }
    .contact-item strong {
        display: block;
        margin-bottom: 4px;
        font-size: 1rem !important;
    }
    .contact-item span {
        display: block;
        font-size: 0.85rem !important;
    }
    
    /* Previne vazamentos no menu de abas e botões gerais */
    .nav-menu, .content-wrapper * {
        max-width: 100%;
    }
}

/* ── SIDEBAR OVERLAY (Mobile) ── */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 45; /* Abaixo da sidebar (z-index 50) e acima do app */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── PREVENT VISITED COLOR BUG ── */
a.quick-card,
a.quick-card:visited,
a.list-link,
a.list-link:visited {
    color: inherit !important;
}

a.quick-card *,
a.quick-card:visited *,
a.list-link *,
a.list-link:visited * {
    color: inherit !important;
}

[data-theme="dark"] a.quick-card h3,
[data-theme="dark"] a.quick-card:visited h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] a.quick-card p,
[data-theme="dark"] a.quick-card:visited p {
    color: var(--text-secondary) !important;
}

[data-theme="light"] a.quick-card h3,
[data-theme="light"] a.quick-card:visited h3 {
    color: #1e293b !important; /* Slate 800 */
}

[data-theme="light"] a.quick-card p,
[data-theme="light"] a.quick-card:visited p {
    color: #475569 !important; /* Slate 600 */
}

/* ── LOGIN OVERLAY & CARD ── */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.4) 0%, rgba(8, 15, 30, 0.95) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.login-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    box-shadow: 
        0 24px 64px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    text-align: center;
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 24px 64px -12px rgba(15, 23, 42, 0.15);
    color: #0f172a;
}

.login-logo {
    height: 64px;
    width: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    text-align: center !important;
}

[data-theme="light"] .login-header p {
    color: #64748b;
}

.login-error-msg {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 12px;
    padding: 12px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    text-align: left;
}

[data-theme="light"] .login-error-msg {
    color: #b91c1c;
    background: #fef2f2;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 6px;
}

.input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.3px;
}

[data-theme="light"] .input-group label {
    color: #475569;
}

.input-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

[data-theme="light"] .input-group input {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

.input-group input:focus {
    border-color: #38bdf8;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

[data-theme="light"] .input-group input:focus {
    border-color: #0284c7;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

.btn-login-submit {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}

.login-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.login-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .login-divider::before {
    background: rgba(0, 0, 0, 0.08);
}

.login-divider span {
    position: relative;
    background: #0f172a;
    padding: 0 16px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

[data-theme="light"] .login-divider span {
    background: #fff;
    color: #64748b;
}

.btn-google-login {
    width: 100%;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    transition: all 0.25s ease;
}

.btn-google-login img {
    height: 20px;
    width: 20px;
}

.btn-google-login:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* ── PROFILE WIDGET & LOGOUT ── */
.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    margin-bottom: 12px;
    width: 100%;
}

[data-theme="dark"] .user-profile-widget {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.user-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-placeholder .material-icons {
    font-size: 32px;
    color: #475569;
}

[data-theme="dark"] .user-avatar-placeholder .material-icons {
    color: rgba(255, 255, 255, 0.7);
}

.user-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
    min-width: 0;
}

/* Light Mode (default) User Widget text colors */
.user-name-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .user-name-text {
    color: #ffffff;
}

.user-role-text {
    font-size: 0.75rem;
    color: #0284c7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .user-role-text {
    color: #38bdf8;
}

.btn-logout {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

[data-theme="dark"] .btn-logout {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .btn-logout:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ── RETRACTABLE IFRAME DRAWER ── */
.iframe-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 60%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.5);
    z-index: 1500;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

[data-theme="light"] .iframe-drawer {
    background: rgba(255, 255, 255, 0.95);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: -15px 0 40px rgba(15, 23, 42, 0.15);
}

.iframe-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .drawer-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

#drawerTitle {
    font-weight: 600;
    font-size: 1.1rem;
    color: #f8fafc;
}

[data-theme="light"] #drawerTitle {
    color: #0f172a;
}

.drawer-actions {
    display: flex;
    gap: 12px;
}

.drawer-actions button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.drawer-actions button:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .drawer-actions button {
    color: #475569;
}

[data-theme="light"] .drawer-actions button:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
}

.drawer-body {
    flex: 1;
    position: relative;
    background: #fff; /* standard background to render pdfs/sites nicely */
}

.drawer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 1024px) {
    .iframe-drawer {
        width: 80%;
    }
}

@media (max-width: 768px) {
    .iframe-drawer {
        width: 100%;
    }
}


