/* CSC Digital Seva Portal - Sarkari Yatra Clean & Modern Stylesheet */
:root {
    --csc-primary: #1e3a8a;
    --csc-primary-hover: #172554;
    --csc-accent: #2563eb;
    --csc-bg: #f8fafc;
    --csc-card-bg: #ffffff;
    --csc-border: #e2e8f0;
    --csc-text-main: #0f172a;
    --csc-text-muted: #64748b;
    --csc-success: #10b981;
    --csc-warn: #f59e0b;
}

.csc-frontend-container, .csc-admin-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--csc-text-main);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Page Titles */
.csc-page-title {
    font-size: 26px;
    font-weight: 800;
    color: #1e3a8a;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.csc-page-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
}

/* Grids & Layout */
.csc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.csc-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }
@media (max-width: 768px) {
    .csc-grid-2, .csc-grid-3 { grid-template-columns: 1fr; }
}

/* Dashboard Header */
.csc-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
@media (max-width: 768px) {
    .csc-dash-header { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* Stat Cards */
.csc-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.csc-stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border-left: 4px solid #1e3a8a;
}
.csc-card-amber { border-left-color: #f59e0b; }
.csc-card-warn { border-left-color: #ef4444; }
.csc-card-success { border-left-color: #10b981; }
.csc-stat-label { font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
.csc-stat-val { font-size: 28px; font-weight: 800; color: #0f172a; margin: 6px 0; }
.csc-stat-sub { font-size: 11px; color: #94a3b8; }

/* General Cards */
.csc-card, .csc-form-card, .csc-auth-card, .csc-track-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.csc-auth-card { max-width: 460px; margin: 30px auto; }

/* Tables */
.csc-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
}
.csc-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}
.csc-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.csc-table tr:hover td { background: #f8fafc; }

/* Service Cards */
.csc-services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; }
.csc-service-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.csc-service-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.07); border-color: #cbd5e1; }
.csc-service-title { font-size: 16px; font-weight: 800; color: #0f172a; margin: 8px 0 2px; }
.csc-service-title-hi { font-size: 13px; color: #64748b; margin-bottom: 6px; }
.csc-service-dept { font-size: 12px; color: #1e3a8a; font-weight: 600; }
.csc-service-pricing { background: #f8fafc; border: 1px solid #f1f5f9; padding: 10px 12px; border-radius: 8px; margin: 12px 0; font-size: 12px; }
.csc-total-fee { font-size: 15px; color: #1e3a8a; font-weight: 800; margin-top: 4px; }
.csc-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; }

/* Badges */
.csc-badge { display: inline-block; padding: 4px 10px; border-radius: 9999px; font-size: 11px; font-weight: 700; background: #e2e8f0; color: #475569; }
.csc-badge-blue { background: #eff6ff; color: #1e40af; }
.csc-badge-success { background: #ecfdf5; color: #065f46; }
.csc-badge-warn { background: #fef3c7; color: #92400e; }
.csc-badge-dark { background: #0f172a; color: #ffffff; }

/* Inputs & Buttons */
.csc-input, .csc-track-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 4px;
    box-sizing: border-box;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.csc-input:focus, .csc-track-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.csc-btn-primary, .csc-btn-apply, .csc-btn-submit {
    display: inline-block;
    padding: 10px 22px;
    background: #1e3a8a;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, transform 0.1s;
}
.csc-btn-primary:hover, .csc-btn-apply:hover { background: #172554; }
.csc-btn-secondary {
    display: inline-block;
    padding: 10px 18px;
    background: #f8fafc;
    color: #334155 !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    border: 1px solid #cbd5e1;
    transition: background-color 0.2s;
}
.csc-btn-secondary:hover { background: #f1f5f9; }
.csc-btn-small {
    display: inline-block;
    padding: 6px 12px;
    background: #eff6ff;
    color: #1e40af !important;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none !important;
    border: 1px solid #bfdbfe;
}
.csc-btn-small:hover { background: #dbeafe; }

/* Alerts */
.csc-alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.csc-alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.csc-alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.csc-alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* Modals */
.csc-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}
.csc-modal-content {
    background: #ffffff;
    border-radius: 14px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}
.csc-modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0; padding-bottom: 14px; }
.csc-modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #64748b; }
.csc-modal-close:hover { color: #0f172a; }

/* Helpers */
.csc-auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 2px solid #e2e8f0; padding-bottom: 8px; }
.csc-tab-btn { flex: 1; padding: 10px 14px; border: none; background: transparent; font-size: 14px; font-weight: 700; color: #64748b; cursor: pointer; border-radius: 8px; transition: all 0.2s; }
.csc-tab-btn.active { background: #1e3a8a; color: #ffffff !important; }
.csc-tab-btn:hover:not(.active) { background: #f1f5f9; color: #0f172a; }
.csc-mt-2 { margin-top: 8px; }
.csc-mt-3 { margin-top: 14px; }
.csc-mt-4 { margin-top: 20px; }
.csc-mb-4 { margin-bottom: 20px; }
.csc-w-full { width: 100%; }
.csc-text-center { text-align: center; }

/* Sub-Header Navigation for Logged-In Citizens */
.csc-sub-header-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}
.csc-sub-header-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}
.csc-sub-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.csc-sub-avatar {
    width: 38px;
    height: 38px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1.5px solid #bae6fd;
}
.csc-sub-user-meta {
    display: flex;
    flex-direction: column;
}
.csc-sub-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}
.csc-sub-phone {
    font-size: 12px;
    color: #64748b;
}
.csc-sub-family-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.csc-sub-family-empty {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
    transition: background 0.2s;
}
.csc-sub-family-empty:hover {
    background: #fde68a;
}
.csc-sub-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.csc-sub-profile-link {
    font-size: 13px;
    font-weight: 600;
    color: #1e3a8a;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    transition: all 0.2s;
}
.csc-sub-profile-link:hover, .csc-sub-profile-link.active {
    background: #1e3a8a;
    color: #ffffff;
    border-color: #1e3a8a;
}
.csc-sub-logout-btn {
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    transition: all 0.2s;
}
.csc-sub-logout-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}
.csc-sub-nav-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #ffffff;
    overflow-x: auto;
    white-space: nowrap;
}
.csc-sub-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
}
.csc-sub-tab:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.csc-sub-tab.active {
    background: #1e3a8a;
    color: #ffffff !important;
}

/* Family ID Badges and Cards */
.csc-family-badge {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 9999px;
}
@media (max-width: 800px) {
    .csc-profile-layout {
        grid-template-columns: 1fr !important;
    }
}
