/*
 * CivicChain Design System
 * Transparent Municipal Services Platform
 * Version 1.0
 */

/* ============================================
   RESET & BASE STYLES
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --civic-navy: #1B3A6B;
    --civic-navy-dark: #122952;
    --civic-blue: #2557A7;
    --civic-blue-light: #3D6FC4;

    /* Blockchain / Verified Green */
    --civic-green: #1B7A3E;
    --civic-green-light: #22A15B;
    --civic-green-bg: #F0FAF4;

    /* Backgrounds */
    --bg-app: #F7F9FC;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-navbar: #1B3A6B;

    /* Grays */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Semantic */
    --success: #10B981;
    --success-bg: #ECFDF5;
    --success-border: #A7F3D0;
    --error: #EF4444;
    --error-bg: #FEF2F2;
    --error-border: #FECACA;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --warning-border: #FDE68A;
    --info: #3B82F6;
    --info-bg: #EFF6FF;
    --info-border: #BFDBFE;

    /* Borders */
    --border: #E2E8F0;
    --border-light: #EDF2F7;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

    /* Spacing */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Layout */
    --sidebar-width: 260px;
    --navbar-height: 64px;
}

/* Accessible focus indicator */
*:focus-visible {
    outline: 2px solid #5DFFB0;
    outline-offset: 2px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #5DFFB0;
    outline-offset: 2px;
    border-radius: 2px;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background-color: var(--bg-app);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--civic-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   SCREEN MANAGEMENT
   ============================================ */

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* ============================================
   LOGIN / AUTH SCREEN
   ============================================ */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F7F9FC 0%, #EBF1FA 100%);
    padding: var(--sp-6);
}

.login-wrapper {
    width: 100%;
    max-width: 460px;
}

.login-brand {
    text-align: center;
    margin-bottom: var(--sp-6);
}

.login-brand .brand-logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--civic-navy);
    letter-spacing: -0.5px;
}

.login-brand .brand-logo .chain-icon {
    margin-right: 6px;
    color: var(--civic-green);
    display: inline-flex;
    align-items: center;
    width: 20px;
    height: 20px;
}

.login-brand .brand-tagline {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-10);
}

.login-header {
    text-align: center;
    margin-bottom: var(--sp-8);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--civic-navy);
    margin-bottom: var(--sp-1);
}

.login-header .login-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
}

.login-header .login-muni {
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 2px;
}

.demo-creds {
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    margin-bottom: var(--sp-6);
}

.demo-creds h4 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-500);
    margin-bottom: var(--sp-2);
}

.demo-creds .cred-row {
    font-size: 12px;
    color: var(--gray-600);
    padding: 3px 0;
    display: flex;
    gap: var(--sp-2);
}

.demo-creds .cred-row strong {
    color: var(--gray-700);
    min-width: 120px;
}

.demo-creds .cred-row code {
    background: var(--gray-200);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 11px;
}

.login-footer {
    text-align: center;
    margin-top: var(--sp-6);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--gray-500);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
    margin-bottom: var(--sp-4);
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--sp-2);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--civic-blue);
    box-shadow: 0 0 0 3px rgba(37, 87, 167, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}

.form-error {
    font-size: 12px;
    color: var(--error);
    margin-top: var(--sp-1);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--civic-navy);
    color: #fff;
    border-color: var(--civic-navy);
}

.btn-primary:hover {
    background: var(--civic-navy-dark);
    border-color: var(--civic-navy-dark);
}

.btn-blue {
    background: var(--civic-blue);
    color: #fff;
    border-color: var(--civic-blue);
}

.btn-blue:hover {
    background: var(--civic-navy);
    border-color: var(--civic-navy);
}

.btn-success {
    background: var(--civic-green);
    color: #fff;
    border-color: var(--civic-green);
}

.btn-success:hover {
    background: var(--civic-green-light);
    border-color: var(--civic-green-light);
}

.btn-danger {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
}

.btn-danger:hover {
    background: #DC2626;
    border-color: #DC2626;
}

.btn-outline {
    background: transparent;
    color: var(--civic-navy);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-outline-white {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

.btn-outline-white:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   TOP NAVIGATION BAR
   ============================================ */

.navbar {
    background: var(--bg-navbar);
    height: var(--navbar-height);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: var(--shadow-md);
}

.navbar-content {
    height: 100%;
    padding: 0 var(--sp-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.navbar-brand .brand-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.navbar-brand .brand-name .chain-icon {
    color: #5DFFB0;
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
    width: 18px;
    height: 18px;
}

.navbar-portal {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    padding-left: var(--sp-3);
    border-left: 1px solid rgba(255,255,255,0.2);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.navbar-username {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

.role-badge {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* ============================================
   MAIN LAYOUT (Sidebar + Content)
   ============================================ */

.main-layout {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: var(--sp-4) 0;
    flex-shrink: 0;
    overflow-y: auto;
    position: sticky;
    top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-400);
    padding: var(--sp-4) var(--sp-4) var(--sp-2);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 var(--sp-3);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 10px var(--sp-3);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
    cursor: pointer;
}

.nav-link:hover {
    background: var(--gray-50);
    color: var(--civic-navy);
    text-decoration: none;
}

.nav-link.active {
    background: var(--civic-navy);
    color: #fff;
}

.nav-link.active:hover {
    background: var(--civic-navy-dark);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.nav-link.active .nav-badge {
    background: rgba(255,255,255,0.3);
}

.sidebar-divider {
    margin: var(--sp-3) var(--sp-3);
    border: none;
    border-top: 1px solid var(--border-light);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.content-area {
    flex: 1;
    padding: var(--sp-8);
    max-width: 100%;
    overflow-x: hidden;
}

.section-panel {
    display: none;
}

.section-panel.active {
    display: block;
}

.section-header {
    margin-bottom: var(--sp-6);
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--civic-navy);
    margin-bottom: 4px;
}

.section-header p {
    font-size: 13px;
    color: var(--gray-500);
}

/* ============================================
   STAT CARDS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    box-shadow: var(--shadow-xs);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--sp-3);
}

.stat-card-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gray-500);
}

.stat-card-icon {
    display: inline-flex;
    align-items: center;
    width: 22px;
    height: 22px;
    opacity: 0.7;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--civic-navy);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-card-value.success { color: var(--civic-green); }
.stat-card-value.warning { color: var(--warning); }
.stat-card-value.error { color: var(--error); }

.stat-card-sub {
    font-size: 12px;
    color: var(--gray-400);
}

/* ============================================
   CARDS / PANELS
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    margin-bottom: var(--sp-5);
}

.card-header {
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.card-header .card-header-meta {
    font-size: 12px;
    color: var(--gray-400);
}

.card-body {
    padding: var(--sp-5);
}

.card-body-sm {
    padding: var(--sp-4);
}

.card-footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border-light);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    font-size: 12px;
    color: var(--gray-500);
}

/* ============================================
   DATA TABLES
   ============================================ */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    background: var(--gray-50);
    padding: 10px var(--sp-4);
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.1s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--gray-50);
}

tbody td {
    padding: 12px var(--sp-4);
    color: var(--gray-700);
    vertical-align: middle;
}

.td-primary {
    font-weight: 600;
    color: var(--gray-900);
}

.td-mono {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--gray-600);
}

/* ============================================
   BADGES / STATUS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: #065F46;
    border: 1px solid var(--success-border);
}

.badge-error {
    background: var(--error-bg);
    color: #991B1B;
    border: 1px solid var(--error-border);
}

.badge-warning {
    background: var(--warning-bg);
    color: #92400E;
    border: 1px solid var(--warning-border);
}

.badge-info {
    background: var(--info-bg);
    color: #1E40AF;
    border: 1px solid var(--info-border);
}

.badge-navy {
    background: rgba(27,58,107,0.1);
    color: var(--civic-navy);
    border: 1px solid rgba(27,58,107,0.2);
}

.badge-green {
    background: var(--civic-green-bg);
    color: var(--civic-green);
    border: 1px solid rgba(27,122,62,0.2);
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress-wrap {
    margin-top: var(--sp-1);
}

.progress-bar-track {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--civic-green);
    transition: width 0.4s ease;
}

.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger { background: var(--error); }
.progress-bar-fill.navy { background: var(--civic-navy); }

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ============================================
   LIVE FEED / TRANSACTION ITEMS
   ============================================ */

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.feed-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 12px var(--sp-4);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
    animation: feedSlideIn 0.3s ease;
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-item:hover {
    background: var(--gray-50);
}

@keyframes feedSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.feed-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.feed-dot.approved { background: var(--success); }
.feed-dot.declined { background: var(--error); }

.feed-item-content {
    flex: 1;
    min-width: 0;
}

.feed-item-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-2);
}

.feed-merchant {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-amount {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.feed-amount.approved { color: var(--gray-800); }
.feed-amount.declined { color: var(--error); }

.feed-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.feed-meta {
    font-size: 11px;
    color: var(--gray-400);
}

.feed-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feed-status.approved { color: var(--success); }
.feed-status.declined { color: var(--error); }

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-6);
    backdrop-filter: blur(2px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}

.modal-header {
    padding: var(--sp-5) var(--sp-6);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--civic-navy);
}

.modal-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: var(--sp-6);
}

.modal-footer {
    padding: var(--sp-4) var(--sp-6);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-3);
    background: var(--gray-50);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.toast {
    background: var(--gray-900);
    color: #fff;
    padding: var(--sp-3) var(--sp-5);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

.toast.success {
    background: var(--civic-green);
}

.toast.error {
    background: var(--error);
}

.toast.warning {
    background: var(--warning);
    color: var(--gray-900);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   ALERT BOXES
   ============================================ */

.alert {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: var(--sp-4);
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
}

.alert-icon {
    display: inline-flex;
    align-items: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #065F46;
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: #991B1B;
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: #92400E;
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    color: #1E40AF;
}

/* ============================================
   BLOCKCHAIN / VERIFIED BADGE
   ============================================ */

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--civic-green);
    background: var(--civic-green-bg);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(27,122,62,0.2);
}

.verified-badge svg { width: 12px; height: 12px; }

.chain-hash {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* ============================================
   CARD PAYMENT ITEM (Physical/Virtual Cards)
   ============================================ */

.payment-card-display {
    background: linear-gradient(135deg, var(--civic-navy) 0%, var(--civic-blue) 100%);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: var(--sp-3);
}

.payment-card-display::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.payment-card-display::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: 40px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.card-tier {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: var(--sp-3);
}

.card-last4 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: var(--sp-2);
}

.card-holder {
    font-size: 13px;
    opacity: 0.8;
}

.card-balance-display {
    text-align: right;
    position: absolute;
    top: var(--sp-5);
    right: var(--sp-5);
}

.card-balance-label {
    font-size: 10px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-balance-amount {
    font-size: 20px;
    font-weight: 700;
}

/* ============================================
   CARD LIST ROWS
   ============================================ */

.card-row {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: 14px var(--sp-4);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.card-row:last-child {
    border-bottom: none;
}

.card-row:hover {
    background: var(--gray-50);
}

.card-row.expanded {
    background: var(--info-bg);
}

.card-row-icon {
    width: 40px;
    height: 40px;
    background: var(--civic-navy);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    color: #fff;
}

.card-row-icon.equipment { background: var(--gray-700); }
.card-row-icon.individual { background: var(--civic-blue); }
.card-row-icon.company { background: var(--civic-navy); }

.card-row-info {
    flex: 1;
    min-width: 0;
}

.card-row-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-row-sub {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.card-row-amount {
    text-align: right;
}

.card-row-balance {
    font-size: 15px;
    font-weight: 700;
    color: var(--civic-navy);
}

.card-row-limit {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

.card-expand {
    font-size: 12px;
    color: var(--gray-400);
    transition: transform 0.2s;
}

.card-row.expanded .card-expand {
    transform: rotate(180deg);
}

.card-spend-history {
    background: var(--gray-50);
    border-bottom: 1px solid var(--border-light);
    padding: var(--sp-4);
    display: none;
}

.card-spend-history.open {
    display: block;
}

/* ============================================
   MCC LOCK TAGS
   ============================================ */

.mcc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: var(--sp-2);
}

.mcc-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    background: rgba(27,58,107,0.08);
    color: var(--civic-navy);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(27,58,107,0.15);
    font-family: monospace;
}

/* ============================================
   PROPOSAL CARDS
   ============================================ */

.proposals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-4);
}

.proposal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
    box-shadow: var(--shadow-xs);
}

.proposal-card.selected {
    border-color: var(--civic-blue);
    box-shadow: 0 0 0 3px rgba(37,87,167,0.12);
}

.proposal-number {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-500);
    margin-bottom: var(--sp-2);
}

.proposal-bid {
    font-size: 26px;
    font-weight: 700;
    color: var(--civic-navy);
    margin-bottom: var(--sp-3);
}

.proposal-detail {
    font-size: 13px;
    color: var(--gray-600);
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
}

.proposal-detail:last-of-type {
    border-bottom: none;
}

.proposal-detail strong {
    color: var(--gray-800);
    font-weight: 600;
}

/* ============================================
   TABS
   ============================================ */

.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: var(--sp-6);
}

.tab-btn {
    padding: 10px var(--sp-5);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    font-family: var(--font);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--civic-navy);
}

.tab-btn.active {
    color: var(--civic-navy);
    border-bottom-color: var(--civic-navy);
    font-weight: 600;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ============================================
   INFO ROWS
   ============================================ */

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}

.info-item label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-400);
    display: block;
    margin-bottom: 4px;
}

.info-item .info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.info-item .info-value.mono {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* ============================================
   DIVIDER
   ============================================ */

.divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: var(--sp-5) 0;
}

/* ============================================
   UTILITY
   ============================================ */

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--gray-500); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: 'Courier New', monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ============================================
   LANDING PAGE (index.html)
   ============================================ */

.landing-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #0F2347 0%, #1B3A6B 40%, #2557A7 100%);
    display: flex;
    flex-direction: column;
}

.landing-header {
    padding: var(--sp-8) var(--sp-8) var(--sp-6);
    text-align: center;
}

.landing-logo {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    margin-bottom: var(--sp-2);
}

.landing-logo .chain-icon {
    color: #5DFFB0;
    display: inline-flex;
    align-items: center;
    width: 24px;
    height: 24px;
}

.landing-tagline {
    font-size: 16px;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.landing-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-8);
}

.landing-headline {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    line-height: 1.2;
    margin-bottom: var(--sp-4);
    letter-spacing: -1px;
    max-width: 700px;
}

.landing-sub {
    font-size: 18px;
    color: rgba(255,255,255,0.65);
    text-align: center;
    max-width: 560px;
    margin-bottom: var(--sp-12);
    line-height: 1.6;
}

.portal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--sp-5);
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.portal-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-xl);
    padding: var(--sp-8);
    text-align: center;
    transition: all 0.25s ease;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.portal-card:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.portal-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: var(--sp-4);
    color: var(--civic-green);
}

.portal-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: var(--sp-3);
}

.portal-card-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    margin-bottom: var(--sp-5);
}

.portal-card .enter-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 10px 24px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.portal-card .enter-btn:hover {
    background: rgba(255,255,255,0.25);
    text-decoration: none;
}

.portal-card.citizen-card .enter-btn {
    background: rgba(93,255,176,0.15);
    border-color: rgba(93,255,176,0.3);
    color: #5DFFB0;
}

.portal-card.citizen-card .enter-btn:hover {
    background: rgba(93,255,176,0.25);
}

.landing-footer {
    padding: var(--sp-6) var(--sp-8);
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.landing-footer p {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 4px;
}

.landing-footer .blockchain-note {
    font-size: 11px;
    color: rgba(93,255,176,0.6);
    letter-spacing: 0.3px;
}

/* ============================================
   PUBLIC CITIZEN PORTAL
   ============================================ */

.citizen-header {
    background: var(--civic-navy);
    padding: var(--sp-4) var(--sp-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.citizen-header-brand {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.citizen-header-brand .chain-icon {
    color: #5DFFB0;
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
    width: 18px;
    height: 18px;
}

.citizen-header-meta {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    text-align: right;
}

.citizen-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--sp-6) var(--sp-6);
}

.contract-pub-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--sp-4);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.contract-pub-header {
    padding: var(--sp-4) var(--sp-5);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-4);
    border-bottom: 1px solid var(--border-light);
}

.contract-pub-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--civic-navy);
}

.contract-pub-crn {
    font-size: 11px;
    font-family: monospace;
    color: var(--gray-500);
    margin-top: 2px;
}

.contract-pub-body {
    padding: var(--sp-4) var(--sp-5);
}

.contract-pub-expand {
    padding: var(--sp-3) var(--sp-5);
    background: var(--gray-50);
    border-top: 1px solid var(--border-light);
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    color: var(--civic-blue);
    font-weight: 600;
    transition: background 0.15s;
}

.contract-pub-expand:hover {
    background: var(--border-light);
}

.contract-pub-transactions {
    display: none;
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border-light);
    background: var(--gray-50);
}

.contract-pub-transactions.open {
    display: block;
}

/* ============================================
   VOTING FLOW
   ============================================ */

.vote-modal-step {
    display: none;
}

.vote-modal-step.active {
    display: block;
}

.vote-proposal-option {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    cursor: pointer;
    transition: all 0.15s;
}

.vote-proposal-option:hover {
    border-color: var(--civic-blue);
    background: var(--info-bg);
}

.vote-proposal-option.selected {
    border-color: var(--civic-green);
    background: var(--civic-green-bg);
}

.vote-success {
    text-align: center;
    padding: var(--sp-8);
}

.vote-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto var(--sp-4);
    color: var(--civic-blue);
}

.vote-success h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--civic-green);
    margin-bottom: var(--sp-3);
}

.vote-success p {
    color: var(--gray-500);
    font-size: 14px;
    max-width: 360px;
    margin: 0 auto;
}

/* ============================================
   BLOCKCHAIN LEDGER TABLE
   ============================================ */

.ledger-hash {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--civic-blue);
}

.ledger-note {
    background: var(--civic-green-bg);
    border: 1px solid rgba(27,122,62,0.2);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    margin-bottom: var(--sp-4);
    font-size: 13px;
    color: var(--civic-green);
    display: flex;
    gap: var(--sp-3);
    align-items: flex-start;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-y: visible;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: var(--sp-2);
        gap: var(--sp-1);
    }

    .nav-link span {
        display: none;
    }

    .nav-icon {
        width: 20px;
        height: 20px;
    }

    .content-area {
        padding: var(--sp-4);
    }

    .portal-cards {
        grid-template-columns: 1fr;
    }

    .landing-headline {
        font-size: 28px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* SVG Icon sizing */
.chain-icon svg,
.nav-icon svg,
.stat-card-icon svg,
.alert-icon svg,
.portal-card-icon svg,
.vote-success-icon svg { width: 100%; height: 100%; }
.modal-close svg { width: 18px; height: 18px; }
.report-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0 auto var(--sp-3); color: var(--civic-navy); }
.report-icon svg { width: 100%; height: 100%; }
