/* Tire Shop Simulator Tycoon - the office computer (ui/os.js): light "shop management software". Shared classes for
   every app: .os-card .os-grid .os-kpi .os-table .os-tabs .os-btn .os-pill .os-meter .os-form .os-chart */
.os { position: absolute; inset: 0; z-index: 30; display: grid; grid-template-columns: 208px 1fr; background: var(--os-bg); color: var(--os-text); font-family: var(--bd); font-size: 15px; -webkit-user-select: text; user-select: text; }
.os-side { background: var(--os-side); color: #dfe7ee; display: flex; flex-direction: column; min-height: 0; padding-left: var(--safe-l); }
.os-brand { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.os-brand i { font-style: normal; font-size: 22px; } .os-brand b { font-family: var(--hd); font-size: 18px; font-weight: 700; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; }
.os-nav { flex: 1; overflow-y: auto; padding: 6px 8px 14px; scrollbar-width: thin; }
.os-nav h5 { font-family: var(--hd); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #7f93a6; margin: 12px 8px 4px; }
.os-nav button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: inherit; text-align: left; font-size: 14.5px; }
.os-nav button:hover { background: rgba(255,255,255,.07); } .os-nav button.on { background: var(--os-acc); color: #fff; font-weight: 600; }
.os-nav button i { font-style: normal; width: 22px; text-align: center; } .os-nav button span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-nav button em { font-style: normal; font-size: 12px; } .os-nav button em.b { background: #e5484d; color: #fff; border-radius: 99px; min-width: 20px; padding: 1px 6px; text-align: center; font-family: var(--mono); font-size: 11px; }
.os-nav button.lock { opacity: .45; }
.os-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding-right: var(--safe-r); }
.os-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--os-card); border-bottom: 1px solid var(--os-line); }
.os-top h2 { flex: 1; font-size: 24px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-chips { display: flex; gap: 8px; } .os-chips span { font-family: var(--mono); font-size: 13.5px; padding: 5px 10px; border-radius: 8px; background: var(--os-bg); border: 1px solid var(--os-line); white-space: nowrap; }
.os-cash { color: #167544; font-weight: 600; } .os-cash.neg { color: #c4353a; }
.os-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--os-line); background: var(--os-bg); color: var(--os-text); font-size: 16px; }
.os-page { flex: 1; overflow-y: auto; padding: 14px 16px calc(24px + var(--safe-b)); }
.os-page h3 { font-size: 19px; margin: 16px 0 8px; } .os-page h3:first-child { margin-top: 0; } .os-page h4 { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--os-muted); margin: 12px 0 6px; }
.os-page p { margin: 6px 0; line-height: 1.45; } .os-muted { color: var(--os-muted); } .os-empty { color: var(--os-muted); padding: 18px; text-align: center; background: var(--os-card); border: 1px dashed var(--os-line); border-radius: 10px; }
.os-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.os-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.os-card { background: var(--os-card); border: 1px solid var(--os-line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.os-card > h3:first-child, .os-card > h4:first-child { margin-top: 0; }
.os-kpi { background: var(--os-card); border: 1px solid var(--os-line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--os-line); }
.os-kpi small { font-family: var(--hd); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--os-muted); }
.os-kpi b { font-family: var(--hd); font-size: 28px; font-weight: 700; line-height: 1.05; } .os-kpi span { font-size: 12.5px; color: var(--os-muted); }
.os-kpi.good { border-top-color: #1f9556; } .os-kpi.good b { color: #167544; } .os-kpi.bad { border-top-color: #e5484d; } .os-kpi.bad b { color: #c4353a; } .os-kpi.warn { border-top-color: #e0a800; } .os-kpi.acc { border-top-color: var(--os-acc); }
.os-tablewrap { overflow-x: auto; background: var(--os-card); border: 1px solid var(--os-line); border-radius: 10px; margin-bottom: 12px; }
.os-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.os-table th { text-align: left; font-family: var(--hd); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--os-muted); padding: 8px 10px; border-bottom: 1px solid var(--os-line); background: #f7f9fb; position: sticky; top: 0; white-space: nowrap; }
.os-table td { padding: 7px 10px; border-bottom: 1px solid #edf1f5; vertical-align: middle; } .os-table tr:last-child td { border-bottom: 0; }
.os-table .num { text-align: right; font-family: var(--mono); font-size: 13.5px; white-space: nowrap; } .os-table tr[data-id] { cursor: pointer; } .os-table tr[data-id]:hover td { background: #fbf3ec; }
.os-table tr.total td { font-weight: 700; border-top: 2px solid var(--os-line); background: #f7f9fb; } .os-table tr.sub td { color: var(--os-muted); padding-left: 22px; }
.os-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 2px solid var(--os-line); }
.os-tabs button { border: 0; background: transparent; padding: 8px 14px; min-height: 40px; font-family: var(--hd); font-weight: 700; font-size: 16px; letter-spacing: .03em; color: var(--os-muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.os-tabs button.on { color: var(--os-acc); border-bottom-color: var(--os-acc); } .os-tabs button i { font-style: normal; font-family: var(--mono); font-size: 11px; background: var(--os-line); border-radius: 99px; padding: 1px 6px; color: var(--os-text); }
.os-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--os-line); background: var(--os-card); color: var(--os-text); font-family: var(--hd); font-weight: 700; font-size: 15px; letter-spacing: .03em; text-transform: uppercase; }
.os-btn:hover { border-color: var(--os-acc); } .os-btn.go { background: #1f9556; border-color: #167544; color: #fff; } .os-btn.acc { background: var(--os-acc); border-color: #a83f06; color: #fff; } .os-btn.bad { background: #e5484d; border-color: #b8353a; color: #fff; }
.os-btn.small { min-height: 30px; padding: 3px 10px; font-size: 13px; } .os-btn[disabled] { opacity: .4; pointer-events: none; }
.os-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .os-row.right { justify-content: flex-end; } .os-spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.os-pill { display: inline-block; font-family: var(--hd); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 9px; border-radius: 99px; background: #e8edf2; color: #51606f; white-space: nowrap; }
.os-pill.green { background: #d7f2e3; color: #167544; } .os-pill.red { background: #fbdcdd; color: #b8353a; } .os-pill.yellow { background: #fbefc4; color: #8a6a00; } .os-pill.blue { background: #d9e9f7; color: #1e5b8c; } .os-pill.acc { background: #fde3d2; color: #a83f06; }
.os-meter { display: inline-block; width: 90px; height: 9px; border-radius: 5px; background: #e3e9ef; overflow: hidden; vertical-align: middle; } .os-meter i { display: block; height: 100%; background: #2471a3; border-radius: 5px; }
.os-meter.good i { background: #1f9556; } .os-meter.bad i { background: #e5484d; } .os-meter.warn i { background: #e0a800; } .os-meter.wide { width: 100%; }
.os-stars { color: #e0a800; letter-spacing: 1px; } .os-stars i { font-style: normal; color: #d5dbe1; }
.os-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; }
.os-form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--os-muted); }
.os-form input, .os-form select, .os-in { min-height: 38px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--os-line); background: #fff; color: var(--os-text); font-size: 15px; }
.os-in.num, .os-form input[type=number] { font-family: var(--mono); text-align: right; width: 110px; } .os-step { display: inline-flex; align-items: center; gap: 4px; } .os-step button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--os-line); background: #fff; font-size: 18px; } .os-step output { min-width: 44px; text-align: center; font-family: var(--mono); }
.os-chart { width: 100%; height: auto; display: block; background: var(--os-card); border-radius: 8px; } .os-chart .grid { stroke: #e3e9ef; stroke-width: 1; } .os-chart .ax { font: 11px var(--mono); fill: var(--os-muted); }
.os-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--os-muted); margin-top: 4px; } .os-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.os-good { color: #167544; } .os-bad { color: #c4353a; } .os-warn { color: #8a6a00; } .os-num { font-family: var(--mono); }
.os-toast { position: absolute; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); z-index: 5; padding: 10px 18px; border-radius: 10px; background: #18222d; color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: 80%; }
.os-toast.good { background: #167544; } .os-toast.bad { background: #b8353a; } .os-toast.warn { background: #8a6a00; }
.os-modal { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(15,22,30,.55); }
.os-dialog { background: var(--os-card); border-radius: 14px; padding: 18px 20px; width: min(620px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.os-dbody h3 { margin: 0 0 8px; font-size: 22px; } .os-dbtns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
@media (max-width: 860px), (max-height: 420px) { .os { grid-template-columns: 62px 1fr; } .os-nav button span, .os-nav h5, .os-brand b { display: none; } .os-nav button { justify-content: center; padding: 8px 4px; } .os-nav button em { position: absolute; margin: -18px 0 0 22px; } .os-chips .os-date { display: none; } }
@media (max-height: 480px) { .os-top { padding: 5px 12px; } .os-top h2 { font-size: 19px; } .os-page { padding: 10px 12px; } .os-kpi b { font-size: 22px; } }
