/* SHOWTILE office — extras on top of admin-theme.css */
body { background: #fff; }

/* sign in */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: #f6f6f6; padding: 16px; }
.login-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-card); padding: 28px; display: grid; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-brand b { font-size: 17px; letter-spacing: .2em; }
.login-brand span:last-child { color: var(--text-muted); }
.login-brand .brand-mark { background: #16191d; color: #fff; }
.login-btn { width: 100%; height: 40px; justify-content: center; }
.err-text { color: var(--red); min-height: 20px; margin: 0; font-size: 13px; }

.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.sidebar-foot { flex-wrap: wrap; gap: 6px; }
.app-shell .sidebar .sidebar-foot .who { flex: 1 1 140px; min-width: 0; }

/* forms inside panels */
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.inline-form .input { width: auto; flex: 1 1 140px; }
.inline-form #itemQ { flex: 3 1 280px; }
.with-btn { display: flex; gap: 6px; }
.with-btn .input { flex: 1; }
.seg-radio { display: flex; gap: 18px; margin-bottom: 12px; font-size: 15px; }
.seg-radio label { display: inline-flex; gap: 6px; align-items: center; }
.confirm-text { margin: 0 0 12px; line-height: 1.55; }
.drawer-foot .spacer, .week-bar .spacer { flex: 1; }
.drawer-foot { flex-wrap: wrap; gap: 8px; }

/* item search results under the search box */
.hit-list { border: 1px solid var(--border); border-radius: 10px; margin: -4px 0 10px; flex: none; }
.hit-more { padding: 8px 12px; color: var(--text-muted); font-size: 13px; }
.hit { display: grid; grid-template-columns: 110px 1fr 110px 110px 90px; gap: 10px; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--border); background: #fff; cursor: pointer; font: inherit; }
.hit:hover { background: var(--blue-light); }
.hit span:nth-child(n + 4) { text-align: right; font-variant-numeric: tabular-nums; }

.totals { display: flex; justify-content: flex-end; gap: 24px; padding: 10px 4px 4px; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.totals b { color: var(--ink); margin-left: 6px; }
.totals .grand b { font-size: 18px; }
.doc-status { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.kv-row { display: flex; gap: 12px; margin-bottom: 12px; font-size: 15px; }
.stats.compact .stat-value { font-size: 18px; }
.drawer .form-sec-title { margin-top: 18px; }

.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgb(0 0 0 / 18%); vertical-align: -1px; margin-right: 6px; }

/* weekly calendars (PO Schedule / Delivery Schedule) */
.week-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.week-bar .btn.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.cal { border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.cal-title { font-size: 18px; font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); overflow-x: auto; }
.cal-grid.cols-5 { grid-template-columns: repeat(5, minmax(170px, 1fr)); }
.cal-col { border-right: 1px solid var(--border); min-height: 420px; padding: 0 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-col:last-child { border-right: 0; }
.cal-col.is-today { background: #f3f8ff; }
.cal-head { text-align: center; font-size: 13px; color: var(--text-secondary); padding: 6px 0; border-bottom: 1px solid var(--border); margin: 0 -6px; }
.cal-col.is-today .cal-head { background: #dbe9ff; color: var(--ink); font-weight: 600; }
.cal-date { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); padding: 4px 0; }
.cal-add { border: 1px solid var(--border); background: #fff; border-radius: 6px; width: 22px; height: 22px; cursor: pointer; color: var(--text-secondary); line-height: 1; }
.cal-add:hover { border-color: var(--ink); color: var(--ink); }
.cal-chip { width: 100%; border: 1px solid rgb(0 0 0 / 15%); border-radius: 4px; padding: 3px 6px; font: inherit; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; cursor: pointer; }
.cal-card { width: 100%; text-align: center; border: 1px solid rgb(0 0 0 / 18%); border-radius: 4px; padding: 6px; font: inherit; font-size: 12px; line-height: 1.35; display: flex; flex-direction: column; gap: 1px; cursor: pointer; }
.cal-card b { font-size: 12px; }
.cal-meta { opacity: .75; font-size: 11px; margin-top: 2px; }
.cal-empty { text-align: center; color: var(--text-muted); padding: 10px 0; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.photo-grid a { display: grid; gap: 4px; color: var(--text-secondary); font-size: 12px; text-decoration: none; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #f6f6f6; }

@media (max-width: 720px) {
  .hit { grid-template-columns: 1fr 1fr; }
  .totals { flex-wrap: wrap; gap: 10px; }
}
.stat { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.stats { margin-bottom: 16px; }

/* ---- use the full screen width ---- */
/* wide windows (invoice, PO, delivery setup, import, stock) take the whole viewport */
.drawer.is-modal.is-wide, .drawer.is-modal.is-wide.is-xwide { width: calc(100vw - 32px); max-height: calc(100dvh - 32px); }
.drawer.is-modal.is-wide.is-xwide { height: calc(100dvh - 32px); }
/* fields flow into as many columns as fit instead of a fixed 2 */
.drawer.is-wide .fieldset { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.drawer.is-wide .fieldset .field.is-wide { grid-column: span 2; }
.drawer.is-wide textarea.input { min-height: 60px; }
.drawer.is-wide .drawer-body { gap: 16px; }
/* list filters: search box grows with the screen */
.filters { flex-wrap: wrap; }
.filters .search-field { flex: 1 1 320px; width: auto; max-width: 640px; }
.page-body { max-width: none; }
