// Page-specific components: pagination, alerts, chips, calendar, inbox, invoice, project/product cards

// ────────────────────────
//  PAGINATION
// ────────────────────────
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color-light);
}
.pagination .page-info {
  margin-right: auto;
  font-size: 12px;
  color: var(--text-muted);
}
.page-link {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 100ms, color 100ms, border-color 100ms;
  text-decoration: none;
}
.page-link:hover { background: var(--bg-surface-secondary); color: var(--text); text-decoration: none; }
.page-link.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary-dk);
}
.page-link.disabled { color: var(--text-disabled); cursor: not-allowed; }

// ────────────────────────
//  ALERTS
// ────────────────────────
.alert {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 12px;
}
.alert .alert-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert .alert-body { flex: 1; }
.alert strong { font-weight: var(--font-weight-medium); }
.alert-info    { color: var(--blue);   border-color: rgba(6,111,209,0.2);   background: var(--blue-lt); }
.alert-success { color: var(--green);  border-color: rgba(47,179,68,0.2);   background: var(--green-lt); }
.alert-warning { color: #b45309;       border-color: rgba(245,159,0,0.2);   background: var(--yellow-lt); }
.alert-error   { color: var(--red);    border-color: rgba(214,57,57,0.2);   background: var(--red-lt); }

// ────────────────────────
//  CHIPS / TAGS
// ────────────────────────
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 22px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: 11px;
  white-space: nowrap;
}
.chip-primary { color: var(--primary); background: var(--primary-lt); border-color: rgba(26,187,156,0.2); }
.chip-blue    { color: var(--blue);    background: var(--blue-lt);    border-color: rgba(6,111,209,0.2); }
.chip-green   { color: var(--green);   background: var(--green-lt);   border-color: rgba(47,179,68,0.2); }
.chip-yellow  { color: #b45309;        background: var(--yellow-lt);  border-color: rgba(245,159,0,0.2); }
.chip-red     { color: var(--red);     background: var(--red-lt);     border-color: rgba(214,57,57,0.2); }
.chip-purple  { color: var(--purple);  background: var(--purple-lt);  border-color: rgba(174,62,201,0.2); }

// ────────────────────────
//  CALENDAR (month grid)
// ────────────────────────
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color-light);
}
.calendar-month {
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  color: var(--text);
}
.calendar-toolbar .nav-btns { display: flex; gap: var(--space-1); }
.calendar-toolbar .spacer { flex: 1; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-color-light);
  border-bottom: 1px solid var(--border-color-light);
}
.calendar-grid .dow {
  background: var(--bg-surface-secondary);
  padding: 8px;
  font-size: 10.5px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: center;
}
.calendar-day {
  background: var(--bg-surface);
  min-height: 90px;
  padding: 6px 8px;
  font-size: 12px;
  position: relative;
  cursor: pointer;
  transition: background 100ms;
}
.calendar-day:hover { background: var(--bg-surface-secondary); }
.calendar-day.muted { color: var(--text-disabled); background: var(--bg-surface-secondary); }
.calendar-day.today .day-num {
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: var(--font-weight-bold);
}
.calendar-day .day-num {
  font-weight: var(--font-weight-medium);
  font-size: 12px;
}
.calendar-event {
  display: block;
  margin-top: 4px;
  padding: 2px 6px;
  font-size: 10.5px;
  line-height: 1.4;
  border-radius: 3px;
  background: var(--primary-lt);
  color: var(--primary);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: filter 120ms;
}
.calendar-event:hover { filter: brightness(0.95); }
.calendar-day { cursor: pointer; }
.calendar-event.blue   { background: var(--blue-lt);   color: var(--blue); }
.calendar-event.yellow { background: var(--yellow-lt); color: #b45309; }
.calendar-event.red    { background: var(--red-lt);    color: var(--red); }
.calendar-event.purple { background: var(--purple-lt); color: var(--purple); }

@media (max-width: 700px) {
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(72px, 1fr));
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  .calendar-grid > * { scroll-snap-align: start; }
  .calendar-day { min-height: 70px; padding: 4px 6px; }
  .calendar-event {
    font-size: 10px;
    padding: 1px 4px;
  }
}

// ────────────────────────
//  INBOX
// ────────────────────────
.inbox-layout {
  display: grid;
  grid-template-columns: 200px 320px 1fr;
  min-height: 640px;
  height: calc(100vh - 240px);
  position: relative;
}
.inbox-sidebar {
  border-right: 1px solid var(--border-color-light);
  padding: 12px 8px;
  overflow-y: auto;
}
.inbox-sidebar-label {
  padding: 14px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.inbox-folder {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 100ms, color 100ms;
  text-decoration: none;
  margin-bottom: 1px;
}
.inbox-folder:hover { background: var(--bg-surface-secondary); color: var(--text); text-decoration: none; }
.inbox-folder.active { background: var(--primary-lt); color: var(--primary); font-weight: var(--font-weight-medium); }
.inbox-folder .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface-secondary);
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.inbox-folder.active .count { color: var(--primary); background: rgba(26, 187, 156, 0.14); }
.inbox-folder svg { width: 14px; height: 14px; flex-shrink: 0; }
.inbox-label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

// List pane (middle column)
.inbox-list-pane {
  border-right: 1px solid var(--border-color-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.inbox-list-toolbar {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color-light);
}
.inbox-search {
  flex: 1;
  height: 30px;
  padding: 0 10px;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 12.5px;
  color: var(--text);
}
.inbox-search:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-surface);
}
.inbox-list { overflow-y: auto; flex: 1; }
.inbox-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: var(--space-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color-light);
  cursor: pointer;
  transition: background 80ms;
  font-size: 13px;
  align-items: start;
}
.inbox-item:hover { background: var(--bg-surface-secondary); }
.inbox-item.unread { background: var(--bg-surface); }
.inbox-item.unread .sender,
.inbox-item.unread .subject { color: var(--text); font-weight: var(--font-weight-bold); }
.inbox-item.selected {
  background: var(--primary-lt);
  border-left: 2px solid var(--primary);
  padding-left: 10px;
}
.inbox-item-body { min-width: 0; }
.inbox-item .sender { font-size: 12.5px; font-weight: var(--font-weight-medium); color: var(--text-secondary); margin-bottom: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item .subject {
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-item .preview {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-item .meta { text-align: right; font-size: 11px; color: var(--text-muted); white-space: nowrap; padding-top: 2px; }
.inbox-star-btn {
  width: 22px;
  height: 22px;
  background: transparent;
  border: 0;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.inbox-star-btn:hover { background: rgba(0, 0, 0, 0.04); }
.inbox-star-btn .star {
  width: 14px;
  height: 14px;
  color: var(--border-color);
}
.inbox-star-btn .star.on { color: var(--yellow); fill: var(--yellow); }

// Label pills inside list and reader
.inbox-label-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: capitalize;
  flex-shrink: 0;
}
.inbox-label-pill[data-label="work"]       { background: var(--primary-lt);  color: var(--primary); }
.inbox-label-pill[data-label="personal"]   { background: var(--blue-lt);     color: var(--blue); }
.inbox-label-pill[data-label="promotions"] { background: var(--yellow-lt);   color: var(--yellow); }
.inbox-label-pill[data-label="urgent"]     { background: var(--red-lt);      color: var(--red); }
.inbox-label-pill-lg {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
}

// Reader pane (right column)
.inbox-reader {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
}
.inbox-reader-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color-light);
  flex-wrap: wrap;
}
.inbox-reader-toolbar [data-action="back"] { display: none; }
.inbox-reader-spacer { flex: 1; }
.inbox-reader-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}
.inbox-reader-subject {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px;
  line-height: 1.3;
}
.inbox-reader-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 0 18px;
  border-bottom: 1px solid var(--border-color-light);
  margin-bottom: 18px;
}
.inbox-reader-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.inbox-reader-meta-text { flex: 1; font-size: 13px; }
.inbox-reader-meta-text strong { color: var(--text); font-weight: var(--font-weight-medium); }
.inbox-reader-email { color: var(--text-muted); font-size: 12px; }
.inbox-reader-to { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.inbox-reader-time { font-size: 12px; color: var(--text-muted); }
.inbox-reader-body {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.inbox-reader-empty { height: 100%; }

// Compose modal: textarea sized for messages
.compose-form .form-control[id="compose-body"] {
  min-height: 180px;
  resize: vertical;
  font-family: var(--font);
}

// Responsive
@media (max-width: 1100px) {
  .inbox-layout { grid-template-columns: 180px 280px 1fr; }
}
@media (max-width: 900px) {
  .inbox-layout { grid-template-columns: 1fr; }
  .inbox-sidebar { display: none; }
  .inbox-list-pane,
  .inbox-reader { grid-row: 1; grid-column: 1; }
  .inbox-reader { display: none; }
  #inbox-root.reader-open .inbox-list-pane { display: none; }
  #inbox-root.reader-open .inbox-reader { display: flex; }
  .inbox-reader-toolbar [data-action="back"] { display: inline-flex; }
}

// ────────────────────────
//  INVOICE
// ────────────────────────
.invoice {
  background: var(--bg-surface);
  padding: 32px;
}
.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.invoice-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 4px;
}
.invoice-meta { font-size: 12.5px; color: var(--text-muted); }
.invoice-meta strong { color: var(--text); font-weight: var(--font-weight-medium); }
.invoice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: 28px;
}
.invoice-grid h4 {
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.invoice-grid p { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.invoice-grid p strong { color: var(--text); font-weight: var(--font-weight-medium); }

// Invoice ships a 32px padded paper-style block with a 2-col header and
// 2-col billed-to/pay-to grid. None of that fits a phone — stack and
// shrink the padding so the long IBAN / address blocks have room.
@media (max-width: 768px) {
  .invoice { padding: 16px; }
  .invoice-header { flex-direction: column; gap: var(--space-3); margin-bottom: 20px; }
  .invoice-grid { grid-template-columns: 1fr; gap: var(--space-3); margin-bottom: 20px; }
}

.invoice-totals {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}
.invoice-totals table { font-size: 13px; }
.invoice-totals td { padding: 4px 16px 4px 0; color: var(--text-secondary); }
.invoice-totals td:last-child { text-align: right; padding-right: 0; min-width: 100px; color: var(--text); font-weight: var(--font-weight-medium); }
.invoice-totals tr.grand td {
  border-top: 2px solid var(--border-color);
  padding-top: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

// ── Invoice line-item editor ──────────────────────────────────────────
// Used on invoice.html for the editable items table + payment status row.
.invoice-editor {
  margin-top: 18px;
  border-top: 1px solid var(--border-color-light);
  padding-top: var(--space-3);
}
.invoice-editor-header,
.line-row {
  display: grid;
  grid-template-columns: 1fr 60px 90px 100px 28px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.line-row {
  font-size: 13px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  border-top: 1px solid var(--border-color-light);
  padding: var(--space-2) 0;
}
.line-row input[type="text"],
.line-row input[type="number"] {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  padding: var(--space-1) 6px;
  border-radius: var(--radius-sm);
  transition: border-color 100ms, background 100ms;
}
.line-row input[type="text"]:hover,
.line-row input[type="number"]:hover { border-color: var(--border-color); }
.line-row input[type="text"]:focus,
.line-row input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-lt);
}
.line-row input[type="number"] { text-align: right; -moz-appearance: textfield; }
.line-row input[type="number"]::-webkit-outer-spin-button,
.line-row input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.line-row .desc-wrap input.desc-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.line-row .amount {
  text-align: right;
  font-weight: var(--font-weight-medium);
  color: var(--text);
}
.line-row .remove-btn {
  width: 24px; height: 24px;
  border: 0;
  background: transparent;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 100ms, background 100ms, color 100ms;
}
.line-row:hover .remove-btn { opacity: 1; }
.line-row .remove-btn:hover { background: var(--red-lt); color: var(--red); }

// The 5-col grid (1fr 60 90 100 28 + 4×10gap = 1fr + 318px) needs at least
// 318px just for fixed columns, which doesn't leave room for the description
// on a 375px phone. Drop the column header and stack qty/rate/amount on a
// second visual row with the description spanning above.
@media (max-width: 600px) {
  .invoice-editor-header { display: none; }
  .line-row {
    grid-template-columns: 1fr 60px 90px 28px;
    grid-template-areas:
      "desc desc desc remove"
      "qty rate amount amount";
    row-gap: 6px;
  }
  .line-row .desc-wrap   { grid-area: desc; }
  .line-row .qty         { grid-area: qty; }
  .line-row .rate        { grid-area: rate; }
  .line-row .amount      { grid-area: amount; }
  .line-row .remove-btn  { grid-area: remove; opacity: 1; }
}

.totals-input {
  width: 50px;
  margin: 0 var(--space-1);
  padding: 1px 6px;
  font: inherit;
  font-size: 12.5px;
  text-align: right;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text);
  -moz-appearance: textfield;
}
.totals-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-lt); }
.totals-input::-webkit-outer-spin-button,
.totals-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

// ── Invoice payment status (horizontal step indicator) ────────────────
.invoice-payment-status {
  margin-top: var(--space-6);
  padding: 18px;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  position: relative;
  gap: var(--space-3);
}
.invoice-payment-status::before {
  content: '';
  position: absolute;
  left: 32px; right: 32px; top: 28px;
  height: 2px;
  background: var(--border-color);
  z-index: 0;
}
.ips-step {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.ips-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
}
.ips-step.done .ips-dot { background: var(--primary); border-color: var(--primary); }
.ips-step.active .ips-dot {
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-lt);
}
.ips-step.paid .ips-dot { background: var(--green); border-color: var(--green); }
.ips-step .ips-title { font-size: 12.5px; font-weight: var(--font-weight-medium); color: var(--text); }
.ips-step:not(.done):not(.active):not(.paid) .ips-title { color: var(--text-muted); }
.ips-step .ips-time { font-size: 11px; color: var(--text-muted); }

// Strip editor chrome from the printed invoice — keeps it looking like a
// finished document instead of an in-progress form.
@media print {
  .invoice-editor-header { display: none; }
  .line-row .remove-btn,
  #add-line,
  .totals-input { display: none; }
  .line-row input { border: 0; padding: 0; background: transparent; }
  .invoice-payment-status { display: none; }
}

// ────────────────────────
//  PROJECT CARD
// ────────────────────────
.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 120ms, box-shadow 120ms;
  cursor: pointer;
}
.project-card:hover {
  border-color: var(--text-muted);
  box-shadow: 0 2px 8px rgba(30,38,51,0.06);
}
.project-card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.project-card .title { font-size: 14px; font-weight: var(--font-weight-bold); color: var(--text); margin-bottom: 2px; }
.project-card .client { font-size: 11.5px; color: var(--text-muted); }
.project-card .desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.project-card .footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-color-light);
  font-size: 11.5px;
  color: var(--text-muted);
}
.project-card .avatars { display: flex; }
.project-card .avatars .av {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 600; color: white;
  margin-left: -4px;
}
.project-card .avatars .av:first-child { margin-left: 0; }

// ────────────────────────
//  PRODUCT CARD (e-commerce)
// ────────────────────────
.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 120ms, box-shadow 120ms, transform 120ms;
  display: block;
  text-decoration: none;
  color: inherit;
}
.product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(30,38,51,0.08);
  transform: translateY(-1px);
  text-decoration: none;
}
.product-thumb {
  aspect-ratio: 4 / 3;
  background: var(--bg-surface-secondary);
  position: relative;
  overflow: hidden;
}
.product-thumb svg { display: block; width: 100%; height: 100%; }
.product-thumb .product-badge {
  position: absolute;
  top: 8px; left: 8px;
}
.product-info { padding: 12px; }
.product-info .name { font-size: 13px; font-weight: var(--font-weight-medium); color: var(--text); margin-bottom: 2px; }
.product-info .category { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.product-info .price-row { display: flex; align-items: baseline; gap: 6px; }
.product-info .price { font-size: 15px; font-weight: 600; color: var(--text); }
.product-info .price-old { font-size: 12px; color: var(--text-muted); text-decoration: line-through; }
.product-info .stars { color: var(--yellow); font-size: 12px; margin-top: 4px; }

// ────────────────────────
//  CONTACT CARD
// ────────────────────────
.contact-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}
.contact-card .av {
  width: 56px; height: 56px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 600;
}
.contact-card .name { font-size: 14px; font-weight: var(--font-weight-bold); color: var(--text); }
.contact-card .role { font-size: 11.5px; color: var(--text-muted); margin-bottom: 12px; }
.contact-card .stats {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  padding-top: 12px;
  border-top: 1px solid var(--border-color-light);
  font-size: 11px;
  color: var(--text-muted);
}
.contact-card .stats strong { display: block; font-size: 13px; color: var(--text); font-weight: var(--font-weight-bold); }

// ────────────────────────
//  ICON GRID (icons.html)
// ────────────────────────
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
}
.icon-category {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 22px 4px 10px;
  margin-top: 8px;
  border-bottom: 1px solid var(--border-color-light);
}
.icon-category:first-child { margin-top: 0; padding-top: 4px; }
.icon-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px 12px;
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius);
  background: var(--bg-surface);
  cursor: pointer;
  transition: background 100ms, border-color 100ms, transform 100ms;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  text-align: center;
  position: relative;
}
.icon-cell:hover {
  background: var(--bg-surface);
  border-color: var(--primary);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.icon-cell svg {
  width: 48px;
  height: 48px;
  color: var(--text-secondary);
  transition: color 100ms;
  stroke-width: 1.4;
}
.icon-cell:hover svg { color: var(--primary); }
.icon-cell .copied {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-lt);
  color: var(--primary);
  border-radius: var(--radius);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms;
}
.icon-cell.was-copied .copied { opacity: 1; }
.icon-cell.was-copied { border-color: var(--primary); }

// ────────────────────────
//  TYPOGRAPHY SHOWCASE
// ────────────────────────
.type-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: var(--space-4);
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color-light);
}
.type-row:last-child { border-bottom: none; }
.type-label { font-size: 11px; color: var(--text-muted); padding-top: 4px; font-family: var(--font-mono); }
// Display samples (56px / 42px headlines) blow past a ~250px column on
// phones; stack the spec label above the sample and let long words break.
.type-row .type-sample, .type-row > :last-child { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .type-row { grid-template-columns: 1fr; gap: var(--space-1); }
}


// ────────────────────────
//  DETAIL MODALS (project / contact)
// ────────────────────────
.detail-project {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail-project .detail-header {
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: flex-start;
}
.detail-project .head-left { flex: 1; min-width: 0; }
.detail-project .client-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.detail-project .desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-3);
  padding: 14px 0;
  border-top: 1px solid var(--border-color-light);
  border-bottom: 1px solid var(--border-color-light);
}
.detail-stats .stat-block .label {
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.detail-stats .stat-block .value {
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  color: var(--text);
  margin-bottom: 6px;
}
.detail-stats .stat-block .progress-thin { margin-top: 4px; }

.detail-section .detail-section-title {
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.detail-members {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-2);
}
.detail-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-secondary);
}
.detail-member .av {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
}
.detail-member .meta { display: flex; flex-direction: column; min-width: 0; }
.detail-member .name { font-size: 12.5px; font-weight: var(--font-weight-medium); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-member .role { font-size: 11px; color: var(--text-muted); }

.detail-tasks { display: flex; flex-direction: column; gap: var(--space-1); }
.detail-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  font-size: 13px;
  color: var(--text);
}
.detail-task .checkbox {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}
.detail-task.done .checkbox {
  background: var(--primary);
  border-color: var(--primary);
}
.detail-task.done .task-title { color: var(--text-muted); text-decoration: line-through; }

.detail-activity { display: flex; flex-direction: column; gap: var(--space-2); }
.detail-activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.detail-activity-item .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 7px;
  flex-shrink: 0;
}
.detail-activity-item strong { color: var(--text); font-weight: var(--font-weight-medium); }
.detail-activity-item .time { color: var(--text-muted); }

// Contact modal
.detail-contact { display: flex; flex-direction: column; gap: 18px; }
.detail-contact-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.detail-contact-head .big-av {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
}
.detail-contact-head .name { font-size: 18px; font-weight: var(--font-weight-bold); color: var(--text); margin-bottom: 2px; }
.detail-contact-head .role { font-size: 13px; color: var(--text-muted); }

.detail-contact-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border-color-light);
  border-bottom: 1px solid var(--border-color-light);
}
.detail-contact-fields > div { display: flex; flex-direction: column; gap: 2px; }
.detail-contact-fields .label {
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.detail-contact-fields .value { font-size: 13px; color: var(--text); }
.detail-contact-fields a.value { color: var(--primary); }

.detail-contact-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  text-align: center;
}
.detail-contact-stats > div {
  padding: 12px;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius);
}
.detail-contact-stats strong {
  display: block;
  font-size: 22px;
  font-weight: var(--font-weight-bold);
  color: var(--text);
  margin-bottom: 2px;
}
.detail-contact-stats span { font-size: 11px; color: var(--text-muted); }

// Make project cards focusable buttons look like cards
button.project-card {
  appearance: none;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button.project-card:hover { border-color: var(--primary); }
.contact-card { cursor: pointer; }

// ────────────────────────
//  FIXED FOOTER (page-scoped)
// ────────────────────────
.page-fixed-footer .footer {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  z-index: 80;
}
.page-fixed-footer .page-wrapper { padding-bottom: 80px; }
@media (max-width: 768px) {
  .page-fixed-footer .footer { left: 0; }
}

// ────────────────────────
//  FILE UPLOAD (form_upload.html)
// ────────────────────────
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  transition: border-color 150ms, background 150ms;
  cursor: pointer;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--primary);
  background: var(--primary-lt);
  color: var(--primary);
}
.dropzone svg { width: 36px; height: 36px; margin-bottom: 8px; opacity: .6; }
.dropzone .hint {
  font-size: 13px;
  color: var(--text);
  font-weight: var(--font-weight-medium);
  margin-bottom: 4px;
}
.dropzone .sub { font-size: 11.5px; }
.upload-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: var(--space-3);
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color-light);
  font-size: 13px;
}
.upload-row:last-child { border-bottom: none; }
.upload-row .icon {
  width: 32px;
  height: 32px;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

// ────────────────────────
//  WIZARD (form_wizards.html)
// ────────────────────────
.wizard-steps {
  display: flex;
  gap: 0;
  padding: 16px;
  border-bottom: 1px solid var(--border-color-light);
}
.wizard-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: .6;
}
.wizard-step.active, .wizard-step.done { opacity: 1; }
.wizard-step .num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface-secondary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}
.wizard-step.active .num {
  background: var(--primary);
  color: white;
  border-color: var(--primary-dk);
}
.wizard-step.done .num {
  background: var(--green);
  color: white;
  border-color: transparent;
}
.wizard-step .label {
  font-size: 12.5px;
  color: var(--text);
  font-weight: var(--font-weight-medium);
}
.wizard-step .sub { font-size: 11px; color: var(--text-muted); }
.wizard-step + .wizard-step::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--border-color);
  margin: 0 14px 0 -14px;
  align-self: center;
}
.wizard-panel { display: none; padding: 20px; }

// Step row stays on one line by default; under 600px it stacks the steps
// vertically — connector line and the secondary "sub" label add width that
// causes the row to overflow on phones.
@media (max-width: 600px) {
  .wizard-steps { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; }
  .wizard-step { flex: none; width: 100%; }
  .wizard-step .sub { display: none; }
  .wizard-step + .wizard-step::before { display: none; }
  .wizard-panel { padding: 14px; }
}
.wizard-panel.active { display: block; }

// ────────────────────────
//  MEDIA GALLERY
// ────────────────────────
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
}
.media-tile {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 150ms;
  border: 1px solid var(--border-color);
}
.media-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 38, 51, 0.08);
}
.media-tile .meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  color: white;
  font-size: 11.5px;
  font-weight: var(--font-weight-medium);
  display: flex;
  justify-content: space-between;
}
.media-tile .meta .size { opacity: .8; font-weight: 400; }

// ────────────────────────
//  PRICING TABLES
// ────────────────────────
.pricing-tier {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.pricing-tier.popular {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 4px 16px rgba(26, 187, 156, 0.12);
  position: relative;
}
.pricing-tier.popular::before {
  content: 'Most popular';
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pricing-tier .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pricing-tier .price {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1;
}
.pricing-tier .price small {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
}
.pricing-tier .desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.pricing-tier ul {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.pricing-tier ul li {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}
.pricing-tier ul li svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

// ────────────────────────
//  LANDING PAGE
// ────────────────────────
.landing-body { background: var(--bg-surface); }
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}
[data-theme="dark"] .landing-nav { background: rgba(20, 29, 43, 0.85); }
.landing-nav .brand { display: flex; align-items: center; gap: 10px; }
.landing-nav .brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}
.landing-nav .brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.2px;
}
.landing-nav nav {
  display: flex;
  gap: var(--space-5);
  margin-left: 32px;
  font-size: 13px;
}
.landing-nav nav a { color: var(--text-secondary); }
.landing-nav nav a:hover { color: var(--text); text-decoration: none; }
.landing-nav .cta { margin-left: auto; display: flex; gap: var(--space-2); }

.hero {
  padding: 80px 32px 60px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 80% at 30% 20%, rgba(26, 187, 156, 0.08), transparent),
    radial-gradient(ellipse 60% 80% at 70% 60%, rgba(66, 153, 225, 0.06), transparent);
}
.hero h1 {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.05;
  max-width: 820px;
  margin: 0 auto 18px;
  color: var(--text);
}
.hero h1 span {
  background: linear-gradient(135deg, var(--primary), var(--azure));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .subhead {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.5;
}
.hero .cta { display: inline-flex; gap: 10px; }

.features {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.feature .icon {
  width: 44px;
  height: 44px;
  background: var(--primary-lt);
  color: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.feature .icon svg { width: 22px; height: 22px; }
.feature h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.feature p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; }

.cta-band {
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  color: white;
  padding: 60px 32px;
  text-align: center;
}
.cta-band h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.8px;
  margin-bottom: 12px;
}
.cta-band p {
  font-size: 15px;
  opacity: .9;
  max-width: 520px;
  margin: 0 auto 24px;
}

.landing-footer {
  padding: 32px;
  border-top: 1px solid var(--border-color-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
}
@media (max-width: 768px) {
  .hero h1 { font-size: 36px; letter-spacing: -1px; }
  .features { grid-template-columns: 1fr; }
  .landing-nav nav { display: none; }
}

// ────────────────────────
//  PRINT
// ────────────────────────
// Hide chrome (sidebar, topbar, footer, action bars) and let the page content
// flow on plain white. Targets invoice and order detail by default; any page
// can opt in by adding `class="print-friendly"` to <body>.
@media print {
  @page { margin: 16mm; size: auto; }

  body { background: white; color: #000; }
  .sidebar,
  .topbar,
  .footer,
  .skip-link,
  .sidebar-backdrop,
  .toast-host,
  .menu-popover,
  .modal-backdrop,
  .page-actions,
  .breadcrumb,
  .card-opt-btn { display: none !important; }

  .main { margin-left: 0 !important; padding: 0 !important; }
  .page-wrapper { padding: 0 !important; max-width: none !important; }
  .card,
  .invoice {
    box-shadow: none !important;
    border: none !important;
    page-break-inside: avoid;
  }
  // Don't break inside table rows.
  tr, .invoice-row { page-break-inside: avoid; }
  // Re-enable link URLs after the link text for printed pages.
  a[href]:not([href^="#"]):not([href^="javascript:"])::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
  // Charts are pixel-rendered canvases; print at the surface size.
  [data-chart] { break-inside: avoid; }
}

