/* Challan Book - Delivery Challan Generator
   Professional Corporate Theme
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --action: #2563EB;
    --action-hover: #1d4ed8;
    --action-secondary: #60a5fa;
    --action-light: #eff6ff;
    --secondary: #64748B;
    --bg: #f8fafc;
    --success: #10B981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --danger: #EF4444;
    --danger-light: #fef2f2;
    --white: #FFFFFF;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #475569;
    --light-text: #94A3B8;
    --muted: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

/* Dark theme variables */
body.dark {
    --bg: #0f172a;
    --white: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --border-light: #1e293b;
    --action-light: rgba(37, 99, 235, 0.15);
    --success-light: rgba(16, 185, 129, 0.15);
    --danger-light: rgba(239, 68, 68, 0.15);
}

/* Dark mode specific overrides */
body.dark .form-card,
body.dark .stat-card,
body.dark .modal-content,
body.dark .table-card,
body.dark .report-filters,
body.dark .stock-panel {
    background: #1e293b;
    border-color: #334155;
}

body.dark .data-table tbody tr:nth-child(even) {
    background: #182234;
}

body.dark .data-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.1);
}

body.dark input,
body.dark select,
body.dark textarea {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}

/* Dark mode search inputs */
body.dark .search-bar input,
body.dark .search-wrapper input,
body.dark .search-bar-compact input,
body.dark .table-search-wrapper input {
    background-color: #0f172a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
}

body.dark .search-bar input:focus,
body.dark .search-wrapper input:focus,
body.dark .search-bar-compact input:focus,
body.dark .table-search-wrapper input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2360A5FA' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15), 0 2px 12px rgba(96, 165, 250, 0.2);
}

body.dark .search-clear-btn {
    background: #334155;
    color: #94a3b8;
}
body.dark .search-clear-btn:hover {
    background: var(--danger);
    color: white;
}

body.dark .dropdown-list {
    background: #1e293b;
    border-color: #334155;
}

body.dark .dropdown-list .dropdown-item:hover {
    background: rgba(37, 99, 235, 0.15);
}

/* Theme toggle button */
.theme-toggle-btn {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    margin-bottom: 12px;
}
.theme-toggle-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    display: flex;
    min-height: 100vh;
}

/* ============================================ */
/* SIDEBAR                                      */
/* ============================================ */
.sidebar {
    width: 270px;
    background: linear-gradient(180deg, var(--primary) 0%, #0a0f1d 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.logo {
    padding: 28px 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    background: rgba(255,255,255,0.02);
}

.logo-img {
    width: 72px;
    height: auto;
    margin-bottom: 14px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.1);
}

.logo-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    opacity: 0.95;
}

.nav-menu {
    list-style: none;
    padding: 16px 14px;
    flex: 1;
}

.nav-menu li {
    margin-bottom: 4px;
}

.nav-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    text-align: left;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.nav-btn .nav-icon {
    font-size: 20px;
    margin-right: 12px;
    opacity: 0.8;
    width: 24px;
    text-align: center;
    transition: all 0.25s;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
    transform: translateX(2px);
}

.nav-btn:hover .nav-icon {
    opacity: 1;
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(37,99,235,0.2) 0%, rgba(37,99,235,0.08) 100%);
    color: var(--white);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--action);
}

.nav-btn.active .nav-icon {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(37,99,235,0.5));
}

/* ============================================ */
/* MAIN CONTENT                                 */
/* ============================================ */
.main-content {
    margin-left: 270px;
    flex: 1;
    padding: 32px 36px;
    max-width: calc(100% - 270px);
    min-height: 100vh;
}

/* ============================================ */
/* MOBILE HAMBURGER & SIDEBAR OVERLAY           */
/* ============================================ */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 90;
    width: 44px;
    height: 44px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
}

.hamburger-btn:hover {
    background: var(--bg);
    border-color: var(--secondary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================ */
/* TABLE SCROLL WRAPPER                         */
/* ============================================ */
.table-scroll-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    background: var(--white);
    border: 1px solid var(--border-light);
}

.table-scroll-wrapper .data-table {
    min-width: 600px;
    margin: 0;
    border: none;
    box-shadow: none;
}

.section {
    display: none;
    animation: fadeIn 0.35s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--text);
    letter-spacing: -0.3px;
    position: relative;
    padding-bottom: 12px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--action), var(--action-secondary));
    border-radius: 2px;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

/* ============================================ */
/* STATS GRID                                   */
/* ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--action), var(--action-secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.stat-icon {
    font-size: 28px;
    margin-bottom: 12px;
    display: block;
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================ */
/* QUICK ACTIONS                                */
/* ============================================ */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

/* ============================================ */
/* BUTTONS                                      */
/* ============================================ */
.btn-primary {
    padding: 11px 22px;
    background: linear-gradient(135deg, var(--action) 0%, #3b82f6 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.15) 100%);
    opacity: 0;
    transition: opacity 0.25s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 11px 22px;
    background: var(--white);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: var(--secondary);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-small {
    padding: 7px 16px;
    background: linear-gradient(135deg, var(--action) 0%, #3b82f6 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(37,99,235,0.2);
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(37,99,235,0.3);
}

.btn-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--action) 0%, #3b82f6 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(37,99,235,0.25);
    flex-shrink: 0;
}

.btn-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

.btn-danger {
    padding: 7px 14px;
    background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(239,68,68,0.2);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(239,68,68,0.3);
}

/* ============================================ */
/* FORMS                                        */
/* ============================================ */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--light-text);
    font-weight: 400;
}

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

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: #cbd5e1;
}

.field-error,
.field-error:focus,
input.field-error,
input.field-error:focus,
select.field-error,
select.field-error:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.field-hint {
    display: block;
    font-size: 11.5px;
    color: var(--action);
    margin-top: 5px;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ============================================ */
/* SECTION HEADER                               */
/* ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 32px 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--action), var(--action-secondary));
    border-radius: 1px;
}

.section-header h3 {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================ */
/* PARTY SECTION                                */
/* ============================================ */
.party-section {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.party-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}

.party-input-group input {
    flex: 1;
}

.dropdown-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    animation: dropdownIn 0.2s ease;
    min-width: 100%;
    width: max-content;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    padding: 11px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    transition: all 0.15s;
}

.dropdown-item:hover,
.dropdown-item.dropdown-active {
    background: var(--action-light);
    color: var(--action);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.item-specs {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.item-code-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--action), #3b82f6);
    color: #fff;
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.selected-item-specs {
    color: var(--secondary);
    font-size: 12px;
    margin-top: 6px;
    padding: 6px 12px;
    background: var(--action-light);
    border-radius: var(--radius-sm);
    display: inline-block;
    border: 1px solid rgba(37,99,235,0.1);
    font-weight: 500;
}

.party-details {
    margin-top: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--bg) 0%, var(--border-light) 100%);
    border-radius: var(--radius);
    font-size: 13.5px;
    line-height: 1.7;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.party-details strong {
    color: var(--text);
}

.party-details.hidden {
    display: none;
}

/* ============================================ */
/* PO LIST                                      */
/* ============================================ */
.po-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.po-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 18px 20px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.po-row:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow);
}

/* ============================================ */
/* ITEMS LIST                                   */
/* ============================================ */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.item-row {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    position: relative;
}

.item-row:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow);
}

.item-row-header {
    display: grid;
    grid-template-columns: 1fr 110px 110px 110px 42px;
    gap: 12px;
    align-items: end;
}

.item-row-header .form-group {
    margin-bottom: 0;
}

.item-row-header input[readonly] {
    background: var(--bg);
    color: var(--secondary);
    font-weight: 600;
}

.item-plate-option {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1.5px dashed var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.item-plate-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--action);
    cursor: pointer;
}

.plate-row {
    margin-top: 14px;
    padding: 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
}

.plate-row .form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.plate-row .form-group {
    margin-bottom: 0;
}

.plate-row input[readonly] {
    background: var(--bg);
    color: var(--secondary);
    font-weight: 600;
}

/* ============================================ */
/* DATA TABLES                                  */
/* ============================================ */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th,
.data-table td {
    padding: 14px 18px;
    text-align: left;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    color: var(--white);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.data-table th:first-child {
    border-radius: var(--radius-lg) 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 var(--radius-lg) 0 0;
}

.data-table tbody tr {
    transition: all 0.15s;
}

.data-table tbody tr:hover {
    background: var(--action-light);
}

.data-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.data-table tbody tr:nth-child(even):hover {
    background: var(--action-light);
}

.data-table td:last-child {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

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

/* Empty state */
.data-table td.text-center {
    justify-content: center;
    color: var(--light-text);
    padding: 40px;
    font-style: italic;
}

/* ============================================ */
/* SEARCH BAR - Modern Design 2025              */
/* ============================================ */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

/* Search input with icon - modern pill/rounded style */
.search-bar input,
.search-wrapper input {
    flex: 1;
    padding: 11px 16px 11px 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 18px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    min-height: 44px;
}

.search-bar input::placeholder,
.search-wrapper input::placeholder {
    color: var(--light-text);
    font-style: italic;
    opacity: 0.8;
}

.search-bar input:hover,
.search-wrapper input:hover {
    border-color: var(--action);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.search-bar input:focus,
.search-wrapper input:focus {
    outline: none;
    border-color: var(--action);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 2px 12px rgba(37, 99, 235, 0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
}

/* Search wrapper with clear button */
.search-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-wrapper input {
    width: 100%;
    padding-right: 40px;
}

.search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: var(--border-light);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s;
    padding: 0;
}

.search-clear-btn:hover {
    background: var(--danger);
    color: white;
}

.search-clear-btn.visible {
    display: flex;
}

/* Compact search bar (for smaller spaces) */
.search-bar-compact {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

.search-bar-compact input {
    flex: 1;
    padding: 9px 14px 9px 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 16px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    min-height: 38px;
}

.search-bar-compact input:focus {
    outline: none;
    border-color: var(--action);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
}

/* ============================================ */
/* FORM CARD                                    */
/* ============================================ */
.form-card {
    background: var(--white);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: 24px;
    max-width: 680px;
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--action), var(--action-secondary));
}

.form-card h3 {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

/* ============================================ */
/* FORM ACTIONS                                 */
/* ============================================ */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--border-light);
    flex-wrap: wrap;
}

/* ============================================ */
/* MODAL                                        */
/* ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalBackdropIn 0.2s ease;
}

@keyframes modalBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal.active {
    display: flex;
}

.modal.closing {
    animation: modalBackdropOut 0.3s ease forwards;
}

.modal.closing .modal-content {
    animation: modalContentOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes modalBackdropOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes modalContentOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to   { opacity: 0; transform: scale(0.96) translateY(10px); }
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalContentIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalContentIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.close {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 26px;
    cursor: pointer;
    color: var(--light-text);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1.5px solid var(--border-light);
    justify-content: flex-end;
}

/* ============================================ */
/* PRINT CHALLAN STYLES - Screen Preview        */
/* ============================================ */
.print-challan {
    max-width: 210mm;
    margin: 0 auto;
    background: var(--white);
    position: relative;
    font-family: 'Times New Roman', Times, serif;
}

.print-page {
    position: relative;
    padding: 15mm;
    box-sizing: border-box;
    min-height: 277mm;
    page-break-after: always;
    break-after: page;
}

.print-header {
    text-align: center;
    margin-bottom: 16px;
    border-bottom: 2px solid #000;
    padding-bottom: 12px;
}

.print-header h2 {
    font-size: 22pt;
    font-weight: bold;
    margin-bottom: 4px;
    color: #000;
}

.print-header .company-info {
    font-size: 10pt;
    color: #333;
    line-height: 1.5;
}

.print-header h3 {
    font-size: 14pt;
    font-weight: bold;
    margin-top: 8px;
    color: #000;
}

.print-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 10pt;
}

.print-party {
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 11pt;
}

.print-party h4 {
    font-size: 11pt;
    color: #333;
    margin-bottom: 6px;
    text-transform: uppercase;
    font-weight: bold;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 11pt;
}

.print-table th,
.print-table td {
    border: 1px solid #000;
    padding: 8px 10px;
    font-size: 11pt;
    vertical-align: middle;
}

.print-table th {
    background: #e0e0e0;
    font-weight: bold;
    text-align: center;
}

.print-table td {
    text-align: left;
}

.print-table td:nth-child(1),
.print-table td:nth-child(3),
.print-table td:nth-child(4),
.print-table td:nth-child(5) {
    text-align: center;
}

.print-footer {
    margin-top: auto;
    padding-top: 20px;
}

.vehicle-info {
    font-size: 11pt;
    margin-bottom: 12px;
    font-weight: bold;
}

.terms {
    font-size: 9pt;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.6;
    border: 1px solid #ccc;
    padding: 10px;
    background: #fafafa;
}

.signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 40px;
}

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

.signature-line {
    border-top: 1px solid #000;
    padding-top: 8px;
    font-size: 11pt;
    font-weight: bold;
    margin-top: 50px;
}

/* ============================================ */
/* UNIVERSAL PRINT STYLES - Fallback            */
/* ============================================ */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    * {
        animation: none !important;
        transition: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color: #000 !important;
    }

    body > *:not(.modal) {
        display: none !important;
    }

    .modal {
        display: block !important;
        position: static !important;
        background: white !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .modal.active {
        display: block !important;
    }

    .modal-content {
        position: static !important;
        width: 210mm !important;
        max-width: 210mm !important;
        min-height: 297mm !important;
        max-height: none !important;
        margin: 0 auto !important;
        padding: 10mm !important;
        background: white !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .close,
    .modal-actions,
    .no-print {
        display: none !important;
    }

    .print-challan {
        max-width: 100% !important;
        width: 100% !important;
    }

    .print-page {
        width: 190mm !important;
        min-height: 277mm !important;
        padding: 0 !important;
        page-break-after: always !important;
        break-after: page !important;
        position: relative !important;
    }

    .print-page:last-child {
        page-break-after: auto !important;
        break-after: auto !important;
    }

    .print-table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto !important;
    }

    .print-table thead {
        display: table-header-group !important;
    }

    .print-table tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .print-table th,
    .print-table td {
        border: 1px solid #000 !important;
        padding: 6px 8px !important;
        font-size: 10pt !important;
    }

    .print-footer {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .terms {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .signatures {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    body {
        font-family: 'Times New Roman', Times, serif !important;
        font-size: 11pt !important;
        line-height: 1.4 !important;
        background: white !important;
    }

    .page-break-after {
        page-break-after: always !important;
        break-after: page !important;
    }
}

.page-break-after {
    page-break-after: always;
    break-after: page;
}

/* ============================================ */
/* FORM VALIDATION                              */
/* ============================================ */

/* Form validation states */
.form-input.error,
.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}
.form-input.success,
.form-group input.success,
.form-group textarea.success,
.form-group select.success {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1) !important;
}
.form-error-message {
    color: var(--danger);
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: fadeIn 0.2s ease;
}
.form-error-message::before {
    content: '⚠';
    font-size: 14px;
}

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.shake {
    animation: shake 0.4s ease-in-out;
}

/* Form group with validation */
.form-group.has-error .form-label,
.form-group.has-error label {
    color: var(--danger);
}

/* Utility */
.mt-4 {
    margin-top: 24px;
}

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

.hidden {
    display: none !important;
}

/* ============================================ */
/* LOGIN SCREEN                                 */
/* ============================================ */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, #1e3a5f 50%, var(--primary-light) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(37,99,235,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(16,185,129,0.05) 0%, transparent 50%);
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    padding: 44px 40px;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
    position: relative;
    z-index: 1;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo .logo-img {
    width: 80px;
    height: auto;
    border-radius: var(--radius);
    margin-bottom: 18px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border: 3px solid var(--white);
}

.login-logo h2 {
    font-size: 24px;
    color: var(--text);
    margin-bottom: 4px;
    font-weight: 700;
}

.login-logo p {
    color: var(--secondary);
    font-size: 14px;
    font-weight: 500;
}

.login-btn {
    width: 100%;
    margin-top: 10px;
    padding: 13px;
    font-size: 15px;
}

.login-links {
    text-align: center;
    margin-top: 20px;
}

.login-links a {
    color: var(--action);
    font-size: 13.5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.demo-hint {
    margin-top: 16px;
    padding: 12px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 13px;
    color: #0369a1;
    text-align: center;
    line-height: 1.5;
}

.demo-hint p {
    margin: 0;
}

.demo-hint code {
    background: #e0f2fe;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 600;
    color: #075985;
    font-size: 12.5px;
}

.login-links a:hover {
    text-decoration: underline;
    color: var(--action-hover);
}

.form-hint {
    font-size: 13.5px;
    color: var(--secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}

.token-box {
    background: linear-gradient(135deg, var(--action-light) 0%, var(--bg) 100%);
    border: 1.5px solid rgba(37,99,235,0.15);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin-bottom: 24px;
}

.token-box code {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--action);
    background: var(--white);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    margin: 10px 0;
    word-break: break-all;
    border: 1.5px dashed var(--border);
    font-family: 'SF Mono', Monaco, monospace;
    letter-spacing: 1px;
}

/* ============================================ */
/* SIDEBAR FOOTER / USER INFO                   */
/* ============================================ */
.sidebar-footer {
    margin-top: auto;
    padding: 18px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}

.user-info {
    margin-bottom: 14px;
    padding: 0 4px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
}

.user-role {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
    font-weight: 500;
}

.logout-btn {
    width: 100%;
    padding: 9px 12px;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.logout-btn:hover {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.4);
    color: #fecaca;
}

/* ============================================ */
/* PROFILE DROPDOWN                             */
/* ============================================ */
.profile-dropdown {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.profile-trigger:hover {
    background: rgba(255,255,255,0.08);
}

.profile-chevron {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    transition: transform 0.2s;
    margin-left: 8px;
}

.profile-dropdown.active .profile-chevron {
    transform: rotate(90deg);
}

.profile-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--primary-light);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all 0.2s ease;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    z-index: 200;
}

.profile-dropdown.active .profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu-item {
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    text-align: left;
    font-size: 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.profile-menu-item:hover {
    background: rgba(255,255,255,0.08);
    color: var(--white);
}

.profile-menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 6px 0;
}

.profile-menu-danger {
    color: #fca5a5;
}

.profile-menu-danger:hover {
    background: rgba(239,68,68,0.2);
    color: #fecaca;
}

/* ============================================ */
/* ROLE BADGES                                  */
/* ============================================ */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 4px;
}

.role-badge.admin {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid rgba(30,64,175,0.15);
}

.role-badge.operator {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid rgba(6,95,70,0.15);
}

.role-badge.helper {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid rgba(146,64,14,0.15);
}

.light-text {
    color: var(--light-text);
    font-size: 13px;
}

/* ============================================ */
/* TAB BAR                                      */
/* ============================================ */
.tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--white);
    padding: 6px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    width: fit-content;
}

.tab-btn {
    padding: 10px 24px;
    background: transparent;
    border: none;
    color: var(--secondary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    border-radius: var(--radius-sm);
    position: relative;
}

.tab-btn:hover {
    color: var(--text);
    background: var(--bg);
}

.tab-btn.active {
    color: var(--white);
    background: linear-gradient(135deg, var(--action) 0%, #3b82f6 100%);
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
    font-weight: 600;
}

/* ============================================ */
/* SKELETON LOADING                             */
/* ============================================ */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}
@keyframes skeletonPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-title { height: 20px; width: 40%; margin-bottom: 16px; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-row { height: 48px; margin-bottom: 4px; }

/* ============================================ */
/* TOAST / ALERT - STACKING SYSTEM              */
/* ============================================ */
#toastContainer {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

#toastContainer .toast {
    pointer-events: auto;
}

.toast {
    min-width: 320px;
    max-width: 420px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast.error {
    background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
}

.toast.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #fbbf24 100%);
    color: var(--text);
}

.toast.info {
    background: linear-gradient(135deg, var(--action) 0%, var(--action-secondary) 100%);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(0,0,0,0.1);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255,255,255,0.5);
    border-radius: 0 0 0 var(--radius);
    animation: toastProgress linear forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ============================================ */
/* DATE WARNING MODAL                           */
/* ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    padding: 28px;
    box-shadow: var(--shadow-xl);
    animation: modalDialogIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

.modal-dialog.warning-dialog {
    border-top: 4px solid var(--warning);
}

@keyframes modalDialogIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    margin-bottom: 16px;
}

.modal-header .modal-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-body p {
    font-size: 15px;
    color: var(--light-text);
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    display: flex;
    justify-content: center;
}

.modal-footer .btn-primary {
    min-width: 100px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        position: fixed;
        height: 100vh;
        left: -260px;
        top: 0;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 72px 20px 20px;
    }

    #app {
        flex-direction: column;
    }

    .hamburger-btn {
        display: flex;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .item-row-header {
        grid-template-columns: 1fr;
    }

    .print-meta {
        grid-template-columns: 1fr;
    }

    .signatures {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tab-bar {
        width: 100%;
    }

    .tab-btn {
        flex: 1;
        text-align: center;
        padding: 10px 12px;
    }

    .table-scroll-wrapper {
        border-radius: var(--radius);
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--light-text);
}


/* ============================================ */
/* DASHBOARD ENHANCEMENTS                       */
/* ============================================ */

.stat-card.highlight {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.stat-card.highlight .stat-label {
    color: rgba(255,255,255,0.85);
}

.stat-card.highlight .stat-number {
    color: white;
}

.stat-change {
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 28px;
}

.dashboard-charts .chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.chart-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.chart-card canvas {
    max-height: 280px;
}

/* ============================================ */
/* REPORTS SECTION                              */
/* ============================================ */

.report-filters {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.report-filters .form-row {
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.report-filters .form-group {
    min-width: 140px;
    flex: 0 0 auto;
}

.report-filters .form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.report-filters select,
.report-filters input[type="date"],
.report-filters input[type="number"] {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
    color: var(--text);
    width: 100%;
    transition: all 0.2s;
}

.report-filters select:focus,
.report-filters input:focus {
    outline: none;
    border-color: var(--action);
    box-shadow: 0 0 0 3px var(--action-light);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
}

.report-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.report-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 24px 0;
}

.report-charts .chart-card canvas {
    max-height: 320px;
}

.report-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.table-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.table-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.table-card .data-table {
    margin: 0;
}

.table-card .data-table th {
    background: var(--primary-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 10px 8px;
}

.table-card .data-table td {
    padding: 10px 8px;
    font-size: 13px;
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */

@media (max-width: 1200px) {
    .dashboard-charts,
    .report-charts,
    .report-tables {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .report-filters .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .report-filters .form-group {
        min-width: 100%;
    }
    
    .report-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}


/* ============================================ */
/* POD SECTION                                  */
/* ============================================ */

.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.stat-card.warning .stat-label {
    color: rgba(255,255,255,0.85);
}

.stat-card.warning .stat-number {
    color: white;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
    margin: 20px 0;
}

.upload-zone:hover {
    border-color: var(--action);
    background: var(--action-light);
}

.upload-zone.dragover {
    border-color: var(--action);
    background: var(--action-light);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
}

/* File preview */
.file-preview-info {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 13px;
}

.file-preview-thumb {
    max-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.file-preview-thumb img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.file-icon {
    font-size: 48px;
    padding: 40px;
}

/* ============================================ */
/* ACCESSIBILITY                                */
/* ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* POD info in modal */
.pod-info {
    background: var(--bg);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.pod-info p {
    margin: 6px 0;
    font-size: 14px;
}

.pod-info code {
    background: var(--white);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--action);
}

/* POD view modal */
.pod-view-info {
    background: var(--bg);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.pod-view-info p {
    margin: 4px 0;
    font-size: 13px;
}

.pod-view-container {
    min-height: 300px;
    background: var(--bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pod-pdf-viewer {
    width: 100%;
    height: 500px;
    border: none;
    background: var(--white);
}

.pod-image-viewer {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

/* Modal large */
.modal-content.modal-large {
    max-width: 800px;
    width: 90%;
}

/* Tab bar for POD */
#podTabs {
    margin-bottom: 20px;
}

/* ============================================ */
/* STOCK MANAGEMENT                             */
/* ============================================ */

.stock-panel {
    animation: fadeIn 0.2s ease;
}

#stockSummary {
    margin-bottom: 24px;
}

#stockSummary .stat-card.warning .stat-number {
    color: var(--warning);
}

/* Stock table status badges */
.badge-success {
    background: var(--success-light);
    color: var(--success);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-warning {
    background: #fffbeb;
    color: var(--warning);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-info {
    background: #eff6ff;
    color: var(--action);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* Stock In / Return form cards */
#stockInPanel .form-card,
#stockReturnPanel .form-card {
    max-width: 700px;
}

#stockInPanel .form-card input[readonly],
#stockReturnPanel .form-card input[readonly] {
    background: var(--border-light);
    color: var(--text-secondary);
}

/* Ledger table */
#stockLedgerTableContainer .data-table td {
    font-size: 13px;
    padding: 10px 12px;
}

/* Tab bar for Stock */
#stockTabs {
    margin-bottom: 20px;
}

/* Stock adjustment modal */
#stockAdjustModal .modal-content {
    max-width: 500px;
}

#stockAdjustModal .form-hint {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
    padding: 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

/* ============================================
   BOX TEST REPORT
   ============================================ */

/* Fix dropdown cutoff - allow overflow for dropdowns inside form cards */
#boxTestReport .form-card {
    overflow: visible;
}

#boxTestReport .items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

#boxTestReport .item-row {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

#boxTestReport .item-row .form-row {
    gap: 12px;
    align-items: flex-end;
}

#boxTestReport .item-row .btn-danger {
    padding: 8px 14px;
    font-size: 16px;
    line-height: 1;
    min-width: 36px;
}

#boxTestReport select.test-report-item-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
}

#boxTestReport select.test-report-item-select:focus {
    outline: none;
    border-color: var(--action);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#boxTestReport input.test-report-item-code,
#boxTestReport input.test-report-bs {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
}

#boxTestReport input.test-report-item-code {
    background: var(--border-light);
    cursor: not-allowed;
}

#boxTestReport input.test-report-bs:focus {
    outline: none;
    border-color: var(--action);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Mode Toggle Bar */
.mode-toggle-bar {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    width: fit-content;
}

.mode-btn {
    padding: 10px 24px;
    border: none;
    background: var(--white);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: var(--border-light);
}

.mode-btn.active {
    background: var(--action);
    color: var(--white);
}

.mode-btn:first-child {
    border-right: 1px solid var(--border);
}

/* Auto mode items table */
#testReportAutoItemsList .data-table {
    margin-top: 0;
}

#testReportAutoItemsList .data-table tbody tr {
    cursor: default;
}

/* Saved Reports badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* Saved reports search bar */
#testReportSavedPanel .search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#testReportSavedPanel .search-bar input[type="text"] {
    flex: 2;
    min-width: 200px;
}

#testReportSavedPanel .search-bar input[type="date"] {
    flex: 1;
    min-width: 140px;
}

/* Sidebar divider */
.nav-divider {
    padding: 12px 16px 4px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 4px;
}

.nav-divider:first-child {
    border-top: none;
    margin-top: 0;
}

.nav-divider span {
    opacity: 0.7;
}

/* ============================================
   PROCESSING OVERLAY
   ============================================ */
#processingOverlay {
    z-index: 9999;
}

#processingOverlay .modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px 56px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    max-width: 400px;
    width: 90%;
}

#processingOverlay .modal-content h3 {
    margin: 20px 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

#processingOverlay .modal-content p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.processing-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-light);
    border-top-color: var(--action);
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   SETTINGS PAGE STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

#settings .card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

#settings .card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

#settings .hint-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Permissions Table */
.permissions-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.permissions-table {
    min-width: 900px;
    margin: 0;
    border: none;
}

.permissions-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 10px 6px;
    background: var(--primary);
    color: var(--white);
    text-align: center;
    white-space: nowrap;
}

.permissions-table th:first-child {
    text-align: left;
    padding-left: 16px;
}

.permissions-table td {
    padding: 10px 6px;
    font-size: 13px;
    text-align: center;
    vertical-align: middle;
}

.permissions-table td:first-child {
    text-align: left;
    padding-left: 16px;
    font-weight: 500;
}

.permissions-table td:nth-child(2) {
    font-size: 11px;
}

.permissions-table .role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.permissions-table .role-badge.admin {
    background: var(--action-light);
    color: var(--action);
}

.permissions-table .role-badge.operator {
    background: var(--success-light);
    color: var(--success);
}

.permissions-table .role-badge.helper {
    background: #fef3c7;
    color: #92400e;
}

.permissions-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--action);
}

.permissions-table tbody tr:hover {
    background: var(--bg);
}

/* Save permissions button row */
.permissions-save-row {
    padding: 16px;
    text-align: right;
    background: var(--white);
    border-top: 1px solid var(--border);
}


/* ═══════════════════════════════════════════════════════════════════════════════
   TOGGLE SWITCH STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

.toggle-row {
    gap: 20px;
}

.toggle-group {
    margin-bottom: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--border);
    border-radius: 26px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-slider {
    background: var(--success);
}

.toggle-input:checked + .toggle-slider::after {
    transform: translateX(22px);
}

.toggle-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    user-select: none;
}


/* Role select dropdown in permissions table */
.role-select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: var(--white);
    color: var(--text);
}

.role-select:focus {
    outline: none;
    border-color: var(--action);
}

.role-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================ */
/* TOOLTIPS                                     */
/* ============================================ */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}
[data-tooltip]:hover::after {
    opacity: 1;
}

/* ============================================ */
/* EMPTY STATES                                 */
/* ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}
.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}
.empty-state-desc {
    font-size: 14px;
}

/* ============================================ */
/* KEYBOARD HELP MODAL                          */
/* ============================================ */
.keyboard-help-content {
    padding: 8px 0;
}
.shortcut-group {
    margin-bottom: 20px;
}
.shortcut-group h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}
.shortcut-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
    font-size: 14px;
}
.shortcut-row kbd {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-family: monospace;
    font-size: 13px;
    min-width: 32px;
    text-align: center;
    box-shadow: 0 2px 0 var(--border);
}
.shortcut-row span {
    color: var(--text-secondary);
}

/* ============================================ */
/* TABLE ENHANCEMENTS: SEARCH, SORT, PAGINATION */
/* ============================================ */

/* Table search - Modern 2025 Design */
.table-search-wrapper {
    margin-bottom: 16px;
    position: relative;
    max-width: 400px;
}
.table-search-wrapper input {
    width: 100%;
    padding: 11px 40px 11px 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 18px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    min-height: 44px;
}
.table-search-wrapper input::placeholder {
    color: var(--light-text);
    font-style: italic;
    opacity: 0.8;
}
.table-search-wrapper input:hover {
    border-color: var(--action);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}
.table-search-wrapper input:focus {
    outline: none;
    border-color: var(--action);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 2px 12px rgba(37, 99, 235, 0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
}

/* Sortable headers */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px;
}
.data-table th.sortable:hover {
    background: rgba(255,255,255,0.1);
}
.data-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    opacity: 0.4;
    font-size: 12px;
}
.data-table th.sortable.asc::after {
    content: '↑';
    opacity: 1;
}
.data-table th.sortable.desc::after {
    content: '↓';
    opacity: 1;
}

/* Pagination */
.table-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px;
    flex-wrap: wrap;
}
.table-pagination button {
    padding: 6px 12px;
    border: 1.5px solid var(--border);
    background: var(--white);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.table-pagination button:hover:not(:disabled) {
    border-color: var(--action);
    color: var(--action);
}
.table-pagination button.active {
    background: var(--action);
    color: white;
    border-color: var(--action);
}
.table-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.table-pagination .page-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 12px;
}

/* Financial Year Badge */
.fy-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--action));
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.fy-badge.prev {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.fy-badge.sidebar-fy {
    display: block;
    margin: 6px auto 0;
    font-size: 0.7rem;
    padding: 2px 8px;
    width: fit-content;
}

/* Checkbox label for admin options */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--action);
    cursor: pointer;
}
