/* ============================================================================
   Ticketengine — Box Office (back office) stylesheet.
   Dense, professional, information-first: operators live in this all day.
   Styles the layout chrome (te-office, te-obar, te-omenu, te-omain, te-login,
   te-btn) plus every office module (tables, forms, calendar/seat-plan editor).
   ========================================================================== */

:root {
  --ink:       #1b1d24;
  --ink-soft:  #3c404b;
  --muted:     #6b7280;
  --line:      #d9dde3;
  --line-soft: #eceef2;
  --bg:        #eef1f5;
  --panel:     #ffffff;
  --bar:       #1d2532;       /* top bar / chrome */
  --bar-ink:   #e8ebf0;
  --brand:     #2563c9;       /* office blue */
  --brand-dk:  #1c4ea0;
  --ok:        #1f8a4c;
  --danger:    #c0392b;
  --warn:      #b9770b;
  --chip:      #e7ebf2;
  --radius:    7px;
  --radius-sm: 4px;
  --font:      'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono:      ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body.te-office {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.4;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- top bar -- */
.te-obar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bar);
  color: var(--bar-ink);
  padding: .4rem .9rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.te-obar__brand { font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.te-obar__user { margin-left: auto; color: #aeb6c4; font-size: 12px; white-space: nowrap; }

.te-omenu { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; }
.te-omenu__item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #c3cad6;
  font: inherit;
  font-size: 12.5px;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.te-omenu__item:hover { background: rgba(255,255,255,.08); color: #fff; }
.te-omenu__item.is-active { background: var(--brand); color: #fff; }

/* ---------------------------------------------------------------- main ----- */
.te-omain { max-width: 1240px; margin: 0 auto; padding: 1rem; }

.te-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(16,16,29,.04);
}
.te-card h1 { font-size: 1.25rem; margin: 0 0 .5rem; }
.te-card h2 { font-size: 1.05rem; margin: 1rem 0 .5rem; }
.te-card h3 { font-size: .95rem; margin: .8rem 0 .4rem; }

.te-section { border-top: 1px solid var(--line-soft); padding-top: .6rem; margin-top: 1rem; }
.te-section:first-of-type { border-top: 0; margin-top: 0; }

.te-muted { color: var(--muted); }
.te-error { color: var(--danger); font-weight: 600; }
.te-wide { display: block; }

.te-flash {
  background: #eaf6ee; border: 1px solid #b9e2c6; color: #1f5f38;
  padding: .5rem .7rem; border-radius: var(--radius-sm); margin-bottom: .8rem;
}
.te-hint { color: var(--muted); font-size: 12px; margin: .4rem 0; }

/* ---------------------------------------------------------------- login ---- */
.te-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bar);
}
.te-login__card {
  background: var(--panel); border-radius: var(--radius);
  padding: 1.8rem; width: 320px; box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.te-login__card h1 { margin: 0 0 .2rem; font-size: 1.15rem; }
.te-login__sub { color: var(--muted); margin: 0 0 1rem; }
.te-login__card label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: .7rem; }
.te-login__card input { width: 100%; margin-top: .2rem; }
.te-login__error { background: #fdecea; border: 1px solid #f5c6cb; color: var(--danger);
  padding: .4rem .6rem; border-radius: var(--radius-sm); margin-bottom: .8rem; font-size: 12px; }

/* ---------------------------------------------------------------- forms ---- */
input[type=text], input[type=password], input[type=number], input[type=email],
select, textarea {
  font: inherit; font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .28rem .4rem;
  background: #fff; color: var(--ink);
  max-width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(37,99,201,.35); outline-offset: 0; border-color: var(--brand);
}
textarea { width: 100%; min-height: 4rem; font-family: var(--font); }
label.te-checkfield { display: inline-flex; align-items: center; gap: .2rem; font-size: 12px; white-space: nowrap; }

/* ---------------------------------------------------------------- buttons -- */
.te-btn {
  appearance: none; border: 1px solid var(--line); background: #f4f6f9;
  color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600;
  padding: .34rem .7rem; border-radius: var(--radius-sm); cursor: pointer;
  white-space: nowrap;
}
.te-btn:hover { background: #e9edf3; }
.te-btn--primary { background: var(--brand); border-color: var(--brand-dk); color: #fff; }
.te-btn--primary:hover { background: var(--brand-dk); }
.te-btn--danger { background: #fff; border-color: #e2b8b4; color: var(--danger); }
.te-btn--danger:hover { background: #fdecea; }
.te-btn--ghost { background: transparent; }
.te-btn--mini { padding: .22rem .5rem; font-size: 12px; }
.te-btn--chip { background: var(--chip); border-color: transparent; font-weight: 600; }
.te-btn--chip.is-active { background: var(--brand); color: #fff; }

.te-inline { display: inline-flex; gap: .3rem; align-items: center; margin: 0; }

/* ---------------------------------------------------------------- bars ------ */
.te-filterbar, .te-dategroups, .te-submenu, .te-planbar {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  margin-bottom: .8rem;
}
.te-filterbar__label { font-size: 12px; color: var(--muted); font-weight: 600; }
.te-filterbar__group { display: flex; gap: .35rem; align-items: center; }

/* ---------------------------------------------------------------- tables ---- */
.te-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.te-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); padding: .4rem .5rem; border-bottom: 2px solid var(--line);
  background: #fafbfc;
}
.te-table td { padding: .35rem .5rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.te-table tbody tr:hover { background: #f7f9fc; }
.te-table__action { text-align: right; width: 1%; white-space: nowrap; }
.te-table__date { color: var(--ink-soft); white-space: nowrap; }
.te-table__qty { width: 5rem; }

.te-rowform { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 0; }
.te-rowform span { color: var(--muted); font-size: 12px; }
.te-rowform--new { background: #f7f9fc; }

.te-empty { text-align: center; color: var(--muted); padding: 1.5rem; }
.te-empty h2 { color: var(--ink-soft); }

.te-tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  padding: .05rem .35rem; border-radius: 3px; background: var(--chip); color: var(--ink-soft);
  letter-spacing: .3px;
}
.te-tag--reserved { background: #fbe3f3; color: #a3308a; }

/* ---------------------------------------------------------------- sell ------ */
.te-sell__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.te-sell__date { color: var(--muted); margin: .15rem 0 0; }
.te-sell__nav { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.te-sell__row { display: flex; gap: .4rem; align-items: center; }
.te-sell__qty { width: 3.5rem; }
.te-sell__left { color: var(--muted); font-size: 11px; }

.te-pricekey { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0; }
.te-pricekey__chip { padding: .2rem .55rem; border-radius: 3px; color: #fff; font-weight: 700; font-size: 11.5px; text-shadow: 0 1px 1px rgba(0,0,0,.3); }

/* ---------------------------------------------------------------- bookings -- */
.te-bookings__search { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.te-field { display: flex; flex-direction: column; gap: .15rem; }
.te-field label { font-size: 11px; color: var(--muted); font-weight: 600; }
.te-field--checks { flex-direction: row; gap: .6rem; align-items: center; }
.te-field--actions { flex-direction: row; gap: .35rem; }

.te-booking--t { background: #fff6f6; }
.te-booking--c { background: #f5f6ff; }
.te-booking__fn { display: flex; gap: .3rem; flex-wrap: wrap; }
.te-booking__detail td { background: #fbfcfe; }
.te-table--lines { margin: .3rem 0; }

.te-pager { display: flex; gap: .4rem; align-items: center; margin-top: .8rem; }
.te-pager__num { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- events ---- */
.te-eventrow { padding: .25rem .5rem; }
.te-eventform__main { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.te-eventform__name { min-width: 12rem; }
.te-eventform__date { width: 11rem; }
.te-eventform__more {
  display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .5rem; padding: .6rem;
  background: #f7f9fc; border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.te-eventform__more label { font-size: 12px; display: flex; flex-direction: column; gap: .15rem; }
.te-eventform__more .te-wide { flex: 1 1 100%; }
.te-admincharge { display: flex; flex-wrap: wrap; gap: .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .4rem .6rem; }
.te-admincharge legend { font-size: 11px; color: var(--muted); font-weight: 700; }

/* ---------------------------------------------------------------- setup ----- */
.te-swatch { display: inline-block; width: 1.4rem; height: 1.1rem; border-radius: 3px; border: 1px solid var(--line); }
.te-row--here td { background: #fdf3e7; }
.te-aon { margin-left: 1rem; font-size: 12px; }

/* ---------------------------------------------------------------- discounts - */
.te-orgroup { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem; margin: .6rem 0; }
.te-orgroup__head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: .3rem; }
.te-orgroup--new { background: #f7f9fc; }
.te-discount-editor__bar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; padding: .5rem .6rem; background: #f7f9fc; border-radius: var(--radius-sm); margin-bottom: .8rem; }
.te-pill-list { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: .3rem 0; }
.te-pill-list li { background: var(--chip); border-radius: 12px; padding: .15rem .6rem; font-size: 12px; }

/* ---------------------------------------------------------------- plan ------ */
#te-planview, #te-seatmap {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fbfbfc; min-height: 420px; aspect-ratio: 1 / 1; max-width: 760px; margin: .5rem 0;
}
.te-planview-svg { width: 100%; height: 100%; display: block; }
.te-seat:hover { stroke: #222; stroke-width: 1.5; }
.te-planview-tools { display: flex; gap: .4rem; margin: .4rem 0; }
.te-import-report { background: #f7f9fc; }

/* ---------------------------------------------------------------- misc ------ */
.te-displayauth .te-authcode {
  border: 2px dashed var(--brand); border-radius: var(--radius); padding: .8rem 1rem;
  margin: .8rem 0; background: #f5f8ff; font-size: 1.1rem;
}
.te-printlink { word-break: break-all; }
.te-templateform, .te-media-edit, .te-voucher-bulk { background: #f7f9fc; }

/* responsive: let dense rows scroll horizontally rather than crush */
@media (max-width: 720px) {
  .te-omain { padding: .6rem; }
  .te-card { padding: .7rem; }
  .te-table { display: block; overflow-x: auto; white-space: nowrap; }
}
