/* =========================================================
   Trinkceb — shared stylesheet
   ========================================================= */

:root {
  /* Brand accent — same tokens as the marketing site */
  --accent: #0B61FF;
  --accent-dark: #0950D9;
  --accent-light: #EEF4FF;
  --bg: #f7f7f9;
  --card: #ffffff;
  --border: #ececef;
  --text: #111827;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --green: #16a34a;
  --green-bg: #e9f9ee;
  --blue: #2563eb;
  --blue-bg: #eaf1ff;
  --orange: #d97706;
  --orange-bg: #fef3e2;
  --purple: #7c3aed;
  --purple-bg: #f1eafe;
  --red: #dc2626;
  --red-bg: #fdeaea;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.04), 0 1px 12px rgba(17, 17, 17, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ---------- App shell ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 28px 8px;
}

.brand-logo { height: 22px; width: auto; display: block; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-group { margin-bottom: 6px; }

.nav-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 18px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
  transition: background .15s ease, color .15s ease;
}

.nav-item svg { flex-shrink: 0; }

.nav-item:hover { background: #f4f4f6; }

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #f7f7f9;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-footer .name { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.sidebar-footer .email { font-size: 12px; color: var(--text-muted); }

/* ---------- Main column ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.search {
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-faint);
}

.search input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: var(--text);
}

.topbar-icons {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  color: var(--text);
}

.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid #fff;
}

/* ---------- Page content ---------- */
.content {
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}

.segmented {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}

.segmented button {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.segmented button.active {
  background: var(--accent);
  color: #fff;
}

/* ---------- Stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.stat-card .label {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 10px;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-card .delta {
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 6px;
}

.delta.up { color: var(--green); }
.delta.down { color: var(--red); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.green { background: var(--green); color: #fff; }
.stat-icon.blue { background: var(--blue); color: #fff; }
.stat-icon.orange { background: var(--orange); color: #fff; }
.stat-icon.purple { background: var(--purple); color: #fff; }
.stat-icon.accent-outline { background: var(--accent-light); color: var(--accent); }
.stat-icon.blue-outline { background: var(--blue-bg); color: var(--blue); }
.stat-icon.green-outline { background: var(--green-bg); color: var(--green); }
.stat-icon.orange-outline { background: var(--orange-bg); color: var(--orange); }
.stat-icon.purple-outline { background: var(--purple-bg); color: var(--purple); }
.stat-icon.red-outline { background: var(--red-bg); color: var(--red); }

/* ---------- Two column layout ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 17px;
  font-weight: 800;
}

.panel-body { padding: 8px 22px 12px; }

/* ---------- Project / payment rows ---------- */
.row-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.row-item:last-child { border-bottom: none; }

.row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.row-title { font-weight: 700; font-size: 15px; }
.row-amount { color: var(--accent); font-weight: 800; font-size: 15px; }
.row-sub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 10px; }

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.progress-track {
  height: 7px;
  border-radius: 99px;
  background: #eee;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.payment-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.payment-item:last-child { border-bottom: none; }

.payment-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.payment-info { flex: 1; }
.payment-info .pname { font-weight: 700; font-size: 14.5px; }
.payment-info .pdate { font-size: 12.5px; color: var(--text-muted); }
.payment-amount { font-weight: 800; font-size: 15px; margin-bottom: 6px; text-align: right; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-green { background: var(--green-bg); color: var(--green); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

.cell-title { font-weight: 700; }
.cell-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.cell-amount { font-weight: 800; }

.link-action { color: var(--accent); font-weight: 700; font-size: 13.5px; }

.table-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.table-actions button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.table-actions button:hover { background: var(--bg); }

/* ---------- Search / filter bar ---------- */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.filter-search {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text-faint);
}

.filter-search input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
  color: var(--text);
}

/* ---------- Project grid (cards) ---------- */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.project-card { padding: 24px; }

.project-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.project-card-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.project-client { color: var(--text-muted); font-size: 13.5px; margin-bottom: 18px; }

.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0;
}

.meta-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600;}
.meta-value { font-size: 14.5px; font-weight: 700; }
.meta-value.paid { color: var(--green); }

.project-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.project-card-actions .btn-primary { flex: 1; justify-content: center; }

.icon-square {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}

/* ---------- Report table ---------- */
.report-panel { padding: 24px; }
.report-title { font-size: 17px; font-weight: 800; margin: 0 0 12px; }

.dist-item { padding: 14px 0; }
.dist-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 700; font-size: 14.5px; }
.dist-note { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }

.stars { color: #f59e0b; letter-spacing: 2px; }

/* ---------- Profile ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

.profile-side { padding: 30px 24px; text-align: center; }

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.profile-side h2 { margin: 0 0 2px; font-size: 19px; }
.profile-side .role { color: var(--text-muted); font-size: 14px; margin-bottom: 14px; }
.profile-side .change-photo { color: var(--accent); font-weight: 700; font-size: 13.5px; margin-bottom: 22px; display: block; }

.profile-menu { text-align: left; }

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.profile-menu-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}

.profile-form { padding: 26px 28px; }
.profile-form h3 { margin: 0 0 22px; font-size: 18px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field.full { grid-column: 1 / -1; }

.form-field label { font-size: 13px; font-weight: 700; color: var(--text); }

.form-field input,
.form-field textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  background: var(--bg);
}

.form-field input:focus,
.form-field textarea:focus { border-color: var(--accent); background: #fff; }

.form-field textarea { resize: vertical; min-height: 90px; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .sidebar { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .content { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Additions: language switch, mobile drawer, demo toast ---------- */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.lang-switch button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: var(--shadow); }

.nav-toggle { display: none; }

.segmented button:hover:not(.active) { color: var(--text); }
.btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible, .segmented button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.is-filtered-out { display: none !important; }

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

.demo-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.25);
  transition: opacity .25s ease, transform .25s ease;
}
.demo-toast.show { opacity: 1; transform: translate(-50%, 0); }

.sidebar-backdrop { display: none; }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform .3s ease;
    box-shadow: 0 0 40px rgba(17, 24, 39, 0.18);
    overflow-y: auto;
  }
  .nav-open .sidebar { transform: none; }
  .nav-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(17, 24, 39, 0.35);
  }
  .topbar { padding: 14px 16px; gap: 10px; }
  .search { min-width: 0; }
  .page-title { font-size: 25px; }
  .panel-header { flex-wrap: wrap; gap: 12px; }
}

.check-list { display: grid; gap: 12px; margin-bottom: 18px; }
.check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.check-row input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.check-row b { display: block; font-size: 14.5px; }
.check-row small { display: block; color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.profile-menu-item svg { flex-shrink: 0; }

@media (max-width: 720px) {
  .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented button { white-space: nowrap; flex-shrink: 0; }
}

/* =========================================================
   Live panel (assets/js/panel-app.js)
   ========================================================= */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: #111827; color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.skip-link:focus { top: 12px; }
.ic { width: 18px; height: 18px; flex-shrink: 0; }
.text-red { color: var(--red); font-weight: 600; }

.brand { padding: 4px 12px 26px; }
.brand-logo--lg { height: 28px; margin: 0 auto; }
.nav-item { width: 100%; }
.sidebar-footer__text { min-width: 0; flex: 1; }
.sidebar-footer .name, .sidebar-footer .email { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn--ghost { border: 0; background: transparent; width: 34px; height: 34px; color: var(--text-muted); }
.icon-btn--ghost:hover { background: #ececf0; color: var(--red); }

.topbar .search { cursor: text; }
.topbar .search input::-webkit-search-cancel-button { cursor: pointer; }
.btn-sm { padding: 9px 14px; font-size: 13.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.65; cursor: progress; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost:hover { background: var(--bg); }
.btn .ic { width: 17px; height: 17px; }

.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.panel-header--row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-body--chart { padding: 22px 22px 18px; }
.stack-col { display: grid; gap: 20px; align-content: start; }
.stat-note { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.stat-icon .ic { width: 20px; height: 20px; }
.stat-icon.green-outline .ic, .stat-icon.blue-outline .ic { stroke-width: 2; }

.row-item--btn { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); font: inherit; color: inherit; cursor: pointer; border-radius: 0; }
.row-item--btn:hover .row-title { color: var(--accent); }
.row-sub .badge { margin-left: 4px; vertical-align: 1px; }
.payment-side { text-align: right; }
.payment-icon--red { background: var(--red-bg); color: var(--red); }
.link-action { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--accent); font-weight: 700; font-size: 13.5px; }
.link-action:hover { text-decoration: underline; }
.link-plain { color: var(--text); }
.link-plain:hover { color: var(--accent); }
.progress-fill--green { background: var(--green); }
.progress-fill--blue { background: var(--accent); }
.progress-fill--orange { background: var(--orange); }
.progress-fill--red { background: var(--red); }
.progress-fill--gray { background: #9ca3af; }
.badge-gray { background: #f1f2f4; color: #6b7280; }

.cell-person { display: inline-flex; align-items: center; gap: 12px; }
.cell-person > span:last-child { display: grid; }
.avatar--sm { width: 34px; height: 34px; font-size: 12px; }
.table-actions button .ic { width: 15px; height: 15px; }
.icon-square .ic { width: 16px; height: 16px; }
.icon-square:hover { color: var(--accent); border-color: var(--accent); }
.icon-square--danger:hover { color: var(--red); border-color: var(--red); }
.meta-note { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); margin-top: -4px; }
.meta-note .ic { width: 14px; height: 14px; }
.meta-row--3 { grid-template-columns: repeat(3, 1fr); }
[data-item][hidden] { display: none !important; }

/* Loading & empty */
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 50vh; color: var(--text-muted); font-weight: 600; }
.spinner { display: inline-block; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; margin-right: 6px; vertical-align: -2px; }
.spinner--lg { width: 26px; height: 26px; border-width: 3px; color: var(--accent); margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 36px 20px; text-align: center; }
.empty-state__icon { width: 34px; height: 34px; color: var(--accent); background: var(--accent-light); padding: 10px; border-radius: 14px; box-sizing: content-box; margin-bottom: 4px; }
.empty-state h3 { margin: 0; font-size: 16px; }
.empty-state p { margin: 0 0 6px; color: var(--text-muted); font-size: 14px; max-width: 420px; }
.locked .empty-state { padding: 56px 20px; }

/* Bar chart */
.bar-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; height: 240px; align-items: end; }
.bar-chart__col { display: grid; grid-template-rows: auto 1fr auto; height: 100%; gap: 6px; text-align: center; min-width: 0; }
.bar-chart__value { font-size: 11px; font-weight: 700; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-chart__bar { display: flex; align-items: flex-end; background: #f4f5f8; border-radius: 8px; overflow: hidden; }
.bar-chart__bar i { display: block; width: 100%; background: linear-gradient(180deg, #3b82ff, var(--accent)); border-radius: 8px 8px 0 0; transition: height .6s cubic-bezier(.22,1,.36,1); }
.bar-chart__label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* Plan card */
.plan-card .panel-body { display: grid; gap: 4px; padding-bottom: 20px; }
.plan-card .btn { margin-top: 10px; }
.plan-summary { border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 14px; background: var(--bg); }
.plan-summary__name { font-size: 20px; font-weight: 800; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.plan-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-facts li { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-muted); }
.plan-facts b { color: var(--text); }

/* Forms */
.form-error { margin: 4px 0 0; padding: 11px 14px; border-radius: 10px; background: var(--red-bg); color: var(--red); font-size: 13.5px; font-weight: 600; }
.form-error[hidden] { display: none; }
.field-help { display: block; font-size: 12.5px; color: var(--text-muted); margin: 2px 0 0; }
.form-field select { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 14px; font-family: inherit; color: var(--text); background: var(--bg); outline: none; }
.form-field select:focus { border-color: var(--accent); background: #fff; }
.form-field input[readonly] { color: var(--text-muted); cursor: not-allowed; }
.check-inline { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 600 !important; cursor: pointer; }
.check-inline input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-actions--start { justify-content: flex-start; }
.form-grid--tight { gap: 12px; margin-bottom: 0; }
.profile-menu-item { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.profile-menu-item:hover:not(.active) { background: var(--bg); }
.profile-side .badge { margin-bottom: 18px; }

/* Modal */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.45); backdrop-filter: blur(2px); }
.modal__dialog { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(17,24,39,.3); animation: pop .22s cubic-bezier(.22,1,.36,1); }
.modal__dialog--wide { max-width: 820px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); background: #fff; }
.modal__head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.modal__body { padding: 22px; }
.modal__text { margin: 0; color: var(--text-muted); line-height: 1.6; }
.modal .form-actions { margin-top: 18px; }
body.modal-open { overflow: hidden; }
.detail-head { display: grid; gap: 8px; margin-bottom: 10px; }
.detail-head .badge { justify-self: start; }
.detail-desc { color: var(--text-muted); margin: 0 0 6px; line-height: 1.6; }
.detail-title { font-size: 15px; margin: 24px 0 8px; }
.notice-box { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.pay-list { list-style: none; margin: 0; padding: 0; }
.pay-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
.pay-list b { color: var(--text); }

/* Toast tones */
.demo-toast.toast--success { background: #065f46; }
.demo-toast.toast--error { background: #991b1b; }

/* Auth pages */
.auth-body { background: radial-gradient(900px 500px at 50% -10%, rgba(11, 97, 255, 0.12), transparent 70%), var(--bg); }
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 18px; }
.login-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 20px 60px rgba(17,24,39,.08); padding: 36px 34px; }
.login-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.login-lang { display: flex; justify-content: center; margin-bottom: 22px; }
.login-title { font-size: 23px; font-weight: 800; text-align: center; margin: 0 0 6px; letter-spacing: -0.02em; }
.login-subtitle { text-align: center; color: var(--text-muted); font-size: 14px; margin: 0 0 24px; line-height: 1.5; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .form-grid { margin: 0; }
.input-wrap { position: relative; }
.input-wrap input { width: 100%; }
.toggle-pass { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; color: var(--text-faint); display: flex; padding: 4px; }
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.remember { display: flex; align-items: center; gap: 8px; color: var(--text-muted); cursor: pointer; }
.remember input { accent-color: var(--accent); width: 16px; height: 16px; }
.remember--block { align-items: flex-start; font-size: 13px; line-height: 1.5; }
.remember--block a { color: var(--accent); font-weight: 600; }
.forgot { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--accent); font-weight: 600; }
.btn-login { width: 100%; justify-content: center; padding: 13px 18px; font-size: 15px; }
.login-footer { text-align: center; margin: 22px 0 0; font-size: 13.5px; color: var(--text-muted); }
.login-footer a { color: var(--accent); font-weight: 700; }
.login-notice { background: var(--accent-light); color: var(--accent-dark); border-radius: 10px; padding: 11px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 18px; text-align: center; }
.login-back { margin: 0; font-size: 13.5px; }
.login-back a { color: var(--text-muted); font-weight: 600; }
.login-back a:hover { color: var(--accent); }

@media (max-width: 1100px) { .meta-row--3 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) {
  .topbar-cta span { display: none; }
  .page-actions { width: 100%; }
  .bar-chart { height: 200px; gap: 6px; }
  .bar-chart__value { display: none; }
  .login-card { padding: 28px 22px; }
  .modal { padding: 0; align-items: end; }
  .modal__dialog { max-height: 92vh; border-radius: 18px 18px 0 0; }
}
td > .cell-title, td > .cell-sub { display: block; }

/* Notifications — slide in from the left */
.notify-stack {
  position: fixed; left: 24px; bottom: 24px; z-index: 120;
  display: flex; flex-direction: column; gap: 12px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.notify {
  --tone: var(--accent);
  --tone-bg: var(--accent-light);
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start;
  padding: 16px 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(17, 24, 39, 0.06);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 18px 48px -12px rgba(17, 24, 39, 0.28);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(calc(-100% - 40px)) scale(0.98);
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .35s ease;
}
.notify::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone); }
.notify.is-in { opacity: 1; transform: none; }
.notify.is-out { opacity: 0; transform: translateX(-40px) scale(0.98); transition-duration: .35s; }
.notify--error { --tone: var(--red); --tone-bg: var(--red-bg); }
.notify--success { --tone: var(--green); --tone-bg: var(--green-bg); }
.notify__icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--tone-bg); color: var(--tone);
}
.notify__icon .ic { width: 20px; height: 20px; }
.notify__body { min-width: 0; padding-top: 1px; }
.notify__body strong { display: block; font-size: 14.5px; font-weight: 700; color: var(--text); }
.notify__body p { margin: 3px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); overflow-wrap: anywhere; }
.notify__close {
  width: 28px; height: 28px; margin: -4px -4px 0 0;
  display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-faint); cursor: pointer;
}
.notify__close:hover { background: var(--bg); color: var(--text); }
.notify__close .ic { width: 16px; height: 16px; }
.notify__timer {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--tone); opacity: 0.35;
  transform-origin: left; animation: notify-timer var(--notify-duration, 5s) linear forwards;
}
.notify.is-paused .notify__timer { animation-play-state: paused; }
@keyframes notify-timer { to { transform: scaleX(0); } }
@media (max-width: 720px) { .notify-stack { left: 16px; right: 16px; bottom: 16px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .notify { transition: opacity .2s; transform: none; } .notify__timer { animation: none; } }
