/* ============================================
   Amerose Riches Empire — Amerose Client
   Gold & Emerald theme
   ============================================ */

:root {
  --gold: #d4af37;
  --gold-light: #f0d67a;
  --gold-dark: #a8862a;
  --emerald: #0e3a2f;
  --emerald-dark: #0a2a22;
  --bg: #0c1f1a;
  --card: #123128;
  --card-border: #1f4a3c;
  --text: #eef4f0;
  --muted: #9db8ad;
  --danger: #c0392b;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: linear-gradient(160deg, var(--bg) 0%, var(--emerald-dark) 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(180deg, var(--emerald-dark), var(--emerald));
  border-bottom: 2px solid var(--gold);
  padding: 0.9rem 0;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}
.brand-logo {
  height: 52px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}
.brand-sub { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }
.brand-reg { font-size: 0.65rem; color: var(--muted); letter-spacing: 1px; opacity: 0.85; }

.header-nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.welcome { color: var(--muted); margin-right: 0.5rem; font-size: 0.9rem; }

/* ---------- Layout ---------- */
.container {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}
.site-footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--card-border);
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-head h1 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--gold-light);
  font-size: 1.8rem;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--gold-light);
  letter-spacing: 0.4px;
}
.form-group .req { color: var(--danger); }
input[type="text"], input[type="password"], input[type="tel"],
input[type="search"], input[type="date"], input[type="number"], textarea, select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}
textarea { resize: vertical; }
select { cursor: pointer; }
select option { background: var(--card); color: var(--text); }
input[type="date"] { color-scheme: dark; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1.2;
}
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #2b2005;
  border-color: var(--gold-dark);
}
.btn-gold:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--gold-light);
  border-color: var(--gold-dark);
}
.btn-outline:hover { background: rgba(212, 175, 55, 0.12); }
.btn-danger {
  background: transparent;
  color: #ff8f7d;
  border-color: var(--danger);
}
.btn-danger:hover { background: rgba(192, 57, 43, 0.25); }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---------- Alerts ---------- */
.alert {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.1rem;
  font-size: 0.9rem;
  border: 1px solid;
}
.alert-success { background: rgba(46, 160, 67, 0.15); border-color: #2ea043; color: #7ee2a8; }
.alert-error   { background: rgba(192, 57, 43, 0.15);  border-color: var(--danger); color: #ff9f8a; }

/* ---------- Search ---------- */
.search-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.search-bar input { flex: 1; min-width: 220px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--card-border); }
.client-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.9rem;
}
.client-table th {
  text-align: left;
  background: var(--emerald);
  color: var(--gold-light);
  padding: 0.75rem 0.9rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.client-table td {
  padding: 0.7rem 0.9rem;
  border-top: 1px solid var(--card-border);
  vertical-align: top;
}
.client-table tbody tr:hover { background: rgba(212, 175, 55, 0.06); }
.td-name { font-weight: 600; white-space: nowrap; }
.td-phone { white-space: nowrap; }
.td-notes { color: var(--muted); max-width: 240px; }
.td-date { color: var(--muted); white-space: nowrap; }
.td-actions { white-space: nowrap; }
.td-actions .btn { margin-right: 0.25rem; }
.inline-form { display: inline; }

.pagination { display: flex; gap: 0.4rem; margin-top: 1.25rem; flex-wrap: wrap; }

.muted { color: var(--muted); margin-bottom: 1rem; }

/* ---------- Status badges ---------- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border: 1px solid;
}
.badge-scheduled   { background: rgba(212, 175, 55, 0.14); border-color: var(--gold-dark); color: var(--gold-light); }
.badge-in-progress { background: rgba(52, 152, 219, 0.14); border-color: #2980b9; color: #7ec3f0; }
.badge-completed   { background: rgba(46, 160, 67, 0.14);  border-color: #2ea043; color: #7ee2a8; }
.badge-cancelled   { background: rgba(192, 57, 43, 0.14);  border-color: var(--danger); color: #ff9f8a; }

.td-price { white-space: nowrap; color: var(--gold-light); font-weight: 600; }

/* Payment badges */
.badge-unpaid       { background: rgba(192, 57, 43, 0.14);  border-color: var(--danger); color: #ff9f8a; }
.badge-deposit-paid { background: rgba(212, 175, 55, 0.14); border-color: var(--gold-dark); color: var(--gold-light); }
.badge-fully-paid   { background: rgba(46, 160, 67, 0.14);  border-color: #2ea043; color: #7ee2a8; }

.form-group .hint { display: block; margin-top: 0.3rem; color: var(--muted); font-size: 0.78rem; }

/* ---------- Hamburger toggle (hidden on desktop) ---------- */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--gold-dark);
  color: var(--gold-light);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { background: rgba(212, 175, 55, 0.12); }

/* ---------- Responsive: tablet & below ---------- */
@media (max-width: 768px) {
  .container { padding: 1.25rem 1rem; }
  .page-head h1 { font-size: 1.5rem; }
  .card { padding: 1.25rem; }
  .card-narrow { margin: 1rem auto; padding: 1.5rem 1.25rem; }
  .profile-card { padding: 1.25rem; }

  /* Header: brand left, hamburger right, nav collapses below */
  .header-inner { flex-wrap: wrap; }
  .brand-logo { height: 44px; }
  .brand-sub { letter-spacing: 1px; }
  .nav-toggle { display: block; }
  .header-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
  .header-nav.open { display: flex; }
  .header-nav .welcome { margin: 0 0 0.25rem; text-align: center; }
  .header-nav .btn {
    width: 100%;
    text-align: center;
    padding: 0.7rem 1rem;
    min-height: 44px;
    line-height: 1.4;
  }

  /* Prevent iOS zoom on focus (needs >=16px inputs) */
  input[type="text"], input[type="password"], input[type="tel"],
  input[type="search"], input[type="date"], input[type="number"], textarea, select {
    font-size: 16px;
  }

  /* Touch-friendly buttons: 44px min target, stacked */
  .btn { min-height: 44px; padding: 0.65rem 1.1rem; }
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; text-align: center; }
  .search-bar input { flex-basis: 100%; min-width: 0; }
  .search-bar .btn { flex: 1; text-align: center; }
  .pagination .btn { min-height: 44px; }

  /* KPI / stat cards: 2 per row on mobile, 1 on very small */
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .stat-value { font-size: 1.3rem; white-space: normal; }

  /* Tables → stacked cards */
  .table-wrap { border: none; overflow-x: visible; }
  .client-table, .client-table tbody, .client-table tr, .client-table td {
    display: block;
    width: 100%;
  }
  .client-table { background: transparent; font-size: 0.92rem; }
  .client-table thead { display: none; }
  .client-table tr {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  }
  .client-table tbody tr:hover { background: var(--card); }
  .client-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border: none;
    padding: 0.35rem 0;
    text-align: right;
  }
  .client-table td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold-light);
    flex-shrink: 0;
    text-align: left;
  }
  .client-table td:not([data-label])::before { display: none; }
  .client-table td.td-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--card-border);
    text-align: left;
  }
  .td-actions .btn { margin-right: 0; width: 100%; text-align: center; min-height: 44px; }
  .inline-form { display: block; }
  .inline-form .btn { width: 100%; }
  .td-name, .td-phone, .td-price, .td-date { white-space: normal; }
  .td-notes { max-width: none; }
}

/* Very small phones (320–480px) */
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.3rem; }
  .client-table td { gap: 0.6rem; }
  .login-logo { max-width: 200px; }
  .empty-state { padding: 2rem 1rem; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.card-narrow { max-width: 460px; margin: 2rem auto; }
.login-brand { text-align: center; margin-bottom: 1.1rem; }
.login-logo {
  max-width: 250px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.5));
}
.login-sub { text-align: center; }
.login-reg {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 1px;
}
.card-title {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--gold);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

/* ---------- Profile & stats ---------- */
.profile-card { padding: 1.5rem 2rem; margin-bottom: 1.5rem; }
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.profile-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold-light);
  margin-bottom: 0.3rem;
}
.profile-notes { margin-top: 1.25rem; color: var(--muted); }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.stat-value {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  color: var(--gold-light);
  white-space: nowrap;
}
.stat-label {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.section-title {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--gold-light);
  font-size: 1.25rem;
  margin-bottom: 0.9rem;
}
.badge-repeat { background: rgba(46, 160, 67, 0.14); border-color: #2ea043; color: #7ee2a8; }
.badge-new    { background: rgba(157, 184, 173, 0.12); border-color: var(--muted); color: var(--muted); }
.client-table td a:not(.btn) { color: var(--gold-light); }

.empty-state { text-align: center; padding: 3rem 2rem; }
.empty-icon { font-size: 3rem; color: var(--gold); margin-bottom: 0.75rem; }
.empty-state h2 { font-family: Georgia, serif; color: var(--gold-light); margin-bottom: 0.4rem; }
.empty-state .btn { margin-top: 1rem; }
