/* ========================================================
   AJ PROFESSIONAL — ADMIN DASHBOARD STYLES
   Reuses variables/fonts from style.css
======================================================== */

.admin-body {
  background: #0a0a0a;
  min-height: 100vh;
}

/* ---------- LOGIN SCREEN ---------- */
.login-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(212,175,55,0.10), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(212,175,55,0.08), transparent 45%),
    #07070a;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #111112;
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 20px;
  padding: 36px 30px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

.login-brand { justify-content: center; margin-bottom: 24px; }
.sidebar-brand { justify-content: flex-start; margin-bottom: 4px; }

.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  text-align: center;
  margin: 0 0 6px;
}
.login-sub {
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  margin: 0 0 24px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}
.form-field input,
.form-field select,
.form-field textarea {
  background: #1a1a1c;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--gold); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.submit-btn {
  border: none;
  border-radius: 999px;
  padding: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 13px;
  color: #000;
  margin-top: 4px;
}

.login-error {
  color: #ff6b6b;
  font-size: 13px;
  text-align: center;
}

.default-hint {
  margin-top: 18px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.5;
}
.default-hint b { color: var(--gold-light); }

.back-to-site {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}
.back-to-site:hover { color: var(--gold); }

/* ---------- DASHBOARD LAYOUT ---------- */
.dashboard-screen {
  display: flex;
  min-height: 100svh;
}

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #0d0d0e;
  border-right: 1px solid rgba(212,175,55,0.15);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100svh;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 24px; flex: 1; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.55);
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-link.active { background: rgba(212,175,55,0.12); color: var(--gold-light); }
.sidebar-site-link { margin-top: auto; }
.sidebar-logout { color: #ff8a8a; }
.sidebar-logout:hover { background: rgba(255,107,107,0.1); }

.admin-main {
  flex: 1;
  padding: 32px 36px 60px;
  max-width: 1200px;
}

.panel-head { margin-bottom: 24px; }
.panel-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.panel-title { font-family: 'Playfair Display', serif; font-size: 28px; margin: 0 0 4px; }
.panel-sub { color: rgba(255,255,255,0.5); font-size: 14px; margin: 0; }
.panel-subhead { font-size: 13px; letter-spacing: 0.1em; color: rgba(255,255,255,0.5); margin: 32px 0 14px; text-transform: uppercase; }

/* ---------- STAT CARDS ---------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.stat-card {
  background: #121213;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px;
}
.stat-card-label { font-size: 12px; color: rgba(255,255,255,0.45); margin-bottom: 8px; }
.stat-card-val { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; }

/* ---------- RECENT / LIST ROWS ---------- */
.recent-list, .appt-list { display: flex; flex-direction: column; gap: 10px; }
.recent-row, .appt-row {
  background: #121213;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.recent-name { font-weight: 600; font-size: 14px; }
.recent-sub { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 2px; }
.dim { color: rgba(255,255,255,0.35); font-weight: 400; }

.status-pill {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 999px;
  text-transform: capitalize;
  font-weight: 600;
}
.status-confirmed { background: rgba(212,175,55,0.15); color: var(--gold-light); }
.status-completed { background: rgba(90,200,120,0.15); color: #6fdb8f; }
.status-cancelled { background: rgba(255,107,107,0.15); color: #ff8a8a; }

.empty-state {
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  padding: 30px 16px;
  text-align: center;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 12px;
}

/* ---------- WORKERS ---------- */
.search-input {
  width: 100%;
  background: #121213;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 20px;
  outline: none;
}
.search-input:focus { border-color: var(--gold); }

.workers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.worker-card {
  background: #121213;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 18px;
}
.worker-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.worker-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D4AF37 0%, #FFD700 50%, #B8941F 100%);
  color: #000;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  flex-shrink: 0;
}
.worker-name { font-weight: 600; font-size: 15px; }
.worker-role { font-size: 12px; color: rgba(255,255,255,0.45); }

.worker-card-rows { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.worker-row { display: flex; gap: 8px; font-size: 12px; color: rgba(255,255,255,0.55); }

.worker-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 14px;
}
.worker-stat-label { font-size: 10px; color: rgba(255,255,255,0.4); margin-bottom: 3px; }
.worker-stat-val { font-size: 13px; font-weight: 700; }
.warn-text { color: #ff9f6b; }

.worker-card-actions { display: flex; gap: 8px; }
.btn-mini {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 12px;
  font-family: inherit;
  transition: background 0.2s;
}
.btn-mini:hover { background: rgba(255,255,255,0.12); }
.btn-mini-danger { flex: 0 0 auto; color: #ff8a8a; }
.btn-mini-danger:hover { background: rgba(255,107,107,0.12); }

/* ---------- APPOINTMENTS ---------- */
.filter-select {
  background: #121213;
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
}
.appt-main { flex: 1; min-width: 200px; }
.appt-note { font-size: 12px; color: rgba(255,255,255,0.4); font-style: italic; margin-top: 4px; }
.appt-actions { display: flex; align-items: center; gap: 8px; }
.appt-status-select {
  background: #1a1a1c;
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
}
.ledger-del {
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.2);
  color: #ff8a8a;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 12px;
}
.appt-bill-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  border-color: rgba(212,175,55,0.3);
  color: var(--gold-light);
}
.appt-bill-btn:hover { background: rgba(212,175,55,0.12); }

/* ---------- SETTINGS ---------- */
.settings-form { max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.settings-note {
  max-width: 480px;
  margin-top: 24px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 14px 16px;
}

/* ---------- MODALS ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 200;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 460px;
  max-height: 88svh;
  overflow-y: auto;
  background: #131314;
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 18px;
  padding: 22px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-family: 'Playfair Display', serif; font-size: 18px; margin: 0; }
.modal-close {
  background: rgba(255,255,255,0.06);
  border: none;
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 13px;
}
.modal-form { display: flex; flex-direction: column; gap: 14px; }

/* ---------- LEDGER ---------- */
.ledger-balance-line {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.ledger-balance-item {
  flex: 1;
  min-width: 140px;
  background: rgba(212,175,55,0.06);
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}
.ledger-balance-item b { display: block; font-size: 16px; color: #fff; margin-top: 4px; }

.ledger-form { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.ledger-add-btn { border: none; font-weight: 700; font-size: 12px; padding: 11px; letter-spacing: 0.06em; }

.ledger-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.ledger-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1a1a1c;
  border-radius: 10px;
  padding: 10px 12px;
}
.ledger-row > div:first-child { flex: 1; }
.ledger-type { font-size: 13px; font-weight: 600; }
.ledger-type-paid { color: #6fdb8f; }
.ledger-type-advance { color: #ff9f6b; }
.ledger-type-repaid { color: #7fb8ff; }
.ledger-note { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.ledger-amount { font-weight: 700; font-size: 13px; white-space: nowrap; }

/* ---------- BILL / INVOICE MODAL ---------- */
.bill-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.bill-modal-actions .btn-mini {
  flex: 1;
  min-width: 140px;
  padding: 12px 10px;
  font-weight: 600;
}
.bill-whatsapp-btn {
  flex: 1.3;
  min-width: 180px;
  background: linear-gradient(135deg, #25D366 0%, #1EBE5A 100%);
  color: #04210f;
}

/* ---------- APP-STYLE BOTTOM NAV OVERRIDE for admin (tabs, not links) ---------- */
.admin-bottom-nav { display: none; }
.admin-bottom-nav .app-nav-item { background: none; border: none; font-family: inherit; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .admin-sidebar { display: none; }
  .admin-main { padding: 20px 16px 90px; }
  .admin-bottom-nav { display: flex; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .login-card { padding: 28px 20px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
