/* Aman Care dashboard — teal #0d5c54 / cream / gold. NOT EstateView blue. */
:root {
  --brand: #0d5c54;
  --brand-dark: #0a4a44;
  --brand-soft: #e3f0ed;
  --cream: #faf7ef;
  --cream-2: #f4efe2;
  --gold: #c9a227;
  --gold-soft: #f7ecd0;
  --ink: #22302d;
  --muted: #6b7a76;
  --line: #e5ddc9;
  --card: #ffffff;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --ok: #1e7e34;
  --ok-soft: #e6f4ea;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--brand-soft), var(--cream) 60%);
}
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 32px 28px; width: 100%; max-width: 400px;
  box-shadow: 0 12px 40px rgba(13, 92, 84, 0.10);
}
.brandmark { display: flex; align-items: center; gap: 12px; }
.brandmark .owl {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  flex: 0 0 auto; overflow: hidden;
}
.brandmark .owl img { width: 100%; height: 100%; object-fit: cover; }
.brandmark .word { font-size: 26px; font-weight: 800; color: var(--brand); letter-spacing: -0.5px; }
.brandmark.small .owl { width: 34px; height: 34px; font-size: 19px; }
.brandmark.small .word { font-size: 19px; }
.login-sub { color: var(--muted); margin: 10px 0 20px; font-size: 14px; }
.login-note { color: var(--muted); font-size: 12px; text-align: center; margin: 14px 0 0; }
.err {
  display: none; background: var(--danger-soft); color: var(--danger);
  border: 1px solid #f0c6c2; border-radius: 10px; padding: 10px 12px;
  font-size: 13px; margin-bottom: 14px;
}
.err.show { display: block; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { min-height: 90px; resize: vertical; }
.login-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 16px; }
.login-row a, a.link { color: var(--brand); cursor: pointer; font-size: 13px; font-weight: 600; text-decoration: none; }
.login-row a:hover, a.link:hover { text-decoration: underline; }

/* ---------- buttons ---------- */
.btn {
  background: var(--brand); color: #fff; border: none; border-radius: 10px;
  padding: 12px 18px; font-size: 15px; font-weight: 700; cursor: pointer;
  min-height: 46px; transition: background .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #8f1d17; }
.btn.warn { background: var(--gold); color: #3d2f05; }
.btn.sm { padding: 8px 12px; font-size: 13px; min-height: 38px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex: 0 0 250px; background: var(--brand); color: #fff;
  display: flex; flex-direction: column; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brandmark .word { color: #fff; }
.sidebar .brandmark .owl { background: rgba(255,255,255,.16); }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 24px; flex: 1; }
.nav button {
  background: transparent; border: none; color: rgba(255,255,255,.85);
  text-align: left; padding: 12px 14px; border-radius: 10px; font-size: 15px;
  font-weight: 600; cursor: pointer; min-height: 46px;
  display: flex; align-items: center; gap: 10px;
}
.nav button:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav button.active { background: rgba(255,255,255,.20); color: #fff; }
.side-foot { border-top: 1px solid rgba(255,255,255,.2); padding-top: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--gold);
  color: #3d2f05; font-weight: 800; display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.user-chip .who { display: flex; flex-direction: column; min-width: 0; }
.user-chip .who span { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.user-chip .who small { font-size: 11px; opacity: .75; text-transform: capitalize; }
.signout { width: 100%; color: #fff !important; border-color: rgba(255,255,255,.5) !important; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; background: var(--card); border-bottom: 1px solid var(--line);
  padding: 10px 16px; position: sticky; top: 0; z-index: 5;
}
.main { flex: 1; padding: 26px; max-width: 1060px; width: 100%; margin: 0 auto; }
.page-title { font-size: 24px; font-weight: 800; margin: 0 0 4px; color: var(--ink); }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

/* ---------- cards / tables ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(13,92,84,.05);
}
.card h3 { margin: 0 0 10px; font-size: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv b { font-weight: 600; }
.kv span { color: var(--muted); text-align: right; }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--gold-soft); color: #7a5c0a; }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--brand-soft); color: var(--brand); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--line); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.tbl td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl-wrap { overflow-x: auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* call report + texts */
.call { border-left: 4px solid var(--brand); padding: 12px 14px; background: #fff; border-radius: 0 10px 10px 0; margin-bottom: 12px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.call.alert { border-left-color: var(--gold); }
.call .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.call p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
.thread { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; }
.msg.out { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.in { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .t { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); min-height: 40px; }
.tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* banner */
.banner { border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; font-size: 14px; line-height: 1.5; }
.banner.info { background: var(--brand-soft); border: 1px solid #bcd9d3; color: #0a4a44; }
.banner.warn { background: var(--gold-soft); border: 1px solid #e3cf8e; color: #5c460a; }
.banner.ok { background: var(--ok-soft); border: 1px solid #bfe3c9; color: #14522a; }

/* faq */
.faq-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item h4 { margin: 0 0 6px; font-size: 15px; }
.faq-item p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.6; }

/* modal + toast */
.modal-bk { position: fixed; inset: 0; background: rgba(20,30,28,.5); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 50; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { font-size: 14px; color: var(--muted); line-height: 1.55; }
.temp-box {
  background: var(--cream-2); border: 2px dashed var(--gold); border-radius: 10px;
  font-family: ui-monospace, monospace; font-size: 20px; font-weight: 700;
  padding: 14px; text-align: center; letter-spacing: 1px; margin: 14px 0;
  user-select: all; color: var(--ink);
}
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s;
  z-index: 60; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* bottom nav (mobile) */
.bottomnav { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar { display: block; }
  .main { padding: 16px 14px 96px; }
  .bottomnav {
    display: block; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: var(--card); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bn-row { display: flex; overflow-x: auto; }
  .bn-row button {
    flex: 1 0 auto; background: none; border: none; padding: 10px 8px 8px;
    font-size: 10.5px; font-weight: 600; color: var(--muted); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    min-width: 64px; min-height: 58px;
  }
  .bn-row button .ic { font-size: 20px; }
  .bn-row button.active { color: var(--brand); }
  .toast { bottom: 110px; }
}
