:root {
  --bg: #f6f7f9;
  --card: #fff;
  --text: #172033;
  --muted: #687386;
  --line: #e2e6ec;
  --blue: #2563eb;
  --navy: #123f73;
  --red: #d12836;
  --green: #16845b;
  --amber: #b7791f;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { color: inherit; }
.wrap { width: min(100% - 32px, 1328px); margin: auto; }
.hidden { display: none !important; }

.topbar { height: 72px; background: linear-gradient(to bottom, var(--navy) calc(100% - 5px), var(--red) 0); color: #fff; }
.topbar .wrap { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; }
.topbar strong { font-size: 17px; letter-spacing: .01em; }
.top-clock { min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.1; text-align: center; }
.top-clock b { font-size: 15px; letter-spacing: .04em; }
.top-clock span { max-width: 280px; margin-top: 4px; overflow: hidden; color: #dbe7f4; font-size: 9px; text-overflow: ellipsis; text-transform: capitalize; white-space: nowrap; }
.auth-area { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.header-button { min-height: 34px; padding: 0 11px; border: 1px solid #ffffff55; border-radius: 8px; background: #ffffff0f; color: #fff; font-size: 10px; font-weight: 700; cursor: pointer; }
.header-button:hover { background: #ffffff1e; }
.header-button.primary { border-color: #fff; background: #fff; color: var(--navy); }
.account-chip { min-width: 0; display: flex; align-items: center; gap: 8px; }
.account-copy { min-width: 0; text-align: right; line-height: 1.15; }
.account-copy b, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy b { max-width: 170px; font-size: 10px; }
.account-copy small { margin-top: 3px; color: #dbe7f4; font-size: 8px; }
.hero { padding: 38px 0 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hero h1 { margin: 0; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.035em; }
.hero p { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.stats { display: flex; gap: 8px; }
.stat { min-width: 90px; padding: 12px 14px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; }
.stat b { font-size: 21px; }
.stat span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.tabs { display: flex; gap: 9px; margin-bottom: 18px; }
.tabs button { min-height: 43px; padding: 0 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 1px 2px #17203308; }
.tabs button:hover { border-color: #b9c9df; background: #f8fbff; color: var(--navy); }
.tabs button.active { border-color: #9cb9e5; background: #eaf2ff; color: var(--blue); box-shadow: 0 3px 10px #2563eb12; }
.tabs span { padding: 1px 6px; background: #e9edf3; border-radius: 20px; font-size: 9px; }

.fleet-toolbar { min-height: 38px; margin: -6px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fleet-toolbar > span { color: var(--muted); font-size: 10px; }
.fleet-toolbar > div { display: flex; gap: 7px; }
.subtle-button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #4f5b6d; font-size: 10px; cursor: pointer; }
.subtle-button:hover { border-color: #b8c1ce; background: #fafbfc; }

.printer-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(224px, 1fr); gap: 12px; overflow-x: auto; padding: 1px 1px 12px; scroll-snap-type: x mandatory; }
.printer-card, .add-card { position: relative; min-height: 370px; overflow: hidden; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px #1018280a; }
.printer-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent); }
.card-top { display: flex; align-items: center; justify-content: space-between; padding: 15px 15px 0; }
.status { padding: 5px 8px; display: inline-flex; align-items: center; border-radius: 999px; background: #f2f4f7; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .02em; }
.status i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); }
.status-printing { border-color: #b9ccef; box-shadow: 0 3px 14px #2563eb12; }
.status-printing .status { background: #eaf2ff; color: #2055a5; }
.status-finished { border-color: #a9d9c8; box-shadow: 0 3px 14px #16845b12; }
.status-finished .status { background: #e8f7f1; color: #126a4a; }
.status-maintenance { border-color: #ead199; background: linear-gradient(145deg, #fff 0, #fffbef 100%); }
.status-maintenance .status { background: #fff4d9; color: #8a5a15; }
.status-broken { border-color: #e7a4aa; background: linear-gradient(145deg, #fff 0, #fff5f6 100%); box-shadow: 0 3px 14px #d1283617; }
.status-broken .status { background: #ffe7e9; color: #a51f2c; }
.trash { opacity: 0; padding: 5px 7px; border: 0; border-radius: 6px; background: transparent; color: #929baa; font-size: 17px; cursor: pointer; }
.printer-card:hover .trash, .printer-card:focus-within .trash { opacity: 1; }
.trash:hover { background: var(--red); color: #fff; }
.printer-main { width: 100%; height: 310px; padding: 8px 18px 14px; display: flex; flex-direction: column; border: 0; background: transparent; text-align: left; cursor: pointer; }
.printer-main:disabled { cursor: grab; }
.printer-icon { height: 112px; display: grid; place-items: center; }
.printer-icon span { position: relative; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 12px; background: #f4f6f9; color: var(--accent); font-size: 35px; }
.printer-icon b { position: absolute; top: 80px; color: var(--text); font-size: 12px; white-space: nowrap; }
.printer-icon em { font-style: normal; }
.state-symbol { position: relative; z-index: 2; }
.state-spinner { position: absolute; z-index: 1; inset: 5px; border: 4px solid #dce6f5; border-top-color: var(--accent); border-right-color: var(--accent); border-radius: 50%; animation: printer-spin 1.15s linear infinite; }
.status-printing .printer-icon span { background: #edf4ff; }
.state-check { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-size: 38px; font-weight: 800; box-shadow: 0 0 0 7px #dff3eb; }
.status-finished .printer-icon span { background: #edf9f4; }
.state-broken { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff; font-size: 46px; font-weight: 500; line-height: 1; box-shadow: 0 0 0 7px #f9dfe2; }
.status-broken .printer-icon span { background: #fff0f2; }
@keyframes printer-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .state-spinner { animation-duration: 2.5s; } }
.printer-card h3 { margin: 4px 0 8px; font-size: 15px; }
.printer-card p { margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.printer-card .job { color: var(--text); font-size: 12px; }
.owner { margin-top: 7px; color: var(--muted); font-size: 10px; }
.queue-note { margin-top: 8px; color: var(--blue); font-size: 9px; font-weight: 650; }
.availability-line { margin-top: 8px; display: block; color: #4f5b6d; font-size: 9px; line-height: 1.35; font-weight: 650; }
.upcoming-warning { margin-top: 7px; padding: 6px 8px; display: block; border: 1px solid #efc66d; border-radius: 7px; background: #fff8e7; color: #855816; font-size: 9px; font-weight: 750; line-height: 1.3; }
.primary-action, .maintenance-action, .broken-action { height: 36px; margin-top: 20px; display: flex; align-items: center; justify-content: center; border: 1px solid #cbd8f6; border-radius: 8px; background: #f4f7fe; color: var(--blue); font-size: 10px; font-weight: 700; }
.maintenance-action { border-color: #e7cf96; background: #fff8e7; color: #855816; }
.broken-action { border-color: #e7a4aa; background: #ffe7e9; color: #a51f2c; }
.progress { height: 5px; margin-top: 15px; overflow: hidden; border-radius: 4px; background: #edf0f4; }
.progress i { display: block; height: 100%; background: var(--accent); }
.time-row { margin-top: 8px; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.time-row b { color: var(--text); }
.status-finished { --accent: var(--green) !important; }
.status-maintenance { --accent: var(--amber) !important; }
.status-broken { --accent: var(--red) !important; }
.card-tools { position: absolute; inset: auto 0 0; height: 40px; display: grid; grid-template-columns: 1fr 42px 42px 42px; border-top: 1px solid var(--line); background: #fafbfc; }
.card-tools button { padding: 0 11px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.card-tools button:last-child { width: 42px; border-right: 0; }
.card-tools button:hover { background: #f0f3f7; color: var(--text); }
.card-tools button:disabled { opacity: .38; cursor: not-allowed; }
.card-tools .cancel-print { color: var(--red); font-size: 12px; }
.card-tools .cancel-print:hover { background: #fff0f1; color: #ad1f2c; }
.add-card { display: flex; flex-direction: column; align-items: center; justify-content: center; border-style: dashed; background: #fbfcfd; color: var(--muted); cursor: pointer; }
.add-card i { width: 54px; height: 54px; margin-bottom: 16px; display: grid; place-items: center; border-radius: 50%; background: #eef2f7; color: var(--blue); font-size: 27px; font-style: normal; }
.add-card b { font-size: 11px; }
.add-card small { margin-top: 5px; font-size: 10px; }

.is-reordering .printer-card { cursor: grab; border-color: #a9bddd; box-shadow: 0 5px 18px #123f7317; }
.is-reordering .printer-card { touch-action: none; user-select: none; -webkit-user-select: none; }
.is-reordering .printer-main { cursor: grab; }
.is-reordering .trash { display: none; }
.is-reordering .printer-card.dragging { opacity: .22; transform: scale(.985); }
.is-reordering .printer-card.drop-before, .is-reordering .printer-card.drop-after { border-color: var(--blue); box-shadow: 0 7px 22px #2563eb24; }
.is-reordering .printer-card.drop-before::after, .is-reordering .printer-card.drop-after::after { content: ""; position: absolute; z-index: 12; top: 9px; bottom: 9px; width: 4px; border-radius: 4px; background: var(--blue); box-shadow: 0 0 0 4px #dbeafe, 0 0 14px #2563eb66; }
.is-reordering .printer-card.drop-before::after { left: 4px; }
.is-reordering .printer-card.drop-after::after { right: 4px; }
.reorder-dragging, .reorder-dragging * { cursor: grabbing !important; }
.reorder-ghost { position: fixed !important; z-index: 250; margin: 0; pointer-events: none; opacity: .9; transform: rotate(1deg) scale(.96); transform-origin: center; border-color: #8cabdb !important; box-shadow: 0 18px 42px #17203338 !important; }
.reorder-ghost::after { content: "Taşınıyor"; position: absolute; top: 10px; right: 10px; padding: 5px 8px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 8px; font-weight: 800; letter-spacing: .03em; }
.reorder-controls { position: absolute; inset: auto 0 0; height: 42px; display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; border-top: 1px solid var(--line); background: #edf4ff; }
.reorder-controls span { text-align: center; color: var(--navy); font-size: 10px; font-weight: 700; }
.reorder-controls button { height: 100%; border: 0; background: transparent; color: var(--blue); cursor: pointer; }
.reorder-controls button:disabled { opacity: .25; }

.lower-grid { margin-top: 18px; display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.panel-head, .calendar-head { min-height: 70px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-head small, .calendar-head small { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.panel-head h2, .calendar-head h2 { margin: 5px 0 0; font-size: 16px; }
.panel-head button { border: 0; background: transparent; color: var(--blue); font-size: 10px; cursor: pointer; }
.activity-row { padding: 13px 20px; display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; border-bottom: 1px solid #edf0f4; }
.activity-row:last-child, .queue-row:last-child { border-bottom: 0; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.activity-row b { font-size: 11px; }
.activity-row p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.activity-meta { text-align: right; }
.activity-meta b, .activity-meta span { display: block; }
.activity-meta b { color: #4c5769; font-size: 9px; }
.activity-meta span { margin-top: 3px; color: #8a94a3; font-size: 9px; }
.queue-row { padding: 13px 17px; display: grid; grid-template-columns: 24px 4px minmax(0, 1fr) auto auto; gap: 9px; align-items: center; border-bottom: 1px solid #edf0f4; }
.queue-row > i { height: 34px; border-radius: 4px; }
.queue-row b, .queue-row span, .queue-row small { display: block; }
.queue-row b { font-size: 10px; }
.queue-row span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.queue-row small { margin-top: 3px; color: #7e8998; font-size: 8px; }
.queue-row strong { font-size: 10px; white-space: nowrap; }
.next-printer-row { min-height: 66px; padding: 12px 17px; display: grid; grid-template-columns: 5px 110px minmax(0, 1fr); gap: 10px; align-items: center; border-bottom: 1px solid #edf0f4; }
.next-printer-row:last-child { border-bottom: 0; }
.next-printer-row > i { height: 34px; border-radius: 4px; }
.next-printer-name b, .next-printer-job b, .next-printer-job span, .next-printer-job small { display: block; }
.next-printer-name b { font-size: 10px; }
.next-printer-job b { font-size: 10px; }
.next-printer-job span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.next-printer-job small { margin-top: 3px; color: #7e8998; font-size: 8px; }
.row-actions { display: flex; gap: 5px; }
.row-actions button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #536074; font-size: 8px; cursor: pointer; }
.row-actions .danger-link { color: var(--red); }
.saved-job-row { min-height: 76px; padding: 13px 18px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid #edf0f4; }
.saved-job-row.is-printing { background: #f0fbf5; box-shadow: inset 4px 0 0 var(--green); }
.saved-job-row.is-planned { background: #f3f7ff; box-shadow: inset 4px 0 0 var(--blue); }
.saved-job-row:last-child, .printed-job-row:last-child { border-bottom: 0; }
.saved-job-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: #edf4ff; color: var(--blue); font-size: 18px; }
.saved-job-row.is-printing .saved-job-icon { background: #d9f4e7; color: var(--green); }
.saved-job-row.is-planned .saved-job-icon { background: #dce9ff; color: var(--blue); }
.saved-job-row b, .saved-job-row span, .saved-job-row small { display: block; }
.saved-job-row b { font-size: 11px; }
.saved-job-row span { margin-top: 3px; color: var(--blue); font-size: 9px; font-weight: 700; }
.saved-job-row .saved-job-status { width: fit-content; margin-top: 5px; padding: 3px 7px; border-radius: 999px; background: #d9f4e7; color: #11704c; font-size: 8px; letter-spacing: .02em; }
.saved-job-row .saved-job-status.planned { background: #dce9ff; color: #1d57b7; }
.saved-job-row .saved-job-duration { color: var(--blue); }
.saved-job-row small { margin-top: 3px; color: #838d9c; font-size: 8px; }
.printed-job-row { width: 100%; min-height: 74px; padding: 13px 18px; display: grid; grid-template-columns: 6px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; border: 0; border-bottom: 1px solid #edf0f4; background: #fff; text-align: left; cursor: pointer; }
.printed-job-row:hover { background: #f8fbfa; }
.printed-job-row > i { width: 6px; height: 38px; border-radius: 5px; }
.printed-job-row b, .printed-job-row span, .printed-job-row small { display: block; }
.printed-job-row b { font-size: 11px; }
.printed-job-row span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.printed-job-row small { margin-top: 3px; color: #7e8998; font-size: 8px; }
.printed-job-row strong { color: #285f4c; font-size: 10px; white-space: nowrap; }
.printed-job-row em { color: var(--blue); font-size: 8px; font-style: normal; white-space: nowrap; }
.empty { min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #99a2af; font-size: 11px; }
.full { min-height: 440px; }

.jobs-subtabs { margin-bottom: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.jobs-subtabs button { position: relative; min-height: 82px; padding: 14px 15px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--muted); text-align: left; cursor: pointer; box-shadow: 0 1px 3px #1720330a; }
.jobs-subtabs button:hover { border-color: #b7c8df; transform: translateY(-1px); box-shadow: 0 5px 16px #17203312; }
.jobs-subtabs button.active { border-color: #9bb8e4; background: linear-gradient(145deg, #f7faff, #eaf2ff); color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue), 0 4px 14px #2563eb12; }
.jobs-subtabs b { font-size: 13px; }
.jobs-subtabs small { margin-top: 7px; color: #7b8798; font-size: 9px; }
.jobs-subtabs span { position: absolute; top: 12px; right: 12px; min-width: 24px; padding: 3px 7px; border-radius: 999px; background: #edf1f6; color: #536174; font-size: 9px; text-align: center; }
.jobs-subtabs button.active span { background: #d6e6ff; color: #1d57b7; }

.calendar-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.calendar-controls > button, .zoom-controls button, .today-badge { height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #536074; font-size: 10px; cursor: pointer; }
.calendar-controls .magic-button { border-color: #b9a2ee; background: linear-gradient(135deg, #6d28d9, #8b5cf6); color: #fff; font-weight: 750; box-shadow: 0 4px 12px #6d28d92b; }
.zoom-controls { height: 36px; display: grid; grid-template-columns: 36px 52px 36px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.zoom-controls button { height: 34px; padding: 0; border: 0; border-radius: 0; font-size: 17px; }
.zoom-controls button:hover { background: #edf4ff; color: var(--blue); }
.zoom-controls button:disabled { opacity: .3; cursor: not-allowed; }
.zoom-controls span { display: grid; place-items: center; border-right: 1px solid var(--line); border-left: 1px solid var(--line); color: var(--navy); font-size: 9px; font-weight: 750; }
.today-badge { display: inline-flex; align-items: center; cursor: default; white-space: nowrap; }
#calendarView { position: relative; overflow: visible; }
.calendar-filter-bar { position: relative; z-index: 40; padding: 9px 14px; overflow: visible; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.calendar-filter-bar > span { color: #738093; font-size: 9px; }
.printer-filter { position: relative; z-index: 41; }
.printer-filter summary { min-width: 148px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #536074; font-size: 10px; cursor: pointer; list-style: none; }
.printer-filter summary::-webkit-details-marker { display: none; }
.printer-filter summary::after { content: "▾"; color: #7c8796; }
.printer-filter[open] summary::after { content: "▴"; }
.printer-filter summary span { margin-left: auto; padding: 1px 6px; border-radius: 12px; background: #edf2f8; color: var(--navy); font-size: 8px; }
.printer-filter-menu { position: absolute; z-index: 100; top: calc(100% + 6px); right: 0; width: 230px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 12px 30px #1720331f; }
.printer-filter-menu label { min-height: 34px; padding: 6px 7px; display: grid; grid-template-columns: 16px 7px 1fr; gap: 8px; align-items: center; border-radius: 6px; color: #465265; font-size: 10px; cursor: pointer; }
.printer-filter-menu label:hover { background: #f4f7fa; }
.printer-filter-menu label input { width: 14px; height: 14px; margin: 0; accent-color: var(--blue); }
.printer-filter-menu label i { width: 7px; height: 22px; border-radius: 4px; }
.printer-filter-menu > button { width: 100%; height: 32px; margin-top: 5px; border: 1px solid #cbd8f6; border-radius: 6px; background: #f4f7fe; color: var(--blue); font-size: 9px; font-weight: 700; cursor: pointer; }
.segmented { display: flex; }
.segmented button { border-radius: 0; }
.segmented button:first-child { border-radius: 7px 0 0 7px; }
.segmented button:last-child { margin-left: -1px; border-radius: 0 7px 7px 0; }
.segmented button.active { position: relative; border-color: var(--blue); background: #edf4ff; color: var(--blue); }
.calendar-days { display: grid; }
.calendar-days.week { grid-template-columns: repeat(7, minmax(180px, 1fr)); overflow-x: auto; }
.calendar-day { min-width: 0; border-right: 1px solid var(--line); }
.calendar-day:last-child { border-right: 0; }
.calendar-day > header { padding: 11px 14px; border-bottom: 1px solid var(--line); background: #f8fafc; color: #4b5668; font-size: 10px; text-transform: capitalize; }
.calendar-printer { min-height: 80px; padding: 12px 14px; display: grid; grid-template-columns: 150px 1fr; gap: 14px; border-bottom: 1px solid #edf0f4; }
.week .calendar-printer { display: block; padding: 10px; }
.calendar-printer:last-child { border-bottom: 0; }
.calendar-printer-name { display: flex; align-items: flex-start; gap: 8px; }
.calendar-printer-name i { width: 7px; height: 24px; flex: 0 0 auto; border-radius: 4px; }
.calendar-printer-name b { font-size: 10px; }
.calendar-printer-name small { margin-top: 4px; display: block; color: #7b8797; font-size: 8px; line-height: 1.35; }
.week .calendar-printer-name { margin-bottom: 7px; }
.calendar-events { display: grid; gap: 6px; }
.calendar-event { min-height: 48px; padding: 8px 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-left: 3px solid var(--blue); border-radius: 6px; background: #edf4ff; }
.calendar-event.reservation { border-color: var(--red); background: #fff1f2; }
.calendar-event.queue { border-color: #7b8798; background: #f2f4f7; }
.calendar-event.maintenance { border-color: var(--amber); background: #fff8e8; }
.calendar-event span, .calendar-event b, .calendar-event small { display: block; }
.calendar-event span { color: #647084; font-size: 8px; }
.calendar-event b { margin-top: 2px; font-size: 10px; }
.calendar-event small { margin-top: 2px; color: #6c7788; font-size: 8px; }
.calendar-event button { width: 24px; height: 24px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #fff8; color: var(--red); cursor: pointer; }
.available-slot { padding: 12px; border: 1px dashed #cbd5df; border-radius: 7px; color: var(--green); font-size: 9px; }

#calendarGrid { position: relative; z-index: 1; overflow: hidden; border-radius: 0 0 12px 12px; }
.calendar-bottom-nav { min-height: 48px; padding: 8px 14px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border-top: 1px solid var(--line); background: #f8fafc; }
.calendar-bottom-nav button { height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--blue); font-size: 9px; font-weight: 700; cursor: pointer; }
.calendar-bottom-nav span { color: #8791a0; font-size: 8px; text-align: center; }
.timeline-scroll { position: relative; z-index: 1; max-height: 72vh; overflow: auto; background: #fff; overscroll-behavior: contain; scrollbar-gutter: stable; }
.timeline-board { min-width: var(--timeline-min-width); display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: 48px var(--timeline-height); }
.timeline-corner { position: sticky; z-index: 8; top: 0; left: 0; padding: 0 9px; display: flex; align-items: center; border-right: 1px solid #cfd6df; border-bottom: 1px solid #cfd6df; background: #eef2f6; color: #596678; font-size: 8px; font-weight: 750; letter-spacing: .04em; }
.timeline-printer-heads { position: sticky; z-index: 7; top: 0; display: grid; grid-template-columns: repeat(var(--printer-count), minmax(190px, 1fr)); border-bottom: 1px solid #cfd6df; background: #f8fafc; }
.timeline-printer-heads > div { min-width: 0; padding: 7px 10px; display: flex; align-items: center; gap: 8px; border-left: 1px solid var(--line); }
.timeline-printer-heads i { width: 7px; height: 27px; flex: 0 0 auto; border-radius: 4px; }
.timeline-printer-heads span, .timeline-printer-heads b, .timeline-printer-heads small { min-width: 0; display: block; }
.timeline-printer-heads b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-printer-heads small { margin-top: 2px; overflow: hidden; color: #7b8797; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-axis { position: sticky; z-index: 5; left: 0; height: var(--timeline-height); border-right: 1px solid #cfd6df; background: #f8fafc; }
.timeline-hour { position: relative; padding: 5px 7px; border-bottom: 1px solid #e7ebf0; color: #7b8695; font-size: 8px; text-align: right; }
.timeline-hour span { display: block; }
.timeline-hour.day-start { border-top: 2px solid #9ba7b7; background: #edf2f7; color: var(--navy); text-align: left; }
.timeline-hour.day-start b { display: block; margin-bottom: 2px; font-size: 8px; text-transform: capitalize; }
.timeline-lanes { position: relative; height: var(--timeline-height); display: grid; grid-template-columns: repeat(var(--printer-count), minmax(190px, 1fr)); }
.timeline-lane { position: relative; min-width: 0; height: var(--timeline-height); border-left: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-height) - 1px), #e7ebf0 calc(var(--hour-height) - 1px), #e7ebf0 var(--hour-height)); }
.timeline-day-divider { position: absolute; z-index: 1; right: 0; left: 0; height: 2px; background: #9ba7b7; pointer-events: none; }
.timeline-now-line { position: absolute; z-index: 6; right: 0; left: 0; height: 2px; background: var(--red); pointer-events: none; box-shadow: 0 0 0 1px #fff8; }
.timeline-now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.timeline-now-line span { position: sticky; left: 91px; top: -9px; width: max-content; padding: 2px 5px; display: block; border-radius: 4px; background: var(--red); color: #fff; font-size: 7px; font-style: normal; }
.timeline-now-axis { position: absolute; z-index: 7; right: 4px; transform: translateY(-50%); padding: 2px 4px; border-radius: 4px; background: var(--red); color: #fff; font-size: 7px; font-style: normal; }
.timeline-event { position: absolute; z-index: 3; right: 5px; left: 5px; min-height: 20px; padding: 6px 7px; overflow: hidden; display: flex; justify-content: space-between; gap: 5px; border-left: 3px solid var(--blue); border-radius: 6px; background: #dfeaff; color: #20304a; box-shadow: 0 1px 3px #17203318; }
.timeline-event.reservation { border-color: var(--red); background: #ffe5e8; }
.timeline-event.queue { border-color: #7b8798; background: #e9edf2; }
.timeline-event.maintenance { border-color: var(--amber); background: repeating-linear-gradient(135deg, #fff4d6, #fff4d6 9px, #ffedbd 9px, #ffedbd 18px); }
.timeline-event > div { min-width: 0; }
.timeline-event small, .timeline-event b, .timeline-event span { display: block; }
.timeline-event small { overflow: hidden; color: #647084; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-event b { margin-top: 3px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-event span { margin-top: 2px; overflow: hidden; color: #5f6c7d; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-event.compact { padding-top: 3px; padding-bottom: 3px; align-items: center; }
.timeline-event.compact small { display: block; font-size: 6px; }
.timeline-event.compact b { margin-top: 1px; font-size: 7px; }
.timeline-event.compact span { display: none; }
.timeline-event button { width: 22px; height: 22px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #fff9; color: var(--red); cursor: pointer; }

.horizontal-board { width: var(--timeline-min-width); min-width: var(--timeline-min-width); display: grid; grid-template-columns: 150px var(--time-width); grid-template-rows: 64px calc(var(--printer-count) * 86px); }
.horizontal-corner { position: sticky; z-index: 12; top: 0; left: 0; padding: 0 12px; display: flex; align-items: center; border-right: 1px solid #cfd6df; border-bottom: 1px solid #cfd6df; background: #eaf0f6; color: #536174; font-size: 9px; font-weight: 750; }
.horizontal-time-head { position: sticky; z-index: 10; top: 0; width: var(--time-width); overflow: hidden; border-bottom: 1px solid #cfd6df; background: #f8fafc; }
.horizontal-days, .horizontal-hours { width: var(--time-width); display: flex; }
.horizontal-days { height: 31px; }
.horizontal-days > div { flex: 0 0 auto; padding: 8px 8px 0; overflow: hidden; border-right: 2px solid #a8b3c1; color: var(--navy); font-size: 9px; font-weight: 750; text-transform: capitalize; white-space: nowrap; }
.horizontal-days > div.weekend { background: #6b728018; color: #647084; }
.horizontal-hours { height: 33px; border-top: 1px solid #e2e7ed; }
.horizontal-hours > div { flex: 0 0 auto; padding-top: 9px; overflow: visible; border-right: 1px solid #e7ebf0; color: #7b8695; font-size: 7px; white-space: nowrap; }
.horizontal-printer-labels { position: sticky; z-index: 8; left: 0; display: grid; grid-template-rows: repeat(var(--printer-count), 86px); border-right: 1px solid #cfd6df; background: #f8fafc; }
.horizontal-printer-labels > div { min-width: 0; padding: 12px 10px; display: flex; align-items: flex-start; gap: 8px; border-bottom: 1px solid var(--line); }
.horizontal-printer-labels i { width: 7px; height: 30px; flex: 0 0 auto; border-radius: 4px; }
.horizontal-printer-labels span, .horizontal-printer-labels b, .horizontal-printer-labels small { min-width: 0; display: block; }
.horizontal-printer-labels b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.horizontal-printer-labels small { margin-top: 5px; color: #7b8797; font-size: 7px; line-height: 1.35; }
.horizontal-lanes { position: relative; width: var(--time-width); height: calc(var(--printer-count) * 86px); display: grid; grid-template-rows: repeat(var(--printer-count), 86px); }
.horizontal-lane { position: relative; width: var(--time-width); height: 86px; border-bottom: 1px solid var(--line); cursor: crosshair; background: repeating-linear-gradient(to right, transparent 0, transparent calc(var(--hour-width) - 1px), #e7ebf0 calc(var(--hour-width) - 1px), #e7ebf0 var(--hour-width)); }
.horizontal-lane:hover { background-color: #f9fbfd; }
.horizontal-lane.scheduled-drop-target { background-color: #e8f1ff; box-shadow: inset 0 0 0 2px var(--blue); }
.scheduled-drop-preview { position: absolute; z-index: 9; top: 7px; height: 72px; min-width: 24px; padding: 9px; overflow: hidden; border: 2px solid var(--blue); border-radius: 7px; background: #dbeafeeb; color: #17448f; box-shadow: 0 4px 16px #2563eb4d; pointer-events: none; }
.scheduled-drop-preview b, .scheduled-drop-preview span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scheduled-drop-preview b { font-size: 9px; }
.scheduled-drop-preview span { margin-top: 6px; font-size: 7px; font-weight: 700; }
.scheduled-drop-preview.invalid { border-color: var(--red); background: #ffe5e8ed; color: #9a2230; }
.horizontal-weekend-band { position: absolute; z-index: 2; top: 0; bottom: 0; background: #6b72801c; pointer-events: none; }
.horizontal-day-divider { position: absolute; z-index: 1; top: 0; bottom: 0; width: 2px; background: #a8b3c1; pointer-events: none; }
.horizontal-now-line { position: absolute; z-index: 7; top: 0; bottom: 0; width: 2px; background: var(--red); pointer-events: none; box-shadow: 0 0 0 1px #fff8; }
.horizontal-now-line::before { content: ""; position: absolute; top: -5px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.horizontal-now-line span { position: sticky; top: 68px; margin-left: 5px; padding: 2px 5px; display: block; width: max-content; border-radius: 4px; background: var(--red); color: #fff; font-size: 7px; font-style: normal; white-space: nowrap; }
.horizontal-now-progress { position: absolute; left: 6px; min-width: 36px; padding: 4px 6px; transform: translateY(-50%); border: 1px solid var(--red); border-radius: 999px; background: #fff; color: var(--red); box-shadow: 0 2px 7px #17203324; font-size: 9px; font-style: normal; font-weight: 800; line-height: 1; text-align: center; white-space: nowrap; }
.horizontal-event { position: absolute; z-index: 4; top: 7px; height: 72px; min-width: 24px; padding: 8px 9px; overflow: hidden; display: flex; justify-content: space-between; gap: 6px; border-left: 3px solid var(--blue); border-radius: 7px; background: #dfeaff; color: #20304a; box-shadow: 0 2px 5px #1720331c; cursor: default; }
.horizontal-event.print:not(.completed) { background: repeating-linear-gradient(115deg, #dfeaff 0 18px, #c9dcfb 18px 31px, #e8f0ff 31px 46px); animation: active-print-flow 1.35s linear infinite; }
.horizontal-event.reservation { border-color: var(--red); background: #ffe5e8; }
.horizontal-event.scheduled { border-color: #7c3aed; background: #eee7ff; }
.horizontal-event.queue { border-color: #7b8798; background: #e9edf2; }
.horizontal-event.maintenance { border-color: var(--amber); background: repeating-linear-gradient(135deg, #fff4d6, #fff4d6 9px, #ffedbd 9px, #ffedbd 18px); }
.horizontal-event.broken { border-color: #a91f2c; background: repeating-linear-gradient(135deg, #ffdfe2, #ffdfe2 12px, #f7bfc5 12px, #f7bfc5 24px); color: #7f1722; }
.horizontal-event.broken span { color: #8e3540; }
.horizontal-event.completed { border-color: var(--green); background: #dff4eb; color: #124f3b; }
.horizontal-event.completed small, .horizontal-event.completed span { color: #36735e; }
.horizontal-event.upcoming { outline: 2px solid #e4a11b; outline-offset: -2px; box-shadow: 0 0 0 3px #fff3cf, 0 3px 8px #8a5a1526; }
.horizontal-event.upcoming small { color: #8a5a15; font-weight: 800; }
.horizontal-event > div { min-width: 0; }
.horizontal-event small, .horizontal-event b, .horizontal-event span { display: block; }
.horizontal-event small { overflow: hidden; color: #647084; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.horizontal-event b { margin-top: 6px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.horizontal-event span { margin-top: 3px; overflow: hidden; color: #5f6c7d; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.horizontal-event.compact { padding: 5px; }
.horizontal-event.compact small { font-size: 6px; }
.horizontal-event.compact b { margin-top: 4px; font-size: 8px; }
.horizontal-event.compact span { display: none; }
.horizontal-event button { width: 22px; height: 22px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #fff9; color: var(--red); cursor: pointer; }
.horizontal-event .event-time-control { position: absolute; z-index: 6; right: 4px; bottom: 4px; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #2563eb44; border-radius: 6px; background: #fff; color: var(--blue); font-size: 16px; font-weight: 800; line-height: 1; }
.horizontal-event .event-time-control:hover { background: #eaf2ff; }
.horizontal-event .scheduled-drag-handle { position: absolute; z-index: 6; top: 4px; right: 4px; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #7c3aed55; border-radius: 6px; background: #fff; color: #6d28d9; font-size: 15px; line-height: 1; cursor: grab; touch-action: none; }
.horizontal-event .scheduled-drag-handle:active { cursor: grabbing; }
.horizontal-event.scheduled:has(.scheduled-drag-handle) { padding-right: 32px; }
.horizontal-event.scheduled-dragging { opacity: .48; filter: saturate(.65); }
.horizontal-event.interactive { cursor: pointer; }
.horizontal-event.interactive:hover { filter: brightness(.98); box-shadow: 0 4px 12px #1720332b; }
@keyframes active-print-flow { to { background-position: 51px 0; } }
@media (prefers-reduced-motion: reduce) { .horizontal-event.print:not(.completed) { animation-duration: 3s; } }

.modal-backdrop { position: fixed; z-index: 200; inset: 0; padding: 18px; display: grid; place-items: center; background: #11182766; backdrop-filter: blur(3px); }
.modal-card { position: relative; width: min(440px, 100%); max-height: 92vh; overflow: auto; padding: 30px; border-radius: 14px; background: #fff; box-shadow: 0 20px 60px #11182733; }
.modal-card:has(.auto-schedule-form) { width: min(680px, 100%); }
.modal-close { position: absolute; right: 14px; top: 10px; border: 0; background: transparent; color: #7b8492; font-size: 27px; cursor: pointer; }
.form { display: flex; flex-direction: column; gap: 15px; }
.form h2 { margin: 0; font-size: 25px; }
.form-intro { margin: -7px 0 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-warning { margin: -2px 0 2px; padding: 10px 11px; border: 1px solid #efc66d; border-radius: 8px; background: #fff8e7; color: #855816; }
.form-warning b, .form-warning span { display: block; }
.form-warning b { font-size: 10px; }
.form-warning span { margin-top: 4px; font-size: 9px; line-height: 1.45; }
.info-sheet { display: flex; flex-direction: column; gap: 14px; }
.info-sheet > small { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.info-sheet h2 { margin: -5px 0 0; font-size: 25px; }
.inline-title-input { width: 100%; margin: -6px 0 0; padding: 3px 5px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--navy); font: inherit; font-size: 25px; font-weight: 750; }
.inline-title-input:hover { border-color: #d7dce3; background: #f8fafc; }
.inline-title-input:focus { border-color: var(--blue); background: #fff; outline: 0; box-shadow: 0 0 0 3px #2563eb18; }
.inline-title-input:disabled { opacity: .6; }
.info-sheet > .inline-edit-hint { margin-top: -11px; color: #8b95a4; font-size: 8px; font-weight: 500; letter-spacing: 0; }
.info-sheet > p { margin: -6px 0 2px; color: var(--muted); font-size: 11px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-grid > div { padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.info-grid span, .info-grid b { display: block; }
.info-grid span { color: var(--muted); font-size: 8px; }
.info-grid b { margin-top: 4px; font-size: 10px; }
.modal-progress { height: 7px; overflow: hidden; border-radius: 6px; background: #edf0f4; }
.modal-progress i { height: 100%; display: block; border-radius: inherit; background: var(--blue); }
.info-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats-hero > div { min-height: 82px; padding: 12px 10px; display: flex; flex-direction: column; justify-content: center; border: 1px solid #d7e2f2; border-radius: 10px; background: linear-gradient(145deg, #f8fbff, #edf4ff); }
.stats-hero b { color: var(--navy); font-size: 17px; }
.stats-hero span { margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.3; }
.stat-active-note, .delay-current-note { padding: 10px 11px; border: 1px solid #cfe2f8; border-radius: 8px; background: #f1f7ff; color: #45617f; font-size: 9px; line-height: 1.45; }
.field-help { margin-top: -9px; color: #7d8898; font-size: 9px; }
.magic-heading { display: flex; align-items: center; gap: 12px; }
.magic-heading > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, #6d28d9, #9f67ee); color: #fff; font-size: 23px; box-shadow: 0 5px 15px #6d28d92c; }
.magic-heading small { color: #7655b8; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.magic-heading h2 { margin-top: 3px; }
.auto-schedule-form { min-width: min(620px, 78vw); }
.auto-add-box { padding: 11px !important; border: 1px solid var(--line) !important; border-radius: 9px !important; background: #fafbfc; }
.auto-add-row, .auto-manual-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.auto-manual-row { grid-template-columns: minmax(130px, 1fr) 78px 88px auto; align-items: end; }
.auto-manual-row label { gap: 4px; font-size: 8px; }
.auto-add-row select, .auto-manual-row input { min-width: 0; }
.auto-add-row button, .auto-manual-row button { padding: 0 13px; border: 1px solid #cbd8f6; border-radius: 8px; background: #edf4ff; color: var(--blue); font-size: 9px; font-weight: 750; cursor: pointer; }
.auto-job-list { max-height: 235px; overflow: auto; display: grid; gap: 6px; }
.auto-job-row { min-height: 55px; padding: 8px 9px; display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.auto-job-row > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #edf4ff; color: var(--blue); font-size: 9px; font-weight: 800; }
.auto-job-row b, .auto-job-row small { display: block; }
.auto-job-row b { font-size: 10px; }
.auto-job-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.auto-job-row > div:last-child { display: flex; gap: 4px; }
.auto-job-row button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #536174; cursor: pointer; }
.auto-job-row button:disabled { opacity: .25; }
.auto-job-row button.danger-link { color: var(--red); }
.auto-empty { min-height: 65px; display: grid; place-items: center; border: 1px dashed #ccd3dd; border-radius: 8px; color: #8b95a3; font-size: 9px; text-align: center; }
.form label { display: flex; flex-direction: column; gap: 6px; color: #4b5565; font-size: 10px; font-weight: 650; }
.form label:has(> input[name="actor"]) { display: none; }
.form input, .form select { height: 43px; padding: 0 11px; border: 1px solid #d7dce3; border-radius: 8px; background: #fff; outline: 0; }
.form input:focus, .form select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #2563eb18; }
.form-grid, .duration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form fieldset { margin: 0; padding: 0; border: 0; }
.form legend { margin-bottom: 7px; color: #4b5565; font-size: 10px; font-weight: 650; }
.form legend span { color: #8490a1; font-size: 9px; font-weight: 550; }
.form fieldset.duration-locked .duration-grid { padding: 8px; border: 1px solid #dfe4ea; border-radius: 9px; background: #f2f4f7; }
.form fieldset.duration-locked input { border-color: #dfe4ea; background: #e8ebef; color: #687386; cursor: not-allowed; box-shadow: none; }
.color-input { padding: 5px !important; }
.submit { height: 43px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.submit.danger { background: var(--red); }
.auth-switch { margin: -3px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.auth-switch button { padding: 0; border: 0; background: transparent; color: var(--blue); font-weight: 700; cursor: pointer; }
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 46px; -webkit-appearance: none; appearance: none; }
.password-field input.masked-password { -webkit-text-security: disc; }
.password-field input.masked-password.password-visible { -webkit-text-security: none; }
.password-field input::-ms-reveal, .password-field input::-ms-clear { display: none; }
.password-field input::-webkit-credentials-auto-fill-button { display: none !important; visibility: hidden; pointer-events: none; }
.password-toggle { position: absolute; right: 7px; bottom: 6px; width: 34px; height: 31px; padding: 6px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #657184; cursor: pointer; }
.password-toggle:hover { background: #eef2f6; }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-off { display: none; }
.password-toggle.is-visible .eye-open { display: none; }
.password-toggle.is-visible .eye-off { display: block; }
.remember-row { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 550 !important; }
.remember-row input { width: 16px; height: 16px; margin: 0; }
.approval-card { text-align: center; }
.approval-icon { width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: #fff4d9; color: #8a5a15; font-size: 25px; }
.approval-card h2 { margin-bottom: 8px; }
.approval-card p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.toast { position: fixed; z-index: 1000; right: 18px; bottom: 18px; max-width: min(420px, calc(100% - 36px)); padding: 11px 14px; border-radius: 8px; background: #172033; color: #fff; font-size: 11px; box-shadow: 0 8px 25px #11182733; }
footer { padding: 24px 2px 30px; display: flex; justify-content: space-between; color: #8a94a3; font-size: 9px; }

@media (max-width: 900px) {
  .lower-grid { grid-template-columns: 1fr; }
  .calendar-head { align-items: flex-start; flex-direction: column; }
  .calendar-controls { width: 100%; justify-content: flex-start; }
}

@media (max-width: 640px) {
  .wrap { width: min(100% - 28px, 1328px); }
  .topbar { height: 64px; }
  .topbar .wrap { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 7px; }
  .topbar strong { max-width: 90px; font-size: 12px; line-height: 1.1; }
  .top-clock b { font-size: 12px; }
  .top-clock span { display: none; }
  .auth-area { gap: 4px; }
  .header-button { min-height: 30px; padding: 0 7px; font-size: 8px; }
  .account-copy b { max-width: 72px; font-size: 8px; }
  .account-copy small { display: none; }
  .hero { padding: 28px 0 21px; align-items: stretch; flex-direction: column; gap: 18px; }
  .hero h1 { font-size: 33px; }
  .stats { width: 100%; }
  .stat { min-width: 0; flex: 1; padding: 10px 11px; }
  .tabs { overflow-x: auto; }
  .tabs button { white-space: nowrap; }
  .tabs button { min-height: 39px; padding: 0 13px; }
  .jobs-subtabs { grid-template-columns: 1fr 1fr; }
  .jobs-subtabs button { min-height: 74px; padding: 12px; }
  .fleet-toolbar { align-items: flex-start; }
  .fleet-toolbar > span { max-width: 42%; line-height: 1.4; }
  .printer-rail { width: calc(100% + 14px); grid-auto-columns: 84%; }
  .trash { opacity: 1; }
  .activity-row { padding: 12px 14px; }
  .activity-meta b { max-width: 78px; overflow: hidden; text-overflow: ellipsis; }
  .queue-row { grid-template-columns: 20px 4px minmax(0, 1fr) auto; }
  .queue-row .row-actions { grid-column: 3 / -1; }
  .saved-job-row { grid-template-columns: 34px minmax(0, 1fr); padding: 12px 14px; }
  .saved-job-row .row-actions { grid-column: 2; flex-wrap: wrap; }
  .printed-job-row { grid-template-columns: 5px minmax(0, 1fr) auto; padding: 12px 14px; }
  .printed-job-row em { display: none; }
  .next-printer-row { grid-template-columns: 5px 82px minmax(0, 1fr); padding: 11px 12px; }
  .today-badge { flex: 1 1 150px; justify-content: center; }
  .top-clock span { max-width: 185px; font-size: 8px; }
  .calendar-filter-bar { align-items: stretch; flex-direction: column; }
  .calendar-controls .magic-button { flex: 1 1 135px; }
  .calendar-bottom-nav { grid-template-columns: 1fr 1fr; }
  .calendar-bottom-nav span { display: none; }
  .printer-filter { width: 100%; }
  .printer-filter summary { width: 100%; }
  .printer-filter-menu { right: auto; left: 0; width: 100%; }
  .timeline-scroll { max-height: 68vh; }
  .timeline-board { grid-template-columns: 76px minmax(0, 1fr); }
  .timeline-printer-heads, .timeline-lanes { grid-template-columns: repeat(var(--printer-count), minmax(164px, 1fr)); }
  .timeline-corner { padding: 0 7px; }
  .timeline-hour { padding-right: 6px; }
  .horizontal-board { grid-template-columns: 132px var(--time-width); }
  .horizontal-corner { padding: 0 9px; }
  .horizontal-printer-labels > div { padding: 10px 8px; }
  .calendar-printer { grid-template-columns: 1fr; gap: 8px; }
  .modal-card { padding: 25px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .auto-schedule-form { min-width: 0; }
  .auto-manual-row { grid-template-columns: 1fr 1fr; }
  #autoManualName { grid-column: 1 / -1; }
  .auto-manual-row button { min-height: 38px; grid-column: 1 / -1; }
  .stats-hero { grid-template-columns: 1fr; }
  footer span:last-child { display: none; }
}

@media (hover: none) {
  .trash { opacity: 1; }
}

.auth-gate { display:none; max-width:620px; margin:90px auto; padding:32px; border:1px solid #cbd5e1; background:white; border-radius:18px; }
.signed-out .auth-gate { display:block; }
.signed-out main { display:none; }
.header-button { text-decoration:none; display:inline-flex; align-items:center; justify-content:center; }
.admin-wrap { max-width:1280px; margin:30px auto; padding:0 20px; }
.admin-panel { background:white; border:1px solid #dbe3ed; border-radius:14px; padding:22px; margin:20px 0; }
.admin-scroll { overflow:auto; }
.admin-table { width:100%; border-collapse:collapse; font-size:14px; }
.admin-table td,.admin-table th { padding:12px 8px; border-bottom:1px solid #e2e8f0; text-align:left; }
.admin-table select { padding:8px; border:1px solid #cbd5e1; border-radius:6px; }
.admin-actions { display:flex; gap:10px; flex-wrap:wrap; }
.admin-status { padding:14px; color:#123f73; background:#eff6ff; border-radius:8px; margin:16px 0; }
.admin-message { min-height:24px; color:#9f1239; }
.admin-summary { display:flex; gap:20px; flex-wrap:wrap; }
.admin-summary b { font-size:26px; display:block; }
@media (max-width: 760px) {
  .topbar { height:auto; min-height:72px; }
  .topbar .wrap { grid-template-columns:1fr auto; padding-top:12px; padding-bottom:16px; row-gap:10px; }
  .auth-area { grid-column:1 / -1; }
  .account-chip { flex-wrap:wrap; justify-content:flex-end; }
  .account-copy b { max-width:140px; }
}
