/* ============ Base / Variables ============ */
:root {
    --primary: #1e6f5c;
    --primary-dark: #14503f;
    --primary-light: #e6f2ef;
    --accent: #f2a541;
    --danger: #d64545;
    --text: #22303c;
    --text-muted: #6b7a86;
    --bg: #f6f8f7;
    --card-bg: #ffffff;
    --border: #e1e6e4;
    --radius: 14px;
    --shadow: 0 2px 10px rgba(20, 40, 35, 0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Tahoma', 'Segoe UI', system-ui, -apple-system, sans-serif;
    direction: rtl;
    text-align: right;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ============ Layout Shells ============ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 22px;
}

.brand-title {
    text-align: center;
    font-size: 1.4rem;
    margin: 0 0 20px;
    color: var(--primary-dark);
}

.app-shell {
    min-height: 100vh;
    padding-bottom: 76px; /* space for bottom nav on mobile */
}

.topbar {
    background: var(--primary);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.topbar h1 {
    font-size: 1.1rem;
    margin: 0;
}

.topbar a.logout {
    color: #fff;
    opacity: 0.85;
    font-size: 0.9rem;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 18px 14px 40px;
}

/* ============ Forms ============ */
.form { display: flex; flex-direction: column; gap: 4px; }
.form label {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 12px;
    margin-bottom: 4px;
}
.form input[type="text"],
.form input[type="password"],
.form input[type="tel"],
.form input[type="number"],
.form select,
.form textarea {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcfc;
    outline: none;
    transition: border-color .15s;
}
.form input:focus, .form select:focus, .form textarea:focus {
    border-color: var(--primary);
    background: #fff;
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn {
    display: inline-block;
    text-align: center;
    padding: 13px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 20px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: var(--primary-light); color: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; margin-top: 0; }
.btn-danger { background: var(--danger); color: #fff; }

/* ============ Alerts ============ */
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
    margin-bottom: 14px;
    line-height: 1.6;
}
.alert-success { background: #e5f5ea; color: #1f7a3d; }
.alert-error { background: #fbe8e8; color: #b13030; }
.alert-warning { background: #fff4e0; color: #92600b; }

.section-title {
    font-size: 1rem;
    color: var(--primary-dark);
    margin: 18px 0 4px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

/* ============ Cards / Orders ============ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 14px;
}

.order-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.order-card .row1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.order-file {
    font-weight: 600;
    font-size: 0.98rem;
    word-break: break-word;
}
.order-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.order-price {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1.05rem;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-pending  { background: #fff4e0; color: #92600b; }
.badge-progress { background: #e3ecfb; color: #24519c; }
.badge-delivered{ background: #e5f5ea; color: #1f7a3d; }

/* Empty state */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 50px 16px;
}
.empty-state .icon { font-size: 2.4rem; margin-bottom: 10px; }

/* ============ Upload dropzone ============ */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
    background: #fbfcfc;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dropzone.has-file {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}
.dropzone .icon { font-size: 2rem; display: block; margin-bottom: 6px; }
.dropzone input[type="file"] { display: none; }

.price-box {
    background: var(--primary-light);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
    margin-top: 18px;
}
.price-box .amount {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary-dark);
}

/* ============ Bottom nav (mobile) ============ */
.bottom-nav {
    position: fixed;
    bottom: 0; right: 0; left: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 30;
}
.bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 10px 4px 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.bottom-nav a.active { color: var(--primary); font-weight: 700; }
.bottom-nav .nav-icon { display: block; font-size: 1.25rem; margin-bottom: 2px; }

/* ============ Tables (admin, wider screens) ============ */
.table-wrap { overflow-x: auto; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
}
table.data-table th, table.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    text-align: right;
    white-space: nowrap;
}
table.data-table th { background: var(--primary-light); color: var(--primary-dark); }

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.filters a {
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.filters a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}
.stat-box {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 10px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-box .num { font-size: 1.4rem; font-weight: 800; color: var(--primary-dark); }
.stat-box .label { font-size: 0.75rem; color: var(--text-muted); }

/* ============ Responsive: larger screens ============ */
@media (min-width: 640px) {
    .container { padding: 26px 20px 50px; }
    .bottom-nav { display: none; }
    .app-shell { padding-bottom: 0; }
    .order-card .row1 { align-items: center; }
    .stat-grid { grid-template-columns: repeat(3, 180px); justify-content: start; }
}

@media (min-width: 960px) {
    .container { max-width: 960px; }
}
