/* ═══════════════════════════════════════════════════════════════
   ΔΩΛΦΟΣ — Tema Visual
   Paleta: Navy + Dourado + Mármore
   ═══════════════════════════════════════════════════════════════ */

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

/* ─── CSS Variables ────────────────────────────────────────── */
:root {
    --navy:        #1B2A4A;
    --gold:        #C9A84C;
    --gold-dark:   #A07D2E;
    --marble:      #FAF8F5;
    --marble-vein: #E8E2D8;
    --text:        #1B2A4A;
    --text-light:  #4A5568;

    --white:       #FFFFFF;
    --danger:      #DC2626;
    --danger-bg:   #FEE2E2;
    --success:     #16A34A;
    --success-bg:  #DCFCE7;
    --info:        #2563EB;
    --info-bg:     #DBEAFE;
    --warning:     #D97706;
    --warning-bg:  #FEF3C7;

    --shadow-sm:   0 1px 2px rgba(27,42,74,0.05);
    --shadow:      0 1px 3px rgba(27,42,74,0.1), 0 1px 2px rgba(27,42,74,0.06);
    --shadow-md:   0 4px 6px rgba(27,42,74,0.07), 0 2px 4px rgba(27,42,74,0.06);
    --shadow-lg:   0 10px 15px rgba(27,42,74,0.1), 0 4px 6px rgba(27,42,74,0.05);

    --radius:      6px;
    --radius-lg:   8px;

    --sidebar-w:   260px;
    --header-h:    60px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--marble);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

img { max-width: 100%; height: auto; }

/* ─── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--navy);
    font-weight: 600;
    line-height: 1.3;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { margin-bottom: 0.75rem; }

small, .text-sm { font-size: 0.875rem; }
.text-muted { color: var(--text-light); }

/* ─── Greek Meander Pattern (inline SVG as border-image) ──── */
.meander-border {
    border-bottom: 3px solid var(--gold);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='6' viewBox='0 0 40 6'%3E%3Cpath d='M0 3h6v3H0zM6 0h3v6H6zM9 3h6v3H9zM15 0h3v6h-3zM18 3h6v3h-6zM24 0h3v6h-3zM27 3h6v3h-6zM33 0h3v6h-3z' fill='%23C9A84C' fill-opacity='0.35'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: bottom;
    background-size: 40px 6px;
}

.meander-top {
    border-top: 3px solid var(--gold);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='6' viewBox='0 0 40 6'%3E%3Cpath d='M0 3h6v3H0zM6 0h3v6H6zM9 3h6v3H9zM15 0h3v6h-3zM18 3h6v3h-6zM24 0h3v6h-3zM27 3h6v3h-6zM33 0h3v6h-3z' fill='%23C9A84C' fill-opacity='0.35'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: top;
    background-size: 40px 6px;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */

/* ─── Navbar (top bar) ─────────────────────────────────────── */
.delfos-navbar {
    background: var(--navy);
    height: var(--header-h);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.delfos-navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.delfos-navbar .navbar-brand img {
    height: 36px;
    width: auto;
}

.delfos-navbar .navbar-brand .brand-text {
    font-family: 'Playfair Display', serif;
    color: var(--white);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.delfos-navbar .navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 2rem;
    list-style: none;
}

.delfos-navbar .navbar-nav a {
    color: rgba(255,255,255,0.7);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.delfos-navbar .navbar-nav a:hover,
.delfos-navbar .navbar-nav a.active {
    color: var(--gold);
    background: rgba(255,255,255,0.08);
}

.delfos-navbar .navbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.delfos-navbar .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.delfos-navbar .user-name {
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
    font-weight: 500;
}

.delfos-navbar .btn-logout {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    transition: all 0.2s;
    text-decoration: none;
}

.delfos-navbar .btn-logout:hover {
    color: var(--white);
    border-color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.08);
}

/* ─── Mobile hamburger ─────────────────────────────────────── */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-right: 0.75rem;
}

/* ─── Sidebar ──────────────────────────────────────────────── */
.delfos-layout {
    display: flex;
    min-height: calc(100vh - var(--header-h));
}

.delfos-sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--marble-vein);
    padding: 1.5rem 0;
    flex-shrink: 0;
    overflow-y: auto;
}

.delfos-sidebar .sidebar-section {
    margin-bottom: 1.5rem;
}

.delfos-sidebar .sidebar-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
}

.delfos-sidebar .sidebar-nav {
    list-style: none;
}

.delfos-sidebar .sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}

.delfos-sidebar .sidebar-nav a:hover {
    color: var(--navy);
    background: var(--marble);
}

.delfos-sidebar .sidebar-nav a.active {
    color: var(--navy);
    background: rgba(201,168,76,0.08);
    border-left-color: var(--gold);
    font-weight: 600;
}

.delfos-sidebar .sidebar-nav .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ─── Main Content ─────────────────────────────────────────── */
.delfos-main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.delfos-main.full-width {
    max-width: 100%;
}

/* ─── Footer ───────────────────────────────────────────────── */
.delfos-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding: 1.25rem 1.5rem;
    font-size: 0.8rem;
    border-top: 3px solid var(--gold);
}

.delfos-footer .footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════════ */

/* ─── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--marble-vein);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--marble-vein);
    border-top: 3px solid var(--gold);
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    color: var(--navy);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--marble-vein);
    background: var(--marble);
}

/* ─── Stat Cards (Dashboard) ───────────────────────────────── */
.stat-card {
    background: var(--white);
    border: 1px solid var(--marble-vein);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.navy   { background: rgba(27,42,74,0.1); color: var(--navy); }
.stat-card .stat-icon.gold   { background: rgba(201,168,76,0.15); color: var(--gold-dark); }
.stat-card .stat-icon.green  { background: rgba(22,163,74,0.1); color: var(--success); }
.stat-card .stat-icon.red    { background: rgba(220,38,38,0.1); color: var(--danger); }

.stat-card .stat-info { flex: 1; }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    font-family: 'Playfair Display', serif;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ─── Stats Grid ───────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ─── Tables ───────────────────────────────────────────────── */
.delfos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.delfos-table th {
    background: var(--marble);
    color: var(--navy);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--gold);
    font-family: 'Playfair Display', serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.delfos-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--marble-vein);
    vertical-align: middle;
}

.delfos-table tbody tr:nth-child(even) {
    background: rgba(250,248,245,0.5);
}

.delfos-table tbody tr:hover {
    background: rgba(201,168,76,0.06);
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

.btn-primary:hover {
    background: #14203a;
    color: var(--white);
}

.btn-secondary {
    background: transparent;
    color: var(--navy);
    border-color: var(--navy);
}

.btn-secondary:hover {
    background: var(--navy);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #b91c1c;
    color: var(--white);
}

.btn-gold {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
    font-weight: 600;
}

.btn-gold:hover {
    background: var(--gold-dark);
    color: var(--white);
}

.btn-sm {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--navy);
    margin-bottom: 0.35rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--marble-vein);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}

.form-control::placeholder {
    color: #9CA3AF;
}

/* ─── Search Input ─────────────────────────────────────────── */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 0.6rem 0.85rem 0.6rem 2.5rem;
    border: 1px solid var(--marble-vein);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}

.search-box .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.9rem;
    pointer-events: none;
}

/* ─── Badges / Labels ──────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.badge-pendente  { background: var(--warning-bg); color: var(--warning); }
.badge-consultado { background: var(--success-bg); color: var(--success); }
.badge-erro      { background: var(--danger-bg);  color: var(--danger); }
.badge-info      { background: var(--info-bg);    color: var(--info); }

/* ─── Flash Messages ───────────────────────────────────────── */
.flash {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.flash-success { background: var(--success-bg); color: #166534; border-color: #BBF7D0; }
.flash-error   { background: var(--danger-bg);  color: #991B1B; border-color: #FECACA; }
.flash-info    { background: var(--info-bg);    color: #1E40AF; border-color: #BFDBFE; }

/* ─── Page Header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 { margin: 0; }

/* ─── Login Page ───────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--marble);
    padding: 2rem;
}

.login-card {
    background: var(--white);
    border: 1px solid var(--marble-vein);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-card .login-logo {
    margin-bottom: 1.5rem;
}

.login-card .login-logo img {
    height: 80px;
    width: auto;
}

.login-card h2 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 0.25rem;
}

.login-card .login-subtitle {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.login-card .form-group { text-align: left; }

.login-card .btn-primary {
    width: 100%;
    padding: 0.7rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.login-card .login-links {
    margin-top: 1.25rem;
    font-size: 0.875rem;
}

/* ─── Empty State ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-light);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Tablet (< 1024px) */
@media (max-width: 1024px) {
    .delfos-sidebar {
        width: 220px;
    }
    .delfos-main {
        padding: 1.5rem;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }

    .delfos-navbar .navbar-nav {
        display: none;
    }

    .delfos-sidebar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        width: var(--sidebar-w);
        z-index: 90;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-lg);
    }

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

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 89;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .delfos-layout {
        flex-direction: column;
    }

    .delfos-main {
        padding: 1rem;
        width: 100%;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .delfos-navbar .user-name {
        display: none;
    }
}

/* Small mobile (< 480px) */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }
}

/* ─── Print ────────────────────────────────────────────────── */
@media print {
    .delfos-navbar, .delfos-sidebar, .delfos-footer { display: none; }
    .delfos-main { padding: 0; max-width: 100%; }
}
