/* ==========================================================================
   AAJ — application shell & theme (v17)
   Loaded AFTER app.css. Gives the whole program the "Abu Ali Jewellery"
   look: right-hand sidebar, white top bar with section tabs, soft cards,
   gold accents and cream table headers. Page-specific rules stay in
   app.css / shop.css; this file only re-skins and adds the new shell.
   ========================================================================== */

@font-face{font-family:"Tajawal";font-weight:400 500;font-display:swap;src:url("fonts/Tajawal-Regular.d11e9f3094b8.ttf") format("truetype")}
@font-face{font-family:"Tajawal";font-weight:600 800;font-display:swap;src:url("fonts/Tajawal-Bold.ef7c3dc2a2b8.ttf") format("truetype")}

:root{
  --navy:#2b2a27;
  --navy-2:#3a3832;
  --gold:#c9a24b;
  --gold-dark:#b48a33;
  --gold-soft:#f8f0dc;
  --cream:#fbf1db;
  --bg:#f3f4f7;
  --card:#fff;
  --text:#23232a;
  --muted:#6b7080;
  --border:#ebedf1;
  --radius:14px;
  --radius-lg:18px;
    --shadow-card:0 1px 2px rgba(25,28,40,.04),0 4px 14px rgba(25,28,40,.03);
  --font-ui:"Tajawal","Segoe UI",system-ui,-apple-system,Tahoma,Arial,sans-serif;
  --content-max:none;
}
body{background:var(--bg);font-family:var(--font-ui);color:var(--text)}

/* ------------------------------------------------------------ shell
   One integrated frame: a fixed full-height sidebar (logo on top) and a fixed
   header that starts where the sidebar ends. Same white surface, same hairline,
   so they read as a single piece. Content is the only thing that scrolls. */
:root{--sb-w:240px;--sb-w-min:72px;--hdr-h:72px;--hairline:#eceef3;--sb-ease:.26s cubic-bezier(.4,0,.2,1)}
html.sb-collapsed{--sb-w:var(--sb-w-min)}
.app-shell{min-height:100vh}
.app-main{min-width:0;margin-inline-start:var(--sb-w);transition:margin-inline-start var(--sb-ease)}
.app-shell.anon .app-main{margin-inline-start:0}
.container{max-width:1800px;padding:16px 24px calc(var(--mobilebar-h) + var(--safe-b) + 32px)}

/* sidebar */
.app-sidebar{
  position:fixed;inset-block:0;inset-inline-start:0;z-index:40;width:var(--sb-w);
  display:flex;flex-direction:column;background:#fff;border-inline-end:1px solid #f4f5f8;
  transition:width var(--sb-ease),transform var(--sb-ease);overflow:hidden;
}
.side-brand{display:flex;align-items:center;justify-content:center;gap:10px;height:var(--hdr-h);flex:none;padding:0 14px;text-decoration:none;overflow:hidden}
/* the one logo file is cut into emblem + wordmark so they can sit side by side and stay large inside 72px */
.brand-emblem,.brand-word{display:block;flex:none;background-image:url("shop_logo.d30dbcf0b445.png");background-repeat:no-repeat}
.brand-emblem{width:54px;height:64px;background-size:92px auto;background-position:center 0}
.brand-word{width:136px;height:40px;background-size:136px auto;background-position:center -101px}
.side-nav{display:flex;flex-direction:column;gap:2px;overflow-y:auto;overflow-x:hidden;padding:14px 12px;flex:1}
.side-link{
  position:relative;display:flex;align-items:center;gap:14px;height:46px;padding:0 14px;border-radius:10px;
  color:#3c3f4a;text-decoration:none;font-size:15px;font-weight:500;white-space:nowrap;
}
.side-link .ic{width:22px;height:22px;flex:none;color:#6d7280}
.side-link:hover{background:#f5f6f9;color:#23232a}
.side-link.active{color:var(--gold-dark);font-weight:700;background:#fbf5e6}
.side-link.active .ic{color:var(--gold)}
.side-link.active::before{content:"";position:absolute;inset-block:11px;inset-inline-start:5px;width:3px;background:var(--gold);border-radius:3px}

/* header */
.app-topbar{
  position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:12px;height:var(--hdr-h);
  background:#fff;border-bottom:1px solid var(--hairline);padding:0 20px;
}
.sb-toggle{display:inline-grid;place-items:center;width:44px;height:44px;border:0;border-radius:10px;background:transparent;color:#5a5e6b;cursor:pointer;flex:none;margin-inline-start:-8px}
.sb-toggle:hover{background:#f5f6f9;color:var(--gold-dark)}
.sb-toggle:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}
.sb-toggle .ic{width:22px;height:22px}
.sb-overlay{display:none}

.top-user{display:flex;align-items:center;gap:10px;margin-inline-start:auto}
.top-add{display:inline-flex;align-items:center;gap:6px;background:var(--gold);color:#fff;text-decoration:none;font-weight:700;font-size:14px;padding:9px 16px;border-radius:10px;white-space:nowrap}
.top-add:hover{background:var(--gold-dark);color:#fff}
.top-add .ic{width:16px;height:16px}

.notif-menu{position:relative}
.notif-menu summary{list-style:none;position:relative;display:grid;place-items:center;width:38px;height:38px;border-radius:10px;cursor:pointer;color:#5a5e6b}
.notif-menu summary::-webkit-details-marker{display:none}
.notif-menu summary:hover,.notif-menu[open] summary{background:var(--bg);color:var(--gold-dark)}
.notif-menu summary .ic{width:20px;height:20px}
.notif-badge{position:absolute;top:2px;inset-inline-end:1px;min-width:16px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:999px;background:var(--red,#b3261e);color:#fff;font-size:10px;font-weight:700;line-height:16px;text-align:center}
.notif-pop{position:absolute;inset-inline-end:0;top:calc(100% + 8px);width:300px;max-width:calc(100vw - 24px);max-height:70vh;overflow:auto;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 10px 30px rgba(25,28,40,.14);padding:6px;z-index:40}
.notif-title{padding:6px 10px 8px;font-size:13px;font-weight:600;border-bottom:1px solid var(--hairline);margin-bottom:4px}
.notif-item{display:grid;gap:1px;padding:8px 10px;border-radius:8px;text-decoration:none;color:var(--text);font-size:13px}
.notif-item:hover{background:var(--bg)}
.notif-item b{font-weight:600}
.notif-item span{color:#8a5f10;font-size:12px}
.notif-item small{color:var(--muted);font-size:11px}
.notif-empty{padding:12px 10px;color:var(--muted);font-size:12px;text-align:center}
@media(max-width:959.98px){.notif-pop{position:fixed;inset-inline:12px;top:calc(var(--hdr-h) + 6px);width:auto;max-width:none}}
.user-menu{position:relative}
.user-menu summary{list-style:none;display:flex;align-items:center;gap:10px;cursor:pointer;padding:4px 6px;border-radius:12px}
.user-menu summary::-webkit-details-marker{display:none}
.user-menu summary:hover{background:var(--bg)}
.user-menu summary .ic{width:16px;height:16px;color:var(--muted)}
.user-avatar{width:40px;height:40px;border-radius:50%;background:var(--gold-soft);color:var(--gold-dark);display:grid;place-items:center;font-weight:700;font-size:14px;flex:none}
.user-meta{display:none;flex-direction:column;line-height:1.25}
.user-meta b{font-size:14px;font-weight:700}
.user-meta small{font-size:12px;color:#6b7080}
.user-pop{position:absolute;inset-inline-end:0;top:calc(100% + 8px);min-width:190px;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 10px 30px rgba(25,28,40,.14);padding:6px;display:flex;flex-direction:column;gap:2px;z-index:50}
.user-pop a,.user-pop button,.user-pop .linkbtn{display:block;width:100%;text-align:start;padding:10px 12px;border-radius:8px;background:none;border:0;font:inherit;font-size:14px;color:var(--text);text-decoration:none;cursor:pointer}
.user-pop a:hover,.user-pop button:hover{background:var(--bg);color:var(--text)}
.user-pop form{margin:0}
.user-pop .logout-top{color:var(--red)}
.user-pop #aajLangSwitch{border:0;border-radius:8px;padding:10px 12px;font-size:14px;color:var(--text)}
.user-pop #aajLangSwitch:hover{background:var(--bg);color:var(--text)}

@media(min-width:960px){
  .user-meta{display:flex}
  .mobilebar{display:none}
  /* collapsed: icons only */
  html.sb-collapsed .side-brand{padding:0}
  html.sb-collapsed .side-brand .brand-word{display:none}
  html.sb-collapsed .side-nav{padding-inline:10px}
  html.sb-collapsed .side-link{justify-content:center;padding:0;gap:0}
  html.sb-collapsed .side-link > span{display:none}
  html.sb-collapsed .side-link.active::before{inset-inline-start:3px}
}

/* phones / small tablets: the sidebar becomes a drawer over the content */
@media(max-width:959.98px){
  .app-main{margin-inline-start:0}
  .app-sidebar{width:84vw;max-width:420px;transform:translateX(100%);box-shadow:none}
  html[dir=ltr] .app-sidebar{transform:translateX(-100%)}
  body.sb-open .app-sidebar{transform:none;box-shadow:0 0 40px rgba(20,22,30,.25)}
  .sb-overlay{display:block;position:fixed;inset:0;z-index:35;background:rgba(20,22,30,.42);opacity:0;pointer-events:none;transition:opacity var(--sb-ease)}
  body.sb-open .sb-overlay{opacity:1;pointer-events:auto}
  .app-topbar{padding:0 12px}
  .container{padding:12px 12px calc(var(--mobilebar-h) + var(--safe-b) + 32px)}
  .top-add span{display:none}
  .top-add{padding:10px}
}
@media(prefers-reduced-motion:reduce){.app-sidebar,.app-main,.sb-overlay{transition:none}}

/* ------------------------------------------------------------ page heading */
.shop-head,.section-head{margin:14px 0 14px}
.shop-head h1,.section-head h1,.page-title h1{font-size:26px;font-weight:800;color:var(--text);letter-spacing:0}
.shop-head p,.section-head p,.page-title p{color:var(--muted);font-size:13px}

/* ------------------------------------------------------------ cards */
.card,.dash-card,.info-card,.upload-card,.login-card,.shop-card,.shop-kpi,.shop-tile{
  border-color:var(--border);border-radius:var(--radius);box-shadow:var(--shadow-card);
}
.shop-card{padding:22px}
.shop-card > h2{font-size:18px;font-weight:800;margin:0 0 4px}
.shop-card > .sub{margin:0 0 16px;color:var(--muted);font-size:12.5px}
.hero,.dashboard-hero{background:#fff;color:var(--text);border:1px solid var(--border);box-shadow:var(--shadow-card);border-inline-start:5px solid var(--gold)}
.hero p,.dashboard-hero p{color:var(--muted)}

/* KPI cards (label on top, big number, unit next to it) */
.shop-kpis{gap:14px;margin-bottom:16px}
.shop-kpi{padding:18px 22px;display:flex;flex-direction:column;gap:2px}
.shop-kpi small{font-size:13.5px;color:#6b7080;font-weight:500}
.shop-kpi strong{font-size:28px;font-weight:800;line-height:1.25;letter-spacing:.2px}
.shop-kpi em{font-size:12px;color:var(--muted)}
.shop-kpi.gold{border-top:1px solid var(--border)}
.shop-kpi .kpi-row{display:flex;align-items:baseline;justify-content:space-between;gap:10px;direction:ltr}
.shop-kpi .kpi-row em{order:-1}
html[dir=rtl] .shop-kpi .kpi-row{direction:ltr}
.shop-kpi.kpi-stat{text-align:end}

/* ------------------------------------------------------------ tables */
.shop-table-wrap,.table-wrap,.invoice-table-shell{border-color:var(--border);border-radius:var(--radius);box-shadow:var(--shadow-card)}
th,.shop-table th{background:var(--cream);color:#2e2a1f;font-size:12.5px;font-weight:700;border-bottom:1px solid #f0e3c2}
.shop-table th,.shop-table td{padding:14px 12px;text-align:center}
.shop-table th:first-child,.shop-table td:first-child{border-start-start-radius:0}
.shop-table tbody tr:nth-child(even){background:#fff}
.shop-table tbody tr:hover{background:#fdfaf2}
.shop-table td{font-size:13.5px;color:#30323b}
.shop-table td.num,.shop-table th.num{text-align:center}
.shop-table tfoot td{background:var(--cream);border-top:1px solid #f0e3c2;font-weight:800}
tbody tr:hover td{background:transparent}

/* the table "card" in the new layout: title, search and count above the grid */
.table-card{background:#fff;border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-card);padding:20px 22px}
.table-card .shop-table-wrap{border:0;box-shadow:none;margin:0;overflow-x:auto}
.table-card .shop-table th:first-child{border-radius:0 10px 10px 0}
.table-card .shop-table th:last-child{border-radius:10px 0 0 10px}
html[dir=ltr] .table-card .shop-table th:first-child{border-radius:10px 0 0 10px}
html[dir=ltr] .table-card .shop-table th:last-child{border-radius:0 10px 10px 0}
.table-card .shop-table th{border-bottom:0}
.table-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.table-head h2{margin:0;font-size:20px;font-weight:800}
.table-head .count{color:var(--muted);font-size:13px}
.table-search{position:relative;flex:1 1 280px;max-width:380px}
.table-search input{width:100%;padding:11px 42px 11px 14px;border:1px solid var(--border);border-radius:10px;font:inherit;font-size:13.5px;background:#fff}
html[dir=ltr] .table-search input{padding:11px 14px 11px 42px}
.table-search .ic{position:absolute;inset-inline-start:auto;inset-inline-end:14px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--muted);pointer-events:none}
.table-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:14px;padding:12px 16px;border-radius:10px;background:var(--cream);font-size:14px;font-weight:700}
.table-foot span b{font-weight:800}
.table-foot .sep{display:none}
.table-note{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:16px;color:var(--muted);font-size:12.5px}

/* row action icons (view / delete) */
.icon-actions{display:inline-flex;gap:8px;align-items:center;justify-content:center}
.icon-actions form{margin:0}
.icon-btn{width:34px;height:34px;border:1px solid var(--border);border-radius:9px;background:#fff;color:#5d6270;display:inline-grid;place-items:center;cursor:pointer;text-decoration:none;padding:0}
.icon-btn:hover{border-color:var(--gold);color:var(--gold-dark);background:var(--gold-soft)}
.icon-btn.danger:hover{border-color:#e7b5ae;color:var(--red);background:var(--red-bg)}
.icon-btn .ic{width:16px;height:16px}
.shop-table .row-actions .linkbtn{color:inherit}
.cell-muted{color:#a2a6b2}

/* ------------------------------------------------------------ buttons & forms */
.btn,.top-add{border-radius:10px}
.btn{background:var(--gold);color:#fff;box-shadow:0 2px 8px rgba(201,162,75,.28)}
.btn:hover{background:var(--gold-dark);color:#fff}
.secondary{background:#fff;color:var(--text);border:1px solid var(--border)}
.secondary:hover{background:var(--bg)}
.btn.wide{min-height:50px;font-size:16px}
.topbar .primary,.filter-reset{border-radius:10px}

.shop-form label{font-size:13px;font-weight:500;color:#3a3d48;gap:7px}
.shop-form label span{font-weight:500}
.shop-form input:not([type=checkbox]):not([type=radio]),.shop-form select,.shop-form textarea,
.shop-filters input,.shop-filters select,.shop-daynav input,
.form-grid input,.form-grid select,.form-grid textarea{
  border:1px solid #e3e6ec;border-radius:10px;background:#fff;padding:12px 14px;font:inherit;font-size:14px;color:var(--text);
}
.shop-form input:focus,.shop-form select:focus,.shop-form textarea:focus,.form-grid input:focus,.form-grid select:focus{
  outline:0;border-color:var(--gold);box-shadow:0 0 0 3px rgba(201,162,75,.18)
}
.shop-form input[type=number]{text-align:end}
.shop-form{gap:14px}
.field-karat input,.field-total_weight input,.field-total_amount input{direction:ltr;text-align:end}

/* segmented choice (بدل / سكراب) */
.kind-choice{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:0}
.kind-choice-label{font-size:13px;font-weight:500;color:#3a3d48;margin-bottom:8px;display:block}
.kind-opt{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:12px 10px;border:1px solid #e3e6ec;border-radius:10px;font-weight:700;font-size:15px;cursor:pointer;text-align:center;background:#fff}
.kind-opt input{position:absolute;opacity:0;pointer-events:none}
.kind-opt small{font-weight:400;font-size:11px;color:var(--muted)}
.kind-opt:hover{border-color:var(--gold)}
.kind-opt:has(input:checked){border-color:var(--gold);background:var(--gold-soft);box-shadow:0 0 0 1px var(--gold) inset}
.kind-opt:has(input:focus-visible){box-shadow:0 0 0 3px rgba(201,162,75,.3)}

/* day navigation: ‹ [date] › */
.shop-daynav{gap:8px;flex-wrap:nowrap}
.shop-daynav a.secondary{width:42px;min-height:42px;padding:0;border-radius:10px}
.shop-daynav input{min-width:176px;text-align:center;height:42px}

/* ------------------------------------------------------------ sub tabs, tags, pills, messages */
.shop-tabs{background:transparent;border:0;padding:0;margin:8px 0 6px;gap:8px}
.shop-tabs a{background:#fff;border:1px solid var(--border);border-radius:10px;color:var(--text);font-weight:500;padding:9px 16px}
.shop-tabs a:hover{border-color:var(--gold);color:var(--gold-dark)}
.shop-tabs a.active{background:var(--gold-soft);border-color:var(--gold);color:#2a2418;font-weight:700}
.tag{font-weight:500;font-size:13px;background:none;padding:0;border-radius:0;color:#30323b}
.tag.in,.tag.out{background:none;color:#30323b}
.msg{border-radius:12px;border:1px solid var(--border);background:#fff;box-shadow:var(--shadow-card)}
.msg.success{background:var(--green-bg);border-color:#cfe9dd}
.msg.warning{background:var(--amber-bg);border-color:#f0d49a}
.msg.error{background:var(--red-bg);border-color:#f3c2bd}
.pill,.confidence{background:var(--bg)}

/* links that were navy */
.invoice-no-link,.supplier-name-link,.section-head a:not(.btn){color:#2a2418}
a{color:var(--gold-dark)}

/* ------------------------------------------------------------ scrap day page (compact, table-first) */
.scrap-page{--label:#4a4e5c;--soft:#6b7080}
.scrap-head{display:flex;align-items:center;flex-wrap:wrap;gap:6px 18px;margin:4px 0 12px}
.scrap-head h1{margin:0;font-size:24px;font-weight:800}
.scrap-head h1 .dash{color:#a2a6b2;font-weight:500;margin-inline:6px}
.scrap-head h1 .date{color:var(--gold-dark);font-variant-numeric:tabular-nums}
.scrap-head .shop-daynav{gap:6px}
.scrap-head .shop-daynav a.secondary{width:38px;min-height:38px;border-radius:9px}
.scrap-head .shop-daynav input{height:38px;min-width:150px;padding:6px 10px;font-size:14px}
.scrap-page .shop-tabs{margin:0 0 10px}
.scrap-page .shop-tabs a{padding:7px 14px;font-size:14px}

.scrap-kpis{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:12px}
@media(min-width:900px){.scrap-kpis{grid-template-columns:repeat(4,1fr)}}
.scrap-kpi{background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow-card);padding:10px 16px}
.scrap-kpi small{display:block;font-size:13px;color:var(--soft);font-weight:600;margin:0 0 2px}
.scrap-kpi .val{display:flex;align-items:baseline;gap:8px}
.scrap-kpi .val strong{font-size:23px;font-weight:800;line-height:1.2;font-variant-numeric:tabular-nums;color:#1c1d24}
.kpi-unit{font-size:12.5px;color:var(--soft);font-weight:600;white-space:nowrap}

/* quick-entry card */
.scrap-form{padding:14px 18px 16px;margin-bottom:12px}
.scrap-form-head{display:flex;align-items:baseline;gap:12px;margin:0 0 10px}
.scrap-form-head h2{margin:0;font-size:17px;font-weight:800}
.scrap-form-head .sub{margin:0;color:var(--soft);font-size:13px}
.scrap-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:10px 12px;align-items:end}
.scrap-grid > *{grid-column:span 12}
@media(min-width:640px){
  .scrap-grid > .f-inv,.scrap-grid > .f-name,.scrap-grid > .f-cpr,.scrap-grid > .f-karat{grid-column:span 6}
  .scrap-grid > .f-weight,.scrap-grid > .f-price,.scrap-grid > .f-amount{grid-column:span 4}
  .scrap-grid > .f-kind{grid-column:span 12}
  .scrap-grid > .f-notes{grid-column:span 8}
  .scrap-grid > .f-save{grid-column:span 4}
}
@media(min-width:1100px){
  .scrap-grid > .f-inv,.scrap-grid > .f-name,.scrap-grid > .f-cpr{grid-column:span 3}
  .scrap-grid > .f-karat{grid-column:span 3}
  .scrap-grid > .f-weight,.scrap-grid > .f-price{grid-column:span 2}
  .scrap-grid > .f-amount{grid-column:span 3}
  .scrap-grid > .f-kind{grid-column:span 3}   /* sits in the 4th slot of the first row, before the karat rows */
  .scrap-grid > .f-notes{grid-column:span 9}
  .scrap-grid > .f-save{grid-column:span 3}
}
.scrap-grid label{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:600;color:var(--label)}
.scrap-grid label > small.help{display:none}
.scrap-grid input:not([type=radio]){width:100%;height:44px;padding:0 12px;font-size:15px}
.scrap-grid input:not([type=radio]){border:1px solid #dfe3ea;border-radius:10px;background:#fff;font:inherit;font-size:15px;color:var(--text)}
.scrap-grid input:not([type=radio]):focus{outline:0;border-color:var(--gold);box-shadow:0 0 0 3px rgba(201,162,75,.18)}
.scrap-grid input::placeholder{color:#9aa0ad}
.scrap-grid .field-error{color:var(--red);font-weight:600;font-size:12.5px}
.f-save .btn{width:100%;height:44px;min-height:44px;font-size:16px}

/* type choice (scrap / exchange): a small segmented selector. Its selected state is a soft pale-gold tint, so the strong
   solid-gold "Save" button stays the one primary action. */
.f-kind .kind-choice-label{font-size:13px;font-weight:600;color:var(--label);margin-bottom:5px}
.f-kind .kind-choice{display:inline-flex;gap:0;border:1px solid #dfe3ea;border-radius:10px;overflow:hidden;background:#fff;width:max-content;max-width:100%}
.f-kind .kind-opt{flex:none;white-space:nowrap;height:38px;flex-direction:row;gap:6px;padding:0 14px;border:0;border-radius:0;font-size:14px;background:transparent;box-shadow:none}
.f-kind .kind-opt + .kind-opt{border-inline-start:1px solid #dfe3ea}
.f-kind .kind-opt > span{font-size:14px;font-weight:700;color:#2b2d36}
.f-kind .kind-opt small{font-size:11.5px;color:var(--soft);font-weight:500;white-space:nowrap}
.f-kind .kind-opt:has(input:checked){background:#faf3df;box-shadow:inset 0 0 0 1.5px var(--gold)}
.f-kind .kind-opt:has(input:checked) > span{color:#2b2d36}
.f-kind .kind-opt:has(input:checked) small{color:#7a5d1f}
.f-kind .kind-opt:has(input:checked)::before{content:"✓";font-weight:800;font-size:12px;color:var(--gold-dark,#a9843b)}
@media(min-width:1100px) and (max-width:1599px){.f-kind .kind-opt small{display:none}}   /* narrow cell: keep the selector compact */
@media(max-width:700px){.f-kind .kind-choice{display:flex;width:100%}.f-kind .kind-opt{flex:1;justify-content:center;padding:0 8px}}

/* old gold purchase: karat rows (karat | weight | amount paid | gram rate | remove) with totals under their own columns */
.scrap-grid > .f-lines{grid-column:1/-1}
.gl{display:grid;gap:6px;padding:10px 12px;background:#fcfaf4;border:1px solid #ece4cf;border-radius:8px}
.gl-row{display:grid;grid-template-columns:minmax(70px,.7fr) minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr) 44px;gap:10px;align-items:start}
.gl-head{font-size:13px;font-weight:600;color:var(--label);align-items:end}
.gl-cell{display:flex;flex-direction:column;gap:4px;min-width:0}
.gl-cell::before{display:none}
.gl input:not([type=checkbox]):not([type=hidden]){width:100%;height:44px;padding:0 12px;font:inherit;font-size:15px;color:var(--text);border:1px solid #dfe3ea;border-radius:10px;background:#fff}
.gl input:not([type=checkbox]):not([type=hidden]):focus{outline:0;border-color:var(--gold);box-shadow:0 0 0 3px rgba(201,162,75,.18)}
.gl input.gl-rate[readonly]:not([type=checkbox]):not([type=hidden]){background:#f3f4f7;color:var(--soft);border-style:dashed;cursor:not-allowed;font-weight:600}
.gl-delete-flag{display:none}
.gl-del{align-items:center;justify-content:flex-start;min-height:44px}
.gl-remove{width:36px;height:36px}
.gl-line.gl-single .gl-remove{visibility:hidden}
.gl-removed{display:none}
.gl-rowerr{grid-column:1/-1}
.gl-total{border-top:1px solid #e6dfca;padding-top:6px;align-items:center}
.gl-t{display:block;min-width:0;padding-inline:12px}   /* same inline padding as the inputs: each number sits under its own field's text */
.gl-t b{font-size:16px;font-weight:800;direction:ltr;unicode-bidi:isolate;display:block;text-align:start;font-variant-numeric:tabular-nums}
html[dir="rtl"] .gl-t b{text-align:right}
.gl-t-title{padding-inline:0;font-size:13px;font-weight:700;color:var(--label)}
.gl-add{justify-self:start;border:1px dashed var(--gold);background:#fff;color:#7a5d1f;border-radius:10px;height:38px;padding:0 16px;font:inherit;font-size:14px;font-weight:700;cursor:pointer}
.gl-add:hover{background:#faf3df}
@media(max-width:700px){
  .gl-head{display:none}
  .gl-line{grid-template-columns:1fr 1fr;gap:8px;padding:10px;border:1px solid #e8ebf0;border-radius:10px;background:#fcfcfd;position:relative}
  .gl-line .gl-cell::before{display:block;content:attr(data-label-ar);font-size:12px;font-weight:600;color:var(--label)}
  html[lang="en"] .gl-line .gl-cell::before{content:attr(data-label-en)}
  .gl-line .gl-del{position:absolute;inset-block-start:-9px;inset-inline-end:-7px;min-height:0}
  .gl-line .gl-remove{width:26px;height:26px;background:#fff}
  .gl-line .gl-del::before{display:none!important}
  .gl-total{grid-template-columns:repeat(3,minmax(0,1fr))}
  .gl-total .gl-t{padding-inline:4px}
  .gl-total .gl-t[data-label-ar]::before{display:block;content:attr(data-label-ar);font-size:11.5px;font-weight:600;color:var(--label)}
  html[lang="en"] .gl-total .gl-t[data-label-ar]::before{content:attr(data-label-en)}
  .gl-total .gl-t-title,.gl-total > span:last-child{display:none}
}

/* table first */
.scrap-page .table-card{padding:14px 18px}
.scrap-page .table-head{margin-bottom:10px}
.scrap-page .table-head h2{font-size:18px}
.scrap-page .table-head .count{color:var(--soft);font-size:13.5px;font-weight:600}
.scrap-page .table-search input{padding-block:9px;font-size:14px}
.scrap-page .shop-table th{font-size:13.5px;padding:11px 10px}
.scrap-page .shop-table td{font-size:15px;padding:10px;color:#23252d}
.scrap-page .shop-table td.num{font-variant-numeric:tabular-nums}
.scrap-page .cell-muted{color:#8f94a1}
.scrap-page .table-foot{margin-top:10px;padding:10px 16px;font-size:15px}
.scrap-page .table-note{margin-top:10px;color:var(--soft);font-size:13px}
.scrap-page .tag{font-size:14px;font-weight:600}

/* ------------------------------------------------------------ sales + stock pages: same compact, table-first treatment */
.page-compact{--label:#4a4e5c;--soft:#6b7080}
.page-compact .shop-head{margin:4px 0 12px;align-items:center}
.page-compact .shop-head h1{font-size:24px}
.page-compact .shop-head p{color:var(--soft);font-size:13.5px}
.page-compact .shop-head h2{font-size:18px}
.page-compact .scrap-head{margin-top:4px}
.page-compact .shop-kpis{gap:10px;margin-bottom:12px}
.page-compact .shop-kpi{padding:10px 16px;gap:0}
.page-compact .shop-kpi small{font-size:13px;color:var(--soft);font-weight:600}
.page-compact .shop-kpi strong{font-size:23px;line-height:1.25;margin-top:0}
.page-compact .shop-kpi em{font-size:12.5px;color:var(--soft);font-weight:600}
.page-compact .shop-card{padding:14px 18px;margin-bottom:12px}
.page-compact .shop-card > h2{font-size:17px;margin:0 0 10px}
.page-compact .shop-form{gap:10px 12px}
.page-compact .shop-form label,.page-compact .shop-filters label{font-size:13px;font-weight:600;color:var(--label);gap:5px}
.page-compact .shop-form label > span,.page-compact .shop-filters label > span{font-weight:600;color:var(--label)}
.page-compact .shop-form input:not([type=checkbox]):not([type=radio]),.page-compact .shop-form select,
.page-compact .shop-filters input,.page-compact .shop-filters select{height:42px;padding:0 12px;font-size:15px}
.page-compact .shop-form textarea{padding:10px 12px;font-size:15px}
.page-compact .shop-form .help,.page-compact .help{color:var(--soft);font-size:12.5px}
.page-compact .shop-filters{gap:10px 12px}
.page-compact .shop-filters .actions .btn{height:42px;min-height:42px}
.page-compact .shop-table th{font-size:13.5px;padding:11px 10px}
.page-compact .shop-table td{font-size:15px;padding:10px;color:#23252d}
.page-compact .shop-table .muted,.page-compact .muted{color:#7d8291}
.page-compact .lines-table input,.page-compact .lines-table select{height:40px;padding:0 10px;font-size:15px}
.page-compact .lines-table td{padding:8px}
.page-compact .shop-table-wrap{margin-bottom:12px}
.page-compact .shop-alert{padding:10px 14px;margin-bottom:10px;font-size:14px}
.page-compact .submit-row{margin-top:10px}
.page-compact .submit-row .btn{height:44px;min-height:44px;font-size:16px}

/* dashboard / other pages: soften the old navy */
.dash-card strong,.card strong{font-weight:800}
.card.tax-card{border-inline-start-color:var(--gold)}

@media print{
  .app-sidebar,.app-topbar,.sb-overlay,.mobilebar{display:none!important}
  .app-main{margin:0}
  body{background:#fff}
}

input::placeholder,textarea::placeholder{color:#b4b8c3;font-weight:400}
.scrap-form .row-3{align-items:end}
.kind-opt,.kind-opt span{color:var(--text)}
.kind-opt > span{font-size:15px;font-weight:700}

/* dashboard banner: light card with a gold edge like the rest of the app */
.ops-hero-v10{background:#fff;color:var(--text);border:1px solid var(--border);border-inline-start:5px solid var(--gold);box-shadow:var(--shadow-card)}
.ops-hero-v10:after{background:rgba(201,162,75,.10)}
.ops-hero-v10 p{color:var(--muted)}
.ops-eyebrow-v10{background:var(--gold-soft);border-color:#eedcae;color:var(--gold-dark)}
.shop-filters input:focus,.shop-filters select:focus,.lines-table input:focus,.lines-table select:focus{outline:0;border-color:var(--gold);box-shadow:0 0 0 3px rgba(201,162,75,.18)}

/* sales invoice lines: plain header (same colour as the card), small add-piece button at the edge */
.lines-table thead th{background:transparent;color:#4a4e5c;border-bottom:1px solid var(--border)}
.lines-table tfoot td{background:transparent;border-top:1px solid var(--border);padding:8px 10px;font-weight:700}
.lines-table tfoot td:first-child{text-align:start}
.lines-table #addLine{min-height:36px;padding:6px 14px;font-size:14px;border-radius:9px;display:inline-flex}

/* ---- review fixes ---- */
/* button labels inside cards were picking up the small grey ".card span" style */
.btn span,.secondary span{color:inherit;font-size:inherit;font-weight:inherit;display:inline;margin:0}
/* checkboxes in form grids (employees, suppliers) stay checkbox-sized */
.form-grid input[type=checkbox]{width:20px;height:20px;min-height:0;padding:0;border-radius:5px;accent-color:var(--gold);align-self:flex-start}
/* fixed bars must start where the sidebar ends instead of running underneath it */
@media(min-width:960px){
  html[dir=rtl] .review-actionbar-v3{right:var(--sb-w);left:0}
  html[dir=ltr] .review-actionbar-v3{left:var(--sb-w);right:0}
  html[dir=rtl] .bulk-float-v131{left:calc(50% - var(--sb-w) / 2)}
  html[dir=ltr] .bulk-float-v131{left:calc(50% + var(--sb-w) / 2)}
  .review-actionbar-v3{transition:left var(--sb-ease),right var(--sb-ease)}
}

/* returns: the VAT month field was cut off on phones */
@media(max-width:820px){
  .rt-vat-strip-month{flex:1 1 100%;width:100%}
  .rt-vat-strip-month label{width:100%;justify-content:space-between;font-size:13px}
  .rt-vat-strip-month input{width:auto;flex:1 1 auto;min-width:180px;min-height:42px;padding:6px 10px;font-size:14px}
}

/* ---- sales day: one row = section tabs + title/date, and a single well-grouped invoice card ---- */
.shop-topline{display:flex;align-items:center;justify-content:space-between;gap:10px 24px;flex-wrap:wrap;margin:4px 0 12px}
.shop-topline .shop-tabs{margin:0}
.shop-topline .scrap-head{margin:0;flex-wrap:nowrap;gap:8px 14px}
.shop-topline .scrap-head h1{white-space:nowrap}
.invoice-body{background:#f8f9fb;border:1px solid var(--border);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:16px}
.invoice-body .shop-form{gap:12px 16px}
.invoice-body .shop-form input:not([type=checkbox]),.invoice-body .shop-form select{background:#fff}
.invoice-body .shop-table-wrap{margin:0;background:#fff}
.invoice-body .lines-table td{padding:10px 8px}
.invoice-body .lines-table th{padding:10px 8px}
.invoice-foot{display:flex;align-items:flex-end;gap:16px;margin-top:14px}
.invoice-foot .btn{flex:none;height:44px;min-height:44px;padding-inline:28px;font-size:16px}
.invoice-foot .invoice-notes{flex:1 1 auto;display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:600;color:var(--label,#4a4e5c)}
.invoice-foot .invoice-notes input{height:44px;width:100%;padding:0 12px;border:1px solid #dfe3ea;border-radius:10px;font:inherit;font-size:15px}
@media(max-width:700px){.invoice-foot{flex-direction:column;align-items:stretch}.shop-topline .scrap-head{flex-wrap:wrap}}
.page-compact #invoicePreview{margin-top:14px}

/* no up/down spinner arrows in number fields (prices, weights, quantities) */
input[type=number]{-moz-appearance:textfield;appearance:textfield}
input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;margin:0}

/* ---- shop home: three KPI cards and a balanced 2x2 grid of sections ---- */
.shop-kpis.cols-3{grid-template-columns:1fr}
.shop-home .shop-sections-grid{display:grid;grid-template-columns:1fr;gap:14px;align-items:stretch}
.shop-home .shop-sections-grid > .shop-card{display:flex;flex-direction:column;margin:0;height:100%}
.shop-home .shop-sections-grid .shop-tiles{flex:1;display:grid;grid-template-columns:1fr;grid-auto-rows:1fr;gap:10px}
.shop-home .shop-tile{padding:14px 16px;height:100%}
.shop-home .shop-tile span:not(.ic){color:#6b7080;font-size:13.5px}
.shop-home .shop-tile b{font-size:15.5px}
@media(min-width:760px){.shop-kpis.cols-3{grid-template-columns:repeat(3,1fr)}}
@media(min-width:900px){.shop-home .shop-sections-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ---------------------------------------------------------------- Report Center */
.rp{--label:#4a4e5c;--soft:#6b7080}
.rp-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:4px 0 12px}
.rp-title{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.rp-title h1{margin:0;font-size:24px;font-weight:800}
.rp-back{width:36px;height:36px;border:1px solid var(--border);border-radius:9px;background:#fff;display:inline-grid;place-items:center;text-decoration:none;color:var(--text);font-size:20px;line-height:1}
.rp-back:hover{border-color:var(--gold);color:var(--gold-dark)}
html[dir=ltr] .rp-back .arr{transform:scaleX(-1)}
.rp-period{color:var(--gold-dark);font-weight:700;font-variant-numeric:tabular-nums}
.rp-lead{color:var(--soft);margin:0 0 14px;font-size:14px}

.rp-filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 12px;padding:12px 16px;margin-bottom:12px}
.rp-f{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:600;color:var(--label);flex:1 1 130px;min-width:120px;max-width:220px}
.rp-f input,.rp-f select{height:40px;padding:0 10px;border:1px solid #dfe3ea;border-radius:10px;background:#fff;font:inherit;font-size:14px;color:var(--text);width:100%}
.rp-f input:focus,.rp-f select:focus{outline:0;border-color:var(--gold);box-shadow:0 0 0 3px rgba(201,162,75,.18)}
.rp-filter-actions{display:flex;gap:8px;margin-inline-start:auto}
.rp-filter-actions .btn,.rp-filter-actions .secondary{height:40px;min-height:40px;padding:0 18px;font-size:14px}

.rp-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-bottom:12px}
.rp-kpi{background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow-card);padding:10px 16px}
.rp-kpi small{display:block;font-size:13px;font-weight:600;color:var(--soft);margin-bottom:2px}
.rp-kpi .val{display:flex;align-items:baseline;gap:8px}
.rp-kpi strong{font-size:22px;font-weight:800;line-height:1.2;font-variant-numeric:tabular-nums;color:#1c1d24}
.rp-kpi.warn{border-color:#f0d49a;background:#fffaf0}

.rp-tabs{display:flex;gap:6px;overflow-x:auto;margin-bottom:10px;scrollbar-width:none}
.rp-tabs::-webkit-scrollbar{display:none}
.rp-tabs a{flex:0 0 auto;padding:9px 18px;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--text);text-decoration:none;font-weight:600;font-size:14px;white-space:nowrap}
.rp-tabs a:hover{border-color:var(--gold);color:var(--gold-dark)}
.rp-tabs a.active{background:var(--gold-soft);border-color:var(--gold);color:#2a2418;font-weight:800}
.rp-note{margin:0 0 10px;color:var(--soft);font-size:13.5px}
.rp-two{display:grid;grid-template-columns:1fr;gap:12px;align-items:start}
@media(min-width:1100px){.rp-two{grid-template-columns:repeat(2,minmax(0,1fr))}}
.rp-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.rp-chips a{padding:7px 14px;border:1px solid var(--border);border-radius:999px;background:#fff;color:var(--text);text-decoration:none;font-weight:600;font-size:13.5px}
.rp-chips a.on{background:var(--gold-soft);border-color:var(--gold);font-weight:800}
.rp-chips b{margin-inline-start:4px;font-variant-numeric:tabular-nums}
.rp-sort{color:inherit;text-decoration:none;white-space:nowrap}
.rp-sort::after{content:" ⇅";color:#b9a77a;font-size:11px}
.rp-sort.on.asc::after{content:" ▲";color:var(--gold-dark)}
.rp-sort.on.desc::after{content:" ▼";color:var(--gold-dark)}
.rp .shop-table td a{color:#2a2418}
.rp .shop-table td a:hover{color:var(--gold-dark)}

/* landing: 5 cards = 3 + 2 balanced (6-column grid), 2 cards = side by side */
.rp-cards{display:grid;grid-template-columns:1fr;gap:14px}
.rp-card{display:flex;flex-direction:column;gap:8px;background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow-card);padding:22px 24px;text-decoration:none;color:var(--text);min-height:190px;transition:border-color .15s,transform .15s}
.rp-card:hover{border-color:var(--gold);transform:translateY(-2px)}
.rp-card-ic{width:44px;height:44px;border-radius:12px;background:var(--gold-soft);color:var(--gold-dark);display:grid;place-items:center}
.rp-card-ic svg{width:24px;height:24px}
.rp-card h2{margin:6px 0 0;font-size:19px;font-weight:800}
.rp-card p{margin:0;color:var(--soft);font-size:14px;line-height:1.6;flex:1}
.rp-card-stat{align-self:flex-start;padding:5px 12px;border-radius:999px;background:var(--bg);font-weight:700;font-size:13px;color:#3c3f4a}
@media(min-width:700px){.rp-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:700px) and (max-width:1099.98px){.rp-cards .rp-card:last-child:nth-child(odd){grid-column:1/-1}}
@media(min-width:1100px){
  .rp-cards{grid-template-columns:repeat(6,minmax(0,1fr))}
  .rp-cards .rp-card{grid-column:span 2}
  .rp-cards .rp-card:nth-child(4),.rp-cards .rp-card:nth-child(5){grid-column:span 3}
  .rp-cards.n2 .rp-card{grid-column:span 3}
}
@media(max-width:699px){.rp-filter-actions{width:100%}.rp-filter-actions .btn,.rp-filter-actions .secondary{flex:1}.rp-f{max-width:none;flex-basis:calc(50% - 6px)}}
.rp-badge{font-style:normal;font-size:11.5px;font-weight:700;background:var(--gold-soft);color:var(--gold-dark);border-radius:999px;padding:1px 8px;margin-inline-start:4px}
.rp-scope{padding:8px 12px;border:1px solid #f0d49a;background:#fffaf0;border-radius:10px;color:#6b4300}
.rp-returned td{background:#fbf6f5}
.rp-returned td.num:not(:last-child){color:#a2a6b2}
.rp-orig{display:block;font-weight:500;font-size:11.5px;color:#8a8f9c;white-space:nowrap}
.rp-returned .tag.out{color:var(--red);font-weight:700}


/* ===== Employee profile + permissions ===== */
.emp-profile{display:grid;gap:16px}
.emp-section{padding:18px}
.emp-h{margin:0 0 10px;font-size:1.05rem}
.emp-hint{margin:0 0 10px;font-size:.88rem}
.emp-notes{display:block;margin-top:12px}
.emp-notes textarea{width:100%}
.emp-check{display:flex;gap:8px;align-items:center;margin-top:12px}
.emp-check input{width:auto}
.emp-role{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.emp-role select{max-width:260px}
.perm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.perm-group{border:1px solid var(--line,#eadfc6);border-radius:12px;padding:10px 12px;margin:0;min-width:0}
.perm-group legend{padding:0 6px;font-weight:700}
.perm-row{display:flex;gap:8px;align-items:flex-start;padding:4px 0;font-size:.9rem;line-height:1.4}
.perm-row input{width:auto;margin-top:3px;flex:none}
.emp-info{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px 16px;margin:0}
.emp-info dt{font-size:.78rem;color:var(--muted,#8a7b5a)}
.emp-info dd{margin:2px 0 0;font-weight:600}
.emp-actions,.emp-toggle{display:flex;gap:10px;flex-wrap:wrap;margin:0}
.emp-toggle{margin-top:4px}
.emp-search{display:flex;gap:8px;margin:0 0 12px;max-width:420px}
.emp-search input{flex:1}
@media (max-width:640px){.perm-grid{grid-template-columns:1fr}}
.emp-page{max-width:1000px;margin:0 auto;display:grid;gap:16px}
.emp-page .form-grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
.emp-info dd .pill{display:inline-block;width:auto}
.emp-toggle{margin:0}
.emp-page>*,.emp-profile{width:100%;max-width:none;margin-inline:0;box-sizing:border-box}.emp-section{max-width:none;margin:0}
.emp-page .form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}@media (max-width:700px){.emp-page .form-grid{grid-template-columns:1fr}}
.shop-kpis.cols-1{grid-template-columns:1fr}@media(min-width:760px){.shop-kpis.cols-1{grid-template-columns:minmax(0,1fr)}.shop-kpis.cols-2{grid-template-columns:repeat(2,1fr)}}
.shop-split.single{grid-template-columns:minmax(0,1fr)}

/* old gold daily table: totals are a real <tfoot>, each value directly under its own column */
.scrap-page #scrapTable tfoot td{background:var(--cream);border-top:1px solid #f0e3c2;font-size:15px;font-weight:800;padding:10px;color:#23252d}
.scrap-page #scrapTable tfoot td.num{font-variant-numeric:tabular-nums}

/* ------------------------------------------------------------ Settings group in the sidebar (Employees / Backups / Shop Details) */
.side-parent{width:100%;background:none;border:0;font:inherit;font-size:15px;font-weight:500;cursor:pointer;text-align:start}
.side-parent .chev{width:16px;height:16px;margin-inline-start:auto;flex:none;color:#8a8f9c;transition:transform .15s}
.side-group.open .side-parent .chev{transform:rotate(180deg)}
.side-sub{display:none;flex-direction:column;gap:2px;margin:2px 0 6px}
.side-group.open .side-sub{display:flex}
.side-sub-link{height:40px;font-size:14px;padding-inline-start:34px}
.side-sub-link .ic{width:18px;height:18px}
html.sb-collapsed .side-parent .chev{display:none}
html.sb-collapsed .side-sub{display:none!important}

/* ------------------------------------------------------------ language: never paint the Arabic first for an English user */
html.aaj-lang-pending body{visibility:hidden}

/* ------------------------------------------------------------ Shop home: denser section grid (3 / 2 / 1 per row, one section = one column) */
.shop-home .shop-sections-grid{grid-template-columns:1fr;gap:12px;align-items:start}
.shop-home .shop-sections-grid > .shop-card{display:block;height:auto;margin:0;padding:12px 14px 14px}
.shop-home .shop-sections-grid > .shop-card > h2{margin:0 0 8px;font-size:16px}
.shop-home .shop-sections-grid .shop-tiles{display:grid;grid-template-columns:1fr;grid-auto-rows:auto;gap:8px}
.shop-home .shop-tile{padding:10px 14px;height:auto}
@media(min-width:900px){.shop-home .shop-sections-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:1280px){.shop-home .shop-sections-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.shop-home .shop-sections-grid > .shop-card.span-2{grid-column:span 2}      /* opt-in only: never the default */

/* ------------------------------------------------------------ readability of small labels (one place, all pages) */
:root{--font-xs:13px;--muted:#5f6475;--label-soft:#4f5466}
.shop-filters label,.sales-filter label,.repair-filter label,.repair-grid label,.repair-find label,.repair-pay-fields label,
.pay-row .pay-f,.silver-fields label,.filter-field label,.reports-filter-grid label{font-size:13px;color:var(--label-soft);font-weight:600}
.repair-grid label.check,.repair-grid label.repair-check{color:var(--text)}
small.help,.shop-form small.help{font-size:12.5px;color:#5a5f72}
th{font-size:12.5px;color:#555a6c}
.shop-kpi small,.dash-label,.card span{color:var(--label-soft)}

/* ------------------------------------------------------------ phone mode (<= 767px): Invoices and Returns only.
   768px and wider (iPad, desktop) never see any of this. Which pages count as "phone pages" is decided by invoices/phone.py. */
.phone-nav,.phone-only-msg{display:none}
@media (max-width:767px){
  .app-sidebar,.sb-overlay,.sb-toggle,.mobilebar,.notif-menu,.top-add{display:none!important}
  .app-main{margin-inline-start:0}
  .app-topbar{padding:0 12px;gap:8px}
  .phone-nav{display:flex;align-items:center;gap:6px;min-width:0}
  .phone-nav a{padding:8px 12px;border-radius:10px;color:var(--text);text-decoration:none;font-size:14px;white-space:nowrap}
  .phone-nav a.active{background:#fbf5e6;color:var(--gold-dark);font-weight:700}
  .phone-nav .phone-brand{padding:6px 8px;font-weight:800;letter-spacing:.06em;color:var(--gold-dark)}
  .user-meta{display:none}
  .user-pop a[href="/admin/"]{display:none}          /* the Django admin is a desktop tool */
  .container{padding:12px 12px 32px}
  body.phone-blocked .container > *:not(.phone-only-msg){display:none!important}
  body.phone-blocked .phone-only-msg{display:flex;flex-direction:column;align-items:center;gap:16px;margin:56px auto 0;max-width:420px;padding:28px 22px;text-align:center;background:#fffdf9;border:1px solid #e6d9bd;border-radius:16px}
  body.phone-blocked .phone-only-msg p{margin:0;font-size:16px;line-height:1.7}
  body.phone-blocked .review-actionbar-v3{display:none!important}
}

/* sidebar Alerts count (filled by a small fetch after the page loads) */
.side-badge{margin-inline-start:auto;min-width:18px;height:18px;padding:0 5px;box-sizing:border-box;border-radius:999px;background:var(--red,#b3261e);color:#fff;font-size:11px;font-weight:700;line-height:18px;text-align:center}
.side-badge[hidden]{display:none}
