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

:root {
  color-scheme: light;
  --pine: #123b31;
  --pine-2: #1b5042;
  --pine-3: #2e6d59;
  --pine-soft: #e8f2ec;
  --amber: #e7a638;
  --amber-soft: #fff4dd;
  --ink: #1e2c27;
  --muted: #7c8983;
  --muted-2: #9aa59f;
  --line: #e9eeea;
  --surface: #fff;
  --canvas: #f5f7f4;
  --red: #c9534e;
  --red-soft: #fff0ee;
  --blue: #5884bb;
  --blue-soft: #edf4fd;
  --green: #27845d;
  --green-soft: #e8f5ee;
  --shadow: 0 10px 30px rgba(34, 59, 48, .055);
  --radius: 16px;
  font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.65; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(231, 166, 56, .42); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 0 0 auto; display: flex; flex-direction: column; width: 258px; padding: 24px 15px 15px; color: #e9f0eb; background: var(--pine); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; color: #fff; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,.12); }
.brand-mark svg { width: 29px; height: 29px; fill: none; stroke: var(--amber); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark svg .brand-mark-line { stroke: #fff; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 20px; line-height: 1.25; letter-spacing: -.3px; }
.brand-copy small { color: #a9c0b5; font-size: 11px; }
.sidebar-label { padding: 9px 13px 7px; color: #8da99c; font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.navigation { display: flex; flex-direction: column; gap: 4px; }
.nav-link { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 13px; color: #ccdad2; border-radius: 10px; font-size: 12px; font-weight: 500; transition: background .16s, color .16s, transform .16s; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.075); }
.nav-link.active { color: #fff; background: rgba(255,255,255,.13); box-shadow: inset -3px 0 0 var(--amber); }
.nav-icon { width: 19px; text-align: center; color: #9fbaad; font-family: 'Segoe UI', sans-serif; font-size: 17px; line-height: 1; }
.nav-link.active .nav-icon { color: var(--amber); }
.nav-shortcut { margin-right: auto; padding: 1px 5px; color: #aac0b5; border: 1px solid rgba(255,255,255,.15); border-radius: 5px; font: 9px 'Segoe UI', sans-serif; }
.secondary-label { margin-top: 16px; }
.sidebar-bottom { margin-top: auto; }
.storage-note { display: flex; align-items: center; gap: 8px; margin: 0 3px 14px; padding: 11px 10px; color: #b5cbbf; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; font-size: 10px; }
.storage-dot, .date-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #64c392; box-shadow: 0 0 0 3px rgba(100,195,146,.13); }
.settings-link { min-height: 40px; font-size: 11px; }
.sidebar-footnote { padding: 12px 13px 0; color: #7e9b8e; font-size: 10px; }
.sidebar-footnote span { padding: 0 4px; }

.main-shell { min-height: 100vh; margin-right: 258px; }
.topbar { position: sticky; z-index: 10; top: 0; height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 34px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-leading, .topbar-actions { display: flex; align-items: center; gap: 13px; }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.breadcrumb-home { color: var(--muted-2); }
.crumb-separator { color: #c6cec9; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.date-chip { display: flex; align-items: center; gap: 9px; padding: 8px 12px; color: #697871; background: #f7f9f7; border: 1px solid #edf0ed; border-radius: 9px; font-size: 11px; }
.date-dot { width: 6px; height: 6px; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; color: var(--pine); background: #e8f2ec; border-radius: 50%; font-size: 12px; font-weight: 700; }
.content { width: min(100%, 1520px); margin: 0 auto; padding: 31px 34px 46px; }
.mobile-menu, .mobile-footer { display: none !important; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.page-heading h1 { margin: 0; color: var(--ink); font-size: 23px; line-height: 1.4; font-weight: 700; letter-spacing: -.45px; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 700; transition: transform .15s, background .15s, box-shadow .15s; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { color: #fff; background: var(--pine); box-shadow: 0 4px 11px rgba(18,59,49,.14); }
.button-primary:hover { background: var(--pine-2); }
.button-amber { color: #3b2b11; background: var(--amber); }
.button-amber:hover { background: #efb849; }
.button-secondary { color: #354740; background: #fff; border-color: #e3e9e5; }
.button-secondary:hover { background: #f7faf8; }
.button-danger { color: var(--red); background: var(--red-soft); border-color: #f5ddda; }
.button-small { min-height: 34px; padding-inline: 12px; font-size: 10px; }
.button-plus { font: 18px/1 'Segoe UI', sans-serif; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: #697871; background: #fff; cursor: pointer; font-size: 15px; transition: all .15s; }
.icon-button:hover { color: var(--pine); border-color: #c8d8ce; background: #f8fbf9; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 19px; }
.stat-card { position: relative; overflow: hidden; min-height: 132px; padding: 17px 18px; background: var(--surface); border: 1px solid #edf0ed; border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card::after { position: absolute; right: 0; top: 19px; width: 3px; height: 31px; content: ''; background: var(--stat-color, var(--pine-3)); border-radius: 4px 0 0 4px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 9px; color: var(--muted); font-size: 10px; font-weight: 600; }
.stat-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--stat-color, var(--pine-3)); background: var(--stat-bg, var(--pine-soft)); border-radius: 10px; font: 16px 'Segoe UI', sans-serif; }
.stat-value { display: block; margin-top: 10px; color: var(--ink); font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -.35px; }
.stat-note { display: flex; align-items: center; gap: 5px; margin-top: 5px; color: var(--muted-2); font-size: 9px; }
.stat-note .positive { color: var(--green); }
.stat-note .warning { color: #c4831e; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(290px, .88fr); gap: 17px; align-items: start; }
.dashboard-column { display: grid; gap: 17px; }
.panel { min-width: 0; padding: 18px 19px; background: var(--surface); border: 1px solid #edf0ed; border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.panel-title { margin: 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.panel-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.text-link { color: var(--pine-3); font-size: 10px; font-weight: 700; cursor: pointer; }
.text-link:hover { color: var(--pine); }
.chart-wrap { height: 216px; display: flex; align-items: stretch; gap: 13px; padding-top: 5px; }
.chart-y-axis { display: flex; flex-direction: column; justify-content: space-between; padding: 4px 0 25px; color: #9ba69f; font-size: 9px; }
.bar-chart { position: relative; flex: 1; display: flex; align-items: end; justify-content: space-around; gap: 13px; padding: 0 3px 25px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), #f1f4f1 calc(25% - 1px), #f1f4f1 25%); }
.bar-group { z-index: 1; height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; min-width: 0; }
.bar-value { color: #829087; font-size: 8px; white-space: nowrap; }
.bar-track { width: min(100%, 31px); height: calc(100% - 23px); display: flex; align-items: end; }
.bar { width: 100%; min-height: 5px; background: #b9d8c7; border-radius: 6px 6px 2px 2px; transition: height .35s; }
.bar.today { background: var(--pine-3); }
.bar-label { position: absolute; bottom: -24px; color: #8d9992; font-size: 9px; white-space: nowrap; }
.chart-legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.legend-dot { width: 8px; height: 8px; display: inline-block; background: var(--pine-3); border-radius: 50%; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: right; white-space: nowrap; }
.data-table th { padding: 10px 11px; color: #8b9891; background: #f8faf8; border-block: 1px solid #edf0ed; font-size: 9px; font-weight: 600; }
.data-table th:first-child { border-radius: 0 8px 8px 0; }
.data-table th:last-child { border-radius: 8px 0 0 8px; }
.data-table td { padding: 11px; color: #405049; border-bottom: 1px solid #f0f3f0; font-size: 10px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfcfb; }
.table-primary { color: var(--ink); font-weight: 700; }
.table-secondary { display: block; margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.table-actions { display: flex; align-items: center; gap: 5px; }
.table-actions .icon-button { width: 28px; height: 28px; font-size: 12px; }
.empty-state { padding: 31px 15px; color: var(--muted); text-align: center; font-size: 11px; }
.empty-icon { width: 40px; height: 40px; display: grid; place-items: center; margin: 0 auto 9px; color: #7b9486; background: #eff5f0; border-radius: 13px; font-size: 19px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 20px; font-size: 9px; font-weight: 600; }
.badge::before { width: 5px; height: 5px; content: ''; background: currentColor; border-radius: 50%; }
.badge-green { color: #28794f; background: var(--green-soft); }
.badge-amber { color: #9b6711; background: var(--amber-soft); }
.badge-red { color: #ad4944; background: var(--red-soft); }
.badge-blue { color: #4972a1; background: var(--blue-soft); }
.badge-gray { color: #727e77; background: #f0f3f1; }
.low-stock-list { display: grid; gap: 3px; }
.low-stock-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f3f0; }
.low-stock-row:last-child { border-bottom: 0; }
.product-initial { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; color: #406959; background: #eef5ef; border-radius: 10px; font-size: 12px; font-weight: 700; }
.low-stock-info { min-width: 0; flex: 1; }
.low-stock-name { overflow: hidden; color: #3b4b43; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.low-stock-category { margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.stock-count { color: var(--red); font-size: 10px; font-weight: 700; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 13px; }
.toolbar-start, .toolbar-end { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.search-field { position: relative; width: min(100%, 300px); }
.search-field input { width: 100%; height: 38px; padding: 0 37px 0 12px; color: var(--ink); background: #fff; border: 1px solid #e7ece8; border-radius: 9px; font-size: 10px; }
.search-field input::placeholder { color: #a2ada6; }
.search-symbol { position: absolute; right: 12px; top: 50%; color: #89978f; transform: translateY(-50%); font-size: 14px; }
.select-control, .field-control { width: 100%; min-height: 39px; padding: 8px 11px; color: #33443c; background: #fff; border: 1px solid #e4eae6; border-radius: 8px; font-size: 11px; }
.select-control { min-width: 120px; height: 38px; }
.filter-tabs { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; }
.filter-tab { flex: 0 0 auto; padding: 6px 12px; color: #79877f; background: #fff; border: 1px solid #e8ede9; border-radius: 20px; cursor: pointer; font-size: 9px; }
.filter-tab.active { color: #fff; background: var(--pine); border-color: var(--pine); }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .table-wrap { padding: 0 14px 8px; }
.table-panel .data-table th { position: sticky; top: 0; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 17px; color: #8a9790; border-top: 1px solid #eef1ef; font-size: 9px; }

.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 355px; gap: 17px; align-items: start; }
.pos-catalog { min-width: 0; }
.pos-search-row { display: flex; gap: 9px; margin-bottom: 11px; }
.pos-search-row .search-field { flex: 1; width: auto; }
.pos-search-row input { height: 42px; }
.pos-categories { display: flex; gap: 7px; padding-bottom: 4px; margin-bottom: 12px; overflow-x: auto; }
.pos-category { flex: 0 0 auto; padding: 6px 12px; color: #76847c; background: #fff; border: 1px solid #e7ece8; border-radius: 8px; cursor: pointer; font-size: 9px; }
.pos-category.active { color: var(--pine); background: #e9f2ec; border-color: #dcebe1; font-weight: 700; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.product-card { position: relative; min-height: 127px; display: flex; flex-direction: column; align-items: stretch; padding: 13px; overflow: hidden; color: var(--ink); background: #fff; border: 1px solid #e9eeea; border-radius: 13px; cursor: pointer; text-align: right; transition: border .16s, transform .16s, box-shadow .16s; }
.product-card:hover:not(:disabled) { transform: translateY(-2px); border-color: #bdd3c4; box-shadow: 0 7px 17px rgba(31,74,53,.08); }
.product-card:disabled { opacity: .52; cursor: not-allowed; }
.product-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.product-card .product-initial { width: 34px; height: 34px; border-radius: 10px; }
.product-card-name { display: -webkit-box; min-height: 36px; margin-top: 10px; overflow: hidden; color: #34473e; font-size: 10px; font-weight: 700; line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: auto; padding-top: 8px; }
.product-card-price { color: var(--pine); font-size: 11px; font-weight: 700; }
.product-card-stock { color: #8a9890; font-size: 8px; }
.product-card-stock.low { color: var(--red); }
.pos-cart { position: sticky; top: 88px; min-height: 500px; display: flex; flex-direction: column; padding: 17px; background: #fff; border: 1px solid #e8eeea; border-radius: var(--radius); box-shadow: var(--shadow); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 13px; border-bottom: 1px solid #edf1ed; }
.cart-title { margin: 0; font-size: 13px; font-weight: 700; }
.cart-count { padding: 2px 8px; color: var(--pine-3); background: var(--pine-soft); border-radius: 20px; font-size: 9px; font-weight: 700; }
.cart-lines { min-height: 100px; max-height: 255px; flex: 1; overflow: auto; }
.cart-empty { display: grid; place-items: center; min-height: 160px; color: #98a49c; text-align: center; font-size: 10px; }
.cart-empty span { display: block; margin-bottom: 5px; color: #9bad9f; font: 28px 'Segoe UI', sans-serif; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 11px 0; border-bottom: 1px solid #f0f3f0; }
.cart-line-name { overflow: hidden; color: #405148; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cart-line-price { margin-top: 2px; color: #8a9890; font-size: 9px; }
.cart-line-total { color: var(--ink); font-size: 10px; font-weight: 700; }
.qty-control { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.qty-control button { width: 23px; height: 23px; display: grid; place-items: center; color: #526359; background: #f3f6f3; border: 0; border-radius: 6px; cursor: pointer; font-size: 12px; }
.qty-control button:hover { background: #e6efe8; }
.qty-control span { min-width: 16px; text-align: center; color: #35473d; font-size: 9px; font-weight: 700; }
.qty-control .qty-remove { color: #bb5d55; background: #fff2f0; }
.cart-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 13px 0 10px; }
.cart-selects select { min-width: 0; height: 35px; padding: 0 8px; font-size: 9px; }
.cart-summary { display: grid; gap: 7px; padding: 12px 0; border-top: 1px solid #edf1ed; }
.summary-line { display: flex; justify-content: space-between; gap: 10px; color: #7d8982; font-size: 10px; }
.summary-line strong { color: #45564d; font-weight: 600; }
.summary-line.total { align-items: center; padding-top: 9px; border-top: 1px dashed #e1e8e2; color: var(--ink); font-size: 11px; font-weight: 700; }
.summary-line.total strong { color: var(--pine); font-size: 19px; font-weight: 800; }
.checkout-button { width: 100%; min-height: 43px; font-size: 11px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.form-field { display: grid; gap: 6px; min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label, .form-label { color: #526159; font-size: 10px; font-weight: 600; }
.field-control { min-width: 0; }
textarea.field-control { min-height: 73px; resize: vertical; }
.field-help { color: var(--muted-2); font-size: 9px; }
.form-section { padding: 15px; background: #fff; border: 1px solid #e9eeea; border-radius: var(--radius); }
.form-section + .form-section { margin-top: 15px; }
.form-section-heading { margin: 0 0 14px; color: #35483e; font-size: 12px; font-weight: 700; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(270px, .75fr); gap: 16px; align-items: start; }
.backup-card { display: grid; gap: 11px; padding: 17px; background: #f9fbf9; border: 1px dashed #cfdad2; border-radius: 13px; }
.backup-card h3 { margin: 0; font-size: 12px; }
.backup-card p { margin: 0; color: #7e8d84; font-size: 10px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.backup-notice { margin-top: 13px; padding: 11px 12px; color: #80621d; background: #fff7e8; border-radius: 9px; font-size: 9px; line-height: 1.8; }
.settings-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; padding: 14px; background: var(--pine); border-radius: 12px; color: #fff; }
.settings-brand .brand-mark { width: 40px; height: 40px; }
.settings-brand strong { display: block; font-size: 13px; }
.settings-brand small { color: #b5cabb; font-size: 9px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(13, 32, 25, .48); backdrop-filter: blur(3px); animation: fade-in .15s ease-out; }
.modal-card { width: min(100%, 570px); max-height: min(88vh, 840px); display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid rgba(255,255,255,.6); border-radius: 17px; box-shadow: 0 24px 80px rgba(14,36,27,.23); animation: modal-in .18s ease-out; }
.modal-card.modal-wide { width: min(100%, 690px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 21px 14px; border-bottom: 1px solid #edf1ed; }
.modal-header h2 { margin: 0; font-size: 14px; }
.modal-header p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.modal-body { overflow-y: auto; padding: 18px 21px; }
.modal-footer { display: flex; justify-content: flex-start; gap: 8px; padding: 13px 21px; background: #fbfcfb; border-top: 1px solid #edf1ed; }
.modal-close { flex: 0 0 auto; }
.invoice-print { max-width: 520px; margin: auto; padding: 6px 3px; color: #27332c; }
.invoice-head { padding-bottom: 15px; border-bottom: 1px dashed #ccd5ce; text-align: center; }
.invoice-logo { width: 43px; height: 43px; display: grid; place-items: center; margin: 0 auto 6px; color: var(--pine); background: var(--pine-soft); border-radius: 13px; font-size: 21px; }
.invoice-head h2 { margin: 0; font-size: 17px; }
.invoice-head p { margin: 2px 0 0; color: #7f8a83; font-size: 10px; }
.invoice-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 13px; padding: 12px 0; color: #5e6b63; font-size: 10px; }
.invoice-meta span:nth-child(even) { text-align: left; }
.invoice-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.invoice-table th, .invoice-table td { padding: 8px 5px; text-align: right; border-bottom: 1px solid #edf0ed; }
.invoice-table th { color: #77837b; font-size: 9px; }
.invoice-totals { display: grid; gap: 6px; padding: 12px 4px; }
.invoice-totals div { display: flex; justify-content: space-between; font-size: 10px; }
.invoice-totals .invoice-total { padding-top: 8px; border-top: 1px dashed #ccd5ce; color: var(--pine); font-size: 14px; font-weight: 800; }
.invoice-thanks { padding-top: 12px; color: #7b8880; border-top: 1px dashed #ccd5ce; text-align: center; font-size: 10px; }

.toast-stack { position: fixed; z-index: 200; left: 22px; bottom: 22px; display: grid; gap: 8px; width: min(360px, calc(100vw - 30px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #f7fbf8; background: #214c3f; border-radius: 11px; box-shadow: 0 12px 35px rgba(17,48,37,.2); font-size: 11px; animation: toast-in .2s ease-out; transition: opacity .25s, transform .25s; }
.toast-error { background: #9e4541; }
.toast-warning { color: #44330f; background: #f0bd5b; }
.toast-mark { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; font-size: 11px; }
.toast-leave { opacity: 0; transform: translateY(8px); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-layout { grid-template-columns: minmax(0, 1fr) 325px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding-inline: 25px; }
}
@media (max-width: 900px) {
  .sidebar { width: 224px; }
  .main-shell { margin-right: 224px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-column { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .pos-layout { grid-template-columns: 1fr; }
  .pos-cart { position: static; min-height: auto; }
  .cart-lines { max-height: 280px; }
  .settings-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { position: relative; inset: auto; width: auto; height: auto; padding: 11px 13px 8px; }
  .brand { padding: 0 4px 9px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 11px; }
  .brand-mark svg { width: 25px; height: 25px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy small { font-size: 9px; }
  .sidebar-label, .sidebar-bottom, .secondary-label { display: none; }
  .navigation { flex-direction: row; gap: 5px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
  .navigation::-webkit-scrollbar { display: none; }
  .nav-link { min-height: 35px; flex: 0 0 auto; gap: 6px; padding: 0 10px; border-radius: 8px; font-size: 9px; }
  .nav-link.active { box-shadow: inset 0 -2px 0 var(--amber); }
  .nav-icon { width: auto; font-size: 14px; }
  .nav-shortcut { display: none; }
  .main-shell { min-height: calc(100vh - 105px); margin-right: 0; }
  .topbar { height: 57px; padding: 0 14px; }
  .mobile-menu { display: none !important; }
  .breadcrumb { gap: 6px; font-size: 10px; }
  .breadcrumb-home { display: none; }
  .crumb-separator { display: none; }
  .date-chip { display: none; }
  .avatar { display: none; }
  .topbar-actions { margin-right: auto; }
  .topbar .button { min-height: 31px; padding-inline: 9px; font-size: 9px; }
  .content { padding: 20px 13px 31px; }
  .page-heading { align-items: flex-start; margin-bottom: 16px; }
  .page-heading h1 { font-size: 18px; }
  .page-heading p { max-width: 255px; font-size: 9px; }
  .heading-actions { gap: 6px; }
  .heading-actions .button { min-height: 33px; padding-inline: 9px; font-size: 9px; }
  .stats-grid { gap: 9px; margin-bottom: 11px; }
  .stat-card { min-height: 108px; padding: 13px; border-radius: 13px; }
  .stat-top { font-size: 9px; }
  .stat-icon { width: 29px; height: 29px; font-size: 14px; }
  .stat-value { margin-top: 7px; font-size: 18px; }
  .stat-note { font-size: 8px; }
  .dashboard-column { grid-template-columns: 1fr; }
  .panel { padding: 14px; border-radius: 13px; }
  .chart-wrap { height: 185px; gap: 8px; }
  .dashboard-grid, .dashboard-column { gap: 11px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-start, .toolbar-end { justify-content: space-between; }
  .search-field { width: 100%; }
  .toolbar .search-field { flex: 1; }
  .table-panel .table-wrap { padding-inline: 8px; }
  .data-table th { padding: 9px 8px; font-size: 8px; }
  .data-table td { padding: 9px 8px; font-size: 9px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-card { min-height: 119px; padding: 10px; }
  .pos-cart { padding: 13px; }
  .form-grid { gap: 10px; }
  .form-field label, .form-label { font-size: 9px; }
  .field-control { font-size: 10px; }
  .settings-layout { gap: 11px; }
  .modal-backdrop { padding: 10px; }
  .modal-card { max-height: 94vh; border-radius: 13px; }
  .modal-header, .modal-body { padding-inline: 15px; }
  .modal-footer { padding-inline: 15px; }
  .mobile-footer { display: flex !important; justify-content: space-between; padding: 12px 15px; color: #89958e; background: #fff; border-top: 1px solid var(--line); font-size: 9px; }
  .toast-stack { left: 10px; bottom: 10px; }
}
@media (max-width: 390px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 11px; }
  .stat-value { font-size: 16px; }
  .page-heading { flex-direction: column; }
  .page-heading .heading-actions { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .cart-selects { grid-template-columns: 1fr; }
}

@media print {
  @page { size: auto; margin: 12mm; }
  body { min-width: 0; background: #fff !important; }
  body * { visibility: hidden !important; }
  #modalRoot, #modalRoot * { visibility: visible !important; }
  #modalRoot { position: absolute; inset: 0; width: 100%; }
  .modal-backdrop { position: static; display: block; padding: 0; background: #fff; }
  .modal-card { width: 100%; max-height: none; overflow: visible; border: 0; box-shadow: none; }
  .modal-header, .modal-footer, .no-print { display: none !important; }
  .modal-body { overflow: visible; padding: 0; }
  .invoice-print { max-width: 100%; }
}


/* حسابات المتجر والجلسة */
[hidden] { display: none !important; }
.session-chip { display: flex; align-items: center; gap: 8px; min-width: 0; }
.session-chip .avatar { flex: 0 0 auto; }
.session-copy { display: grid; min-width: 0; line-height: 1.35; }
.session-copy strong { max-width: 130px; overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.session-copy small { color: var(--muted); font-size: 9px; }
.logout-button { color: #6b7771; }
.self-account-label { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.username-cell { color: #42574d; font-family: ui-monospace, monospace; font-size: 11px !important; text-align: left !important; }
.user-security-note { margin-top: 14px; }
.table-actions .button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: radial-gradient(ellipse at 50% 0%, #e9f1eb 0, #f4f6f2 42%, #f5f7f4 100%); }
.auth-card { width: min(100%, 440px); padding: 29px; background: #fff; border: 1px solid #e6ece7; border-radius: 20px; box-shadow: 0 22px 70px rgba(22, 56, 42, .10); animation: modal-in .24s ease-out; }
.auth-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 22px; border-bottom: 1px solid #eef1ee; }
.auth-brand-mark { width: 47px; height: 47px; display: grid; place-items: center; border-radius: 15px; background: var(--pine); box-shadow: 0 7px 16px rgba(18,59,49,.16); }
.auth-brand-mark svg { width: 29px; height: 29px; fill: none; stroke: var(--amber); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.auth-brand-mark svg path:last-child { stroke: #fff; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { color: var(--pine); font-size: 16px; }
.auth-brand small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.auth-heading { padding: 23px 0 8px; }
.auth-eyebrow { color: #b27821; font-size: 9px; font-weight: 700; }
.auth-heading h1 { margin: 4px 0 0; color: var(--ink); font-size: 21px; line-height: 1.5; }
.auth-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.auth-form { display: grid; gap: 13px; padding-top: 10px; }
.auth-field { display: grid; gap: 6px; color: #42534a; font-size: 10px; font-weight: 700; }
.auth-field input { width: 100%; min-height: 43px; padding: 0 12px; color: var(--ink); background: #fbfcfb; border: 1px solid #e2e9e4; border-radius: 9px; outline: none; font-size: 12px; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.auth-field input:focus { border-color: #78a48d; box-shadow: 0 0 0 3px rgba(46,109,89,.1); }
.auth-field input::placeholder { color: #a4afa8; }
.auth-submit { min-height: 45px; margin-top: 3px; font-size: 12px; }
.auth-submit:disabled { opacity: .7; cursor: progress; }
.auth-error { padding: 10px 12px; color: #8d3632; background: #fff0ee; border: 1px solid #f4d9d6; border-radius: 9px; font-size: 10px; line-height: 1.8; }
.data-integrity-warning { margin: 0 0 16px; font-size: 11px; }
.auth-note { margin: 14px 0 0; color: #7f6a3d; font-size: 9px; line-height: 1.9; }
.auth-footer { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-top: 14px; color: #829087; border-top: 1px solid #eef1ee; font-size: 9px; }
.auth-footer .storage-dot { width: 6px; height: 6px; }

@media (max-width: 640px) {
  .session-copy { display: none; }
  .session-chip .avatar { display: grid; width: 29px; height: 29px; font-size: 10px; }
  .topbar-actions { gap: 7px; }
  .logout-button { min-height: 30px !important; padding-inline: 8px !important; }
  .auth-screen { min-height: 100svh; padding: 18px 13px; }
  .auth-card { padding: 22px 19px; border-radius: 16px; }
  .auth-brand strong { font-size: 14px; }
  .auth-heading h1 { font-size: 19px; }
}


/* الاتصال بقاعدة المتجر المشتركة */
.cloud-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; color: #416a55; background: #eff7f1; border: 1px solid #e1eee4; border-radius: 20px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.cloud-indicator { width: 7px; height: 7px; flex: 0 0 auto; background: #57a875; border-radius: 50%; box-shadow: 0 0 0 3px rgba(87,168,117,.12); }
.cloud-chip[data-status="connecting"], .cloud-chip[data-status="syncing"] { color: #906516; background: #fff8e9; border-color: #f3e7c8; }
.cloud-chip[data-status="connecting"] .cloud-indicator, .cloud-chip[data-status="syncing"] .cloud-indicator { background: #d5a239; box-shadow: 0 0 0 3px rgba(213,162,57,.12); }
.cloud-chip[data-status="offline"] { color: #a3413c; background: #fff2f0; border-color: #f3d8d5; }
.cloud-chip[data-status="offline"] .cloud-indicator { background: #c9534e; box-shadow: 0 0 0 3px rgba(201,83,78,.12); }
.cloud-warning { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; padding: 12px 14px; color: #7c5632; background: #fff7e8; border: 1px solid #f0dfbd; border-radius: 11px; font-size: 10px; }
.cloud-warning strong { color: #75451d; }
.app-shell.is-saving { cursor: progress; }
.app-shell.is-saving .content { opacity: .72; pointer-events: none; }
@media (max-width: 640px) {
  .cloud-chip { width: 29px; min-height: 29px; justify-content: center; padding: 0; }
  .cloud-chip [data-cloud-label] { display: none; }
  .date-chip { display: none; }
}


/* تثبيت بقالتي كتطبيق ويب */
.pwa-install-button {
  position: fixed;
  z-index: 25;
  inset-inline-start: 18px;
  bottom: 18px;
  min-height: 42px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(18, 59, 49, .2);
}
.pwa-install-symbol { font: 18px/1 'Segoe UI', sans-serif; }
@media (max-width: 640px) {
  .pwa-install-button { inset-inline-start: 12px; bottom: 64px; min-height: 40px; padding-inline: 12px; font-size: 10px; }
}
@media print {
  .pwa-install-button { display: none !important; }
}
