/* RMA System — Industrial Minimalism */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --bg-app: #F5F4F0;
  --bg-surface: #FFFFFF;
  --bg-muted: #F1EFE8;
  --bg-hover: #F5F4F0;

  --accent: #185FA5;
  --accent-bg: #E6F1FB;
  --accent-focus: #B5D4F4;

  --status-new: #185FA5;
  --status-new-bg: #E6F1FB;
  --status-progress: #854F0B;
  --status-progress-bg: #FAEEDA;
  --status-resolved: #3B6D11;
  --status-resolved-bg: #EAF3DE;
  --status-closed: #888780;
  --status-closed-bg: #F1EFE8;

  --danger: #A32D2D;
  --danger-strong: #E24B4A;

  --text-primary: #1A1A18;
  --text-secondary: #5A584F;
  --text-muted: #888780;

  --border: 0.5px solid rgba(0,0,0,0.12);
  --border-strong: 0.5px solid rgba(0,0,0,0.18);

  --radius-sm: 8px;
  --radius-md: 12px;

  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

.rma-root {
  font-family: var(--font-sans);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }

/* ─── Buttons ─── */
.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: -0.005em;
  transition: background 0.08s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-muted); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: #144d85; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-muted); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: #fbeeee; }

/* ─── Inputs ─── */
.input, .select, .textarea {
  font-family: var(--font-sans);
  font-size: 13px;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: box-shadow 0.1s, border-color 0.1s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 90px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  box-shadow: 0 0 0 2px var(--accent-focus);
  border-color: var(--accent);
}
.input.error, .textarea.error { border-color: var(--danger-strong); }

.label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.005em;
}

.field-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 5px;
}

/* ─── Status pills ─── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.pill-new { color: var(--status-new); background: var(--status-new-bg); }
.pill-progress { color: var(--status-progress); background: var(--status-progress-bg); }
.pill-resolved { color: var(--status-resolved); background: var(--status-resolved-bg); }
.pill-closed { color: var(--status-closed); background: var(--status-closed-bg); }

/* ─── Type pills (no dot) ─── */
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: var(--border);
}

/* ─── Sidebar ─── */
.sidebar {
  width: 220px;
  flex: 0 0 220px;
  background: var(--bg-app);
  border-right: var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.sidebar-brand {
  padding: 4px 8px 0;
}
.sidebar-brand .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.sidebar-brand .logo-mark {
  width: 22px; height: 22px;
  background: var(--text-primary);
  color: #fff;
  border-radius: 5px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}
.sidebar-brand .subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-left: 30px;
}

.sidebar-section { display: flex; flex-direction: column; gap: 1px; }
.sidebar-section-title {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px 6px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 400;
  letter-spacing: -0.005em;
}
.sidebar-item:hover { background: rgba(0,0,0,0.035); }
.sidebar-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 500;
}
.sidebar-item .left {
  display: flex; align-items: center; gap: 9px;
}
.sidebar-item .dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.sidebar-item .badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  background: rgba(0,0,0,0.06);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: 4px;
  min-width: 22px;
  text-align: center;
}
.sidebar-item.active .badge {
  background: rgba(24,95,165,0.14);
  color: var(--accent);
}
.sidebar-item .badge.badge-new { background: var(--status-new-bg); color: var(--status-new); }
.sidebar-item .badge.badge-progress { background: var(--status-progress-bg); color: var(--status-progress); }

/* ─── Topbar ─── */
.topbar {
  height: 60px;
  border-bottom: var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-surface);
}
.topbar h1 {
  font-size: 17px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.012em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.topbar h1 .count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--font-mono);
}

.topbar-search {
  position: relative;
  width: 320px;
}
.topbar-search .input {
  height: 32px;
  padding-left: 32px;
  font-size: 12.5px;
  background: var(--bg-app);
  border-color: transparent;
}
.topbar-search .input:focus { background: #fff; }
.topbar-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.topbar-right { display: flex; gap: 10px; align-items: center; }

/* ─── Stats cards ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat-card {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: var(--border);
}
.stat-card .stat-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  letter-spacing: 0.005em;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-card .stat-label .dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.stat-card .stat-value {
  font-size: 24px;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-card .stat-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ─── Filter bar ─── */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  margin-bottom: 14px;
  gap: 12px;
}
.filter-pills { display: flex; gap: 4px; background: var(--bg-muted); padding: 3px; border-radius: var(--radius-sm); }
.filter-pill {
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: -0.005em;
}
.filter-pill.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 500;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.12);
}
.filter-pill .count { color: var(--text-muted); margin-left: 5px; font-family: var(--font-mono); font-size: 11px; }
.filter-pill.active .count { color: var(--text-secondary); }

/* ─── Table ─── */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: var(--border);
  overflow: hidden;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 11px 16px;
  border-bottom: var(--border);
  background: #FAFAF7;
}
.tbl tbody td {
  padding: 12px 16px;
  border-bottom: var(--border);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--bg-hover); }

.tbl .col-id { width: 130px; }
.tbl .col-actions { width: 130px; text-align: right; }

.tbl a.id-link {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.tbl a.id-link:hover { text-decoration: underline; }

.client-cell { display: flex; flex-direction: column; line-height: 1.3; }
.client-cell .name { font-weight: 500; font-size: 13px; }
.client-cell .email { font-size: 11.5px; color: var(--text-muted); }

.timestamp {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
}
.icon-btn:hover { background: var(--bg-muted); color: var(--text-primary); }
.icon-btn.danger:hover { background: #fbeeee; color: var(--danger); }

/* ─── Pagination ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  background: #FAFAF7;
}
.pagination .pages { font-family: var(--font-mono); }

/* ─── Modal ─── */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: grid;
  place-items: center;
  z-index: 100;
}
.modal {
  width: 540px;
  max-width: calc(100% - 40px);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: var(--border-strong);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 40px);
}
.modal-header {
  padding: 18px 22px 14px;
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 10px;
}
.modal-body { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  padding: 14px 22px;
  border-top: var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #FAFAF7;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── Customer form ─── */
.public-page {
  background: var(--bg-app);
  min-height: 100%;
  padding: 56px 24px;
  display: flex;
  justify-content: center;
}
.public-card {
  width: 560px;
  max-width: 100%;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: var(--border);
  padding: 36px 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.public-header { display: flex; flex-direction: column; gap: 14px; padding-bottom: 18px; border-bottom: var(--border); }
.public-header .brand {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
}
.public-header h1 {
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.018em;
  line-height: 1.2;
}
.public-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}
.form-grid { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.helper {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--accent);
  width: 14px; height: 14px;
}
.checkbox-row a { color: var(--accent); text-decoration: none; }

.upload-zone {
  border: 0.5px dashed rgba(0,0,0,0.22);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #FAFAF7;
  cursor: pointer;
}
.upload-zone:hover { background: var(--bg-muted); }
.upload-zone .upload-title { font-size: 12.5px; font-weight: 500; }
.upload-zone .upload-sub { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

.btn-submit {
  height: 44px;
  font-size: 14px;
  width: 100%;
  justify-content: center;
}

.public-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ─── Confirm dialog (smaller modal) ─── */
.modal.modal-sm { width: 420px; }
.modal-sm .modal-body { padding-top: 14px; }
.modal-sm p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.modal-sm .id-inline {
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: var(--bg-muted);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ─── Internal scroll containers in artboards ─── */
.admin-frame {
  width: 100%;
  height: 100%;
  display: flex;
  background: var(--bg-app);
  position: relative;
  overflow: hidden;
}
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.admin-content {
  flex: 1;
  padding: 22px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}
