/* D Byk Hisab — styles. Plain CSS. */
:root {
  --ground: #F2F3F0; --surface: #FFFFFF; --ink: #16181C; --muted: #5B616B; --line: #E2E4E0; --line2: #ECEEEA;
  --blue: #1F4FD1; --blue-d: #163A9C; --blue-l: #E9EDF9; --orange: #B8420E; --orange-l: #FCE9DE; --orange-d: #9A3608;
  --green: #17663A; --green-l: #E3F1E8; --dark: #16181C;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.45; }
a { color: var(--blue); } a:hover { color: var(--blue-d); }
h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.01em; line-height: 1.2; }
h2 { font-size: 17px; margin: 0 0 10px; }
.hidden { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 13px; } .strong { font-weight: 600; } .caps { text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.mono { font-family: var(--mono); font-weight: 600; } .lg { font-size: 19px; } .xl2 { font-size: 24px; } .big { font-size: 32px; line-height: 1.15; }
.r { text-align: right; } .m0 { margin: 0; } .mt { margin-top: 14px; } .mt6 { margin-top: 6px; }
.good { color: var(--green); font-weight: 600; } .bad { color: #B42318; font-weight: 600; } .warn { color: var(--orange-d); font-weight: 600; } .out { color: var(--orange); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.view { padding-top: 22px; padding-bottom: 110px; outline: none; display: flex; flex-direction: column; gap: 16px; }
.view > h1 { margin-bottom: 0; }

/* header */
.top { background: var(--dark); color: #fff; position: sticky; top: 0; z-index: 20; }
.toprow { display: flex; align-items: center; gap: 8px 14px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand:hover { color: #fff; }
.brand.big { color: var(--ink); font-size: 22px; }
.logo { display: inline-flex; width: 30px; height: 30px; border-radius: 8px; background: var(--blue); color: #fff; align-items: center; justify-content: center; font-family: var(--mono); }
#topnav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1 1 auto; }
#topnav a { color: #C9CDD4; text-decoration: none; padding: 8px 9px; border-radius: 8px; font-size: 14px; }
#topnav a.on { background: #2C3038; color: #fff; font-weight: 600; }
#topnav a:hover { color: #fff; }
.who { display: flex; align-items: center; gap: 10px; }
.whoname { color: #C9CDD4; font-size: 13px; }
#storepick { font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 8px; border: 1px solid #3A3F48; background: #22252B; color: #fff; }

/* bottom nav (phones) */
.botnav { display: none; }
@media (max-width: 1280px) { .whoname { display: none; } }
@media (max-width: 860px) {
  #topnav, .whoname { display: none; }
  .toprow { justify-content: space-between; flex-wrap: nowrap; }
  #storepick { max-width: 130px; }
  .who { gap: 6px; }
  .botnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 4px; }
  .botnav a { flex: 1 1 0; text-align: center; text-decoration: none; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 10px 2px; border-radius: 10px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .botnav a.on { color: var(--ink); background: var(--ground); }
  .botnav a.plus { background: var(--blue); color: #fff; }
  .botnav a.plus.out { background: var(--orange); }
  .wrap { padding: 0 14px; }
  h1 { font-size: 22px; }
}

/* buttons */
.btn { font: inherit; font-size: 14.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 15px;
  border-radius: 10px; border: 1px solid #CDD1CB; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #9AA0A8; color: var(--ink); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.pri { background: var(--blue); border-color: var(--blue); color: #fff; } .btn.pri:hover { background: var(--blue-d); color: #fff; }
.btn.dark { background: var(--dark); border-color: var(--dark); color: #fff; } .btn.dark:hover { background: #2C3038; color: #fff; }
.top .btn.dark { border-color: #3A3F48; }
.btn.danger { color: #B42318; border-color: #F1C4BF; } .btn.danger:hover { background: #FDEDEB; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn.xl { min-height: 54px; font-size: 16px; border-radius: 14px; }
.btn.full { width: 100%; } .btn.left { justify-content: flex-start; }
.btn.icon { width: 42px; padding: 0; font-size: 20px; }
.btn.ghost { visibility: hidden; }
.btn.dashed { border-style: dashed; border-width: 1.5px; background: #F7F8F6; }
.grow { flex: 1 1 0; }

/* layout */
.row { display: flex; align-items: center; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; gap: 10px; }
.row.gap { gap: 10px; } .row.wrapr { flex-wrap: wrap; gap: 10px; } .row.base { align-items: baseline; }
.stack { display: flex; flex-direction: column; gap: 14px; } .stack.tight { gap: 8px; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid2c { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.split > .grow2 { flex: 999 1 520px; min-width: 0; } .split > .grow1 { flex: 1 1 340px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.li { padding: 10px 0; border-top: 1px solid var(--line2); }

/* banners, toast, modal */
.banner { background: var(--blue-l); color: #1F3FA3; border-radius: 10px; padding: 11px 14px; font-size: 14px; }
.banner.bad { background: #FDEDEB; color: #B42318; }
.banner.warnb, .result.warnb { background: var(--orange-l); color: var(--orange-d); }
.banner.okb, .result.okb { background: var(--green-l); color: var(--green); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; background: var(--dark); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 60; max-width: min(560px, 92vw); font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.bad { background: #B42318; }
.modal { position: fixed; inset: 0; background: rgba(15,17,20,.5); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal .box { background: #fff; border-radius: 16px; padding: 22px; width: min(460px, 100%); display: flex; flex-direction: column; gap: 14px; max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0; }
.spinner { padding: 40px 0; text-align: center; color: var(--muted); }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .box { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
.err { color: #B42318; font-weight: 600; min-height: 1em; }

/* form fields */
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
.fld input, .fld select, .fld textarea, .filters input, .filters select, .payrow select, .payrow input, .tbl.inputs input {
  font: inherit; font-size: 16px; color: var(--ink); font-weight: 500; padding: 10px 12px; border: 1px solid #CDD1CB; border-radius: 10px; background: #fff; min-height: 44px; width: 100%; }
.fld textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
input.money { font-family: var(--mono); font-weight: 600; font-size: 18px; }
.static { font-size: 16px; color: var(--ink); font-weight: 600; padding: 10px 0; }
.fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.fs legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; padding: 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; margin-top: 10px; min-height: 40px; }
.check input { width: 20px; height: 20px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.formhead { display: flex; align-items: center; gap: 10px; } .formhead h1 { margin: 0; }
.seg { display: flex; flex-wrap: wrap; border: 1.5px solid var(--ink); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1 1 0; font: inherit; font-size: 14px; font-weight: 600; min-height: 46px; border: 0; background: #fff; color: var(--ink); cursor: pointer; padding: 0 10px; }
.seg button + button { border-left: 1px solid #CDD1CB; }
.seg button.on { background: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.pick { gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--blue-l); color: #1F3FA3; font-weight: 600; font-size: 13px; }
.chip.grey { background: #F0F1EE; color: #3D424A; }
.chip.gap { background: var(--orange-l); color: var(--orange-d); font-family: var(--mono); }
.chip .x { font: inherit; font-family: var(--sans); font-size: 11.5px; border: 0; background: rgba(255,255,255,.7); color: var(--orange-d); border-radius: 999px; padding: 2px 7px; cursor: pointer; }
.chipbtn { font: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid #CDD1CB; background: #fff; color: var(--ink); cursor: pointer; }
.chipbtn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.payrow { display: flex; gap: 8px; align-items: center; }
.payrow select { flex: 1 1 50%; } .payrow input { flex: 1 1 50%; }
.paysum { margin-top: 8px; font-size: 14px; min-height: 1.4em; }
.photo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.photobtn { min-height: 54px; flex: 1 1 240px; justify-content: flex-start; }

/* day book */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; background: #fff; padding: 5px; border-radius: 12px; border: 1px solid var(--line); align-self: flex-start; }
.tabs button, .tabs a { font: inherit; font-weight: 600; font-size: 14px; padding: 0 14px; min-height: 40px; border-radius: 8px; border: 0; background: transparent; color: #3D424A; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.tabs .on { background: var(--ink); color: #fff; }
.dayhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.dayhead h1 { margin: 0; }
.daynav { display: flex; gap: 6px; align-items: center; }
.daynav input { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid #CDD1CB; border-radius: 10px; min-height: 42px; background: #fff; }
.cashcard { background: var(--dark); color: #fff; border-radius: 16px; padding: 18px 20px; }
.cashcard .dim { color: #C9CDD4; } .cashcard .w { color: #fff; font-size: 15px; } .cashcard .three { margin-top: 10px; }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.act { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px; border-radius: 14px; background: #fff; border: 1px solid #D6D9D3; color: var(--ink); font-weight: 600; text-decoration: none; }
.act:hover { border-color: #9AA0A8; color: var(--ink); }
.act span { font-size: 22px; line-height: 1; }
.act.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.act.orange { background: var(--orange); border-color: var(--orange); color: #fff; }
@media (max-width: 520px) { .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } .act { padding: 0 12px; font-size: 14px; } }

/* entry list */
.elist { display: flex; flex-direction: column; }
.erow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line2); color: var(--ink); text-decoration: none; }
.elist > .erow:first-child { border-top: 0; }
a.erow:hover { background: #FAFAF8; color: var(--ink); }
.emain { min-width: 0; flex: 1 1 auto; } .et { font-weight: 600; } .es { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.eamt { font-family: var(--mono); font-weight: 600; white-space: nowrap; } .eamt.out { color: var(--orange); }
.eside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 5px; background: #F0F1EE; color: #3D424A; vertical-align: 1px; }
.tag.ok { background: var(--green-l); color: var(--green); } .tag.warn { background: var(--orange-l); color: var(--orange-d); }

/* close day */
.denoms { display: flex; flex-direction: column; }
.denom { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.denom .dl { width: 64px; } .denom .dt { margin-left: auto; color: #3D424A; }
.denom .qty { width: 64px; text-align: center; font: inherit; font-family: var(--mono); font-weight: 600; font-size: 17px; border: 1px solid #CDD1CB; border-radius: 10px; min-height: 42px; }
.result { border-radius: 14px; padding: 12px 16px; font-size: 13px; }

/* tiles, cards */
.filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.filters input, .filters select { width: auto; font-size: 15px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.scard { display: flex; flex-direction: column; gap: 14px; }
.pillc { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #F0F1EE; color: #3D424A; white-space: nowrap; }
.pillc.okc { background: var(--green-l); color: var(--green); } .pillc.warnc { background: var(--orange-l); color: var(--orange-d); }
.mbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #ECEEEA; }
.mbar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12.5px; color: #3D424A; }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.dl2 { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; border-top: 1px solid var(--line2); padding-top: 12px; }
.dl2 dt { font-size: 12.5px; color: var(--muted); } .dl2 dd { margin: 2px 0 0; font-family: var(--mono); font-weight: 600; }
.bar { height: 10px; background: #F0F1EE; border-radius: 5px; overflow: hidden; } .bar span { display: block; height: 100%; background: var(--blue); }
.barrow { padding: 6px 0; } .barrow .bar { margin-top: 4px; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; border-top: 1px solid var(--line2); }
.alerts li:first-child { border-top: 0; }
.alerts .grow { flex: 1 1 260px; min-width: 0; }
.atag { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: var(--blue-l); color: #1F3FA3; white-space: nowrap; }
.atag.w { background: var(--orange-l); color: var(--orange-d); }
.gaps { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line2); }
.moved { margin-top: 12px; padding: 12px 14px; background: #F4F5F2; border-radius: 10px; display: flex; flex-direction: column; gap: 4px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl td, .tbl th { padding: 9px 8px 9px 0; border-top: 1px solid var(--line2); vertical-align: top; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; border-top: 0; }
.tbl td.r, .tbl th.r { text-align: right; padding-right: 14px; }
.tbl td.r:last-child, .tbl th.r:last-child { padding-right: 0; }
.tbl.bills input.money { width: 130px; min-width: 0; }
.tbl.bills input[type=date] { width: 160px; min-width: 0; }
.tbl tr.tot td { border-top: 2px solid var(--ink); font-weight: 700; }
.tbl.inputs td { vertical-align: middle; } .tbl.inputs input { min-width: 120px; }
.tblwrap { overflow-x: auto; }

/* report paper */
.paper { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06); padding: 36px 40px; display: flex; flex-direction: column; gap: 26px; }
.phead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 14px; }
.ptitle { font-size: 30px; margin: 4px 0 0; }
.paper section.grey { background: #F4F5F2; border-radius: 10px; padding: 16px 18px; }
.pfoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 600px) { .paper { padding: 20px 16px; } .ptitle { font-size: 22px; } }

.billrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; } .billrow.one { grid-template-columns: 1fr; }
.bblock { display: flex; flex-direction: column; gap: 4px; margin: 0; }
@media (max-width: 700px) { .billrow { grid-template-columns: 1fr; } }

/* payroll */
.nowrap { flex-wrap: nowrap; white-space: nowrap; }
.tbl.pay { font-size: 13.5px; min-width: 1150px; }
.tbl.pay td, .tbl.pay th { vertical-align: middle; padding-right: 10px; }
.tbl.pay th { white-space: nowrap; vertical-align: bottom; } .tbl.pay th .small { font-weight: 500; }
.tbl.pay .stick { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 110px; }
.tbl.pay tr.grp td { background: var(--ground); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 7px 8px; }
.tbl.pay tr.unsaved td { background: #FFFBF6; }
.tbl.pay tr.unsaved td.stick { background: #FFFBF6; }
input.pin { font: inherit; font-family: var(--mono); font-weight: 600; width: 58px; min-height: 36px; padding: 4px 8px; border: 1px solid #CDD1CB; border-radius: 8px; background: #fff; color: var(--ink); text-align: right; }
input.pin.w { width: 86px; }
input.pin:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.tbl.staffl input.money { width: 120px; min-width: 0; } .tbl.staffl input.phone { width: 140px; min-width: 0; } .tbl.staffl input.pin { min-width: 0; width: 80px; }
.tbl.staffl tr.off td { color: var(--muted); }
.savebar { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0 2px; z-index: 3; }
.tbl.pay td > .small { white-space: nowrap; }
@media (max-width: 860px) { .savebar { position: static; } }
.slip { max-width: 720px; }
.tbl.inputs select { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid #CDD1CB; border-radius: 10px; background: #fff; min-height: 44px; }
@media (max-width: 860px) { input.pin { font-size: 16px; } }

@media print {
  body { background: #fff; }
  .top, .botnav, .noprint, .toast { display: none !important; }
  .view { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .paper { box-shadow: none; padding: 0; }
  .tile, .panel { break-inside: avoid; }
  section { break-inside: avoid; }
}
