/* =================================================================
   Hilow — Admin Panel
   Dark, refined, ember-accented control surface
   ================================================================= */

.admin-body {
  background: #15110E;
  color: #E8DDCC;
  font-family: var(--font-body);
}
.admin-body .container { max-width: 100%; }

/* ---------- Shell layout ---------- */
.admin-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: linear-gradient(180deg, #1F1814 0%, #15100D 100%);
  border-right: 1px solid rgba(200,149,74,0.14);
  padding: 24px 18px; display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; height: 100vh;
}
.admin-brand {
  display: flex; align-items: center; gap: 10px; color: var(--amber);
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
}
.admin-brand em { color: #E8DDCC; font-style: normal; font-weight: 400; opacity: 0.7; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-radius: var(--radius-sm); color: #B8A995; font-weight: 500; font-size: .94rem;
  transition: background .2s, color .2s;
}
.admin-nav a:hover { background: rgba(200,149,74,0.1); color: var(--amber); }
.admin-nav a.active {
  background: linear-gradient(90deg, rgba(139,30,30,0.35), rgba(139,30,30,0.08));
  color: #fff; border-left: 3px solid var(--ember-bright); padding-left: 11px;
}
.admin-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.side-link {
  display: inline-block; padding: 10px 14px; font-size: .88rem;
  color: #8A7B6C; background: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--font-body); border-radius: var(--radius-sm); transition: color .2s;
}
.side-link:hover { color: var(--amber); }
.side-link.logout { color: #C8341F; }
.side-link.logout:hover { color: #E5583F; }

/* ---------- Main ---------- */
.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 36px; border-bottom: 1px solid rgba(200,149,74,0.12);
  background: rgba(31,24,20,0.6); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10;
}
.admin-page-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: #F5EFE6; margin: 0; }
.admin-user { font-size: .85rem; color: #8A7B6C; }
.admin-user b { color: var(--amber); font-weight: 600; }
.admin-content { padding: 36px; }

/* ---------- Panels ---------- */
.panel {
  background: #1F1814; border: 1px solid rgba(200,149,74,0.14);
  border-radius: var(--radius); padding: 24px; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel-head h3 { margin: 0; font-size: 1.15rem; color: #F5EFE6; }
.panel-head .muted { color: #8A7B6C; font-size: .85rem; }

/* ---------- Dashboard ---------- */
.dash-greeting { margin-bottom: 28px; }
.dash-h2 { font-size: 1.7rem; color: #F5EFE6; margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #1F1814; border: 1px solid rgba(200,149,74,0.14);
  border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 4px;
}
.stat-card.stat-primary {
  background: linear-gradient(135deg, var(--ember-deep) 0%, #5A1410 100%);
  border-color: rgba(200,52,31,0.4);
}
.stat-label { font-size: .72rem; letter-spacing: 0.12em; text-transform: uppercase; color: #8A7B6C; }
.stat-primary .stat-label { color: rgba(245,239,230,0.7); }
.stat-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; color: #F5EFE6; line-height: 1; }
.stat-value.warn { color: #E5583F; }
.stat-foot { font-size: .78rem; color: #8A7B6C; }
.stat-primary .stat-foot { color: rgba(245,239,230,0.6); }

.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.week-stats { display: flex; gap: 24px; }
.week-stat { display: flex; flex-direction: column; gap: 2px; }
.week-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--amber); }
.week-num.warn { color: #E5583F; }
.week-label { font-size: .78rem; color: #8A7B6C; }

/* Bar chart */
.bar-chart { display: flex; align-items: flex-end; gap: 16px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar-wrap { width: 100%; max-width: 56px; height: 120px; display: flex; align-items: flex-end; background: rgba(200,149,74,0.08); border-radius: 6px 6px 0 0; overflow: hidden; }
.bar { width: 100%; background: linear-gradient(180deg, var(--ember-bright), var(--ember-deep)); border-radius: 6px 6px 0 0; transition: height .5s ease; min-height: 2px; }
.bar-val { font-size: .82rem; font-weight: 600; color: #E8DDCC; }
.bar-label { font-size: .72rem; color: #8A7B6C; text-align: center; }

/* Pie */
.pie-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.pie { width: 160px; height: 160px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(200,149,74,0.1); }
.pie-legend { display: flex; flex-direction: column; gap: 8px; }
.pie-legend li { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: #C8B89E; }
.pie-legend b { color: #F5EFE6; margin-left: 6px; }
.dot { width: 12px; height: 12px; border-radius: 3px; }

.quick-actions { display: flex; flex-direction: column; gap: 10px; }
.quick-action {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: rgba(200,149,74,0.06); border: 1px solid rgba(200,149,74,0.14);
  border-radius: var(--radius-sm); color: #E8DDCC; transition: all .2s;
}
.quick-action:hover { background: rgba(200,149,74,0.14); border-color: var(--amber); color: #F5EFE6; }
.qa-num { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--amber); min-width: 36px; text-align: center; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end;
  background: #1F1814; border: 1px solid rgba(200,149,74,0.14);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field label { font-size: .72rem; letter-spacing: 0.1em; text-transform: uppercase; color: #8A7B6C; }
.filter-field input, .filter-field select {
  background: #15110E; border: 1px solid rgba(200,149,74,0.2); color: #E8DDCC;
  border-radius: var(--radius-sm); padding: 9px 12px; font-family: var(--font-body); font-size: .9rem;
}
.filter-field input:focus, .filter-field select:focus { outline: 0; border-color: var(--ember-bright); }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- Data table ---------- */
.table-wrap { overflow-x: auto; background: #1F1814; border: 1px solid rgba(200,149,74,0.14); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; min-width: 880px; }
.data-table thead th {
  text-align: left; padding: 14px 18px; font-size: .72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: #8A7B6C; border-bottom: 1px solid rgba(200,149,74,0.18); font-weight: 600;
}
.data-table tbody td { padding: 16px 18px; border-bottom: 1px solid rgba(200,149,74,0.08); color: #D8C9B4; vertical-align: top; font-size: .92rem; }
.data-table tbody tr:hover { background: rgba(200,149,74,0.05); }
.data-table .actions-col { white-space: nowrap; }
.empty-row { text-align: center; color: #8A7B6C; padding: 40px !important; }
.table-count { margin-top: 12px; }

/* mini buttons */
.mini-btn {
  display: inline-block; padding: 6px 12px; margin: 2px 2px 2px 0; font-size: .78rem;
  font-weight: 600; border-radius: 6px; border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-body); transition: all .15s; background: none;
}
.mini-btn.confirm { background: var(--ember-deep); color: #fff; }
.mini-btn.confirm:hover { background: var(--ember); }
.mini-btn.arrive { background: #3F5A2E; color: #fff; }
.mini-btn.arrive:hover { background: #4F6E3B; }
.mini-btn.danger { background: transparent; color: #E5583F; border-color: rgba(229,88,63,0.3); }
.mini-btn.danger:hover { background: var(--danger); color: #fff; }

/* ---------- Forms (admin re-skin) ---------- */
.admin-body .field label { color: #C8B89E; }
.admin-body .field input,
.admin-body .field select,
.admin-body .field textarea {
  background: #15110E; border: 1px solid rgba(200,149,74,0.2); color: #E8DDCC;
}
.admin-body .field input:focus, .admin-body .field select:focus, .admin-body .field textarea:focus {
  border-color: var(--ember-bright); box-shadow: 0 0 0 3px rgba(200,52,31,0.15);
}
.admin-body .field.check label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; color: #C8B89E; }
.admin-body .field input[type=checkbox] { width: auto; }
.admin-body .field input[type=radio] { width: auto; accent-color: var(--ember-bright); }
.admin-body .field input[type=date],
.admin-body .field input[type=time] {
  color-scheme: dark;
}

/* capacity & settings grids */
.capacity-grid, .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.cap-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.cap-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; background: rgba(200,149,74,0.05);
  border: 1px solid rgba(200,149,74,0.12); border-radius: var(--radius-sm);
}
.cap-info { display: flex; flex-direction: column; gap: 2px; }
.cap-info strong { color: #F5EFE6; }
.cap-actions { display: flex; gap: 6px; }
.cap-form-wrap { border: 1px dashed rgba(200,149,74,0.25); border-radius: var(--radius-sm); padding: 16px; margin-top: 12px; background: rgba(0,0,0,0.18); }
.cap-form-wrap summary { cursor: pointer; font-weight: 600; color: var(--amber); padding: 4px 0; }
.cap-form { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cap-form .field { margin: 0; }
.cap-form .field:last-of-type { grid-column: 1 / -1; }
.cap-form .btn { grid-column: 1 / -1; justify-self: start; }

/* hours table */
.hours-form { overflow-x: auto; }
.hours-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; min-width: 480px; }
.hours-table th, .hours-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(200,149,74,0.1); }
.hours-table th { font-size: .72rem; letter-spacing: 0.1em; text-transform: uppercase; color: #8A7B6C; font-weight: 600; }
.hours-table td { color: #D8C9B4; }
.hours-table input[type=time] { background: #15110E; border: 1px solid rgba(200,149,74,0.2); color: #E8DDCC; border-radius: 6px; padding: 6px 8px; color-scheme: dark; }

/* switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  position: absolute; inset: 0; background: rgba(200,149,74,0.2); border-radius: 999px; transition: background .2s;
}
.switch-track::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: #E8DDCC; border-radius: 50%; transition: transform .2s;
}
.switch input:checked + .switch-track { background: var(--ember-deep); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }

/* special dates list */
.special-form { margin-bottom: 20px; }
.special-list { display: flex; flex-direction: column; gap: 8px; }
.special-list li { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: rgba(200,149,74,0.05); border-radius: var(--radius-sm); }
.special-list .tag { margin-left: 8px; }
.tag-closed { background: rgba(229,88,63,0.18); color: #E5583F; }
.tag-open { background: rgba(107,142,78,0.18); color: #8FB86B; }

/* admin login */
.login-body { background: #15110E; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.login-glow {
  position: absolute; top: 20%; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,52,31,0.25), transparent 65%); filter: blur(40px);
  animation: pulse 6s ease-in-out infinite;
}
.login-card { position: relative; z-index: 2; width: 100%; max-width: 420px; background: #1F1814; border: 1px solid rgba(200,149,74,0.18); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-lg); }
.login-brand { display: flex; align-items: center; gap: 10px; color: var(--amber); font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 24px; }
.login-title { font-size: 2.2rem; color: #F5EFE6; margin: 0 0 24px; }
.login-form { display: flex; flex-direction: column; gap: 4px; }
.login-hint { text-align: center; margin-top: 20px; font-size: .82rem; color: #8A7B6C; }
.login-hint code { background: rgba(200,149,74,0.12); color: var(--amber); }

/* ---------- Admin button overrides (dark-bg safe) ---------- */
.admin-body .btn-ghost {
  color: #E8DDCC;
  border-color: rgba(200,149,74,0.3);
}
.admin-body .btn-ghost:hover {
  background: rgba(200,149,74,0.12);
  border-color: var(--amber);
  color: var(--amber);
}
.mini-btn.ghost {
  color: #D8C9B4;
  border-color: rgba(200,149,74,0.3);
}
.mini-btn.ghost:hover {
  background: rgba(200,149,74,0.12);
  color: #F5EFE6;
  border-color: var(--amber);
}

/* ---------- Admin alerts ---------- */
.admin-body .alert { background: rgba(200,52,31,0.12); border: 1px solid rgba(200,52,31,0.3); color: #E5583F; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 14px; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-side-foot { margin: 0 0 0 auto; flex-direction: row; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-row, .capacity-grid, .settings-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 24px 18px; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .cap-form { grid-template-columns: 1fr; }
  .admin-topbar { padding: 16px 18px; }
}
