/* Digital DirAction CRM — white ground, black ink, yellow accent (#E9B942) */

:root {
  --black: #121110;
  --gold: #e9b942;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f4f1;
  --text: #1a1917;
  --dim: #6b6a66;
  --line: #e8e6e1;
  --won: #17915f;
  --lost: #d6455d;
  --pill: 999px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26,25,23,.05), 0 1px 3px rgba(26,25,23,.07);
  --lift: 0 10px 26px -10px rgba(26,25,23,.25);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3 { margin: 0; letter-spacing: -.02em; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: var(--black);
  display: flex; flex-direction: column; padding: 20px 0;
}
.brand { padding: 0 20px 18px; }
.brand-line { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -.03em; line-height: 1.15; display: flex; align-items: baseline; }
.tri { width: 11px; height: 9px; margin: 0 1px; fill: var(--gold); align-self: center; }
.brand-tag { margin-top: 8px; color: #a3a09a; font-size: 10.5px; }
.nav { display: flex; flex-direction: column; gap: 3px; padding: 16px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.nav-item {
  padding: 9px 14px; color: #a3a09a; font-size: 13.5px; font-weight: 500;
  border-radius: var(--pill); text-decoration: none; transition: background .15s, color .15s;
}
.nav-item:hover { background: #2a2825; color: #fff; }
.nav-item.active { background: var(--gold); color: var(--black); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 14px 20px 0; color: rgba(163,160,154,.65); font-size: 11px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center;
  background: #f8e7c0; color: var(--black); font-size: 11px; font-weight: 700;
}
.who-name { display: block; font-size: 13px; font-weight: 500; }
.who-role { display: block; font-size: 11px; color: var(--dim); }
.content { padding: 22px 24px 48px; }

/* ---------------------------------------------------------------- bits */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; font-weight: 600; }
.page-head p { margin: 5px 0 0; color: var(--dim); font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px;
  border: 1px solid var(--black); background: var(--black); color: #fff;
  border-radius: var(--pill); font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { opacity: .9; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--line); font-weight: 500; }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: none; border-color: transparent; color: var(--dim); font-weight: 500; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-danger { background: var(--lost); border-color: var(--lost); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 15px 17px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); }
.card-body { padding: 15px 17px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px,1fr)); gap: 14px; margin-bottom: 16px; }
.stat { padding: 16px 17px; }
.stat-label { color: var(--dim); font-size: 12.5px; font-weight: 500; }
.stat-value { font-size: 25px; font-weight: 600; letter-spacing: -.025em; margin-top: 8px; }
.stat-hint { color: var(--dim); font-size: 11.5px; margin-top: 3px; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 11px 14px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--dim);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.cell-name { font-weight: 500; }
.cell-sub { color: var(--dim); font-size: 11.5px; }
.right { text-align: right; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: var(--pill); font-size: 11.5px; font-weight: 500;
  background: var(--surface-2); white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.flash { padding: 11px 15px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.flash-ok  { background: #e7f6ee; color: #0f5c3c; }
.flash-err { background: #fdecee; color: #8c1f2c; }

.empty { padding: 56px 20px; text-align: center; color: var(--dim); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

/* --------------------------------------------------------------- forms */
.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 14px; }
label { display: block; font-size: 11.5px; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 36px; padding: 0 13px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--pill);
  background: var(--surface); color: var(--text);
}
textarea { height: auto; min-height: 78px; padding: 9px 13px; border-radius: var(--radius); resize: vertical; }
.field { margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--lost); font-size: 11.5px; margin-top: 4px; }

/* -------------------------------------------------------------- kanban */
.board { display: flex; gap: 13px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.col { width: 264px; flex: 0 0 264px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 9px; }
.col-head h2 { font-size: 13px; font-weight: 600; }
.col-count { margin-left: auto; padding: 1px 9px; border-radius: var(--pill); background: var(--surface-2); color: var(--dim); font-size: 11.5px; font-weight: 600; }
.drop {
  min-height: 120px; display: flex; flex-direction: column; gap: 8px; padding: 8px;
  border-radius: var(--radius); background: var(--surface-2);
  border: 1px dashed transparent; transition: background .15s, border-color .15s;
}
.drop.over { border-color: var(--gold); background: #fdf6e3; }
.deal {
  flex: 0 0 auto; position: relative; overflow: hidden; padding: 10px 11px 10px 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); cursor: grab; text-decoration: none; display: block; color: inherit;
}
.deal:hover { box-shadow: var(--lift); }
.deal.dragging { opacity: .45; }
.deal::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--rail, #ccc); }
.deal-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.deal-sub { color: var(--dim); font-size: 11.5px; margin-top: 1px; }
.deal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.deal-val { font-size: 12px; font-weight: 700; }
.col-foot { margin-top: 8px; padding: 0 4px; text-align: right; font-size: 11.5px; font-weight: 600; color: var(--dim); }

/* ------------------------------------------------------------ calendar */
.cal { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.cal-head { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-head div { padding: 7px 4px; text-align: center; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.cal-day { min-width: 0; min-height: 104px; padding: 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: var(--surface-2); }
.cal-num { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 11.5px; }
.cal-num.today { background: var(--black); color: #fff; font-weight: 700; }
.chip { display: flex; gap: 5px; padding: 3px 5px; margin-top: 3px; border-left: 3px solid var(--chip, #ccc); background: var(--surface-2); border-radius: 5px; font-size: 10.5px; line-height: 1.3; }
.chip.done { opacity: .5; text-decoration: line-through; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--surface-2); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--lift); }
.auth-card .brand-line { color: var(--text); }
.auth-card .brand-tag { color: var(--dim); }
.auth-card h1 { font-size: 20px; font-weight: 600; margin: 22px 0 6px; }
.auth-card p.sub { color: var(--dim); font-size: 13px; margin: 0 0 22px; }
.auth-card .btn { width: 100%; justify-content: center; height: 42px; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 760px) {
  .sidebar { display: none; }
  .content { padding: 16px 14px 32px; }
  .grid-2 { grid-template-columns: 1fr; }
  .mobile-nav { display: flex; gap: 5px; padding: 9px 12px; background: var(--black); overflow-x: auto; }
  .mobile-nav a { flex: none; padding: 6px 14px; border-radius: var(--pill); color: #a3a09a; font-size: 13px; text-decoration: none; white-space: nowrap; }
  .mobile-nav a.active { background: var(--gold); color: var(--black); font-weight: 600; }
}
@media (min-width: 761px) { .mobile-nav { display: none; } }
