/* ============================================================
   LogiERP · V1 screens (style C)
   Reuses app.css tokens/components.
   ============================================================ */

body { background: var(--bg); }

.v1-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.v1-head h1 { font-size: 25px; }
.v1-head .sub { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 16px; }
.summary {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 16px; box-shadow: var(--shadow);
}
.summary .k { font-size: 11px; color: var(--muted); }
.summary .v { font-size: 23px; font-weight: 650; margin-top: 5px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.summary .v small { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.summary .f { font-size: 10.5px; color: var(--muted); margin-top: 3px; }

.toolbar { display: flex; align-items: center; gap: 8px; margin: 14px 0 10px; }
.toolbar .spacer { margin-left: auto; }

.tabs-line { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 16px 0 0; }
.tabs-line .tab {
  padding: 10px 0 11px; font-size: 13px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.tabs-line .tab.active { color: var(--text); border-color: var(--brand); font-weight: 600; }

.table-card.standalone { border-top: 1px solid var(--line); border-radius: var(--radius); margin-top: 12px; }

/* right detail panel */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; align-items: start; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 13.5px; font-weight: 650; }
.panel-body { padding: 14px 16px; }

.customer-hero { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.customer-hero .avatar { width: 40px; height: 40px; flex: 0 0 40px; font-size: 15px; background: var(--brand); }
.customer-hero .name { font-size: 15px; font-weight: 650; }
.customer-hero .code { font-family: var(--font-num); font-size: 11px; color: var(--muted); margin-top: 3px; }

.field-list { display: flex; flex-direction: column; gap: 0; margin-top: 8px; }
.field-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.field-row:last-child { border-bottom: 0; }
.field-row .k { color: var(--muted); flex: 0 0 auto; }
.field-row .v { text-align: right; font-weight: 500; }
.field-row .v.num { font-family: var(--font-num); }

.mini-timeline { margin-top: 4px; }
.mt-row { display: flex; gap: 10px; padding: 8px 0; position: relative; }
.mt-row:before { content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.mt-row:last-child:before { display: none; }
.mt-dot { width: 11px; height: 11px; flex: 0 0 11px; margin-top: 3px; border-radius: 50%; background: var(--brand); z-index: 1; }
.mt-dot.gray { background: var(--faint); }
.mt-dot.warn { background: var(--danger); }
.mt-body { min-width: 0; }
.mt-title { font-size: 11.5px; font-weight: 600; }
.mt-meta { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* output table group title */
.group-row td { background: var(--brand-weak); font-weight: 650; font-size: 12px; color: var(--text); height: 40px; }
.group-row td .muted { font-weight: 500; color: var(--muted); }

/* modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .38);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  width: 520px; background: var(--surface); border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22); overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 11.5px; color: var(--muted); }
.form-field input, .form-field select {
  height: 34px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface);
  padding: 0 10px; font-family: inherit; font-size: 12.5px; color: var(--text); outline: none;
}
.form-field input:focus, .form-field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }

/* users */
.user-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.user-card:last-child { border-bottom: 0; }
.user-card .avatar { width: 34px; height: 34px; flex: 0 0 34px; font-size: 12px; }
.user-name { font-size: 13px; font-weight: 650; }
.user-role { font-size: 11px; color: var(--muted); margin-top: 2px; }
.perm { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.perm-table td, .perm-table th { height: 44px; }

.empty-box { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 12.5px; }
.empty-box b { display: block; color: var(--text); font-size: 14px; margin-bottom: 6px; }

/* compact output tables: 13 columns must fit one screen */
.compact-table { table-layout: fixed; }
.compact-table th { white-space: normal; font-size: 10px; padding: 9px 7px; line-height: 1.25; }
.compact-table td { white-space: normal; font-size: 11.5px; padding: 9px 7px; height: auto; line-height: 1.35; }
.compact-table .id { word-break: break-all; }
.compact-table .group-row td { white-space: normal; }
