/* ======================================================================
   Joy Konark Report Portal — stylesheet
   ====================================================================== */
:root {
  --primary: #e8308c;
  --primary-dark: #cf1f78;
  --secondary: #f9c015;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e6e8f0;
  --bg: #f1f3f9;
  --green: #15a34a;
  --red: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --sidebar: #1c1530;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 23px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 14px; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.text-green { color: var(--green); } .text-red { color: var(--red); }
.text-grey { color: var(--muted); }  .text-blue { color: var(--primary); }
.text-amber { color: #b45309; }
.ic { display: block; flex-shrink: 0; }
code {
  background: #fce4f0; padding: 1px 6px; border-radius: 5px; color: var(--primary-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 9px; font-size: 14px; font-weight: 600;
  line-height: 1.2; text-decoration: none; transition: all .15s ease; white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #cdd3e1; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(232,48,140,.32); outline-offset: 1px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { background: transparent; border-style: dashed; color: var(--muted); }
.btn-danger { background: #fff; border-color: #f3b9b9; color: var(--red); }
.btn-danger:hover { background: #fef2f2; border-color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { display: flex; width: 100%; }
.btn-copied { background: #dcfce7 !important; border-color: #86efac !important; color: #166534 !important; }
.btn-approve, .btn-deny {
  flex: 1; padding: 15px; font-size: 16px; color: #fff; border: none; border-radius: 11px;
}
.btn-approve { background: linear-gradient(180deg, #1bb55a, #15a34a); }
.btn-approve:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-deny { background: linear-gradient(180deg, #ef4444, #dc2626); }
.btn-deny:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* ---- Alerts & badges --------------------------------------------------- */
.alert {
  padding: 12px 15px; border-radius: 10px; margin: 0 0 16px; font-size: 14px;
  border: 1px solid transparent;
}
.alert a { font-weight: 600; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warn    { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.badge-blue  { background: #fce0ef; color: var(--primary-dark); }
.badge-amber { background: #fdf0c8; color: #8a5a00; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red   { background: #fee2e2; color: #991b1b; }
.badge-grey  { background: #e8eaf0; color: #475569; }
.pill {
  display: inline-block; background: #eef0f7; color: var(--muted);
  padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
}

/* ---- Auth / install cards --------------------------------------------- */
.auth-bg {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  padding: 20px; background: linear-gradient(150deg, #e8308c 0%, #8d1a52 60%, #3a1233 100%);
}
.auth-card {
  background: #fff; padding: 34px 34px 36px; border-radius: 18px; width: 100%;
  max-width: 392px; box-shadow: 0 24px 60px rgba(15,23,42,.32);
}
.auth-logo { display: block; width: 188px; height: auto; margin: 2px auto 16px; }
.auth-card h1 { font-size: 21px; }
.auth-card > p:first-of-type { margin-top: 4px; margin-bottom: 20px; text-align: center; }

/* ---- Sidebar layout ---------------------------------------------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 246px; flex-shrink: 0; background: var(--sidebar); color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; align-self: flex-start;
}
.sidebar-brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  padding: 18px 18px 14px;
}
.brand-logo {
  width: 126px; height: auto; display: block;
  background: #fff; border-radius: 10px; padding: 8px 10px;
}
.brand-sub {
  font-size: 10.5px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: #9a9fbe; padding-left: 3px;
}
.sidenav { display: flex; flex-direction: column; gap: 3px; padding: 6px 12px; flex: 1; }
.sidenav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 9px; color: #bcc0d8; font-size: 14px; font-weight: 600;
  transition: background .15s, color .15s;
}
.sidenav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidenav a.active { background: var(--primary); color: #fff; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.avatar {
  width: 33px; height: 33px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.uname { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .btn {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff;
}
.sidebar-foot .btn:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.22); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.container { flex: 1; max-width: 1020px; width: 100%; margin: 0 auto; padding: 28px 28px 70px; }
.sitefoot { text-align: center; color: #9aa1b4; font-size: 12px; padding: 22px; }

.mobilebar { display: none; }
.scrim { display: none; }

@media (max-width: 880px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.4);
  }
  .layout.nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
  .layout.nav-open .scrim { display: block; }
  .mobilebar {
    display: flex; align-items: center; gap: 12px; padding: 0 14px; height: 56px;
    background: var(--sidebar); color: #fff; position: sticky; top: 0; z-index: 30;
  }
  .menu-btn {
    background: none; border: none; color: #fff; cursor: pointer;
    padding: 6px; display: flex; border-radius: 8px;
  }
  .menu-btn:hover { background: rgba(255,255,255,.1); }
  .mobilebar-title { font-weight: 700; }
  .container { padding: 20px 16px 60px; }
}

/* ---- Page head --------------------------------------------------------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.page-sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

/* ---- Stat cards -------------------------------------------------------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15,23,42,.1); }
.stat-ic {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat-ic-grey  { background: #eef0f7; color: #475569; }
.stat-ic-pink  { background: #fce0ef; color: var(--primary-dark); }
.stat-ic-amber { background: #fdf0c8; color: #8a5a00; }
.stat-ic-green { background: #dcfce7; color: #15803d; }
.stat-body { display: flex; flex-direction: column; }
.stat-num { font-size: 25px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
@media (max-width: 720px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

/* ---- Cards & grid ------------------------------------------------------ */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card-flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }
.empty {
  background: #fff; border: 1px dashed #c7cdde; border-radius: var(--radius);
  padding: 54px 30px; text-align: center;
}
.empty-icon {
  width: 74px; height: 74px; border-radius: 50%; background: #fce0ef; color: var(--primary);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 10px;
}
.empty h2 { margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.subhead { font-weight: 700; font-size: 13px; margin: 18px 0 8px; }

/* ---- Tables ------------------------------------------------------------ */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid #eef0f5; }
.table th {
  color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 700; background: #fafbfd;
}
.table tbody tr:last-child td { border-bottom: none; }
.card-flush .table th, .card-flush .table td { padding-left: 20px; padding-right: 20px; }
.table-hover tbody tr { cursor: pointer; transition: background .12s ease; }
.table-hover tbody tr:hover { background: #fdf2f8; }
.row-title { font-weight: 600; }

/* ---- Filter tabs ------------------------------------------------------- */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-tabs a {
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
}
.filter-tabs a:hover { color: var(--ink); text-decoration: none; }
.filter-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- Forms ------------------------------------------------------------- */
label { display: block; margin-bottom: 15px; font-size: 14px; font-weight: 600; }
input[type=text], input[type=password], input[type=url], input[type=file],
textarea, select {
  width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid #cbd2e1;
  border-radius: 9px; font-size: 14px; font-family: inherit; font-weight: 400;
  color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,48,140,.16);
}
textarea { resize: vertical; }
.fieldset {
  border: 1px solid var(--line); border-radius: 11px; padding: 16px 18px;
  margin: 0 0 16px; background: #fcfcfe;
}
.fieldset legend {
  font-weight: 700; font-size: 12px; padding: 0 7px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted);
}
.radio, .check { font-weight: 400; }
.radio { display: block; margin-bottom: 7px; }
.radio input { width: auto; margin-right: 7px; }
.src-panel { margin-top: 10px; }
.row-2 { display: flex; gap: 14px; }
.row-2 label { flex: 1; }
@media (max-width: 560px) { .row-2 { flex-direction: column; gap: 0; } }
.inline { display: inline; }

/* ---- Doctor selection list -------------------------------------------- */
.checklist-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; background: #fbe9f3; border-radius: 10px 10px 0 0;
  border: 1px solid var(--line); border-bottom: none;
}
.check-all {
  display: flex; align-items: center; gap: 7px; font-size: 14px;
  cursor: pointer; white-space: nowrap; margin: 0;
}
.check-all input { width: auto; margin: 0; }
.filter-input { flex: 1; min-width: 140px; margin-top: 0 !important; padding: 7px 11px !important; }
#sel-count { margin-left: auto; }
.checklist {
  max-height: 260px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 0 0 10px 10px; padding: 6px;
}
.check {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 8px; cursor: pointer; font-size: 14px; margin: 0;
}
.check:hover { background: #fdf2f8; }
.check input { width: auto; margin: 0; }
.doc-name { font-weight: 600; }
.new-row { display: flex; gap: 9px; margin-bottom: 9px; }
.new-row input { margin-top: 0; }
@media (max-width: 560px) { .new-row { flex-direction: column; gap: 6px; } }

/* ---- Settings: template helpers --------------------------------------- */
.tpl-block {
  border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px;
  margin-bottom: 14px; background: #fcfcfe;
}
.tpl-text {
  background: #f6f7fb; border: 1px solid var(--line); border-radius: 9px;
  padding: 13px 15px; margin: 10px 0 7px; white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.6; color: var(--ink);
}
.tpl-picker { margin-bottom: 4px; }

/* ---- Key/value list & big status -------------------------------------- */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 8px 0 16px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-size: 14px; }
.big-status { font-size: 23px; font-weight: 800; margin: 4px 0 8px; letter-spacing: -.02em; }

/* ---- Copy link cell ---------------------------------------------------- */
.link-cell { display: flex; gap: 6px; align-items: center; }
.copy-input {
  width: 230px; max-width: 42vw; font-size: 12px; padding: 6px 9px !important;
  margin-top: 0 !important; background: #f8fafc; color: var(--muted);
}

/* ---- Doctor review page ----------------------------------------------- */
.review-bg {
  background: linear-gradient(160deg, #3a1233, #1c1530);
  min-height: 100vh; padding: 28px 14px;
}
.review-wrap { max-width: 580px; margin: 0 auto; }
.review-logo { text-align: center; margin-bottom: 18px; }
.review-logo img {
  width: 172px; height: auto; background: #fff;
  border-radius: 12px; padding: 9px 13px;
}
.review-card {
  background: #fff; border-radius: 20px; padding: 30px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
}
.review-card.center { text-align: center; padding: 52px 30px; }
.review-card h1 { font-size: 22px; margin: 8px 0 12px; }
.big-icon { font-size: 52px; line-height: 1; }
.report-desc {
  background: #f5f3f7; padding: 13px 16px; border-radius: 10px;
  font-size: 14px; margin: 14px 0; color: #334155;
}
.report-file { margin: 20px 0; }
.report-img { width: 100%; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 12px; }
.report-frame {
  width: 100%; height: 480px; border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 12px;
}
.ask { font-weight: 700; font-size: 15px; margin: 22px 0 12px; }
.decide-buttons { display: flex; gap: 12px; }
.fineprint { color: var(--muted); font-size: 12px; text-align: center; margin-top: 16px; }
