:root {
    --brand-teal: #1e6b7a;
    --brand-teal-dark: #155a67;
    --brand-yellow: #FFD700;
    --brand-yellow-bg: #FFFF00;
    --brand-pink: #FFCDD2;
    --brand-blue: #BBDEFB;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fff;
    color: #222;
}

body.rtl {
    direction: rtl;
    text-align: right;
}

body.ar {
    font-size: 1.1rem;
}

/* ── DZRT Logo ────────────────────────────────────────────────── */
.dzrt-logo-en,
.dzrt-logo-ar {
    display: inline-block;
    background: #000;
    color: #fff;
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: 1px;
    padding: 8px 18px;
    min-width: 100px;
    text-align: center;
    line-height: 1.2;
    user-select: none;
}

.dzrt-logo-ar {
    font-size: 1.4rem;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-brand {
    background-color: var(--brand-teal);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 40px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    display: inline-block;
}

.btn-brand:hover {
    background-color: var(--brand-teal-dark);
    color: #fff;
}

.btn-brand-outline {
    background: #fff;
    color: var(--brand-teal);
    border: 2px solid var(--brand-teal);
    border-radius: 10px;
    padding: 10px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-brand-outline:hover {
    background: var(--brand-teal);
    color: #fff;
}

.btn-gold {
    background-color: #e6ac00;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
}

.btn-green {
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
}

.btn-blue {
    background-color: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

/* ── Language Select Page ────────────────────────────────────── */
.lang-select-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 32px;
}

.lang-buttons {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-buttons .btn-brand {
    min-width: 160px;
    font-size: 1.15rem;
    padding: 14px 48px;
}

/* ── Customer Flow Pages ─────────────────────────────────────── */
.customer-page {
    max-width: 960px;
    margin: 40px auto;
    padding: 0 20px;
}

.customer-name-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.customer-name-block {
    font-size: 1.05rem;
}

.customer-name-block .label {
    color: #555;
    margin-bottom: 2px;
}

.customer-name-block .value {
    font-weight: 700;
    font-size: 1.1rem;
}

.period-instruction {
    font-size: 1.05rem;
    margin-bottom: 18px;
    font-weight: 600;
}

/* ── Date Pickers ────────────────────────────────────────────── */
.date-row {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    align-items: flex-start;
}

.date-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.date-group label {
    font-weight: 600;
    color: #c00;
    font-size: 0.95rem;
}

.flatpickr-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 200px;
    background: #fff;
}

/* ── SKU Table ───────────────────────────────────────────────── */
.sku-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 18px;
}

.sku-tables-wrapper {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.sku-table {
    border-collapse: collapse;
    min-width: 260px;
}

.sku-table th {
    background: var(--brand-yellow-bg);
    font-weight: 700;
    padding: 8px 14px;
    border: 1px solid #ccc;
    text-align: center;
}

.sku-table td {
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.sku-table tr:nth-child(even) td {
    background: #f9f9f9;
}

.sku-table .total-row td {
    background: var(--brand-yellow-bg);
    font-weight: 700;
}

.sku-table input[type="number"] {
    width: 80px;
    text-align: center;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.95rem;
}

/* ── Review Page ─────────────────────────────────────────────── */
.review-page {
    max-width: 700px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}

.review-message {
    font-size: 1.1rem;
    margin-bottom: 32px;
    line-height: 1.6;
}

.thankyou-text {
    color: #555;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

/* ── Admin Layout ────────────────────────────────────────────── */
.admin-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

.admin-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 24px;
    background: #fff;
    border-bottom: 2px solid #eee;
}

.admin-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #ddd;
    padding: 0 24px;
    background: #fff;
}

.admin-nav a {
    display: inline-block;
    padding: 10px 28px;
    font-weight: 700;
    font-size: 1rem;
    color: #333;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.admin-nav a.active {
    background: var(--brand-yellow-bg);
    color: #222;
    border-bottom: 3px solid #e6c800;
}

.admin-nav a:hover:not(.active) {
    background: #f5f5f5;
}

.admin-content {
    padding: 24px;
}

/* ── Filter Row ──────────────────────────────────────────────── */
.filter-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: #fafafa;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.filter-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #555;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    background: #fff;
    min-width: 140px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding-bottom: 1px;
}

/* ── Report Table ────────────────────────────────────────────── */
.table-scroll {
    overflow-x: auto;
    margin-top: 8px;
}

.report-table {
    border-collapse: collapse;
    font-size: 0.82rem;
    white-space: nowrap;
    min-width: 100%;
}

.report-table th, .report-table td {
    border: 1px solid #ccc;
    padding: 5px 8px;
    text-align: center;
}

.report-table .th-submission-date,
.report-table .th-customer-data,
.report-table .th-selling-period,
.report-table .th-sellout {
    background: var(--brand-yellow-bg);
    font-weight: 700;
}

.report-table .th-uploaded {
    background: var(--brand-pink);
    font-weight: 700;
}

.report-table .th-actual {
    background: var(--brand-blue);
    font-weight: 700;
}

.report-table .th-difference {
    background: #E0E0E0;
    font-weight: 700;
}

.report-table .th-leaf {
    background: var(--brand-yellow-bg);
    font-weight: 700;
}

.report-table tbody tr:nth-child(even) td {
    background: #f9f9f9;
}

.report-table tbody tr:hover td {
    background: #e8f4f8;
}

/* ── Customers Table ─────────────────────────────────────────── */
.customers-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9rem;
}

.customers-table th {
    background: #f0f0f0;
    padding: 9px 12px;
    border: 1px solid #ccc;
    text-align: left;
    font-weight: 700;
}

.customers-table td {
    padding: 7px 12px;
    border: 1px solid #e0e0e0;
    vertical-align: middle;
}

.customers-table tbody tr:nth-child(even) td {
    background: #f9f9f9;
}

.row-indicator {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: var(--brand-teal);
    border-radius: 2px;
    vertical-align: middle;
}

/* ── Alerts / Errors ─────────────────────────────────────────── */
.alert-error {
    background: #fce4e4;
    border: 1px solid #f5aca6;
    color: #c00;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 0.97rem;
}

.alert-success {
    background: #e4f5e4;
    border: 1px solid #a6d5a6;
    color: #155724;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
}

/* ── Admin Login ─────────────────────────────────────────────── */
.admin-login-wrapper {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
}

.admin-login-wrapper h2 {
    text-align: center;
    margin-bottom: 28px;
    color: var(--brand-teal);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

/* ── RTL-specific overrides ──────────────────────────────────── */
body.rtl .customer-name-row {
    flex-direction: row-reverse;
}

body.rtl .date-row {
    flex-direction: row-reverse;
}

body.rtl .sku-table th,
body.rtl .sku-table td {
    text-align: right;
}

body.rtl .sku-tables-wrapper {
    flex-direction: row-reverse;
}

body.rtl .review-page {
    text-align: right;
}

body.rtl .filter-row {
    flex-direction: row-reverse;
}

/* ── btn-dzrt: Bootstrap-compatible brand teal button ─────────── */
.btn-dzrt {
    background-color: var(--brand-teal);
    color: #fff !important;
    border-color: var(--brand-teal);
    font-weight: 700;
}
.btn-dzrt:hover,
.btn-dzrt:focus {
    background-color: var(--brand-teal-dark);
    border-color: var(--brand-teal-dark);
    color: #fff !important;
}

/* ── Admin logo (plain, no EN/AR distinction) ─────────────────── */
.dzrt-logo {
    display: inline-block;
    background: #000;
    color: #fff;
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: 1px;
    padding: 6px 16px;
    text-align: center;
    user-select: none;
}

/* ── Admin page header / title ────────────────────────────────── */
.admin-page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
}

/* ── Admin filter helpers ─────────────────────────────────────── */
.filter-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #555;
}
.filter-select,
.filter-input {
    min-width: 130px;
    font-size: 0.92rem;
}

/* ── Admin action buttons ─────────────────────────────────────── */
.btn-filter-apply {
    background-color: var(--brand-teal);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 7px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-filter-apply:hover { background-color: var(--brand-teal-dark); }

.btn-filter-reset {
    background-color: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 7px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}
.btn-filter-reset:hover { background-color: #5a6268; color: #fff; }

.btn-export {
    background-color: #28a745;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    padding: 7px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}
.btn-export:hover { background-color: #218838; }

.btn-import {
    background-color: var(--brand-teal);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 7px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-import:hover { background-color: var(--brand-teal-dark); }

.btn-upload {
    background-color: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 7px 18px;
    font-weight: 600;
    cursor: pointer;
}
.btn-upload:hover { background-color: #0b5ed7; }

/* ── Empty state ──────────────────────────────────────────────── */
.empty-state {
    color: #999;
    font-size: 0.95rem;
}

/* ── QR code button ───────────────────────────────────────────── */
.btn-qr {
    background-color: #5a3ea0;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 7px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}
.btn-qr:hover { background-color: #4a3080; color: #fff; }

/* ── QR card ──────────────────────────────────────────────────── */
.qr-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    padding: 16px 20px;
    background: #fff;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    min-width: 200px;
}

.qr-card-brand {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #111;
    margin-bottom: 12px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.qr-code-canvas {
    line-height: 0;
}

.qr-card-number {
    font-size: 12px;
    color: #555;
    margin-top: 10px;
    font-weight: 500;
}

/* ── Logo images ──────────────────────────────────────────────── */
.site-logo-img {
    height: 48px;
    width: auto;
}

.admin-logo-img {
    height: 38px;
    width: auto;
}

.qr-card-logo {
    height: 44px;
    width: auto;
    margin-bottom: 10px;
}
