/* ============================================================
   Secured Recovery - Client Dashboard
   Matches TheFox / Elementor design language used across the site
   Colors: dark navy #011722, teal #6dc8be / #1abc9c
   ============================================================ */
:root {
  --dark: #011722;
  --dark-2: #0a2733;
  --brand: #1abc9c;
  --brand-2: #6dc8be;
  --brand-dark: #15987f;
  --ink: #2c3e50;
  --muted: #7f8c8d;
  --border: #ecf0f1;
  --bg: #f4f6f7;
  --white: #ffffff;
  --danger: #e74c3c;
  --warn: #e67e22;
  --info: #3498db;
  --success: #27ae60;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(1, 23, 34, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Lato", "Open Sans", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.9rem; }

a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand); }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 20px;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(109, 200, 190, 0.25), transparent 60%),
    radial-gradient(900px 420px at 90% 110%, rgba(26, 188, 156, 0.18), transparent 60%),
    linear-gradient(160deg, #011722 0%, #0a2733 55%, #0f3342 100%);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 34px 34px 26px;
}

.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-logo { width: 132px; height: auto; }
.auth-brand h1 {
  font-family: "Raleway", "Lato", sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--dark);
  margin: 8px 0 2px;
  letter-spacing: 0.5px;
}
.auth-tag { color: var(--muted); margin: 0 0 18px; font-size: 0.92rem; }

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg);
  border-radius: 8px;
  padding: 5px;
  margin-bottom: 22px;
}
.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab-btn.active {
  background: var(--dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(1, 23, 34, 0.3);
}
.tab-btn:hover:not(.active) { color: var(--brand-dark); }

.auth-form { display: block; }
.auth-hint {
  margin-top: 16px;
  padding: 12px;
  background: #f4fbfa;
  border: 1px solid #d8efe9;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.5;
}
.auth-hint strong { color: var(--brand-dark); }
.auth-footer {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  text-align: center;
}
.auth-footer a { color: var(--brand-2); }

/* ---------- Fields & Buttons ---------- */
.field { display: flex; flex-direction: column; margin-bottom: 15px; }
.field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}
.field small { font-weight: 400; color: var(--muted); }
.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.18);
}
textarea.input { resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(180deg, #1abc9c 0%, #17a98d 100%);
  color: #fff;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(26, 188, 156, 0.28);
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn:hover { background: linear-gradient(180deg, #15a789 0%, #12977c 100%); box-shadow: 0 8px 20px rgba(26, 188, 156, 0.36); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost {
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--bg); box-shadow: none; }
.btn-danger {
  background: linear-gradient(180deg, #e74c3c 0%, #d94433 100%);
  box-shadow: 0 6px 16px rgba(231, 76, 60, 0.25);
}
.btn-danger:hover { background: linear-gradient(180deg, #d94433 0%, #c0392b 100%); }
.btn-sm { padding: 8px 14px; font-size: 0.86rem; }
.btn-xs { padding: 5px 10px; font-size: 0.78rem; }
.btn-link {
  background: none;
  border: none;
  color: var(--brand-dark);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.92rem;
  padding: 0;
}
.btn-link:hover { color: var(--brand); }

.form-msg {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  display: none;
}
.form-msg.show { display: block; }
.form-msg.error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c2; }
.form-msg.ok { background: #eafaf1; color: #1e8449; border: 1px solid #a9dfbf; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(1, 23, 34, 0.05);
}
.app-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.app-brand { display: flex; align-items: center; gap: 10px; }
.app-brand img { width: 44px; height: auto; }
.app-brand span {
  font-family: "Raleway", "Lato", sans-serif;
  font-weight: 900;
  color: var(--dark);
  font-size: 1.05rem;
}
.app-nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav-link {
  border: none;
  background: transparent;
  padding: 9px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-link:hover { color: var(--brand-dark); background: var(--bg); }
.nav-link.active { background: var(--dark); color: #fff; }
#btn-logout { color: var(--danger); }
#btn-logout:hover { background: #fdecea; color: var(--danger); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--dark);
  cursor: pointer;
  padding: 4px 8px;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.view { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.hero {
  color: #fff;
  background:
    linear-gradient(120deg, rgba(26, 188, 156, 0.18), transparent 45%),
    linear-gradient(135deg, #011722 0%, #0c2b38 100%);
  border-radius: var(--radius);
  padding: 34px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.hero h2 {
  margin: 0 0 8px;
  font-family: "Raleway", "Lato", sans-serif;
  font-weight: 900;
  font-size: 1.7rem;
  letter-spacing: 0.3px;
}
.hero p { margin: 0; color: rgba(255,255,255,0.82); font-size: 1rem; }
.hero-small { padding: 24px 28px; }
.hero-small h2 { font-size: 1.35rem; }

/* ---------- Stats ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(1, 23, 34, 0.04);
  border-top: 3px solid var(--brand);
}
.stat-card .stat-label { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.stat-card .stat-value { font-family: "Raleway", "Lato", sans-serif; font-weight: 900; font-size: 1.6rem; color: var(--dark); margin: 6px 0 0; }
.stat-card .stat-value small { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.stat-card.stat-teal { border-top-color: var(--brand); }
.stat-card.stat-blue { border-top-color: var(--info); }
.stat-card.stat-amber { border-top-color: var(--warn); }
.stat-card.stat-green { border-top-color: var(--success); }
.stat-card.stat-red { border-top-color: var(--danger); }

/* ---------- Panels ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 2px 8px rgba(1, 23, 34, 0.04);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel h3 { margin: 0; font-family: "Raleway", "Lato", sans-serif; font-weight: 900; color: var(--dark); font-size: 1.1rem; }
.panel h3 + p { margin: 4px 0 0; }
.panel-sub { margin-top: 26px; }

.form-panel h3 {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--dark);
  font-family: "Raleway", "Lato", sans-serif;
  font-size: 1.05rem;
}
.form-panel h3 + .form-grid, .form-panel h3 + h3 { margin-top: 20px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 18px;
}
.field.full { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}
.toolbar .search { flex: 1; min-width: 220px; }
.toolbar .select { width: auto; }

/* ---------- Claims list ---------- */
.claim-list { display: flex; flex-direction: column; gap: 12px; }
.claim-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(1, 23, 34, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.claim-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.claim-card .cc-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 12px;
  background: #e5f7f2;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
}
.claim-card .cc-main { flex: 1; min-width: 0; }
.claim-card .cc-ref { font-weight: 900; color: var(--dark); }
.claim-card .cc-type { color: var(--muted); font-size: 0.88rem; }
.claim-card .cc-amount { font-weight: 700; color: var(--dark); white-space: nowrap; }
.claim-card .cc-date { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.claim-card .cc-actions { display: flex; gap: 6px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.st-submitted { background: #ebf5fb; color: #2874a6; }
.st-review { background: #fef3e2; color: #d68910; }
.st-docs { background: #fdecea; color: #c0392b; }
.st-progress { background: #eaf2f8; color: #2e86c1; }
.st-recovered { background: #eafaf1; color: #1e8449; }
.st-closed { background: #f2f3f4; color: #5d6d7e; }
.st-rejected { background: #fdedec; color: #b03a2e; }

/* ---------- Guide ---------- */
.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-list li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 0.94rem; }
.guide-list li:last-child { border-bottom: none; }
.guide-list .badge { flex: 0 0 auto; }

/* ---------- Empty ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state h3 { color: var(--dark); margin: 0 0 6px; }
.empty-state .btn { margin-top: 16px; }

/* ---------- Detail ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.detail-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.detail-item.full { grid-column: 1 / -1; }
.detail-item dt { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 3px; }
.detail-item dd { margin: 0; font-weight: 600; color: var(--dark); word-break: break-word; }
.tt { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tt .badge-hold { font-size: 0.86rem; margin: 0 12px 0 4px; }

.notes { display: flex; flex-direction: column; gap: 14px; }
.note-item {
  border-left: 3px solid var(--brand);
  background: var(--bg);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}
.note-item .note-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.note-item .note-head strong { color: var(--dark); }
.note-item p { margin: 0; font-size: 0.93rem; color: var(--ink); }
.note-item.note-system { border-left-color: var(--info); }
.note-item.note-system .note-head strong { color: var(--info); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th {
  text-align: left;
  padding: 12px 12px;
  background: var(--dark);
  color: #fff;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.table th:first-child { border-radius: 8px 0 0 0; }
.table th:last-child { border-radius: 0 8px 0 0; }
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:hover { background: #fafcfc; }
.table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Admin tabs ---------- */
.admin-tabs {
  display: flex;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px;
  margin-bottom: 20px;
  max-width: 420px;
}
.atab { animation: fadeIn 0.2s ease; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(1, 23, 34, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
  animation: fadeIn 0.2s ease;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 2;
}
.modal-head h3 { margin: 0; font-family: "Raleway", "Lato", sans-serif; font-weight: 900; color: var(--dark); }
.modal-close {
  border: none;
  background: var(--bg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--muted);
  cursor: pointer;
}
.modal-close:hover { background: #fdecea; color: var(--danger); }
#modal-body { padding: 22px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: #fff;
  padding: 13px 22px;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 200;
  animation: fadeIn 0.25s ease;
}
.toast.ok { background: var(--success); }
.toast.error { background: var(--danger); }

/* ---------- Footer ---------- */
.app-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.75);
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.86rem;
}
.app-footer a { color: var(--brand-2); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .app-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(1,23,34,0.08);
    display: none;
  }
  .app-nav.open { display: flex; }
  .nav-link { padding: 12px 14px; }
  .claim-card { flex-wrap: wrap; }
  .claim-card .cc-actions { margin-left: auto; }
}