/* ============================================================
   Online Labour & Cess System — Main Stylesheet
   ============================================================ */

/* ── CSS VARIABLES ── */
:root {
    --navy:       #1B2A4A;
    --navy-light: #243660;
    --navy-dark:  #111d33;
    --rust:       #C0522A;
    --rust-light: #D4693E;
    --beige:      #FDF6EC;
    --beige-dark: #F5EAD8;
    --white:      #FFFFFF;
    --text-muted: #6c757d;
    --border:     #e2e8f0;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:  0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:  0 10px 30px rgba(0,0,0,.12);
    --radius:     12px;
}

* { box-sizing: border-box; }

/* ── BASE ── */
html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--beige);
    color: #1a202c;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

/* ── NAVBAR ── */
.navbar {
    background: var(--navy) !important;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.navbar-inner {
    display: flex;
    align-items: stretch;
    width: 100%;
}
.navbar-brand-wrap {
    background: var(--navy-dark);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    border-right: 1px solid rgba(255,255,255,.08);
}
.navbar-brand-wrap .brand-icon {
    width: 38px;
    height: 38px;
    background: var(--rust);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
}
.navbar-brand-wrap .brand-text { color: white; }
.navbar-brand-wrap .brand-text strong {
    display: block;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
}
.navbar-brand-wrap .brand-text small {
    font-size: .72rem;
    opacity: .65;
    font-weight: 400;
}
.navbar-nav-wrap {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-left: auto;
    gap: 4px;
}
.nav-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 8px;
    color: rgba(255,255,255,.75) !important;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    transition: all .18s;
}
.nav-pill:hover,
.nav-pill.active {
    background: rgba(255,255,255,.12);
    color: white !important;
}
.nav-pill i { font-size: .8rem; }

/* ── MAIN CONTAINER ── */
.main-container {
    max-width: 1140px;
}

/* ── PAGE HERO ── */
.page-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    border-radius: var(--radius);
    padding: 22px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-md);
}
.page-hero-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}
.page-hero-text h4 { margin: 0; color: white; font-weight: 700; font-size: 1.1rem; }
.page-hero-text p  { margin: 2px 0 0; color: rgba(255,255,255,.65); font-size: .82rem; }

/* ── CARDS ── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--white);
    overflow: hidden;
}
.card-header {
    background: var(--navy);
    color: white;
    padding: 14px 20px;
    font-weight: 600;
    font-size: .9rem;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header .badge-count {
    background: rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .75rem;
    margin-left: auto;
}
.card-body { padding: 24px; }
.card-body-flush { padding: 0; }

/* ── SECTION LABELS ── */
.section-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.section-value {
    font-size: .95rem;
    font-weight: 600;
    color: #1a202c;
}

/* ── FORM ── */
.form-label { font-weight: 500; font-size: .85rem; color: var(--navy); margin-bottom: 5px; }
.form-control,
.form-select {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    padding: 9px 13px;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--rust);
    box-shadow: 0 0 0 3px rgba(192,82,42,.15);
    outline: none;
}
.form-control[readonly] { background: #f8fafc; color: #4a5568; }

.field-group {
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.field-group.highlight {
    background: #eef2ff;
    border-color: #c7d2fe;
}
.field-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--navy);
    color: white;
    border-radius: 50%;
    font-size: .72rem;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

/* ── CHALLAN PREVIEW BOX ── */
.challan-preview-box {
    background: var(--beige-dark);
    border: 1.5px dashed var(--rust);
    border-radius: 8px;
    padding: 12px 16px;
}

/* ── DECLARATION BOX ── */
.declaration-box {
    background: #fffbf5;
    border: 1.5px solid #f0c080;
    border-radius: 10px;
    padding: 20px 22px;
}
.declaration-box .dec-title {
    color: var(--rust);
    font-weight: 700;
    font-size: .9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.declaration-box p { font-size: .88rem; color: #4a5568; line-height: 1.6; }
.declaration-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.declaration-label { cursor: pointer; }

/* ── BUTTONS ── */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: .88rem;
    padding: 9px 20px;
    transition: all .18s;
}
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}
.btn-navy { background: var(--navy); border-color: var(--navy); color: white; }
.btn-navy:hover { background: var(--navy-light); border-color: var(--navy-light); color: white; }
.btn-rust { background: var(--rust); border-color: var(--rust); color: white; }
.btn-rust:hover { background: var(--rust-light); border-color: var(--rust-light); color: white; }
.btn-primary { background: var(--navy); border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-light); border-color: var(--navy-light); }
.btn-danger { background: var(--rust); border-color: var(--rust); }
.btn-danger:hover { background: var(--rust-light); border-color: var(--rust-light); }
.btn-outline-navy { border: 1.5px solid var(--navy); color: var(--navy); background: transparent; }
.btn-outline-navy:hover { background: var(--navy); color: white; }
.btn-lg { padding: 12px 28px; font-size: .95rem; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-icon { display: inline-flex; align-items: center; gap: 7px; }

/* ── TABLE ── */
.table { font-size: .85rem; margin: 0; }
.table thead th {
    background: var(--navy);
    color: white;
    font-weight: 600;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 7px 14px;
    border: none;
    white-space: nowrap;
}
.table tbody td { padding: 9px 14px; vertical-align: middle; border-color: #f1f5f9; }
.table tbody tr:hover td { background: #fef9f5; }
.table tbody tr:last-child td { border-bottom: none; }

/* ── DETAIL TABLE (SubmitToDEO) ── */
.detail-table { font-size: .88rem; }
.detail-table th {
    width: 38%;
    background: #f8fafc;
    padding: 13px 20px;
    color: var(--navy);
    font-weight: 600;
    vertical-align: top;
    border-color: #f1f5f9;
}
.detail-table td {
    padding: 13px 20px;
    vertical-align: top;
    border-color: #f1f5f9;
}
.detail-table th.align-middle,
.detail-table td.align-middle { vertical-align: middle; }

/* ── STATUS BADGES ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
}
.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .7;
}
.status-pending { background: #fff3cd; color: #856404; }
.status-paid    { background: #d1fae5; color: #065f46; }
.status-deo     { background: #dbeafe; color: #1e40af; }
.status-none    { background: #f1f5f9; color: #475569; }

/* ── STATUS BADGE SIZES ── */
.status-badge-lg { font-size: .85rem; padding: 6px 14px; }

/* ── ACTION CARDS (Dashboard) ── */
.action-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    text-decoration: none;
    color: var(--navy);
    display: block;
    transition: all .2s;
    position: relative;
    overflow: hidden;
}
.action-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--navy);
    transform: scaleX(0);
    transition: transform .2s;
}
.action-card:hover {
    border-color: var(--navy);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    color: var(--navy);
}
.action-card:hover::before { transform: scaleX(1); }
.action-card .ac-icon {
    width: 60px;
    height: 60px;
    background: var(--beige);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--navy);
    margin: 0 auto 14px;
    transition: all .2s;
}
.action-card:hover .ac-icon { background: var(--navy); color: white; }
.action-card h5 { font-weight: 700; font-size: 1rem; margin: 0 0 6px; }
.action-card p  { font-size: .82rem; color: var(--text-muted); margin: 0; }

/* ── STAT CARDS (Dashboard) ── */
.stat-card { text-align: center; padding: 20px 12px; }
.stat-number { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-number-navy  { color: var(--navy); }
.stat-number-rust  { color: var(--rust); }
.stat-number-blue  { color: #1e40af; }

/* ── CHALLAN / RECEIPT ── */
.challan-wrap {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.challan-header {
    background: var(--navy);
    color: white;
    padding: 20px 28px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.challan-header .ch-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.challan-header h5 { margin: 0; font-weight: 700; font-size: 1rem; }
.challan-header small { opacity: .65; font-size: .78rem; }
.challan-body { padding: 28px; }
.challan-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.challan-row:last-child { border-bottom: none; }
.cr-label { font-size: .82rem; color: var(--text-muted); font-weight: 500; }
.cr-value { font-weight: 600; font-size: .92rem; }
.amount-display {
    background: linear-gradient(135deg, var(--rust) 0%, var(--rust-light) 100%);
    border-radius: 10px;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    color: white;
}
.ad-label  { font-size: .82rem; opacity: .85; }
.ad-amount { font-size: 2rem; font-weight: 800; }

/* ── SUCCESS CIRCLE ── */
.success-circle {
    width: 80px;
    height: 80px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 2rem;
    color: #065f46;
}

/* ── STEP BAR ── */
.step-bar {
    display: flex;
    align-items: center;
    margin-bottom: 28px;
    gap: 0;
}
.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.step-item:last-child { flex: 0; }
.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.step-dot.done   { background: #d1fae5; color: #065f46; }
.step-dot.active { background: var(--navy); color: white; }
.step-dot.todo   { background: #f1f5f9; color: #94a3b8; }
.step-dot-icon   { font-size: .65rem; }
.step-line { flex: 1; height: 2px; background: #e2e8f0; margin: 0 4px; }
.step-line.done { background: #6ee7b7; }
.step-label { font-size: .75rem; font-weight: 500; }
.step-label.active { color: var(--navy); }
.step-label.done   { color: #065f46; }
.step-label.todo   { color: #94a3b8; }

/* ── ALERTS ── */
.alert { border-radius: 10px; border: none; font-size: .88rem; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info    { background: #dbeafe; color: #1e40af; }
.alert-warning-sm { font-size: .82rem; }

/* ── FOOTER ── */
footer {
    background: var(--navy);
    color: rgba(255,255,255,.55);
    padding: 18px 0;
    margin-top: auto;
    font-size: .8rem;
}
footer a { color: rgba(255,255,255,.7); text-decoration: none; }

/* ── MISC UTILITIES ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-rust  { color: var(--rust) !important; }
.text-navy  { color: var(--navy) !important; }
.bg-beige   { background: var(--beige) !important; }
.fw-500     { font-weight: 500; }
.fw-600     { font-weight: 600; }
.fw-700     { font-weight: 700; }
.fw-800     { font-weight: 800; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state i { font-size: 3rem; opacity: .3; margin-bottom: 12px; display: block; }
.empty-state p { font-size: .9rem; margin: 0; }

.sticky-sidebar { position: sticky; top: 20px; }

/* ── TABLE COL WIDTHS ── */
.col-sr     { width: 36px; }
.col-action { width: 120px; }

/* ── ACTION BUTTON (table rows) ── */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 6px;
    font-size: .76rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1.5;
}
.action-btn i { font-size: .68rem; }

.action-btn-navy    { background: var(--navy);    color: #fff; border-color: var(--navy); }
.action-btn-navy:hover { background: var(--navy-light); border-color: var(--navy-light); color: #fff; }

.action-btn-rust    { background: var(--rust);    color: #fff; border-color: var(--rust); }
.action-btn-rust:hover { background: var(--rust-light); border-color: var(--rust-light); color: #fff; }

.action-btn-warning { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.action-btn-warning:hover { background: #fef3c7; color: #78350f; border-color: #f59e0b; }

.action-btn-success { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; }
.action-btn-success:hover { background: #d1fae5; color: #064e3b; border-color: #34d399; }

.action-btn-ghost   { background: #f8fafc; color: #475569; border-color: var(--border); }
.action-btn-ghost:hover { background: #f1f5f9; color: var(--navy); border-color: var(--navy); }

/* ============================================================
   Flatpickr Date Picker — Custom Theme (Navy / Rust)
   ============================================================ */

/* Wrapper input — calendar icon on the right */
.date-input-wrap {
    position: relative;
}
.date-input-wrap .form-control {
    padding-right: 40px;
    cursor: pointer;
    background-color: #fff;
}
.date-input-wrap .date-icon {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--navy);
    opacity: .5;
    pointer-events: none;
    font-size: .9rem;
}

/* Calendar container */
.flatpickr-calendar {
    font-family: 'Inter', 'Segoe UI', sans-serif !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden;
    padding: 0 !important;
    width: 308px !important;
}

/* Month/year header */
.flatpickr-months {
    background: var(--navy) !important;
    border-radius: 12px 12px 0 0;
    padding: 10px 0;
}
.flatpickr-month {
    background: transparent !important;
    color: white !important;
    height: 40px !important;
}
.flatpickr-current-month {
    color: white !important;
    font-size: .95rem !important;
    font-weight: 600 !important;
    padding-top: 6px !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--navy) !important;
    color: white !important;
    font-weight: 600;
    border: none;
    font-size: .9rem;
    /* -webkit-appearance: none; */
    cursor: pointer;
}
.flatpickr-current-month input.cur-year {
    color: white !important;
    font-weight: 600 !important;
    font-size: .9rem !important;
}
.flatpickr-prev-month,
.flatpickr-next-month {
    color: rgba(255,255,255,.8) !important;
    fill: rgba(255,255,255,.8) !important;
    padding: 8px 12px !important;
}
.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    color: white !important;
    fill: white !important;
    background: rgba(255,255,255,.12) !important;
    border-radius: 6px;
}
.flatpickr-prev-month svg,
.flatpickr-next-month svg {
    fill: inherit !important;
}

/* Weekday header row */
.flatpickr-weekdays {
    background: var(--navy-light) !important;
    padding: 6px 0 4px !important;
}
.flatpickr-weekday {
    background: transparent !important;
    color: rgba(255,255,255,.7) !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Day grid */
.flatpickr-days {
    border: none !important;
    padding: 8px 6px 10px !important;
}
.dayContainer {
    padding: 0 !important;
    min-width: 296px !important;
    max-width: 296px !important;
    width: 296px !important;
}
.flatpickr-day {
    border-radius: 8px !important;
    font-size: .85rem !important;
    font-weight: 500 !important;
    color: #1a202c !important;
    height: 36px !important;
    line-height: 36px !important;
    max-width: 36px !important;
    margin: 2px !important;
    border: none !important;
    transition: background .15s, color .15s !important;
}
.flatpickr-day:hover {
    background: var(--beige-dark) !important;
    color: var(--navy) !important;
    border: none !important;
}
.flatpickr-day.today {
    background: #eef2ff !important;
    color: var(--navy) !important;
    font-weight: 700 !important;
    border: 1.5px solid #c7d2fe !important;
}
.flatpickr-day.today:hover {
    background: var(--beige-dark) !important;
    border-color: var(--rust) !important;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--rust) !important;
    color: white !important;
    border: none !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(192,82,42,.35) !important;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #cbd5e1 !important;
    background: transparent !important;
}

/* Footer (time / clear / close) */
.flatpickr-innerContainer {
    border-top: 1px solid var(--border);
}

/* ── File Upload Control ── */
.file-upload-wrap {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: #f8fafc;
    transition: border-color .2s, background .2s;
    overflow: hidden;
}
.file-upload-wrap:hover,
.file-upload-wrap.has-file {
    border-color: var(--rust);
    background: #fff8f5;
}
.file-upload-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    min-height: 52px;
}
.file-upload-icon {
    font-size: 1.1rem;
    color: var(--rust);
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: rgba(192,82,42,.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.file-upload-text {
    font-size: .84rem;
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-upload-wrap.has-file .file-upload-text {
    color: var(--navy);
    font-weight: 600;
}
.file-upload-wrap.has-file .file-upload-icon {
    background: rgba(192,82,42,.15);
    color: var(--rust);
}
.file-upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Static file display (for uploaded files with actions) */
.file-upload-label-static {
    border-radius: 8px;
    background: #fff;
    border: 1.5px solid var(--border);
}
.file-upload-wrap.file-selected {
    border-color: var(--rust) !important;
    border-style: solid !important;
    background: #fff !important;
}
.min-w-0 {
    min-width: 0 !important;
}
