/* werqly admin — builds on the tokens and components in styles.css */

body.adm { background: var(--paper); min-height: 100vh; }

.adm-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.adm-main { padding: 32px 24px 64px; }

.adm-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.adm-header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.adm-header .brand { display: inline-flex; align-items: center; gap: 10px; }
.adm-badge {
  font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 9px;
}
.adm-user { display: flex; align-items: center; gap: 14px; }
.adm-user form { margin: 0; }
.adm-email { font-size: .88rem; color: var(--muted); }

.adm h1 { font-size: 1.6rem; letter-spacing: -0.025em; }
.adm-h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); margin: 26px 0 10px; }
.adm-sub { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.adm-muted { color: var(--muted-2); }
.adm-note { margin-top: 14px; font-size: .82rem; color: var(--muted-2); }
.adm-nowrap { white-space: nowrap; }

.adm-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.adm-form { display: grid; gap: 16px; margin-top: 18px; }

.adm-alert { border-radius: 10px; padding: 12px 14px; font-size: .9rem; margin: 0 0 18px; border: 1px solid; }
.adm-alert-error { color: #9B2C2C; background: #FDF2F2; border-color: #F5C6C6; }
.adm-alert-warn { color: #7A4B00; background: #FFF8EB; border-color: #F5DDB0; }
.adm-alert-ok { color: #0E6B38; background: #EEF9F2; border-color: #BFE5CD; }

/* login */
.adm-login { max-width: 400px; margin: 48px auto 0; }

/* list */
.adm-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.adm-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-search input { width: 300px; max-width: 100%; padding: 8px 12px; font-size: .9rem; }

.adm-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.adm-chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 500;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}
.adm-chip span { font-size: .78rem; color: var(--muted-2); font-weight: 600; }
.adm-chip:hover { border-color: var(--muted-2); }
.adm-chip.is-active { color: var(--accent); background: var(--accent-soft); border-color: rgba(11, 79, 228, .3); }
.adm-chip.is-active span { color: var(--accent); }

.adm-tablewrap { margin-top: 0; }
.adm-table { min-width: 960px; }
.adm-table thead th { background: var(--surface); white-space: nowrap; }
.adm-table td { padding: 13px 20px; font-size: .9rem; color: var(--ink-2); border-top: 1px solid var(--line-soft); vertical-align: top; }
.adm-table tbody tr:hover td { background: #FAFBFD; }
.adm-table a { color: var(--accent); }
.adm-rowlink { font-weight: 600; color: var(--ink) !important; }
.adm-rowlink:hover { color: var(--accent) !important; }

.adm-status { display: inline-block; font-size: .76rem; font-weight: 600; border-radius: 999px; padding: 3px 9px; white-space: nowrap; background: var(--line-soft); color: var(--ink-2); }
.adm-status-new { background: var(--accent-soft); color: var(--accent); }
.adm-status-contacted { background: #F1ECFE; color: #5B3CC4; }
.adm-status-meeting { background: #FFF4E0; color: #9A5B00; }
.adm-status-proposal { background: #E8F6FB; color: #0D6B8A; }
.adm-status-won { background: #EEF9F2; color: #0E6B38; }
.adm-status-lost { background: #F2F3F5; color: #6B7280; }

.adm-source { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }

.adm-empty { text-align: center; padding: 64px 24px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius-lg); }
.adm-empty h2 { font-size: 1.1rem; }
.adm-empty p { color: var(--muted); margin-top: 8px; }
.adm-empty a { color: var(--accent); }

/* detail */
.adm-back { display: inline-block; font-size: .9rem; color: var(--muted); margin-bottom: 16px; }
.adm-back:hover { color: var(--ink); }
.adm-detail { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.adm-detail h1 { margin-top: 6px; }
.adm-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin: 22px 0 0; }
.adm-dl dt { font-size: .78rem; color: var(--muted-2); font-weight: 500; }
.adm-dl dd { margin: 3px 0 0; font-size: .95rem; color: var(--ink); word-break: break-word; }
.adm-dl a { color: var(--accent); }
.adm-message { white-space: pre-wrap; font-size: .95rem; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px 16px; }

.adm-estimate { margin-top: 4px; font-size: .92rem; color: var(--ink-2); }
.adm-estimate table { min-width: 0; margin-top: 10px; }
.adm-estimate td, .adm-estimate th { padding: 8px 12px; font-size: .86rem; }

@media (max-width: 860px) {
  .adm-detail { grid-template-columns: 1fr; }
  .adm-dl { grid-template-columns: 1fr; }
  .adm-email { display: none; }
}
.adm-card > .adm-form:first-child { margin-top: 0; }
.adm-source-calculator { color: #0D6B8A; border-color: #BFE3EF; background: #F2FAFD; }
.adm-source-quote { color: #0E6B38; border-color: #BFE5CD; background: #EEF9F2; }
.adm-source-chat { color: #6B3FA0; border-color: #DCCBF2; background: #F7F2FC; }
.adm-source-open { color: #9A3412; border-color: #F5CBA7; background: #FFF4EC; }
.adm-mini { min-width: 560px; }
.adm-mini th, .adm-mini td { padding: 9px 12px; font-size: .86rem; border-top: 1px solid var(--line-soft); text-align: left; }
.adm-mini thead th { border-top: 0; color: var(--muted); font-weight: 600; }
.adm-mini tr.is-chosen td { background: #EEF9F2; font-weight: 600; }
.adm-estimate strong { color: var(--ink); }

/* admin nav */
.adm-nav { display: flex; gap: 4px; margin-left: 18px; }
.adm-nav a { font-size: .9rem; font-weight: 500; color: var(--muted); padding: 6px 10px; border-radius: 8px; }
.adm-nav a:hover { color: var(--ink); background: var(--paper); }
.adm-nav a.is-active { color: var(--accent); background: var(--accent-soft); }
.adm-header-left { display: flex; align-items: center; }

/* quotes */
.adm-quote-status { display: inline-block; font-size: .76rem; font-weight: 600; border-radius: 999px; padding: 3px 9px; white-space: nowrap; background: var(--line-soft); color: var(--ink-2); }
.adm-quote-status-draft { background: #F2F3F5; color: #6B7280; }
.adm-quote-status-sent { background: #E8F6FB; color: #0D6B8A; }
.adm-quote-status-accepted { background: #EEF9F2; color: #0E6B38; }
.adm-quote-status-declined { background: #FDF2F2; color: #9B2C2C; }
.adm-quote { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.adm-quote .adm-h2 { margin-top: 0; }
.adm-quote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.adm-quote-grid .field-wide { grid-column: 1 / -1; }
.adm-quote-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem; color: var(--ink); }
.adm-quote-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.adm-quote-actions form { margin: 0; }
.adm-num { text-align: right; white-space: nowrap; }
@media (max-width: 860px) { .adm-quote-grid { grid-template-columns: 1fr; } .adm-nav { margin-left: 8px; } }

/* prospects */
.adm-prospect-import { margin-top: 24px; }
.adm-tasks { margin-top: 20px; }
.adm-tasks form { margin-top: 8px; }
.adm-list { margin: 0; padding-left: 18px; font-size: .9rem; color: var(--ink-2); display: grid; gap: 4px; }
.adm code { font-size: .84em; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 5px; }

/* quickscan */
.adm-scan { margin-top: 16px; font-size: .92rem; color: var(--ink-2); display: grid; gap: 10px; }
.adm-scan h3 { font-size: 1.15rem; color: var(--ink); }
.adm-scan p { margin: 0; }
.adm-scan strong { color: var(--ink); }
.adm-scan-list { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.adm-scan-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.adm-scan-cols > div { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; }
.adm-scan-running { background: #FFF4E0; color: #9A5B00; }
.adm-scan-error { background: #FDF2F2; color: #9B2C2C; }
.adm-scan-done { background: #EEF9F2; color: #0E6B38; }
@media (max-width: 860px) { .adm-scan-cols { grid-template-columns: 1fr; } }
