/* admin-dash.css — RMCS Arms admin dashboard styles
   Mobile-first. Tables collapse to cards on small screens.
   Imports after tracker.css to reuse its CSS variables. */

/* ── Layout ── */
.adm-wrap { max-width:1100px; margin:0 auto; padding:24px 16px; }

.adm-header {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:28px; flex-wrap:wrap; gap:12px;
}
.adm-header h1 { font-size:1.5rem; margin:0; }
.adm-nav { display:flex; gap:8px; flex-wrap:wrap; }
.adm-nav a {
  color:var(--text-muted); font-size:0.85rem; text-decoration:none;
  padding:5px 12px; border:1px solid var(--border); border-radius:var(--radius);
  transition:border-color .15s, color .15s;
}
.adm-nav a:hover, .adm-nav a.active { border-color:var(--accent); color:var(--accent); }

/* ── Count cards ── */
.adm-counts { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; margin-bottom:32px; }
.adm-count-card {
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius);
  padding:18px 16px; text-decoration:none; display:block; transition:border-color .15s;
}
.adm-count-card:hover { border-color:var(--accent); }
.adm-count-card .cnt-num { font-size:2rem; font-weight:700; color:var(--accent); line-height:1; }
.adm-count-card .cnt-label { font-size:0.8rem; color:var(--text-muted); margin-top:4px; text-transform:uppercase; letter-spacing:0.6px; }

/* ── Recent activity feed ── */
.adm-section-title { font-size:0.75rem; text-transform:uppercase; letter-spacing:0.8px; color:var(--text-muted); margin-bottom:10px; font-weight:600; }
.adm-feed { display:flex; flex-direction:column; gap:8px; }
.adm-feed-item {
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius);
  padding:12px 14px; display:flex; align-items:center; gap:12px; text-decoration:none;
  transition:border-color .15s;
}
.adm-feed-item:hover { border-color:var(--accent); }
.adm-badge { display:inline-block; padding:2px 9px; border-radius:12px; font-size:0.72rem; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; white-space:nowrap; }
.adm-badge-contact          { background:rgba(79,156,249,0.15); color:#4f9cf9; }
.adm-badge-custom-builds    { background:rgba(200,169,110,0.15); color:var(--accent); }
.adm-badge-cerakote         { background:rgba(139,92,246,0.15); color:#a78bfa; }
.adm-badge-engraving        { background:rgba(245,158,11,0.15); color:#f59e0b; }
.adm-badge-suppressor       { background:rgba(16,185,129,0.15); color:#10b981; }
.adm-feed-name  { flex:1; font-weight:500; }
.adm-feed-date  { font-size:0.8rem; color:var(--text-muted); white-space:nowrap; }

/* ── Status badge ── */
.st-new          { background:rgba(200,169,110,0.15); color:var(--accent); }
.st-contacted    { background:rgba(79,156,249,0.15); color:#4f9cf9; }
.st-in_progress  { background:rgba(16,185,129,0.2); color:#10b981; }
.st-done         { background:rgba(62,207,142,0.15); color:var(--green); }
.st-archived     { background:rgba(139,147,158,0.1); color:var(--text-muted); }
.st-paid         { background:rgba(16,185,129,0.2); color:#10b981; }
.st-awaiting_payment { background:rgba(245,158,11,0.15); color:#f59e0b; }
.st-abandoned    { background:rgba(239,68,68,0.15); color:#ef4444; }

/* ── Search / filter bar ── */
.adm-toolbar {
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
  margin-bottom:20px;
}
.adm-search {
  flex:1; min-width:180px; background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--radius); padding:8px 12px; color:var(--text); font-size:0.9rem;
  font-family:inherit;
}
.adm-search:focus { outline:none; border-color:var(--accent); }
.adm-select {
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius);
  padding:8px 10px; color:var(--text); font-size:0.85rem; font-family:inherit; cursor:pointer;
}
.adm-select:focus { outline:none; border-color:var(--accent); }

/* ── Table ── */
.adm-table-wrap { overflow-x:auto; }
.adm-table { width:100%; border-collapse:collapse; min-width:520px; }
.adm-table th {
  text-align:left; font-size:0.72rem; font-weight:600; text-transform:uppercase;
  letter-spacing:0.7px; color:var(--text-muted); padding:8px 10px;
  border-bottom:1px solid var(--border);
}
.adm-table td { padding:11px 10px; border-bottom:1px solid var(--border); font-size:0.88rem; vertical-align:middle; }
.adm-table tr:hover td { background:var(--surface-2); }
.adm-table a { color:var(--accent); text-decoration:none; }
.adm-table a:hover { text-decoration:underline; }

/* Inline status dropdown form */
.st-form { display:inline; }
.st-select {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:3px 7px; font-size:0.8rem; color:var(--text); font-family:inherit; cursor:pointer;
}
.st-select:focus { outline:none; border-color:var(--accent); }

/* ── Mobile cards (table → cards below 640px) ── */
@media (max-width:639px) {
  .adm-table, .adm-table thead, .adm-table tbody, .adm-table th, .adm-table td, .adm-table tr {
    display:block;
  }
  .adm-table thead { display:none; }
  .adm-table tr {
    background:var(--surface-2); border:1px solid var(--border);
    border-radius:var(--radius); margin-bottom:10px; padding:12px;
  }
  .adm-table td {
    padding:5px 0; border:none; font-size:0.85rem;
    display:flex; justify-content:space-between; gap:8px;
  }
  .adm-table td::before {
    content:attr(data-label);
    font-size:0.7rem; text-transform:uppercase; letter-spacing:0.5px;
    color:var(--text-muted); font-weight:600; white-space:nowrap; padding-top:2px;
  }
}

/* ── Detail page ── */
.adm-detail-grid {
  display:grid; grid-template-columns:1fr 1fr; gap:0; margin-bottom:24px;
}
.adm-field { padding:10px 0; border-bottom:1px solid var(--border); }
.adm-field label { font-size:0.72rem; text-transform:uppercase; letter-spacing:0.6px; color:var(--text-muted); display:block; margin-bottom:3px; }
.adm-field .val { font-size:0.92rem; word-break:break-all; }
.adm-full-width { grid-column:1/-1; }

/* Notes textarea */
.adm-notes { width:100%; min-height:100px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius); padding:10px 12px; color:var(--text); font-size:0.9rem; font-family:inherit; resize:vertical; box-sizing:border-box; }
.adm-notes:focus { outline:none; border-color:var(--accent); }

/* Buttons */
.btn-adm {
  background:var(--accent); color:#0b0d0f; border:none; border-radius:var(--radius);
  padding:8px 18px; font-size:0.9rem; font-weight:600; cursor:pointer; font-family:inherit;
  display:inline-block; text-decoration:none;
}
.btn-adm:hover { opacity:0.85; }
.btn-adm-sm { padding:5px 12px; font-size:0.82rem; }
.btn-ghost {
  background:transparent; border:1px solid var(--border); color:var(--text-muted);
  border-radius:var(--radius); padding:7px 14px; font-size:0.85rem; cursor:pointer; font-family:inherit; text-decoration:none; display:inline-block;
}
.btn-ghost:hover { border-color:var(--accent); color:var(--accent); }

/* Flash messages */
.adm-flash { padding:10px 14px; border-radius:var(--radius); margin-bottom:16px; font-size:0.88rem; }
.adm-flash-ok   { background:rgba(16,185,129,0.12); color:#10b981; border:1px solid rgba(16,185,129,0.3); }
.adm-flash-err  { background:rgba(239,68,68,0.12); color:#ef4444; border:1px solid rgba(239,68,68,0.3); }

/* Login page */
.adm-login-wrap { max-width:380px; margin:80px auto; padding:0 16px; }
.adm-login-box { background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius); padding:32px 28px; }
.adm-login-box h1 { font-size:1.4rem; margin:0 0 24px; text-align:center; }
.adm-input {
  width:100%; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:10px 12px; color:var(--text); font-size:0.95rem; font-family:inherit; box-sizing:border-box;
  margin-bottom:14px;
}
.adm-input:focus { outline:none; border-color:var(--accent); }

@media (max-width:639px) {
  .adm-detail-grid { grid-template-columns:1fr; }
  .adm-header { flex-direction:column; align-items:flex-start; }
}
