@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --gold:         #C4912A;
    --gold-light:   #F0CC5A;
    --gold-bright:  #FFE180;
    --gold-dark:    #8B6010;
    --gold-mid:     #D4A030;
    --gold-grad:    linear-gradient(180deg, #FFE180 0%, #D4A030 35%, #C4912A 65%, #8B6010 100%);
    --gold-shim:    linear-gradient(135deg, #FFE180 0%, #C4912A 45%, #8B6010 100%);
    --green:        #1a5c38;
    --green-light:  #2a8a55;
    --dark:         #0c0c14;
    --dark-2:       #12121e;
    --dark-3:       #1a1a2a;
    --dark-4:       #22223a;
    --glass:        rgba(255, 255, 255, 0.04);
    --glass-border: rgba(196, 145, 42, 0.18);
    --text:         #e8e8f0;
    --text-muted:   #9090a8;
    --text-bright:  #ffffff;
    --shadow-gold:  0 0 30px rgba(196,145,42,0.25);
    --transition:   all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--dark);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    line-height: 1.7;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark-2); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }
::selection { background: var(--gold); color: var(--dark); }

h1, h2, h3, .nav-brand {
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.02em;
}

.navbar {
    background: rgba(12, 12, 20, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.nav-brand {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gold-shim);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a:hover { color: var(--gold-light); }

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -6px;
    left: 0;
    background: linear-gradient(90deg, var(--gold), var(--green));
    transition: width 0.3s ease;
    border-radius: 3px;
}

.nav-links a:hover::after { width: 100%; }

main {
    flex: 1;
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.6s ease-out forwards;
}

/* Cards */
.card {
    background: var(--dark-3);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.card:hover {
    box-shadow: 0 24px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(196,145,42,0.2);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--dark-2);
    border: 1.5px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-bright);
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Poppins', 'Inter', sans-serif;
    transition: all 0.3s ease;
    box-shadow: none;
}

.form-control::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-control:focus {
    outline: none;
    background: var(--dark-3);
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(196,145,42,0.15);
}

/* Custom Checkboxes */
input[type="checkbox"], input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.4rem;
    height: 1.4rem;
    background: var(--dark-2);
    border: 2px solid var(--glass-border);
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    top: 3px;
}

input[type="radio"] { border-radius: 50%; }

input[type="checkbox"]:hover, input[type="radio"]:hover {
    border-color: var(--gold);
    background: rgba(196,145,42,0.08);
}

input[type="checkbox"]:checked, input[type="radio"]:checked {
    background: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 4px 10px rgba(196,145,42,0.3);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    color: #1a0f00;
    font-size: 0.95rem;
    font-weight: bold;
}

input[type="radio"]:checked::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    background: #1a0f00;
    border-radius: 50%;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    font-size: 1.05rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-mid), var(--gold-dark));
    color: #1a0f00;
    box-shadow: 0 8px 20px rgba(196,145,42,0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #fff0a0, var(--gold-bright), var(--gold-mid));
    box-shadow: 0 12px 30px rgba(196,145,42,0.5);
    transform: translateY(-2px) scale(1.01);
}

.btn-secondary {
    background: var(--dark-4);
    color: var(--text);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--dark-3);
    color: var(--text-bright);
    border-color: var(--gold);
    transform: translateY(-2px);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: var(--dark-3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(196,145,42,0.08);
    color: var(--text);
}

th {
    background: var(--dark-4);
    color: var(--gold);
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.8rem;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--dark-4); }

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

h1 { font-size: 2.75rem; font-weight: 800; color: var(--text-bright); }
h2 { font-size: 2rem; color: var(--text-bright); font-weight: 700; }
h3 { font-size: 1.5rem; color: var(--text-bright); font-weight: 700; }

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

.flash-messages { margin-bottom: 2rem; }

.alert {
    padding: 1.2rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-weight: 600;
    animation: fadeIn 0.5s ease-out;
    display: flex;
    align-items: center;
}

.alert-success {
    background: rgba(26,92,56,0.15);
    color: #6de9a4;
    border: 1px solid rgba(26,92,56,0.3);
}

.alert-danger {
    background: rgba(239,68,68,0.1);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.2);
}

/* Section header */
.section-header {
    border-bottom: 2px solid var(--glass-border);
    padding-bottom: 0.8rem;
    margin-top: 3rem;
    margin-bottom: 1.8rem;
    color: var(--gold);
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
}

.checkbox-group-container {
    background: var(--dark-4);
    padding: 1.8rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.checkbox-group-container label:first-child {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    display: block;
    color: var(--text-bright);
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}

.checkbox-group-container div {
    display: grid;
    gap: 1rem;
    color: var(--text);
    font-weight: 500;
}

/* Multi-step Form */
.form-step { display: none; animation: fadeIn 0.4s ease-in-out; }
.form-step.active { display: block; }

.progress-container {
    margin-bottom: 3rem;
    position: relative;
    padding: 0 1rem;
}

.progress-bar {
    position: absolute;
    top: 50%;
    left: 1rem;
    right: 1rem;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--green));
    transform: translateY(-50%);
    width: 0%;
    transition: width 0.4s ease;
    z-index: 1;
}

.progress-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 1rem;
    right: 1rem;
    height: 4px;
    background: var(--dark-4);
    transform: translateY(-50%);
    z-index: 0;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.progress-steps .step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dark-3);
    border: 3px solid var(--dark-4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.4s ease;
    box-shadow: 0 0 0 4px var(--dark);
}

.progress-steps .step.active {
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 0 4px var(--dark), 0 0 15px rgba(196,145,42,0.3);
}

.progress-steps .step.completed {
    background: var(--gold);
    border-color: var(--gold);
    color: #1a0f00;
    box-shadow: 0 0 0 4px var(--dark);
}

/* ── Responsive grid utilities ── */
.resp-2col {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    align-items: start;
}
.resp-2col-wide {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}
.resp-stats-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.resp-stats-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
    .card { padding: 1.25rem; border-radius: 14px; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    .header-flex { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .btn { font-size: 0.88rem; padding: 0.7rem 1.4rem; }
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .progress-steps .step { width: 32px; height: 32px; font-size: 0.8rem; }
    .checkbox-group-container { padding: 1.2rem; }
    .alert { font-size: 0.88rem; }

    /* Page content padding */
    .page-content { padding: 1rem !important; }

    /* Common two-column layouts → stack */
    .two-col-grid,
    [style*="grid-template-columns:1fr 300px"],
    [style*="grid-template-columns:1fr 320px"],
    [style*="grid-template-columns:1fr 340px"] {
        grid-template-columns: 1fr !important;
    }

    /* Stats grids: 3-col → 2-col */
    [style*="grid-template-columns:repeat(3,1fr)"],
    [style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* RP form grid */
    .rp-grid { grid-template-columns: 1fr !important; }

    /* Tables horizontal scroll */
    table { min-width: 600px; }
    .sch-wrap > div,
    .rp-wrap > div { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Toolbar wrap */
    .sch-toolbar, .rp-toolbar { flex-direction: column; }
    .sch-search, .rp-search { min-width: unset; width: 100%; }

    /* Fixed send panel → full width bottom sheet */
    #send-panel { width: 100% !important; right: -100% !important; top: auto; bottom: 0; height: 85vh; border-radius: 18px 18px 0 0; }
    #send-panel.open { right: 0 !important; }

    /* Email modal */
    #emailModal { width: 94vw !important; }

    /* Banner layouts */
    [style*="display:flex; align-items:center; gap:2rem"] { flex-direction: column; gap: 1rem; }

    /* Sticky right column → not sticky on mobile */
    [style*="position:sticky"] { position: relative !important; top: auto !important; }

    /* Utility classes → stack on mobile */
    .resp-2col, .resp-2col-wide { grid-template-columns: 1fr !important; }
    .resp-stats-3 { grid-template-columns: repeat(2, 1fr) !important; }
    .resp-stats-4 { grid-template-columns: repeat(2, 1fr) !important; }

    /* Banner flex → column */
    .resp-banner { flex-direction: column !important; gap: 1rem !important; }
    .resp-banner > div:last-child { align-items: flex-start !important; flex-direction: row !important; flex-wrap: wrap; }

    /* Hide stat boxes in banner on very small screens */
    @media (max-width: 480px) {
        .resp-banner > div:last-child { display: none !important; }
    }
}
