
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f4f6;
}

.header {
    padding: 10px;
    background: linear-gradient(#2F3C52, #9CB8E4);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}


.title {
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.icon {
    font-size: 28px;
}

    .icon.green {
        color: #5CFFA9;
        text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    }

    .icon.red {
        color: #B32828;
        text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    }

.tabs {
    display: flex;
    gap: 8px;
    padding: 10px;
}

.tabbtn {
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    background: #e5e7eb;
}

    .tabbtn.active {
        background: #1E3A8A;
        color: white;
    }

.tabpanel {
    display: none;
    padding: 10px;
}

    .tabpanel.active {
        display: block;
    }

.controls {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.box {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px;
}

.box-title {
    font-weight: bold;
    color: #1E3A8A;
    margin-bottom: 6px;
}

.box.wide {
    min-width: 300px;
}

.row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gap {
    width: 12px;
    display: inline-block;
}

select, input {
    height: 34px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0 10px;
}

.btn {
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: bold;
    color: white;
    cursor: pointer;
}

    .btn.green {
        background: #4CAF50;
    }

    .btn.purple {
        background: #9C27B0;
    }

    .btn.orange {
        background: #FF5722;
    }

.report-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
}

.report-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.logo {
    width: 140px;
    height: 70px;
    object-fit: cover;
    border: 2px solid #90CAF9;
    border-radius: 8px;
    background: #E3F2FD;
}

.report-title {
    font-size: 26px;
    font-weight: bold;
    color: #1E3A8A;
    margin-bottom: 12px;
}

.mini-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mini {
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid;
    min-width: 120px;
    text-align: center;
}

.mini-label {
    font-size: 12px;
    opacity: .9;
}

.mini-value {
    font-size: 16px;
    font-weight: bold;
}

.mini.green {
    background: #E8F5E8;
    border-color: #A5D6A7;
    color: #1B5E20;
}

.mini.red {
    background: #FFEBEE;
    border-color: #EF9A9A;
    color: #B71C1C;
}

.mini.orange {
    background: #FFF3E0;
    border-color: #FFCC80;
    color: #E65100;
}

.table-head {
    margin-top: 15px;
    background: #1E3A8A;
    color: white;
    padding: 12px 14px;
    border-radius: 10px 10px 0 0;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    font-weight: bold;
}

#shiftBody {
    border: 1px solid #e0e0e0;
    border-top: none;
    padding: 0;
    max-height: 520px;
    overflow: auto;
}

.row4 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    padding: 10px 14px;
    border-bottom: 1px solid #e0e0e0;
}

.center {
    text-align: center;
}

.right {
    text-align: right;
    padding-right: 10px;
}

.blue {
    color: #2196F3;
    font-weight: 600;
}

.green {
    color: #4CAF50;
    font-weight: 600;
}

.orange {
    color: #FF9800;
    font-weight: 600;
}

.gate-header {
    background: #f5f5f5;
    padding: 10px 14px;
    font-weight: bold;
    color: #1E3A8A;
    border-bottom: 1px solid #e0e0e0;
}

.gate-total {
    background: #E3F2FD;
    padding: 10px 14px;
    font-weight: bold;
    color: #1976D2;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    border-bottom: 2px solid #e0e0e0;
}

.grand {
    margin-top: 10px;
    background: #1E3A8A;
    color: white;
    border-radius: 0 0 10px 10px;
    padding: 14px;
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    font-size: 18px;
    font-weight: bold;
}

    .grand .left {
        padding-left: 10px;
    }

.simple-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
}

    .simple-card.purple-border {
        border-top: 6px solid #8E24AA;
    }

.simple-title {
    font-size: 26px;
    font-weight: bold;
    color: #1E3A8A;
    margin-bottom: 10px;
}

.simple-big {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.big {
    font-size: 36px;
    font-weight: bold;
}

.small-row {
    margin-top: 10px;
    color: #666;
}

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.company-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid #e0e0e0;
}

    .company-card .label {
        font-weight: bold;
        margin-bottom: 8px;
    }

    .company-card .value {
        font-size: 28px;
        font-weight: bold;
    }

    .company-card .value2 {
        font-size: 20px;
        font-weight: bold;
        opacity: .9;
    }

    .company-card.blue {
        background: #E3F2FD;
        color: #1976D2;
    }

    .company-card.purple {
        background: #F3E5F5;
        color: #7B1FA2;
    }

    .company-card.green {
        background: #E8F5E9;
        color: #2E7D32;
    }

    .company-card.brown {
        background: #FFF3E0;
        color: #795548;
    }

    .company-card.orange2 {
        background: #FFCCBC;
        color: #D84315;
    }

.status {
    padding: 10px;
    color: #444;
    font-style: italic;
}

/* Login */
.login-bg {
    background: linear-gradient(#2F3C52, #9CB8E4);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 340px;
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
}

.login-title {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 14px;
    color: #1E3A8A;
}

.login-card label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    color: #333;
}

.login-card input {
    width: 100%;
    margin-top: 6px;
}

.login-card button {
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: #1E3A8A;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.login-error {
    margin-top: 10px;
    color: #b91c1c;
    font-weight: bold;
}

/* Search tab table (8 columns) */
.table-head.search-head {
    grid-template-columns: 2fr 1.4fr 1.4fr 1.2fr 1fr 1fr 1fr 0.8fr;
}

.search-body {
    border: 1px solid #e0e0e0;
    border-top: none;
    padding: 0;
    max-height: 520px;
    overflow: auto;
}

.row8 {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 1fr 1fr 1fr 1fr 1fr; /* ✅ match header */
    padding: 10px 14px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

    .row8:nth-child(even) {
        background: #f9fafb;
    }

    /* Fix LTR display for car number + price */
    .row8 > div:nth-child(5),
    .row8 > div:nth-child(6) {
        direction: ltr;
        unicode-bidi: plaintext;
    }

    .row8:nth-child(even) {
        background: #f9fafb;
    }

.rowline {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 1fr 1fr 1fr 1fr 1fr;
    padding: 10px 14px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

    .rowline:nth-child(even) {
        background: #f9fafb;
    }


    /* Fix LTR display for car number and price inside RTL page */
    .rowline > div:nth-child(5), /* Car Number column */
    .rowline > div:nth-child(6) /* Price column */ {
        direction: ltr;
        unicode-bidi: plaintext;
    }

.search-label {
    font-weight: bold;
    margin-bottom: 6px;
}



/* Remove double border look */
.search-body {
    border: none;
    border-top: none;
    max-height: 520px;
    overflow-y: auto;
}

/* Mobile fix: allow 8-column table to scroll horizontally */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
}

/* Force a minimum width so columns don't collapse */
.table-head.search-head,
.search-body,
.row8 {
    min-width: 900px; /* you can increase to 1000 if needed */
}

/* Desktop labels on by default */
.h-mobile {
    display: none;
}

.h-desktop {
    display: inline;
}

/* Make search table scroll container nicer */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ✅ Mobile layout for Search table */
@media (max-width: 768px) {

    /* Show Kurdish labels on mobile */
    .h-desktop {
        display: none;
    }

    .h-mobile {
        display: inline;
        font-weight: 700;
    }

    /* Make header + rows use grid areas to reorder */
    .table-head.search-head,
    .row8 {
        grid-template-columns: 1.6fr 1.2fr 1.6fr 1.2fr 1.4fr 1fr; /* item car date price company gate */
        grid-template-areas: "item car date price company gate";
        font-size: 13px;
    }

        /* Hide Driver (4) and Shift (8) on mobile */
        .table-head.search-head > div:nth-child(4),
        .table-head.search-head > div:nth-child(8),
        .row8 > div:nth-child(4),
        .row8 > div:nth-child(8) {
            display: none;
        }

        /* Assign areas (based on your current order in JS) */
        .table-head.search-head > div:nth-child(1),
        .row8 > div:nth-child(1) {
            grid-area: item;
        }

        .table-head.search-head > div:nth-child(5),
        .row8 > div:nth-child(5) {
            grid-area: car;
        }

        .table-head.search-head > div:nth-child(2),
        .row8 > div:nth-child(2) {
            grid-area: date;
        }

        .table-head.search-head > div:nth-child(6),
        .row8 > div:nth-child(6) {
            grid-area: price;
        }

        .table-head.search-head > div:nth-child(3),
        .row8 > div:nth-child(3) {
            grid-area: company;
        }

        .table-head.search-head > div:nth-child(7),
        .row8 > div:nth-child(7) {
            grid-area: gate;
        }

        /* Keep car number + price LTR */
        .row8 > div:nth-child(5),
        .row8 > div:nth-child(6) {
            direction: ltr;
            unicode-bidi: plaintext;
        }

    /* Reduce padding so it fits nicely */
    .table-head.search-head {
        padding: 10px 10px;
    }

    .row8 {
        padding: 10px 10px;
    }
}

.logout-btn {
    background: #b91c1c;
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

    .logout-btn:hover {
        background: #991b1b;
    }


/* ========== ITEM SEARCH SECTION STYLES ========== */
.search-item-container {
    padding: 10px 0;
}

.search-item-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.search-item-label {
    font-weight: bold;
    color: #1E3A8A;
    font-size: 14px;
}

.search-item-input {
    height: 38px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0 12px;
    font-size: 14px;
    width: 200px;
    direction: ltr;
    text-align: center;
    font-family: monospace;
    font-size: 16px;
}

    .search-item-input:focus {
        outline: none;
        border-color: #4CAF50;
        box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
    }

.btn.gray {
    background: #6c757d;
}

    .btn.gray:hover {
        background: #5a6268;
    }

.search-item-info {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    margin: 10px 0;
    font-size: 14px;
}

    .search-item-info strong {
        color: #1E3A8A;
        font-size: 16px;
    }

.search-item-hint {
    padding: 8px 0;
    color: #6c757d;
}

.item-search-table-container {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow-x: auto;
    background: white;
    margin-top: 10px;
}

.item-table-head {
    background: #1E3A8A;
    color: white;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 1.5fr 1.5fr 0.8fr 1.8fr;
    font-weight: bold;
    font-size: 13px;
    position: sticky;
    top: 0;
}

    .item-table-head > div {
        text-align: center;
        padding: 0 5px;
    }

.item-search-body {
    max-height: 550px;
    overflow-y: auto;
    background: white;
}

.item-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 1.5fr 1.5fr 0.8fr 1.8fr;
    padding: 12px 14px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    transition: background 0.2s;
}

    .item-row:hover {
        background: #f8f9fa;
    }

    .item-row:nth-child(even) {
        background: #fafbfc;
    }

        .item-row:nth-child(even):hover {
            background: #f0f2f5;
        }

.item-cell {
    text-align: center;
    padding: 0 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .item-cell strong {
        color: #1E3A8A;
    }

/* Mobile responsive for item search */
@media (max-width: 1024px) {
    .item-table-head,
    .item-row {
        grid-template-columns: 0.9fr 0.9fr 1.8fr 1.3fr 1.3fr 0.7fr 1.5fr;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .item-table-head,
    .item-row {
        grid-template-columns: 0.8fr 0.8fr 1.5fr 1.2fr 1.2fr 0.6fr 1.3fr;
        font-size: 11px;
        padding: 8px 10px;
    }

    .search-item-input {
        width: 150px;
        font-size: 14px;
    }

    .search-item-info {
        flex-direction: column;
        gap: 5px;
    }
}


/* ==========================================================
   S. ZINANA VISUAL THEME
   Pistachio green + metallic gray. Visual-only overrides.
   ========================================================== */
:root {
    --sz-pistachio: #a8c686;
    --sz-pistachio-light: #eaf1e2;
    --sz-pistachio-pale: #f3f6ef;
    --sz-green: #49634a;
    --sz-green-deep: #314638;
    --sz-metal: #68737d;
    --sz-metal-dark: #424b54;
    --sz-metal-light: #d9dee2;
    --sz-page: #f2f4f1;
    --sz-card: #ffffff;
    --sz-border: #d8ded7;
    --sz-text: #27332b;
    --sz-shadow: 0 8px 24px rgba(49, 70, 56, .08);
}

body {
    background: var(--sz-page);
    color: var(--sz-text);
}

.navbar {
    background: rgba(255, 255, 255, .96) !important;
    border-bottom: 1px solid var(--sz-border) !important;
}

.navbar-brand {
    color: var(--sz-green-deep) !important;
    font-weight: 800;
    letter-spacing: .2px;
}

.nav-link {
    color: var(--sz-metal-dark) !important;
    font-weight: 600;
}

    .nav-link:hover {
        color: var(--sz-green) !important;
    }

.header {
    background: linear-gradient(120deg, #3f5147 0%, #65736d 48%, #a8c686 100%);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 16px;
    box-shadow: var(--sz-shadow);
    margin: 12px 0;
}

.title {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.18);
}

.tabs {
    gap: 8px;
    padding: 10px 4px;
}

.tabbtn {
    background: #e3e7e3;
    color: #3f4a43;
    border: 1px solid #d2d9d2;
    border-radius: 11px;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

    .tabbtn:hover {
        background: #d6e2cc;
        transform: translateY(-1px);
    }

    .tabbtn.active {
        background: linear-gradient(135deg, #617a5c, #3f5945);
        color: #fff;
        border-color: #3f5945;
        box-shadow: 0 4px 12px rgba(63,89,69,.22);
    }

.controls {
    background: #edf0ec;
    border: 1px solid var(--sz-border);
    border-radius: 14px;
}

.box, .report-card, .simple-card, .company-card, .login-card,
.item-search-table-container {
    background: var(--sz-card);
    border-color: var(--sz-border);
    box-shadow: var(--sz-shadow);
}

.box {
    border-radius: 12px;
}

.box-title, .report-title, .simple-title, .login-title,
.search-item-label, .search-item-info strong, .item-cell strong {
    color: var(--sz-green-deep);
}

select, input, textarea {
    border-color: #c8d0c9;
    background-color: #fff;
    color: var(--sz-text);
}

    select:focus, input:focus, textarea:focus {
        outline: none;
        border-color: #91b477;
        box-shadow: 0 0 0 3px rgba(168,198,134,.25);
    }

.btn {
    transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
    box-shadow: 0 3px 8px rgba(45,55,48,.12);
}

    .btn:hover {
        filter: brightness(.96);
        transform: translateY(-1px);
    }

    .btn.purple, .btn.orange, .login-card button {
        background: linear-gradient(135deg, #6e8a61, #435d49);
        color: #fff;
    }

    .btn.green {
        background: linear-gradient(135deg, #a8c686, #6e8a61);
        color: #203326;
    }

    .btn.gray {
        background: linear-gradient(135deg, #87919a, #5e6871);
        color: #fff;
    }

.report-card, .simple-card {
    border-radius: 15px;
}

.report-title, .simple-title {
    letter-spacing: -.2px;
}

.logo {
    border-color: #a8c686;
    background: var(--sz-pistachio-light);
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 140px;
    height: 70px;
    padding: 8px;
    border: 2px solid #a8c686;
    border-radius: 10px;
    background: linear-gradient(145deg, #f8fbf5, #dce8d2);
    color: #3f5945;
    font-weight: 800;
    font-size: 17px;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.table-head, .item-table-head {
    background: linear-gradient(120deg, #46574d, #68737d);
    color: #fff;
}

.grand {
    background: linear-gradient(120deg, #46574d, #68737d);
    color: #fff;
}

.gate-header {
    background: #edf1eb;
    color: var(--sz-green-deep);
    border-bottom-color: var(--sz-border);
}

.gate-total {
    background: #e7eee2;
    color: #405744;
    border-bottom-color: var(--sz-border);
}

#shiftBody, .search-body, .item-search-body {
    border-color: var(--sz-border);
}

.row4, .row8, .rowline, .item-row {
    border-bottom-color: #e5e9e4;
}

.row8, .rowline, .item-row {
    background: #fff;
}

    .row8:nth-child(even), .rowline:nth-child(even), .item-row:nth-child(even) {
        background: #f5f7f3;
    }

    .row8:hover, .rowline:hover, .item-row:hover {
        background: #eaf1e4;
    }

.blue, .company-card.blue {
    color: #526b58;
}

.green {
    color: #5d8050;
}

.orange {
    color: #8a7650;
}

.company-card.blue {
    background: #edf2e9;
    border-color: #d7e2cf;
}

.company-card.purple {
    background: #eef0ed;
    color: #59665d;
}

.company-card.green {
    background: #e8f0e2;
    color: #405b43;
}

.company-card.brown {
    background: #f0f0e9;
    color: #6c6a58;
}

.company-card.orange2 {
    background: #e9ece8;
    color: #58645b;
}

.mini.green {
    background: #eaf2e3;
    border-color: #c6d8b8;
    color: #405b43;
}

.mini.red {
    background: #f0eeeb;
    border-color: #d9d2ca;
    color: #6d5c56;
}

.mini.orange {
    background: #eef0e9;
    border-color: #d8decd;
    color: #6b704e;
}

.simple-card.purple-border {
    border-top-color: #8ca77a;
}

.login-bg {
    background: radial-gradient(circle at top left, #b9d19d 0%, #718575 42%, #424e48 100%);
}

.login-card {
    border: 1px solid rgba(255,255,255,.7);
}

    .login-card button {
        border-radius: 10px;
    }

.login-error {
    color: #a33f3f;
}

.logout-btn {
    background: #5e6871;
    box-shadow: 0 3px 8px rgba(0,0,0,.12);
}

    .logout-btn:hover {
        background: #424b54;
    }

.status {
    color: #657168;
    padding: 12px 10px;
}

@media (max-width: 768px) {
    .header {
        border-radius: 12px;
    }

    .title {
        font-size: 19px;
    }

    .tabs {
        padding-left: 0;
        padding-right: 0;
    }

    .brand-logo {
        width: 100px;
        height: 60px;
        font-size: 14px;
    }
}
