/* =====================================================
   CITIZENS RULE - Main Stylesheet
   citizenzrule.kingdomlegacy.digital
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
    --navy: #0F2640;
    --navy-light: #1B3A5C;
    --gold: #D4A843;
    --gold-light: #E8C878;
    --gold-dim: rgba(212,168,67,0.12);
    --cream: #FAF7F2;
    --white: #FFFFFF;
    --gray-50: #F8F9FA;
    --gray-100: #F0F2F5;
    --gray-200: #E2E5EA;
    --gray-300: #C8CDD5;
    --gray-400: #8D95A2;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --red: #DC2626;
    --red-light: #FEF2F2;
    --green: #059669;
    --green-light: #ECFDF5;
    --blue: #2563EB;
    --blue-light: #EFF6FF;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(15,38,64,0.08);
    --shadow: 0 4px 16px rgba(15,38,64,0.1);
    --shadow-lg: 0 12px 40px rgba(15,38,64,0.15);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    color: var(--gray-800);
    background: var(--cream);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    line-height: 1.2;
    color: var(--navy);
}

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

/* ── Layout ── */
.cr-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.cr-container-sm { max-width: 560px; margin: 0 auto; padding: 0 24px; }
.cr-container-md { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ── Top Bar ── */
.cr-topbar {
    background: var(--navy);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.cr-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.cr-logo {
    font-family: 'DM Serif Display', serif;
    color: var(--white);
    font-size: 22px;
    letter-spacing: -0.3px;
}
.cr-logo span { color: var(--gold); }
.cr-nav { display: flex; gap: 4px; align-items: center; }
.cr-nav a {
    color: rgba(255,255,255,0.7);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.cr-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.cr-nav a.active { color: var(--gold); background: rgba(212,168,67,0.12); }

/* ── Auth Pages (Login/Register) ── */
.cr-auth-page {
    min-height: 100vh;
    display: flex;
    background: var(--navy);
    position: relative;
    overflow: hidden;
}
.cr-auth-page::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,168,67,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.cr-auth-page::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(27,58,92,0.3) 0%, transparent 70%);
    pointer-events: none;
}
.cr-auth-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 80px;
    position: relative;
    z-index: 1;
}
.cr-auth-left h1 {
    font-size: 48px;
    color: var(--white);
    margin-bottom: 16px;
    line-height: 1.15;
}
.cr-auth-left h1 em { color: var(--gold); font-style: italic; }
.cr-auth-left p {
    color: rgba(255,255,255,0.6);
    font-size: 18px;
    max-width: 440px;
    line-height: 1.7;
}
.cr-auth-features {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.cr-auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.cr-auth-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(212,168,67,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.cr-auth-feature h4 {
    color: var(--white);
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}
.cr-auth-feature p {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    margin: 0;
}
.cr-auth-right {
    width: 520px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 1;
}
.cr-auth-card {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.cr-auth-card h2 {
    font-size: 28px;
    margin-bottom: 8px;
}
.cr-auth-card .subtitle {
    color: var(--gray-400);
    margin-bottom: 32px;
    font-size: 14px;
}

/* ── Forms ── */
.cr-form-group {
    margin-bottom: 20px;
}
.cr-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cr-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.cr-input, .cr-select, .cr-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}
.cr-input:focus, .cr-select:focus, .cr-textarea:focus {
    border-color: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(27,58,92,0.1);
}
.cr-input::placeholder { color: var(--gray-300); }
.cr-textarea { resize: vertical; min-height: 100px; }
.cr-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238D95A2' fill='none' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

/* ── Buttons ── */
.cr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    text-decoration: none;
}
.cr-btn-primary {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}
.cr-btn-primary:hover {
    background: var(--navy-light);
    border-color: var(--navy-light);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.cr-btn-gold {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}
.cr-btn-gold:hover {
    background: var(--gold-light);
    border-color: var(--gold-light);
    color: var(--navy);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.cr-btn-outline {
    background: transparent;
    color: var(--navy);
    border-color: var(--gray-200);
}
.cr-btn-outline:hover {
    border-color: var(--navy);
    color: var(--navy);
}
.cr-btn-sm { padding: 8px 16px; font-size: 13px; }
.cr-btn-lg { padding: 16px 36px; font-size: 16px; }
.cr-btn-full { width: 100%; }

/* ── Dashboard Layout ── */
.cr-dashboard {
    display: flex;
    min-height: 100vh;
}
.cr-sidebar {
    width: 260px;
    background: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
}
.cr-sidebar-logo {
    padding: 24px 24px;
    font-family: 'DM Serif Display', serif;
    font-size: 20px;
    color: var(--white);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cr-sidebar-logo span { color: var(--gold); }
.cr-sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.cr-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.cr-sidebar-nav a:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.cr-sidebar-nav a.active { color: var(--gold); background: rgba(212,168,67,0.12); }
.cr-sidebar-nav .nav-icon { font-size: 18px; width: 24px; text-align: center; }
.cr-sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.cr-sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}
.cr-sidebar-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold-dim);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.cr-main {
    flex: 1;
    margin-left: 260px;
    padding: 32px 40px;
    min-height: 100vh;
}

/* ── Page Header ── */
.cr-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}
.cr-page-header h1 { font-size: 32px; }
.cr-page-header .subtitle { color: var(--gray-400); margin-top: 4px; font-size: 14px; }

/* ── Cards ── */
.cr-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    padding: 28px;
    margin-bottom: 24px;
}
.cr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
}
.cr-card-header h3 { font-size: 18px; }

/* ── Stat Cards ── */
.cr-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.cr-stat {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}
.cr-stat .label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-400);
    margin-bottom: 8px;
}
.cr-stat .value {
    font-family: 'DM Serif Display', serif;
    font-size: 36px;
    color: var(--navy);
    line-height: 1;
}
.cr-stat .change {
    font-size: 12px;
    margin-top: 8px;
    color: var(--green);
    font-weight: 500;
}

/* ── Table ── */
.cr-table {
    width: 100%;
    border-collapse: collapse;
}
.cr-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-400);
    border-bottom: 2px solid var(--gray-100);
}
.cr-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}
.cr-table tr:hover td { background: var(--gray-50); }

/* ── Badges ── */
.cr-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.cr-badge-green { background: var(--green-light); color: var(--green); }
.cr-badge-red { background: var(--red-light); color: var(--red); }
.cr-badge-blue { background: var(--blue-light); color: var(--blue); }
.cr-badge-gold { background: var(--gold-dim); color: #8B6914; }

/* ── Alerts ── */
.cr-alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.cr-alert-error { background: var(--red-light); color: var(--red); border: 1px solid rgba(220,38,38,0.15); }
.cr-alert-success { background: var(--green-light); color: var(--green); border: 1px solid rgba(5,150,105,0.15); }
.cr-alert-info { background: var(--blue-light); color: var(--blue); border: 1px solid rgba(37,99,235,0.15); }
.cr-alert-gold { background: var(--gold-dim); color: #8B6914; border: 1px solid rgba(212,168,67,0.2); }

/* ── Section Dividers ── */
.cr-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gray-400);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

/* ── Copy Code Box ── */
.cr-code-box {
    background: var(--gray-800);
    color: #A5F3FC;
    padding: 20px;
    border-radius: var(--radius);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    position: relative;
}
.cr-code-box .copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}
.cr-code-box .copy-btn:hover { background: rgba(255,255,255,0.25); }

/* ── Empty States ── */
.cr-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}
.cr-empty .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.cr-empty h3 { color: var(--gray-500); font-family: 'DM Sans', sans-serif; font-weight: 600; }
.cr-empty p { margin-top: 8px; font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .cr-auth-page { flex-direction: column; }
    .cr-auth-left { padding: 40px 24px; text-align: center; }
    .cr-auth-left h1 { font-size: 32px; }
    .cr-auth-features { display: none; }
    .cr-auth-right { width: 100%; padding: 0 24px 40px; }
    .cr-sidebar { display: none; }
    .cr-main { margin-left: 0; padding: 20px 16px; }
    .cr-form-row { grid-template-columns: 1fr; }
    .cr-page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
