/* ===== PANELS: login, top bar, sidebar, stepper, tables ===== */

/* Login */
.login-page { height: 100%; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 400px; padding: 32px; background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px; align-items: stretch;
}
.login-title { font-size: var(--font-size-title); font-weight: 700; }
.login-note { font-size: var(--font-size-small); color: var(--muted); text-align: center; }

/* Top bar */
.top-bar {
  height: var(--top-bar-height); padding: 0 var(--page-padding); display: flex; align-items: center; gap: 10px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.top-bar-name { font-size: 15px; font-weight: 700; }
.user-chip {
  height: 32px; padding: 0 20px; border-radius: 16px; background: var(--surface); min-width: 66px;
  font-size: var(--font-size-control); font-weight: 500; position: relative;
}
.user-chip:hover { background: var(--accent-soft); color: var(--accent); }

/* Page layout */
.app-layout { height: 100%; display: flex; flex-direction: column; }
.app-body { flex: 1; min-height: 0; display: flex; gap: 20px; padding: 24px var(--page-padding); }   /* Figma: window padding 24, 20 between sidebar card and content */
.sidebar {
  width: var(--sidebar-width); flex: none; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border-radius: 16px; overflow: auto;   /* Figma: white card 220 wide, r16, padding 14 / 12, gap 6 */
}
.sidebar-title { display: flex; align-items: center; height: 26px; padding: 0; font-size: 14px; font-weight: 700; }
.sidebar-title .icon-button { width: 26px; height: 26px; }
.sidebar-title .icon-button:not(.sidebar-archive-button) { background: var(--accent-soft); color: var(--accent); }   /* Figma: soft + button */
.sidebar-title .sidebar-archive-button { margin-right: 8px; }
.sidebar-title .sidebar-archive-button.is-active { background: var(--accent-soft); color: var(--accent); }
.sidebar-empty { padding: 8px 4px; font-size: var(--font-size-small); color: var(--muted); }
.sidebar-group { display: flex; align-items: center; height: 24px; padding: 0 4px; font-size: 10px; font-weight: 500; color: var(--muted); }
.sidebar-item {
  min-height: 48px; padding: 0 10px; border-radius: 13px; text-align: left; font-size: 13px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px; font-weight: 500;
}
.sidebar-item small { color: var(--muted); font-size: 10px; font-weight: 400; }
.sidebar-item:hover { background: var(--surface); }
.sidebar-item.is-selected { background: var(--accent-soft); color: var(--accent); }
.main-area { flex: 1; min-width: 0; overflow: auto; padding: 0; display: flex; flex-direction: column; gap: 16px; }

/* Heading */
.page-heading { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: var(--font-size-title); font-weight: 700; }
.page-subtitle { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Tabs row + stepper */
.tabs-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* Stage stepper (Figma): 18px dot + label, steps joined by a 14 x 2 connector */
.stepper { display: flex; align-items: center; gap: 6px; margin-right: 16px; }
.step { display: inline-flex; align-items: center; gap: 6px; height: 18px; font-size: var(--font-size-small); font-weight: 500; color: var(--muted); }
.step-dot {
  width: 18px; height: 18px; border-radius: 9px; box-sizing: border-box; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.4px solid var(--line); font-size: var(--font-size-tiny); font-weight: 700; color: var(--muted);
}
.step.is-done { color: var(--text); }
.step.is-done .step-dot { background: var(--sage); border-color: var(--sage); color: var(--on-accent); }
.step.is-current { color: var(--accent); font-weight: 700; }
.step.is-current .step-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.step-connector { width: 14px; height: 2px; background: var(--line); flex: none; }
.step-connector.is-done { background: var(--sage); }
.step .icon { width: 12px; height: 12px; }

/* Page tab (Figma): 32 high, accent-soft when selected */
.page-tab {
  height: 32px; padding: 0 12px; border-radius: var(--control-radius);
  font-size: 13px; font-weight: 500; background: var(--surface); color: var(--muted);
}
.page-tab:hover { color: var(--text); }
.page-tab.is-selected { background: var(--accent-soft); color: var(--accent); }
.split-button { display: flex; }
.split-button .button:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-button .button:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 8px; border-left-color: rgba(255,255,255,.35); }

/* Banner */
.banner .button { background: var(--card); color: var(--amber); border-color: transparent; min-height: 28px; }
.banner {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 36px; border-radius: var(--control-radius);
  background: var(--amber-soft); color: var(--amber); font-size: var(--font-size-control); font-weight: 500;
}

/* Notices on the All Departments page: one banner per notice, the list scrolls after about 3 */
.notice-list { display: flex; flex-direction: column; gap: 8px; max-height: 128px; overflow-y: auto; flex: none; }   /* 3 x 36px + 2 x 8px gaps = 124px; You can change this */
.notice-list .banner { flex: none; }
.banner.is-done { background: var(--sage-soft); color: var(--sage); }

/* Header form (Figma): ONE white card, two rows. Row 1 = 6 equal fields, row 2 = Computer Description (double width) + 3 fields */
.header-form {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card); border-radius: 16px; padding: 14px 16px;
}
.header-row { display: grid; gap: 12px; }
.header-row.is-row-1 { grid-template-columns: repeat(6, 1fr); }
.header-row.is-row-2 { grid-template-columns: 2fr 1fr 1fr 1fr; }
.header-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.header-field label { font-size: 10px; font-weight: 500; color: var(--muted); }
.header-field input, .header-field .plain-text, .date-field {
  height: 32px; box-sizing: border-box; padding: 0 12px; border-radius: var(--control-radius);
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--text); outline: none; width: 100%;
  display: flex; align-items: center;
}
.header-field input:focus { border-color: var(--accent); }

/* Date field + calendar popup (Figma: Date picker popup) */
.date-field { justify-content: space-between; gap: 8px; cursor: pointer; text-align: left; font-family: inherit; }
.date-field:hover, .date-field:focus-visible { border-color: var(--accent); }
.date-field:disabled { cursor: default; border-color: var(--line); }
.date-field .icon { color: var(--muted); flex: none; }
.date-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-text.is-empty { color: var(--muted); }
.date-popup {
  position: fixed; z-index: 80; width: 252px; box-sizing: border-box; padding: 12px; display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--dialog-shadow);
}
.date-header { display: flex; align-items: center; justify-content: space-between; }
.date-title { font-size: var(--font-size-control); font-weight: 500; color: var(--text); }
.date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-weekday { height: 22px; display: flex; align-items: center; justify-content: center; font-size: var(--font-size-tiny); color: var(--muted); }
.date-day {
  height: 28px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text);
  font-size: var(--font-size-control); font-family: inherit; cursor: pointer;
}
.date-day:hover { background: var(--surface); }
.date-day.is-faded { color: var(--muted); opacity: .5; }
.date-day.is-today { border-color: var(--accent); }
.date-day.is-selected { background: var(--accent); color: var(--on-accent); border-color: var(--accent); opacity: 1; }
.date-footer { display: flex; align-items: center; justify-content: space-between; }

/* Tables */
.table { display: flex; flex-direction: column; gap: 6px; }
.table-head, .table-row {
  display: grid; align-items: center; gap: 12px; padding: 0 12px;
  grid-template-columns: var(--cols, 48px minmax(240px, 2fr) 1.2fr 1.2fr 150px 70px 70px);
}
.table-head { height: 32px; font-size: var(--font-size-small); color: var(--muted); font-weight: 500; }
.table-row { min-height: var(--row-height); background: var(--card); border-radius: var(--row-radius); }
.table-row.is-child .cell-name { padding-left: 28px; }
.table-row.is-drop-target { box-shadow: 0 -2px 0 var(--accent); }
.table-row.is-drop-into { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }   /* drop here = become a plugin */
.table-row.is-dragging { opacity: .4; }
/* Multi select: picked rows are highlighted (accent-soft fill + 1.5px accent border) */
.table-row.is-selected, .check-item.is-multi { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.check-item.is-multi { color: var(--accent); }
.selection-count { font-size: var(--font-size-control); font-weight: 700; color: var(--accent); white-space: nowrap; }
.check-list-title .selection-count { flex: 1; }
.cell-name { display: flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; }
.software-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.software-link:hover { text-decoration-thickness: 2px; }
.cell-name small { color: var(--muted); font-weight: 400; }
.cell-suggestion.is-newer { color: var(--amber); font-weight: 500; }
.expand-slot { width: 20px; height: 20px; flex: none; }
.table-head > div:nth-child(2) { display: flex; align-items: center; gap: 8px; }   /* arrow and "Software name" on one line */
.table-row.is-child .expand-slot { display: none; }   /* plugin rows are already indented */
.expand-button { flex: none; width: 20px; height: 20px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.expand-button .icon { width: 16px; height: 16px; transition: transform var(--duration-fast); }
.expand-button.is-open .icon { transform: rotate(90deg); }

/* Admin overview table */
.admin-table { --cols: 2fr 1fr 1.2fr 1fr 70px 70px 90px 110px; }
.admin-table { gap: 8px; }
.admin-table .table-head { height: 28px; }          /* Figma: header 28, rows 48, gap 8 */
.admin-table .table-row { min-height: 48px; font-size: 13px; }

.empty-note { padding: 40px; text-align: center; color: var(--muted); }

/* QC pages */
.qc-layout { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
/* Check items list: white card, 34 high items (Figma) */
.check-list { display: flex; flex-direction: column; gap: 4px; background: var(--card); border-radius: 16px; padding: 14px 12px; }
.check-list-title { display: flex; align-items: center; height: 24px; padding: 0 4px; margin-bottom: 4px; font-size: 13px; font-weight: 700; }
.check-list-title .icon-button { width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.check-item {
  min-height: 34px; padding: 6px 10px; border-radius: var(--control-radius); text-align: left;
  font-size: var(--font-size-control); font-weight: 500; color: var(--text);
}
.check-item:hover { background: var(--surface); }
.check-item.is-dragging { opacity: .4; }
.check-item.is-drop-target { box-shadow: 0 -2px 0 var(--accent); }
.check-item.is-selected { background: var(--accent-soft); color: var(--accent); }
/* Check detail: white card, 20 Bold title, plain bullet lines */
.check-detail { background: var(--card); border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.check-detail-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.check-detail-title .icon-button { width: 28px; height: 28px; border-radius: 8px; background: var(--surface); }
.check-line { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 16px; }
.check-line::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); flex: none; }
.hint-box { padding: 10px 12px; border-radius: var(--control-radius); background: var(--amber-soft); color: var(--amber); font-size: var(--font-size-control); }

/* Issue Log */
.issue-table { --cols: 48px 1fr 90px 80px 2.4fr 130px 120px 1.4fr; }
.issue-table .table-row { padding-top: 8px; padding-bottom: 8px; }
.issue-table .editable-cell:empty { min-height: 28px; }   /* an empty cell (no remark yet) must still be easy to double click; cells with text stay centered */
.clamp-two-lines { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.filter-row { display: flex; align-items: center; gap: 10px; }
.filter-row .select { width: auto; padding: 7px 32px 7px 12px; background-position: right 10px center; font-size: var(--font-size-control); }
.status-pills { display: flex; gap: 6px; }

.sidebar-row { position: relative; display: flex; align-items: center; }
.sidebar-row .sidebar-item { flex: 1; min-width: 0; }
.sidebar-row .icon-button { position: absolute; right: 8px; top: 10px; width: 28px; height: 28px; opacity: 0; }   /* "..." sits inside the 196 wide item (Figma) */
.sidebar-row:hover .icon-button, .sidebar-row:focus-within .icon-button { opacity: 1; }

/* Archived (read-only) list: fewer columns */
.table.is-archived { --cols: 48px minmax(240px, 3fr) 1.5fr 70px 70px; }
.table.is-no-suggestion { --cols: 48px minmax(240px, 3fr) 1.5fr 150px 70px 70px; }   /* no Web suggestion column (Online check is off) */
.tick { color: var(--sage); display: inline-flex; }
.dash { color: var(--muted); }

.bottom-bar { height: 44px; flex: none; padding: 0 var(--page-padding); display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--line); font-size: var(--font-size-small); background: var(--card); }

/* Column resize: no visible line, only the cursor changes over the edge */
.table-head > div { position: relative; }
.col-resizer { position: absolute; top: 0; right: -10px; width: 12px; height: 100%; cursor: col-resize; z-index: 1; }

/* Issue log filters (Figma): white pills 30 high */
.filter-pill {
  height: 30px; padding: 0 10px; border-radius: var(--control-radius); background: var(--card);
  font-size: var(--font-size-control); font-weight: 500; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-pill:hover { color: var(--text); }
.issue-text { font-size: 13px; font-weight: 500; }

/* ===== Reference images ===== */
.check-detail-columns { display: grid; grid-template-columns: 1fr 330px; gap: 24px; align-items: start; }
.check-detail-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.reference-column { display: flex; flex-direction: column; gap: 10px; }
.reference-label { font-size: var(--font-size-small); font-weight: 500; color: var(--muted); }
.reference-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.reference-card .reference-image { display: block; width: 100%; height: 190px; object-fit: cover; cursor: zoom-in; }
.reference-caption { padding: 8px 10px; font-size: var(--font-size-small); font-weight: 500; color: var(--muted); }
.reference-image.is-broken { background: var(--surface); }
.add-image-link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 0; background: none; border: 0; color: var(--accent); font-size: 13px; font-weight: 500; cursor: pointer; }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 8px; height: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: var(--font-size-control); cursor: pointer; }
.dropzone.is-over { border-color: var(--accent); color: var(--accent); }
.thumb-row { display: flex; gap: 10px; align-items: center; }
.thumb-row .reference-image { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; }
.thumb-row .input { flex: 1; }
.image-viewer { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.image-viewer .reference-image.is-large { max-width: 90%; max-height: 80%; border-radius: 12px; }
.image-viewer-caption { color: var(--on-accent); font-size: var(--font-size-control); }

/* ===== Breadcrumb (IT inside a department): 16 high, gap 8, 12 Medium ===== */
.breadcrumb { display: flex; align-items: center; gap: 8px; height: 16px; flex: none; }
.breadcrumb-link { display: inline-flex; align-items: center; gap: 8px; padding: 0; background: none; border: 0; color: var(--accent); font-size: var(--font-size-control); font-weight: 500; cursor: pointer; }
.breadcrumb-text { color: var(--muted); font-size: var(--font-size-control); font-weight: 500; }

/* ===== Inline version edit (double click) ===== */
.version-edit { width: 100%; max-width: 150px;   /* Figma version cell is 150 wide */  height: 30px; box-sizing: border-box; padding: 0 10px; font-size: 12px; color: var(--text); background: var(--surface); border: 1px solid var(--accent); border-radius: var(--control-radius); outline: none; user-select: text; }

/* Software list lock banner and the plain "Unlock requested" note */
.banner.is-lock { height: 36px; padding-top: 0; padding-bottom: 0; }
.link-button { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-size: var(--font-size-control); font-weight: 500; }
.unlock-note { color: var(--amber); }
.checkbox.is-disabled:not(.is-checked) { opacity: .4; }
.pill.is-disabled { opacity: .4; cursor: default; }
.pill.is-disabled:hover { color: var(--muted); }

/* Stage action button in the bottom bar: same size as the other buttons (30 px high, radius 10, padding 12) */
.bottom-bar .button { min-height: 30px; height: 30px; padding: 0 12px; }
.bottom-bar .split-button .button:last-child { padding: 0 8px; }


/* Items / Lab cells in the Issue Log: text, then a small dropdown arrow */
.issue-table .editable-cell.has-arrow { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cell-arrow { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.cell-arrow:hover { background: var(--surface); color: var(--text); }
.table-row.is-cut { opacity: .45; }   /* rows waiting to be moved (Ctrl+X) */
