/* ══════════════════════════════════════════════════════
   H.Nizam Din & Sons — Multi-Customer Dashboard
   style.css
   ══════════════════════════════════════════════════════ */

/* ── VARIABLES ──────────────────────────────────────── */
:root {
  --bg:         #0f1520;
  --bg2:        #161f30;
  --bg3:        #1c2840;
  --border:     #2a3a55;
  --gold:       #c9a84c;
  --gold-lt:    #e0c070;
  --text:       #d8e0f0;
  --muted:      #7a90b0;
  --done:       #3db87a;
  --pending:    #e09040;
  --future:     #5b9bd5;
  --danger:     #e05252;
  --radius:     10px;
  --header-h:   64px;
  --sidenav-w:  80px;
  --bottomnav-h:64px;
}

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

html, body { height: 100%; }

/* Fix: prevent CSS display rules from overriding the hidden attribute */
[hidden] { display: none !important; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, #1a2540 0%, var(--bg) 70%);
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.login-logo {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--gold), #a07828);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #0f1520;
  margin-bottom: 4px;
}

.login-title {
  font-size: 20px; font-weight: 800;
  color: var(--gold-lt); text-align: center;
}

.login-sub {
  font-size: 12px; color: var(--muted);
  text-align: center; line-height: 1.5;
}

.login-error {
  width: 100%;
  background: rgba(224,82,82,0.1);
  border: 1px solid rgba(224,82,82,0.3);
  border-radius: 7px;
  color: var(--danger);
  font-size: 12px;
  padding: 8px 12px;
  text-align: center;
  display: none;
}

.login-error.show { display: block; }

.login-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.login-input:focus { border-color: var(--gold); }
.login-input::placeholder { color: var(--muted); }

.login-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--gold), #a07828);
  color: #0f1520;
  border: none;
  border-radius: 9px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: opacity 0.2s;
  margin-top: 4px;
}

.login-btn:hover    { opacity: 0.88; }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.login-footer {
  font-size: 11px; color: var(--muted);
  text-align: center; line-height: 1.5;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════════ */
.app-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── HEADER ─────────────────────────────────────────── */
.app-header {
  height: var(--header-h);
  background: linear-gradient(135deg, #0a1020, #131d30);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 100;
  gap: 12px;
}

.header-left {
  display: flex; align-items: center; gap: 12px;
}

.app-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold), #a07828);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #0f1520;
  flex-shrink: 0;
}

.header-brand {
  font-size: 15px; font-weight: 700; color: var(--gold-lt);
}

.header-tag {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px;
}

.header-right {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.client-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 20px; padding: 4px 12px;
}

.chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
}

#clientName { font-size: 12px; font-weight: 600; color: var(--gold-lt); }

.live-pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px;
}

.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pending);
  transition: background 0.4s;
}

#liveLabel { font-size: 11px; color: var(--muted); }

.logout-btn {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted);
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.logout-btn:hover { background: rgba(224,82,82,0.12); color: var(--danger); }

/* ── APP BODY ────────────────────────────────────────── */
.app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── SIDE NAV (desktop) ─────────────────────────────── */
.side-nav {
  width: var(--sidenav-w);
  background: #0c1422;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 4px;
  flex-shrink: 0;
}

/* ── BOTTOM NAV (mobile) ────────────────────────────── */
.bottom-nav {
  height: var(--bottomnav-h);
  background: #0c1422;
  border-top: 1px solid var(--border);
  display: none; /* shown via media query */
  flex-shrink: 0;
}

/* ── NAV ITEMS (shared) ─────────────────────────────── */
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.2s;
  position: relative;
}

/* Side nav item sizing */
.side-nav .nav-item {
  width: 52px; height: 52px;
}

.side-nav .nav-item.active {
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.25);
}

/* Bottom nav item sizing */
.bottom-nav .nav-item {
  flex: 1; height: 100%;
  border-radius: 0;
}

.bottom-nav .nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 20%; right: 20%;
  height: 2px; background: var(--gold);
}

.nav-icon  { font-size: 18px; color: #3a4f6a; transition: color 0.2s; }
.nav-label { font-size: 8px; color: #3a4f6a; font-weight: 600;
             text-transform: uppercase; letter-spacing: 0.4px; transition: color 0.2s; }

.nav-item.active .nav-icon,
.nav-item.active .nav-label { color: var(--gold); }

.nav-item:hover .nav-icon,
.nav-item:hover .nav-label  { color: var(--gold-lt); }

/* ── MAIN CONTENT ────────────────────────────────────── */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 20px;
  display: flex;
  flex-direction: column;
}

/* ── MONTH BAR ───────────────────────────────────────── */
.month-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.01);
  flex-shrink: 0;
}

.month-bar button {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--gold); width: 28px; height: 28px;
  border-radius: 7px; font-size: 18px;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background 0.2s;
}

.month-bar button:hover { background: rgba(201,168,76,0.15); }

.month-bar span {
  font-size: 14px; font-weight: 600; color: var(--text);
  min-width: 140px; text-align: center;
}

/* ── SCREENS ─────────────────────────────────────────── */
.screen { display: none; padding: 20px; flex-direction: column; gap: 18px; }
.screen.active { display: flex; }

/* ══════════════════════════════════════════════════════
   SHARED COMPONENTS
══════════════════════════════════════════════════════ */
.sec-head { display: flex; align-items: center; justify-content: space-between; }

.sec-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.8px;
}

.sec-icon { font-size: 15px; }

.sec-sub {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  margin-top: -8px;
}

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
}

.bgold    { background: rgba(201,168,76,0.15); color: var(--gold);    border: 1px solid rgba(201,168,76,0.3); }
.bdone    { background: rgba(61,184,122,0.15); color: var(--done);    border: 1px solid rgba(61,184,122,0.3); }
.bpending { background: rgba(224,144,64,0.15); color: var(--pending); border: 1px solid rgba(224,144,64,0.3); }
.bfuture  { background: rgba(91,155,213,0.15); color: var(--future);  border: 1px solid rgba(91,155,213,0.3); }

/* ══════════════════════════════════════════════════════
   TASKS SCREEN
══════════════════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  position: relative; overflow: hidden;
  transition: transform 0.2s;
}

.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
}

.stat-done::before    { background: var(--done);    }
.stat-pending::before { background: var(--pending); }
.stat-future::before  { background: var(--future);  }
.stat-avg::before     { background: var(--gold);    }
.stat-card:hover      { transform: translateY(-2px); }

.stat-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 5px; }
.stat-val { font-size: 34px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-sub { font-size: 11px; color: var(--muted); }

.progress-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px;
}

.prog-hdr { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.prog-bar { height: 10px; background: rgba(255,255,255,0.07); border-radius: 5px; overflow: hidden; margin-bottom: 8px; }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--done), #59d699); border-radius: 5px; transition: width 0.6s ease; }
.prog-sub { font-size: 12px; color: var(--muted); }

.task-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.task-col {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden;
}

.col-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.col-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-done    { background: var(--done);    }
.dot-pending { background: var(--pending); }
.dot-future  { background: var(--future);  }

.btn-add {
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.25);
  color: var(--gold); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}

.btn-add:hover { background: rgba(201,168,76,0.2); }

.task-list {
  flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 5px; min-height: 50px;
}

.empty-state { font-size: 12px; color: var(--muted); text-align: center; padding: 18px 10px; }

.task-item {
  display: flex; align-items: flex-start; gap: 7px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 9px; transition: background 0.15s;
}

.task-item:hover { background: rgba(255,255,255,0.06); }

.task-check {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--done); cursor: pointer; flex-shrink: 0; margin-top: 1px;
  transition: border-color 0.2s;
}

.task-check:hover { border-color: var(--done); }
.task-body { flex: 1; min-width: 0; }
.task-name { font-size: 12px; color: var(--text); word-break: break-word; }
.task-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }

.task-del {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 11px; padding: 2px 3px;
  border-radius: 4px; transition: color 0.2s; flex-shrink: 0;
}

.task-del:hover { color: var(--danger); }

.add-form {
  display: none; flex-direction: column; gap: 6px;
  padding: 10px; border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.add-form.open { display: flex; }

.add-form input {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 7px 9px;
  font-size: 12px; outline: none; transition: border-color 0.2s;
}

.add-form input:focus { border-color: var(--gold); }
.add-form input::placeholder { color: var(--muted); }

.form-btns { display: flex; gap: 6px; }

.btn-ok, .btn-no {
  flex: 1; padding: 7px; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer; border: none;
  transition: opacity 0.2s;
}

.btn-ok  { background: var(--gold); color: #0f1520; }
.btn-no  { background: rgba(255,255,255,0.07); color: var(--muted); }
.btn-ok:hover, .btn-no:hover { opacity: 0.85; }

/* ══════════════════════════════════════════════════════
   FEEDBACK SCREEN
══════════════════════════════════════════════════════ */
.feedback-wrap {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
}

.star-row { display: flex; gap: 10px; }

.star {
  font-size: 34px; color: var(--border);
  cursor: pointer; transition: color 0.15s, transform 0.1s; line-height: 1;
}

.star.active { color: var(--gold); }
.star:hover  { color: var(--gold-lt); transform: scale(1.1); }

.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px;
}

.cat-item label {
  display: block; font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 5px;
}

.mini-stars { display: flex; gap: 4px; }

.mini-star {
  font-size: 18px; color: var(--border); cursor: pointer; transition: color 0.15s;
}

.mini-star.active { color: var(--gold); }
.mini-star:hover  { color: var(--gold-lt); }

textarea#feedbackText {
  width: 100%; min-height: 80px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 10px 12px;
  font-size: 13px; resize: vertical; outline: none;
  transition: border-color 0.2s; font-family: inherit;
}

textarea#feedbackText:focus { border-color: var(--gold); }
textarea#feedbackText::placeholder { color: var(--muted); }

.submit-btn {
  background: linear-gradient(135deg, var(--gold), #a07828);
  color: #0f1520; border: none; border-radius: 8px;
  padding: 11px 24px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s; align-self: flex-start;
}

.submit-btn:hover { opacity: 0.9; }

.hist-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--muted); font-weight: 600; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

.fb-entry {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 8px;
}

.fb-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.fb-stars { font-size: 15px; color: var(--gold); letter-spacing: 2px; }
.fb-date  { font-size: 10px; color: var(--muted); }
.fb-text  { font-size: 13px; color: var(--text); font-style: italic; margin-bottom: 6px; line-height: 1.5; }

.fb-cats { display: flex; flex-wrap: wrap; gap: 5px; }

.fb-cat {
  background: rgba(201,168,76,0.08); border: 1px solid rgba(201,168,76,0.2);
  border-radius: 12px; padding: 2px 8px; font-size: 10px; color: var(--gold);
}

/* ══════════════════════════════════════════════════════
   REPORTS SCREEN
══════════════════════════════════════════════════════ */
.reports-wrap {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
}

.report-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px;
}

.report-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px;
  cursor: pointer; display: flex; flex-direction: column; gap: 7px;
  transition: border-color 0.2s, transform 0.15s;
}

.report-card:hover { border-color: var(--gold); transform: translateY(-2px); }

.report-ico  { font-size: 24px; }
.report-name { font-size: 13px; font-weight: 700; color: var(--text); }
.report-desc { font-size: 11px; color: var(--muted); line-height: 1.5; flex: 1; }
.report-btn  { font-size: 11px; font-weight: 600; color: var(--gold); margin-top: 4px; }

/* ══════════════════════════════════════════════════════
   ADMIN SCREEN
══════════════════════════════════════════════════════ */
.admin-wrap {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
}

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

.customer-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}

.customer-card:hover {
  border-color: var(--gold); background: rgba(201,168,76,0.04);
}

.customer-card.viewing {
  border-color: var(--gold); background: rgba(201,168,76,0.08);
}

.cust-avatar {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #0f1520; flex-shrink: 0;
}

.cust-info { flex: 1; }
.cust-name { font-size: 14px; font-weight: 700; color: var(--text); }
.cust-email{ font-size: 11px; color: var(--muted); margin-top: 2px; }

.cust-stats {
  display: flex; gap: 14px;
}

.cust-stat { text-align: center; }
.cust-stat-val { font-size: 18px; font-weight: 800; color: var(--text); }
.cust-stat-lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.view-btn {
  background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold); border-radius: 7px; padding: 6px 12px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}

.view-btn:hover { background: rgba(201,168,76,0.2); }

.admin-banner {
  background: rgba(201,168,76,0.08); border: 1px solid rgba(201,168,76,0.25);
  border-radius: 8px; padding: 10px 14px;
  font-size: 12px; color: var(--gold-lt);
  display: flex; align-items: center; gap: 8px;
}

/* ══════════════════════════════════════════════════════
   REPORT MODAL
══════════════════════════════════════════════════════ */
.r-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 1000;
  align-items: flex-start; justify-content: center;
  padding: 32px 16px; overflow-y: auto;
}

.r-overlay.open { display: flex; }

.r-modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; width: 100%; max-width: 680px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6); overflow: hidden;
  flex-shrink: 0;
}

.r-modal-stripe { height: 4px; background: linear-gradient(90deg, var(--gold), var(--gold-lt)); }

.r-modal-hdr {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border);
}

.r-modal-ico   { font-size: 20px; }
.r-modal-title { flex: 1; font-size: 16px; font-weight: 700; color: var(--text); }

.r-close {
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  color: var(--muted); width: 28px; height: 28px; border-radius: 7px;
  cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.r-close:hover { background: rgba(224,82,82,0.15); color: var(--danger); }

.r-modal-body { padding: 20px; max-height: 65vh; overflow-y: auto; }

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

.btn-print {
  background: var(--gold); color: #0f1520; border: none;
  border-radius: 7px; padding: 8px 16px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s;
}

.btn-print:hover { opacity: 0.88; }

.btn-close-r {
  background: rgba(255,255,255,0.07); color: var(--muted);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 8px 16px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}

.btn-close-r:hover { background: rgba(255,255,255,0.12); }

/* Report inner sections */
.r-section { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.r-section:last-child { border-bottom: none; }

.r-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.9px; color: var(--gold); margin-bottom: 10px;
  display: flex; align-items: center; gap: 7px;
}

.r-hint { font-size: 10px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.r-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 16px; line-height: 1.7; }

.r-good {
  display: flex; align-items: center; gap: 12px;
  background: rgba(61,184,122,0.08); border: 1px solid rgba(61,184,122,0.25);
  border-radius: 9px; padding: 16px 18px; color: var(--done); font-size: 13px; font-weight: 500;
}

.r-rec {
  background: rgba(255,255,255,0.04); border-left: 3px solid var(--gold);
  border-radius: 4px; padding: 11px 14px; font-size: 13px; color: var(--text); line-height: 1.6;
}

.summary-hero { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0 14px; }
.summary-score { font-size: 52px; font-weight: 800; color: var(--text); line-height: 1; }
.summary-stars { font-size: 22px; color: var(--gold); letter-spacing: 4px; }
.summary-sentiment { font-size: 17px; font-weight: 700; margin-top: 2px; }
.summary-count { font-size: 11px; color: var(--muted); }

.rbar-row { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.rbar-lbl { font-size: 11px; color: var(--muted); min-width: 34px; text-align: right; }
.rbar-track { flex: 1; height: 7px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; }
.rbar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-lt)); border-radius: 3px; transition: width 0.5s; }
.rbar-count { font-size: 11px; color: var(--muted); min-width: 16px; }

.cat-score-row { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.cat-score-name { font-size: 11px; color: var(--text); min-width: 110px; }
.cat-score-track { flex: 1; height: 7px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; }
.cat-score-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.cat-score-val { font-size: 11px; font-weight: 600; color: var(--text); min-width: 26px; text-align: right; }

.r-comment { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px; padding: 11px 13px; margin-bottom: 8px; }
.r-comment-stars { font-size: 13px; color: var(--gold); letter-spacing: 2px; }
.r-comment-date { font-size: 10px; color: var(--muted); margin-left: 8px; }
.r-comment-text { font-size: 12px; color: var(--text); line-height: 1.55; font-style: italic; margin-top: 5px; }

.risk-summary-row { display: flex; gap: 16px; justify-content: space-around; flex-wrap: wrap; }
.risk-stat { text-align: center; padding: 8px 16px; }
.risk-stat-val { font-size: 28px; font-weight: 800; color: var(--text); }
.risk-stat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 3px; }

.risk-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  gap: 3px 8px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 7px; align-items: center;
}

.risk-task-name { font-size: 12px; font-weight: 600; color: var(--text); grid-column: 1; grid-row: 1; }
.risk-badge { grid-column: 2; grid-row: 1 / 3; padding: 3px 8px; border-radius: 12px; font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-align: center; }
.risk-reason { font-size: 10px; color: var(--muted); grid-column: 1; grid-row: 2; }

.monthly-report { color: var(--text); font-size: 13px; line-height: 1.65; }
.mr-letterhead { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.mr-from-name { font-size: 18px; font-weight: 800; color: var(--gold-lt); }
.mr-from-tag  { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px; }
.mr-to-block  { text-align: right; }
.mr-to-lbl    { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.mr-to-name   { font-size: 14px; font-weight: 700; color: var(--text); }
.mr-title     { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.mr-date      { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.mr-divider   { height: 1px; background: linear-gradient(90deg, var(--gold) 0%, transparent 100%); margin: 12px 0; }
.mr-section   { margin-bottom: 16px; }
.mr-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.9px; color: var(--gold); margin-bottom: 8px; }
.mr-item      { display: flex; align-items: baseline; gap: 7px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 12px; }
.mr-tick      { flex-shrink: 0; font-size: 13px; }
.mr-item-done    .mr-tick { color: var(--done);    }
.mr-item-pending .mr-tick { color: var(--pending); }
.mr-item-future  .mr-tick { color: var(--future);  }
.mr-meta   { color: var(--muted); font-size: 10px; }
.mr-none   { font-size: 11px; color: var(--muted); font-style: italic; }
.mr-quote  { background: rgba(255,255,255,0.04); border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 4px; font-style: italic; font-size: 12px; color: var(--text); margin-top: 7px; }
.mr-footer { font-size: 10px; color: var(--muted); text-align: center; padding-top: 8px; }

/* ══════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 80px; right: 22px;
  background: #1c2a40; border: 1px solid var(--gold);
  color: var(--text); padding: 9px 16px;
  border-radius: 8px; font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
  z-index: 9999; box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

#toast.show { opacity: 1; }

/* ══════════════════════════════════════════════════════
   PRINT / SAVE AS PDF
══════════════════════════════════════════════════════ */
@media print {
  body > *       { display: none !important; }
  .r-overlay     { display: block !important; position: static !important; background: none !important; padding: 0 !important; }
  .r-modal       { border: none !important; box-shadow: none !important; max-width: 100% !important; }
  .r-modal-stripe, .r-modal-hdr, .r-modal-foot { display: none !important; }
  .r-modal-body  { max-height: none !important; overflow: visible !important; padding: 0 !important; }
  .monthly-report { color: #111 !important; }
  .mr-from-name, .mr-section-title, .r-section-title { color: #8a5a00 !important; }
  .mr-meta, .mr-footer, .mr-none { color: #666 !important; }
  .mr-quote { border-left-color: #8a5a00 !important; background: #fafafa !important; color: #333 !important; }
  .summary-stars { color: #c9a84c !important; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Show bottom nav, hide side nav */
  .side-nav   { display: none; }
  .bottom-nav { display: flex; }

  .app-screen { padding-bottom: var(--bottomnav-h); }

  #toast { bottom: calc(var(--bottomnav-h) + 12px); }

  .app-header { padding: 0 14px; }
  .header-tag { display: none; }

  .screen { padding: 14px 12px; gap: 14px; }

  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-val  { font-size: 28px; }

  .task-board { grid-template-columns: 1fr; }

  .report-grid { grid-template-columns: 1fr; }

  .r-overlay { padding: 14px 10px; }
  .r-modal-body { max-height: 58vh; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — DESKTOP (side nav active)
══════════════════════════════════════════════════════ */
@media (min-width: 641px) {
  .bottom-nav { display: none; }
  .side-nav   { display: flex; }
}
