/* Admin panel styles — Auto Access Denied */
:root {
  --bg: #0b1016;
  --surface: #141c26;
  --surface-2: #1a2430;
  --line: #273342;
  --text: #f2f6fa;
  --muted: #9aabbb;
  --accent: #ff4d3d;
  --green: #3ddc97;
  --amber: #ffb43a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 85% -10%, rgba(255,77,61,.09), transparent 45%), var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.back-link { display: inline-block; color: var(--muted); font-size: .85rem; margin-bottom: 22px; }
.back-link:hover { color: var(--accent); }

.admin-wrap {
  width: min(100% - 32px, 1240px);
  margin-inline: auto;
  padding: 48px 0 72px;
}

/* Login */
.login-card {
  max-width: 410px;
  margin: 7vh auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 38px 34px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login-logo { height: 54px; width: auto; object-fit: contain; margin-bottom: 14px; }
.login-card h1 { margin: 0 0 6px; font-size: 1.8rem; }
.login-card p { color: var(--muted); margin: 0 0 26px; }
.login-card form { display: grid; gap: 10px; }
.login-card label { font-size: .85rem; font-weight: 700; }
input[type="text"], input[type="password"], select {
  width: 100%;
  background: #0e141c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: 12px 14px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,77,61,.12); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 9px;
  padding: 11px 18px; font-weight: 700; font-size: .92rem;
  transition: background .18s, transform .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #ff6355; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,.05); }
.btn-danger { background: transparent; border-color: rgba(255,77,61,.35); color: #ff9187; }
.btn-danger:hover { background: rgba(255,77,61,.12); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.login-status {
  margin-top: 6px; padding: 10px 12px; border-radius: 8px; font-size: .86rem;
  background: rgba(255,77,61,.1); border: 1px solid rgba(255,77,61,.35); color: #ffc9c3;
}

/* Dashboard */
.dashboard-header {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  margin-bottom: 30px;
}
.dashboard-header h1 { margin: 0 0 4px; font-size: 2rem; }
.dashboard-header p { margin: 0; color: var(--muted); }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px 22px;
}
.stat-card span { display: block; color: var(--muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.stat-card strong { display: block; font-size: 2rem; line-height: 1.2; margin-top: 6px; }
.stat-card.new strong { color: var(--accent); }
.stat-card.contacted strong { color: var(--amber); }
.stat-card.closed strong { color: var(--green); }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
}
.panel-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 22px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.panel-toolbar h2 { margin: 0; font-size: 1.2rem; }
.muted { color: var(--muted); font-size: .85rem; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters input { min-width: 240px; }
.filters select { width: auto; min-width: 150px; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 900px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.02); }
td.notes-cell { max-width: 220px; color: var(--muted); }
td.notes-cell div {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.package-pill {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  background: rgba(255,77,61,.1); border: 1px solid rgba(255,77,61,.25);
  color: #ffb2aa; font-size: .74rem; font-weight: 700; white-space: nowrap;
}
.status-select {
  padding: 6px 8px; font-size: .8rem; width: auto; min-width: 120px;
  background: var(--surface-2);
}
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.icon-btn {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 7px; padding: 6px 10px; font-size: .78rem; white-space: nowrap;
}
.icon-btn:hover { color: var(--text); border-color: #47586b; }
.icon-btn.danger:hover { color: #ff9187; border-color: rgba(255,77,61,.45); }
.empty-state { padding: 50px 24px; text-align: center; color: var(--muted); }
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  padding: 12px 18px; border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.4);
  font-size: .88rem;
}
.toast.error { border-left-color: var(--accent); }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dashboard-header { flex-direction: column; align-items: flex-start; }
  .filters { width: 100%; }
  .filters input { min-width: 0; flex: 1; }
}
