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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --bg-dark: #0a0e1a;
    --bg-surface: #111827;
    --bg-elevated: #1a2236;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: #64748b;
    --text-muted: #374151;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-width: 240px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* ─── App Layout ─── */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
}

.logo-text span {
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 0.75rem 0.75rem 0.25rem;
    opacity: 0.6;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
    position: relative;
}

.nav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-link:hover svg {
    opacity: 1;
}

.nav-link.active {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.nav-link.active svg {
    opacity: 1;
}

.nav-link.nav-danger {
    color: #ef4444;
    opacity: 0.7;
}

.nav-link.nav-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    opacity: 1;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
}

/* ─── Main Content ─── */
.page-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0 !important;
    background: var(--bg-dark) !important;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
}

.content-body {
    padding: 2rem;
    flex: 1;
}

/* ─── Cards ─── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card:last-child {
    margin-bottom: 0;
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.1), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─── Welcome banner ─── */
.welcome-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.welcome-banner h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-banner p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ─── Tables ─── */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

.table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-completed {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ─── Buttons ─── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.625rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    color: white;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    margin-right: 0.4rem;
    transition: all 0.15s;
    text-decoration: none;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(0, 0, 0, 0.35);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.25rem;
    cursor: pointer;
}

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

/* ─── Grids ─── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

/* ─── Auth Layout ─── */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 60%), var(--bg-dark);
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.75rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        padding: 0.5rem;
    }

    .nav-section-label { display: none; }

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

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .content-body {
        padding: 1rem;
    }
}


/* ─── Landing Page ─── */
.landing-container {
    display: block;
    background: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.hero-section {
    background: linear-gradient(135deg, #007bff 0%, #0062cc 100%);
    padding: 6rem 0;
    color: white;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.hero-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4rem;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-text h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn-outline-white {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-outline-white:hover {
    background: white;
    color: #007bff;
}

.hero-login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    color: #1e293b;
    text-align: center;
}

.hero-login-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.login-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.form-group-minimal {
    position: relative;
    margin-bottom: 1rem;
}

.input-icon-minimal {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.4;
    font-size: 0.9rem;
}

.form-control-minimal {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #334155;
    transition: 0.3s;
}

.form-control-minimal:focus {
    outline: none;
    border-color: #007bff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.btn-primary-full {
    width: 100%;
    background: #007bff;
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 1rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary-full:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.login-footer-note {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
}

.features-section {
    background: white;
    padding: 6rem 0;
    text-align: center;
}

.section-header {
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 1rem;
    font-weight: 700;
}

.section-header p {
    color: #64748b;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.feature-item {
    padding: 2rem;
}

.icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.5rem auto;
}

.icon-blue {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.feature-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.feature-item p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

.lgpd-section {
    background: #f1f5f9;
    padding: 5rem 0;
}

.lgpd-box {
    background: #e2e8f0;
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.lgpd-icon {
    font-size: 2.5rem;
    color: #007bff;
    margin-bottom: 1.5rem;
}

.lgpd-box h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: #1e293b;
}

.lgpd-box p {
    color: #475569;
    margin-bottom: 2rem;
}

.lgpd-checks {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.check-item {
    font-size: 0.9rem;
    color: #334155;
    font-weight: 500;
}

.footer-section {
    background: #1e293b;
    padding: 5rem 0;
    color: white;
    text-align: center;
}

.footer-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.footer-subtitle {
    color: #94a3b8;
    margin-bottom: 3rem;
}

.contact-card {
    background: white;
    color: #1e293b;
    padding: 3rem;
    border-radius: 12px;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.contact-header a {
    color: #007bff;
    font-weight: 700;
    font-size: 1.2rem;
}

.info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    text-align: left;
    display: inline-block;
}

.info-list {
    list-style: none;
    margin-top: 0.5rem;
    color: #475569;
}

.warning-text {
    font-size: 0.85rem;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.75rem;
    border-radius: 6px;
    display: inline-block;
}

@media (max-width: 900px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        padding-top: 2rem;
    }

    .hero-buttons {
        justify-content: center;
    }

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

    .lgpd-checks {
        flex-direction: column;
        gap: 1rem;
    }
}


/* ─── Overrides: neutralizar thriveo.css ─── */

/* Impede que thriveo.css transforme .sidebar-nav (div) num nav sticky horizontal */
.sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
    border-bottom: none !important;
    padding: 1rem 0.75rem !important;
    flex: 1 !important;
    gap: 2px !important;
    overflow-y: auto !important;
}

/* Sidebar: garantir layout fixo vertical */
.sidebar,
aside.sidebar {
    width: var(--sidebar-width) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
}

/* Logo não deve ser afetado pelo thriveo nav styles */
.sidebar-header {
    padding: 1.25rem !important;
    border-bottom: 1px solid var(--border) !important;
    flex-shrink: 0 !important;
}

.sidebar-footer {
    padding: 0.75rem !important;
    border-top: 1px solid var(--border) !important;
    flex-shrink: 0 !important;
}

/* Nav links dentro da sidebar ficam verticais */
.sidebar-nav .nav-link,
.sidebar-footer .nav-link {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.625rem 0.75rem !important;
    margin-bottom: 0 !important;
    font-size: 0.875rem !important;
    border-radius: 8px !important;
}

/* Page main: remover padding herdado do thriveo .main-content */
.page-main {
    padding: 0 !important;
}

/* Header sticky correto */
.header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    padding: 1rem 2rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border) !important;
}

@media (max-width: 768px) {
    .sidebar, aside.sidebar {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
    }
    .sidebar-nav {
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }
    .page-main {
        margin-left: 0 !important;
    }
}


/* ─── Dashboard stat cards ─── */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.dash-stat-card {
    background: #111827;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

/* Impede qualquer SVG filho de vazar */
.dash-stat-card svg,
.dash-stat-card img {
    display: none !important;
}

.dash-stat-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.dash-stat-label {
    display: block !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #64748b !important;
    margin-bottom: 0 !important;
}

.dash-stat-number {
    display: block !important;
    font-size: 3rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    color: #818cf8 !important;
    -webkit-text-fill-color: #818cf8 !important;
    background: none !important;
    padding: 0 !important;
}

.dash-stat-btn {
    display: inline-block !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #6366f1 !important;
    padding: 0.5rem 0 0 !important;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    margin-top: 0.25rem !important;
    background: none !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    width: 100% !important;
    transition: color 0.15s !important;
}

.dash-stat-btn:hover {
    color: #a5b4fc !important;
}

/* Welcome banner override (thriveo pode sobrescrever h3 color) */
.welcome-banner h3 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.35rem !important;
    background: linear-gradient(to right, #818cf8, #c084fc) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.welcome-banner p {
    color: var(--text-secondary) !important;
    font-size: 0.875rem !important;
}

@media (max-width: 768px) {
    .dash-stats { grid-template-columns: 1fr; }
}

/* Garante que SVGs na sidebar não expandam */
.sidebar-nav .nav-link svg,
.sidebar-footer .nav-link svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    flex-shrink: 0 !important;
}
