/* ==============================
   IMAGINA CRM — style.css
   Dark Mode · Gold Accents
   ============================== */

:root {
  --bg:         #0e0e10;
  --bg2:        #141416;
  --bg3:        #1a1a1e;
  --bg4:        #222228;
  --border:     #2a2a32;
  --border2:    #333340;
  --text:       #f0f0f0;
  --text2:      #9999aa;
  --text3:      #666677;
  --gold:       #C9A84C;
  --gold-light: #e4c06d;
  --gold-dim:   rgba(201,168,76,0.15);
  --blue:       #5b8dee;
  --blue-dim:   rgba(91,141,238,0.15);
  --red:        #e05c5c;
  --red-dim:    rgba(224,92,92,0.15);
  --green:      #4eba6f;
  --green-dim:  rgba(78,186,111,0.15);
  --yellow:     #d4a843;
  --yellow-dim: rgba(212,168,67,0.15);
  --sidebar-w:  240px;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --trans:      0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--trans);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
}

.sidebar-logo-img {
  height: 128px;
  max-width: 210px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(201,168,76,0.35));
  display: block;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--trans);
}
.sidebar-close:hover { color: var(--text); }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--trans);
  position: relative;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--gold-dim); color: var(--gold); }
.nav-item.active .nav-icon { color: var(--gold); }

.nav-icon { flex-shrink: 0; transition: color var(--trans); }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.sidebar-footer {
  padding: 16px 12px 20px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-meta { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--text3); }

.user-switcher {
  display: flex;
  gap: 6px;
}

.user-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans);
}
.user-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }

/* ===== OVERLAY ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
  backdrop-filter: blur(2px);
}
.overlay.active { display: block; }

/* ===== MAIN ===== */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color var(--trans);
}
.menu-toggle:hover { color: var(--text); }

.page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text3);
  pointer-events: none;
}
.search-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  font-family: inherit;
  width: 200px;
  transition: border-color var(--trans), width var(--trans);
  outline: none;
}
.search-input:focus { border-color: var(--gold); width: 240px; }
.search-input::placeholder { color: var(--text3); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--trans);
  white-space: nowrap;
}
.btn-primary {
  background: var(--gold);
  color: #0a0a0a;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201,168,76,0.3); }
.btn-ghost {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-ghost:hover { background: var(--bg4); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #e87070; }
.btn-export {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-export:hover { border-color: var(--gold); color: var(--gold); }
.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  border-radius: var(--radius-sm);
}
.btn-icon:hover { border-color: var(--gold); color: var(--gold); }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }

.back-btn { margin-bottom: 20px; }

/* ===== PAGE CONTAINER ===== */
.page-container { flex: 1; padding: 24px; overflow-y: auto; }

.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== METRICS GRID ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: border-color var(--trans), transform var(--trans);
}
.metric-card:hover { border-color: var(--border2); transform: translateY(-2px); }

.metric-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.metric-icon.gold { background: var(--gold-dim); color: var(--gold); }
.metric-icon.blue { background: var(--blue-dim); color: var(--blue); }
.metric-icon.red  { background: var(--red-dim);  color: var(--red); }
.metric-icon.green{ background: var(--green-dim); color: var(--green); }

.metric-body { display: flex; flex-direction: column; gap: 3px; }
.metric-label { font-size: 12px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.metric-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; }
.metric-sub { font-size: 11px; color: var(--text3); }

/* ===== DASHBOARD BOTTOM ===== */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.chart-card, .recent-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 12px; color: var(--text3); }
.card-link { font-size: 12px; color: var(--gold); text-decoration: none; font-weight: 500; }
.card-link:hover { text-decoration: underline; }

.chart-wrap { position: relative; height: 200px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

.recent-list { display: flex; flex-direction: column; gap: 10px; }

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  transition: background var(--trans);
  cursor: pointer;
}
.recent-item:hover { background: var(--bg4); }

.recent-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1.5px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.recent-info { flex: 1; min-width: 0; }
.recent-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-service { font-size: 11px; color: var(--text3); }
.recent-amount { font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; }

/* ===== FILTERS BAR ===== */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color var(--trans);
}
.filter-select:hover, .filter-select:focus { border-color: var(--gold); color: var(--text); }

/* ===== TABLE ===== */
.table-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.clients-table {
  width: 100%;
  border-collapse: collapse;
}

.clients-table thead {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.clients-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text3);
  white-space: nowrap;
}

.clients-table td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
}

.clients-table tbody tr:last-child td { border-bottom: none; }

.clients-table tbody tr {
  transition: background var(--trans);
  cursor: pointer;
}
.clients-table tbody tr:hover { background: var(--bg3); }

.client-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  border: 1.5px solid var(--border2);
}

.client-name-text { font-weight: 600; color: var(--text); }
.client-email { font-size: 11px; color: var(--text3); }

/* Progress bar */
.progress-wrap { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.progress-bar {
  flex: 1;
  height: 5px;
  background: var(--bg4);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.progress-label { font-size: 11px; color: var(--text3); white-space: nowrap; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-active  { background: var(--blue-dim);   color: var(--blue); }
.badge-completed{ background: var(--green-dim); color: var(--green); }
.badge-cash    { background: var(--bg4);         color: var(--text3); }
.badge-installments { background: var(--gold-dim); color: var(--gold); }
.badge-paid    { background: var(--green-dim); color: var(--green); }
.badge-pending { background: var(--yellow-dim); color: var(--yellow); }
.badge-overdue { background: var(--red-dim);   color: var(--red); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ===== ACTIONS ===== */
.action-btns { display: flex; gap: 6px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text3);
  text-align: center;
  line-height: 1.7;
}

/* ===== SECTION TITLE ===== */
.section-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 16px; }
.alerts-header { margin-bottom: 16px; }

/* ===== ALERTS ===== */
.alerts-list { display: flex; flex-direction: column; gap: 12px; }

.alert-card {
  background: var(--bg2);
  border: 1px solid var(--red-dim);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--trans);
  cursor: pointer;
}
.alert-card:hover { transform: translateX(4px); }

.alert-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--red-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  flex-shrink: 0;
}

.alert-info { flex: 1; }
.alert-name { font-size: 14px; font-weight: 600; color: var(--text); }
.alert-detail { font-size: 12px; color: var(--text3); margin-top: 2px; }

.alert-amount { font-size: 18px; font-weight: 700; color: var(--red); white-space: nowrap; }

/* ===== CLIENT PROFILE ===== */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}

.profile-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.profile-avatar-lg {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 14px;
}

.profile-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.profile-service { font-size: 13px; color: var(--text3); margin-bottom: 16px; }

.profile-meta { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.profile-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
}
.profile-meta-row svg { color: var(--text3); flex-shrink: 0; }
.profile-meta-label { color: var(--text3); min-width: 80px; font-size: 12px; }

.profile-amount-block {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.profile-amount-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.profile-amount-row:last-child { margin-bottom: 0; }
.profile-amount-label { color: var(--text3); }
.profile-amount-value { font-weight: 600; color: var(--text); }
.profile-amount-total { color: var(--gold) !important; font-size: 15px !important; font-weight: 700 !important; }

.profile-progress-bar {
  height: 6px;
  background: var(--bg4);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}
.profile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 4px;
  transition: width 0.6s ease;
}

.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Installments panel */
.installments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.installment-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  margin-bottom: 8px;
  transition: all var(--trans);
}
.installment-row:hover { border-color: var(--border2); background: var(--bg4); }

.installment-row.is-paid  { border-left: 3px solid var(--green); }
.installment-row.is-overdue { border-left: 3px solid var(--red); background: var(--red-dim); }
.installment-row.is-soon  { border-left: 3px solid var(--yellow); }

.inst-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg4);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  flex-shrink: 0;
}

.inst-info { flex: 1; }
.inst-amount { font-size: 14px; font-weight: 700; color: var(--text); }
.inst-date { font-size: 11px; color: var(--text3); }
.inst-notes { font-size: 11px; color: var(--text3); font-style: italic; }
.inst-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* Timeline */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 0 0 16px 0;
  position: relative;
}

.timeline-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.timeline-dot.paid  { background: var(--green-dim); color: var(--green); border: 2px solid var(--green); }
.timeline-dot.pend  { background: var(--bg3); color: var(--text3); border: 2px solid var(--border2); }
.timeline-dot.over  { background: var(--red-dim);  color: var(--red); border: 2px solid var(--red); }

.timeline-content { flex: 1; padding-top: 6px; }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text); }
.timeline-date  { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  padding: 16px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s ease;
}
.modal-sm { max-width: 380px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--trans);
}
.modal-close:hover { color: var(--text); }

.modal-form { padding: 20px 24px; }

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

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }

.form-label { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.4px; }

.form-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--trans);
  width: 100%;
}
.form-input:focus { border-color: var(--gold); }
.form-input::placeholder { color: var(--text3); }
textarea.form-input { resize: vertical; }
select.form-input { cursor: pointer; }
select.form-input option { background: var(--bg3); }

.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }

.radio-group { display: flex; gap: 20px; }
.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition: color var(--trans);
}
.radio-label:hover { color: var(--text); }
.radio-label input[type="radio"] { display: none; }
.radio-custom {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  position: relative;
  transition: border-color var(--trans);
  flex-shrink: 0;
}
.radio-label input[type="radio"]:checked + .radio-custom {
  border-color: var(--gold);
}
.radio-label input[type="radio"]:checked + .radio-custom::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.radio-label input[type="radio"]:checked ~ span:last-child { color: var(--gold); }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}

.confirm-text { padding: 20px 24px; color: var(--text2); font-size: 14px; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow);
  min-width: 260px;
  max-width: 360px;
  font-size: 13px;
  color: var(--text);
  animation: slideIn 0.3s ease, fadeOut 0.4s ease 2.8s forwards;
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-info    { border-left: 3px solid var(--blue); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
  }
  .sidebar-close { display: flex; }
  .menu-toggle { display: flex; }

  .main { margin-left: 0; }

  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .metric-value { font-size: 20px; }

  .topbar { padding: 0 16px; gap: 10px; }
  .search-input { width: 140px; }
  .search-input:focus { width: 160px; }
  .btn-primary span { display: none; }
  .page-container { padding: 16px; }

  .form-row { grid-template-columns: 1fr; }

  .clients-table th:nth-child(3),
  .clients-table td:nth-child(3),
  .clients-table th:nth-child(4),
  .clients-table td:nth-child(4) { display: none; }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .filter-group { flex-direction: column; }
  .filters-bar { flex-direction: column; align-items: stretch; }
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}
.login-screen.hidden {
  animation: loginFadeOut 0.4s ease forwards;
  pointer-events: none;
}
@keyframes loginFadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.97); }
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-logo-img {
  max-width: 400px;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(201,168,76,0.35));
  margin-bottom: 4px;
}

.login-brand {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 3px;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.login-subtitle {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 28px;
}

.login-form {
  text-align: left;
}
.login-form .form-group {
  margin-bottom: 16px;
}

.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap .form-input {
  padding-right: 40px;
}
.pw-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--trans);
}
.pw-toggle:hover { color: var(--gold); }

.login-error {
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 12px;
  padding: 8px 12px;
  margin-bottom: 14px;
  text-align: center;
  animation: shake 0.35s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60%  { transform: translateX(-6px); }
  40%,80%  { transform: translateX(6px); }
}

.login-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 14px;
  margin-top: 4px;
}

.login-footer {
  font-size: 11px;
  color: var(--text3);
  margin-top: 24px;
  letter-spacing: 0.5px;
}

/* ===== ACTIVE USER BUTTON ===== */
.user-btn.active-user {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

/* ===== LOGOUT BUTTON ===== */
.logout-btn {
  width: 100%;
  margin-top: 10px;
  justify-content: center;
  font-size: 12px;
  padding: 7px 12px;
  color: var(--text3);
  border-color: var(--border);
}
.logout-btn:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-dim);
}
