/* ============================================================================
   RCG Work Hub — Design system
   Brand palette from the Riya's Cake Gallery logo:
   chocolate espresso, warm cream, gallery red, caramel amber.
   ========================================================================== */

:root {
  /* brand */
  --brand-900: #221410;         /* darkest espresso */
  --brand-800: #2e1c15;         /* sidebar */
  --brand-700: #3d261c;
  --brand-600: #54341f;
  --red-700: #7a1616;           /* "gallery" red */
  --red-600: #8b1a1a;
  --red-500: #a32424;
  --amber-500: #e8963f;         /* cake caramel */
  --amber-100: #fdf0df;
  --cream: #f6e7c9;

  /* surfaces & ink */
  --bg: #f7f3ec;
  --card: #ffffff;
  --line: #ece3d4;
  --line-strong: #ddd0bb;
  --ink: #2c211b;
  --muted: #8a7a6c;
  --soft: #faf6ef;

  /* status */
  --good: #2e9e5b;  --good-bg: #e5f5ec;  --good-ink: #1e7a44;
  --warn: #e8a13c;  --warn-bg: #fdf1dd;  --warn-ink: #9c6410;
  --bad:  #d64545;  --bad-bg:  #fbe7e7;  --bad-ink:  #ab2626;
  --info-bg: #f3ece1; --info-ink: #54341f;

  --shadow-sm: 0 1px 2px rgba(46, 28, 21, 0.06);
  --shadow: 0 8px 24px rgba(46, 28, 21, 0.09);
  --shadow-lg: 0 18px 48px rgba(46, 28, 21, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 256px;
  --font: "Noto Sans Bengali", "Hind Siliguri", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--cream); }

h1, h2, h3, h4 { line-height: 1.25; }

/* ============================ Login ===================================== */
.auth-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(232, 150, 63, 0.28), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(139, 26, 26, 0.35), transparent 60%),
    linear-gradient(150deg, var(--brand-800), var(--brand-900));
}
.auth-card {
  width: 100%; max-width: 410px;
  background: var(--card);
  border-radius: 24px;
  padding: 42px 36px 34px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: rise .35s ease;
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.auth-card .brand-logo { width: 108px; height: 108px; object-fit: contain; margin: 0 auto 4px; display: block; }
.auth-card h1 { font-size: 23px; margin: 10px 0 2px; font-weight: 800; }
.auth-card p.sub { color: var(--muted); margin: 0 0 26px; font-size: 13.5px; }
.err { color: var(--bad-ink); font-size: 13px; min-height: 20px; margin: 2px 0 8px; font-weight: 600; }
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--muted); }

/* ============================ Form fields =============================== */
.field { text-align: left; margin-bottom: 16px; min-width: 0; }
.field label {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; color: var(--ink);
  background: var(--soft);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--red-600); background: #fff;
  box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.12);
}
.field input::placeholder, .field textarea::placeholder { color: #b6a898; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.check input { accent-color: var(--red-600); width: 16px; height: 16px; }

/* ============================ Buttons =================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: none; cursor: pointer; font-weight: 700; font-size: 14px; font-family: inherit;
  padding: 11px 18px; border-radius: 12px; white-space: nowrap;
  transition: transform .06s, filter .15s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--red-500), var(--red-700)); color: #fff; box-shadow: 0 4px 14px rgba(139, 26, 26, 0.32); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: rgba(139, 26, 26, 0.08); color: var(--red-600); }
.btn-ghost:hover { background: rgba(139, 26, 26, 0.15); }
.btn-light { background: #fff; color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn-light:hover { border-color: var(--red-500); color: var(--red-600); }
.btn-success { background: var(--good); color: #fff; }
.btn-success:hover { filter: brightness(1.07); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.icon-btn {
  border: none; background: rgba(255,255,255,0.1); color: inherit; cursor: pointer;
  width: 32px; height: 32px; border-radius: 9px; font-size: 15px;
  display: grid; place-items: center; transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.22); }

/* ============================ App shell ================================= */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand-800), var(--brand-900));
  color: #f3e9db;
  padding: 22px 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 20px; }
.sidebar .brand img {
  width: 46px; height: 46px; object-fit: contain; border-radius: 12px;
  background: var(--cream); padding: 4px;
}
.sidebar .brand .t { font-weight: 800; font-size: 18px; letter-spacing: .02em; }
.sidebar .brand .t small { display: block; font-weight: 500; font-size: 11px; opacity: .65; letter-spacing: .14em; }
.sidebar .nav { display: flex; flex-direction: column; gap: 3px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-radius: 11px; color: #cbb9a6; font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-link .ico { width: 21px; text-align: center; font-size: 16px; }
.nav-link:hover { background: rgba(246, 231, 201, 0.09); color: #fff; }
.nav-link.active {
  background: linear-gradient(135deg, rgba(163, 36, 36, 0.85), rgba(122, 22, 22, 0.85));
  color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.sidebar .spacer { flex: 1; }
.sidebar .me-card {
  background: rgba(246, 231, 201, 0.08); border: 1px solid rgba(246, 231, 201, 0.12);
  border-radius: 14px; padding: 11px 12px;
  display: flex; gap: 10px; align-items: center;
}
.sidebar .me-card .av {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-size: 19px; background: linear-gradient(135deg, var(--amber-500), var(--red-500));
  flex-shrink: 0;
}
.sidebar .me-card .me-id { min-width: 0; flex: 1; }
.sidebar .me-card .nm { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me-card .rl { font-size: 11px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 34px 6px; gap: 16px; flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 24px; font-weight: 800; }
.topbar .sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.topbar-actions .field { margin: 0; }
.content { padding: 18px 34px 56px; }
#burger {
  display: none; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink);
  width: 40px; height: 40px; border-radius: 10px; font-size: 18px; cursor: pointer;
}

/* ============================ Cards / grid ============================== */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card.flush { padding: 0; overflow: hidden; }
.card h3 {
  margin: 0 0 14px; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); font-weight: 700;
}
.card.flush h3 { margin: 18px 20px 6px; }
.section-title {
  margin: 30px 0 12px; font-size: 17px; font-weight: 800;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

/* stat tiles */
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.stat .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.stat .ico {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-size: 17px; background: var(--amber-100); flex-shrink: 0;
}
.stat .n { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }

/* hero balance (finance) */
.hero {
  border-radius: 20px; padding: 28px 30px; color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(480px 220px at 90% -20%, rgba(232, 150, 63, 0.5), transparent 65%),
    linear-gradient(120deg, var(--brand-800), var(--red-700) 75%);
  box-shadow: var(--shadow);
}
.hero .chip { position: absolute; top: 22px; right: 28px; font-size: 11px; letter-spacing: .2em; opacity: .75; font-weight: 700; }
.hero .label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .78; }
.hero .balance { font-size: 42px; font-weight: 800; margin: 6px 0 16px; letter-spacing: -0.01em; }
.hero .io { display: flex; gap: 34px; }
.hero .io .k { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .95; }
.hero .io .k.inc { color: #9fe8bd; } .hero .io .k.exp { color: #ffb9a8; }
.hero .io .v { font-size: 18px; font-weight: 700; }
.hero .date { position: absolute; bottom: 20px; right: 28px; font-size: 12px; opacity: .75; }

/* ============================ Badges ==================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800;
  letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}
.badge.high, .badge.rejected { background: var(--bad-bg); color: var(--bad-ink); }
.badge.medium, .badge.pending, .badge.project { background: var(--warn-bg); color: var(--warn-ink); }
.badge.low, .badge.approved, .badge.goal { background: var(--good-bg); color: var(--good-ink); }
.badge.role, .badge.budget { background: var(--info-bg); color: var(--info-ink); }

/* ============================ Task board ================================ */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.col { background: rgba(255, 255, 255, 0.55); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.col > h4 {
  margin: 6px 8px 12px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--brand-600); display: flex; justify-content: space-between; align-items: center;
}
.col > h4 .count { background: var(--brand-600); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 9px; }
.task {
  background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 14px;
  margin-bottom: 10px; box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--amber-500);
  transition: box-shadow .15s, transform .15s;
}
.task:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.task.p-HIGH { border-left-color: var(--bad); }
.task.p-MEDIUM { border-left-color: var(--warn); }
.task.p-LOW { border-left-color: var(--good); }
.task .tt { font-weight: 700; font-size: 15px; }
.task .desc { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.task .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.task .who { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.task .who .av { width: 22px; height: 22px; border-radius: 50%; background: var(--amber-100); display: grid; place-items: center; font-size: 12px; }
.task .actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.task.done { opacity: .68; }
.task.done .tt { text-decoration: line-through; }

.empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 30px 10px; }
.empty .e-ico { display: block; font-size: 30px; margin-bottom: 8px; opacity: .8; }

/* ============================ Tables ==================================== */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
table.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 13px 16px; border-bottom: 1.5px solid var(--line-strong);
  background: var(--soft); white-space: nowrap;
}
table.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--soft); }
table.tbl tr:last-child td { border-bottom: none; }
.amt-credit { color: var(--good-ink); font-weight: 700; }
.amt-debit { color: var(--bad-ink); font-weight: 700; }

/* progress bars */
.progress { height: 8px; background: #efe6d6; border-radius: 999px; overflow: hidden; }
.progress > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--amber-500), var(--red-500));
  transition: width .4s ease;
}
.progress.goal > span { background: linear-gradient(90deg, #27ae60, #2e9e5b); }
.progress.warn > span { background: linear-gradient(90deg, #e67e22, var(--warn)); }

/* budgets */
.budget-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.budget-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.budget-card .nm { font-weight: 700; }
.budget-card .nums { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 10px 0 7px; }

/* team cards */
.person {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px 18px; box-shadow: var(--shadow-sm); text-align: center;
  transition: box-shadow .15s, transform .15s;
}
.person:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.person .av {
  width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 10px;
  display: grid; place-items: center; font-size: 30px; color: #fff;
  background: linear-gradient(135deg, var(--amber-500), var(--red-600));
  box-shadow: 0 6px 16px rgba(139, 26, 26, 0.25);
}
.person .nm { font-weight: 800; font-size: 16px; }
.person .ti { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.person .lv { font-size: 12.5px; font-weight: 700; color: var(--red-600); margin-bottom: 7px; }

/* ============================ Modal ===================================== */
.modal-back {
  position: fixed; inset: 0; background: rgba(34, 20, 16, 0.55);
  display: none; place-items: center; z-index: 60; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-back.open { display: grid; }
.modal {
  background: #fff; border-radius: 20px; width: 100%; max-width: 470px; padding: 26px;
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto;
  animation: rise .22s ease;
}
.modal h2 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.modal .msub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.modal .row { display: flex; gap: 12px; }
.modal .row .field { flex: 1; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.confirm-body { text-align: center; padding: 6px 4px 0; }
.confirm-body .confirm-ico { font-size: 40px; margin-bottom: 6px; }
.confirm-body h2 { margin-bottom: 6px; }
.confirm-body .msub { margin-bottom: 4px; }
.confirm-body + .modal-actions { justify-content: center; }

/* fab */
.fab {
  position: fixed; right: 28px; bottom: 28px; width: 58px; height: 58px; border-radius: 50%;
  font-size: 26px; color: #fff; border: none; cursor: pointer; z-index: 40;
  background: linear-gradient(135deg, var(--red-500), var(--red-700));
  box-shadow: 0 10px 26px rgba(122, 22, 22, 0.45);
  display: none;
  transition: transform .12s;
}
.fab:hover { transform: scale(1.06); }

/* toasts */
#toasts { position: fixed; top: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast {
  background: var(--brand-900); color: #f6efe3; border-radius: 12px; padding: 12px 16px;
  box-shadow: var(--shadow-lg); font-size: 14px; min-width: 240px; max-width: 360px;
  display: flex; align-items: center; gap: 10px;
  animation: slidein .22s ease;
  transition: opacity .3s, transform .3s;
}
.toast.out { opacity: 0; transform: translateX(24px); }
.toast .toast-ico {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: rgba(255,255,255,0.14); flex-shrink: 0;
}
.toast.good .toast-ico { background: var(--good); color: #fff; }
.toast.bad .toast-ico { background: var(--bad); color: #fff; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* denied */
.denied {
  max-width: 460px; margin: 12vh auto; text-align: center; background: #fff;
  border: 1px solid var(--line); border-radius: 20px; padding: 44px 40px; box-shadow: var(--shadow);
}
.denied .lock { font-size: 52px; }

/* misc */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pill-count { background: var(--info-bg); color: var(--info-ink); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.flex { display: flex; } .between { justify-content: space-between; }
.center { align-items: center; } .gap { gap: 10px; } .wrap { flex-wrap: wrap; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }

/* emoji picker */
.emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-opt {
  width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--soft); font-size: 20px; cursor: pointer; line-height: 1;
  display: grid; place-items: center; transition: transform .08s, border-color .12s, background .12s;
}
.emoji-opt:hover { transform: scale(1.1); border-color: var(--amber-500); }
.emoji-opt.sel { border-color: var(--red-600); background: var(--amber-100); box-shadow: 0 0 0 2px rgba(139,26,26,.18); }
.emoji-preview {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font-size: 25px; background: var(--amber-100); flex-shrink: 0;
}

/* ============================ Charts ==================================== */
.chart { width: 100%; height: auto; display: block; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-tick { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.ch-label { font-size: 12px; fill: var(--ink); font-family: var(--font); font-weight: 600; }
.ch-center { font-size: 15px; font-weight: 800; fill: var(--ink); font-family: var(--font); }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); justify-content: center; }
.ch-legend.col { flex-direction: column; gap: 8px; justify-content: center; margin-top: 0; }
.ch-legend span { display: inline-flex; align-items: center; gap: 7px; }
.ch-legend i { width: 11px; height: 11px; border-radius: 3.5px; display: inline-block; }
.ch-legend b { color: var(--ink); }
.doughnut-wrap { display: grid; grid-template-columns: minmax(0, 220px) 1fr; gap: 14px; align-items: center; }
.doughnut-wrap svg.donut { max-width: 220px; margin: 0 auto; }

/* ============================ Responsive ================================ */
@media (max-width: 1080px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .board { grid-template-columns: 1fr; }
  .doughnut-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed; z-index: 50; transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  #burger { display: grid; place-items: center; }
  .fab { display: block; }
}
@media (max-width: 680px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .content { padding: 14px 16px 72px; }
  .topbar { padding: 18px 16px 4px; }
  .topbar h1 { font-size: 20px; }
  .modal .row { flex-direction: column; gap: 0; }
  .hero .balance { font-size: 32px; }
  .hero .chip { position: static; display: block; margin-bottom: 10px; }
  .hero .date { position: static; margin-top: 14px; }
}
