:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Auth / Login Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #eff6ff 0%, #bfdbfe 100%);
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.auth-card h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.auth-card .subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f1f5f9;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Navbar */
.navbar {
    background-color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #475569 !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.btn-home:hover {
    background-color: #f1f5f9;
    color: var(--primary-color) !important;
}

.btn-home svg {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.btn-home:hover svg {
    color: var(--primary-color);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.mt-4 {
    margin-top: 2rem;
}

.card {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #f8fafc;
}

.card-header h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.card-body {
    padding: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.75rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* E-Challan View Styles */
.view-bg {
    background-color: #e2e8f0;
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.challan-wrapper {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.challan-actions {
    display: flex;
    justify-content: flex-end;
}


/* Compact form styles */
.compact .form-group {
    margin-bottom: 1rem;
}

.compact label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.compact input,
.compact select,
.compact textarea {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.section-title {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}


/* OFFICIAL DOCUMENT PRINT STYLES */
.official-doc {
    background-color: white;
    width: 100%;
    margin: 0 auto;
    padding: 2px;
    font-family: 'Times New Roman', Times, serif;
    color: black;
    border: 2px solid blue;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.official-header {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 10px 0;
    /*margin-bottom: 15px;*/
}

.official-top-section {
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    margin-bottom: 15px;
    align-items: center;
}

.top-details {
    border: 1px solid black;
    padding: 10px 15px;
    flex: 1;
    margin-right: 20px;
}

.top-details table {
    border-collapse: collapse;
}

.top-details td {
    /*padding: 3px 0;*/
    font-size: 1.1rem;
    font-weight: bold;
}

.top-details td:first-child {
    width: 140px;
}

.top-qr {
    padding: 5px;
}

.official-middle-section {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    margin-bottom: 15px;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.details-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.details-box {
    border: 1px solid black;
    flex: 1;
}

.box-title-wrapper {
    font-style: italic;
    font-weight: bold;
    /*margin-bottom: 5px;*/
    padding-left: 5px;
    font-size: 1rem;
}

.details-box table {
    width: 100%;
    border-collapse: collapse;
}

.details-box td {
    padding: 3px 10px;
    font-size: 1rem;
}

.details-box td:first-child {
    width: 40%;
}

.official-note-section {
    padding: 0 15px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

.official-note-section p {
    margin-bottom: 5px;
}

.official-issued-by {
    text-align: right;
    padding: 20px 15px;
    font-weight: bold;
    font-size: 1rem;
}

.official-footer {
    padding: 10px 15px;
    font-style: italic;
    font-size: 0.9rem;
    font-weight: bold;
}

.watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
    z-index: 1;
    pointer-events: none;
    text-align: center;
}

.watermark img {
    width: 500px;
    max-width: 100%;
}

/* E-CHALLAN DASHBOARD (HOME PAGE) DESIGN SYSTEM */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.text-muted {
    color: var(--text-muted);
}

.btn-add-challan {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-weight: 600;
    border-radius: 0.75rem;
    text-decoration: none;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}

.btn-add-challan:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.4);
}

/* Stats Cards Grid */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.link-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-all {
    background: #eff6ff;
    color: #3b82f6;
}

.icon-valid {
    background: #ecfdf5;
    color: #10b981;
}

.icon-expired {
    background: #fef2f2;
    color: #ef4444;
}

.stat-details h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
}

.stat-details p {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Filter Bar styles */
.filter-bar {
    background-color: white;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-group.flex-grow {
    flex: 1;
    min-width: 250px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.filter-group input,
.filter-group select {
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    outline: none;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

.filter-actions button,
.filter-actions a {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    border-radius: 0.5rem;
}

/* Beautiful Table Designs */
.overflow-hidden {
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.table-wrapper {
    overflow-x: auto;
}

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

.dashboard-table th {
    background-color: #f8fafc;
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.dashboard-table td {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.925rem;
    color: #334155;
    vertical-align: middle;
}

.dashboard-table tr:last-child td {
    border-bottom: none;
}

.dashboard-table tr:hover td {
    background-color: #f8fafc;
}

.font-mono {
    font-family: monospace;
}

.font-bold {
    font-weight: 700;
}

.text-highlight {
    color: var(--primary-color);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.py-4 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.vehicle-pill {
    background-color: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-weight: 700;
    font-size: 0.825rem;
    border: 1px solid #e2e8f0;
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Action Buttons styling */
.actions-cell {
    white-space: nowrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    background-color: white;
    text-decoration: none;
    margin-left: 0.25rem;
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: scale(1.1);
}

.btn-action.view:hover {
    background-color: #eff6ff;
    color: #3b82f6;
    border-color: #bfdbfe;
}

.btn-action.print:hover {
    background-color: #ecfdf5;
    color: #10b981;
    border-color: #a7f3d0;
}

.btn-action.edit:hover {
    background-color: #fffbeb;
    color: #f59e0b;
    border-color: #fde68a;
}

.btn-action.delete:hover {
    background-color: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}

/* Pagination bar styles */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 0.25rem;
}

.pagination-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background-color: white;
    color: #475569;
    font-size: 0.875rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(.disabled) {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.pagination-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions {
        justify-content: flex-end;
    }

    .pagination-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}


/* Print Styles */
@media print {
    body {
        background-color: white;
        padding: 0;
        margin: 0;
    }

    .view-bg {
        background-color: white;
        padding: 0;
        align-items: flex-start;
        min-height: auto;
    }

    .no-print {
        display: none !important;
    }

    .official-doc {
        border: 2px solid blue !important;
        box-shadow: none;
        margin: 0;
        width: 100%;
        max-width: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        margin: 1cm;
    }
}

.public-verification-bg {
    background-image: url('bg_pattern.png');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 1.5rem;
    font-family: var(--font-family);
}

.public-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    width: 100%;
    max-width: 540px;
    overflow: hidden;
}

.public-card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-title {
    color: #17a2b8 !important;
    font-size: 1.25rem;
    font-weight: 700;
}

.public-card-body {
    padding-left: 0.5rem;
    padding-right: 2rem;
}

.status-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.status-expired {
    color: #dc2626;
}

.status-valid {
    color: #16a34a;
}

.verification-table {
    width: 100%;
    border-collapse: collapse;
}

.verification-table td {
    padding: 0.25rem 0;
    font-size: 0.95rem;
    vertical-align: top;
    line-height: 1.5;
}

.verification-table td:nth-child(1) {
    color: #1e293b;
    width: 30%;
    font-weight: 400;
}

.verification-table td:nth-child(2) {
    color: #475569;
    width: 4%;
    text-align: center;
}

.verification-table td:nth-child(3) {
    color: #16a34a;
    font-weight: 500;
    width: 48%;
}