/* ============================================================
   MariaAgent — Final v4
   ============================================================ */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root, html[data-theme="dark"] {
  --bg: #0a0d18;
  --bg-2: #0f1220;
  --bg-3: #141828;
  --navy: #10141f;
  --navy-2: #181c2e;
  --navy-3: #1f2540;
  --card: #131728;
  --card-2: #1a1f36;
  --card-3: #232846;
  --card-hover: #1e2340;
  --ink: #eef1f8;
  --ink-2: #b8bfd4;
  --muted: #7f88a3;
  --brand: #c9364a;
  --brand-2: #e04b5f;
  --brand-3: #a02939;
  --accent: #3eb489;
  --accent-2: #5ec9a1;
  --warn: #e0a84e;
  --danger: #c9364a;
  --info: #4a7fd9;
  --border: rgba(80, 40, 55, 0.30);
  --border-2: rgba(201, 54, 74, 0.25);
  --border-3: rgba(201, 54, 74, 0.45);
  --ring: rgba(201,54,74,0.25);
  --glow: rgba(201,54,74,0.4);
  --glow-accent: rgba(62,180,137,0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.5);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.55);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,0.7);
  --grad-primary: linear-gradient(135deg, #c9364a, #e04b5f);
  --grad-accent: linear-gradient(135deg, #3eb489, #5ec9a1);
  --grad-blood: linear-gradient(135deg, #8b1e2e, #c9364a);
  --grad-blood-anim: linear-gradient(135deg, #8b1e2e, #c9364a, #e04b5f, #c9364a, #8b1e2e);
}

html[data-theme="light"] {
  --bg: #f5f6fa;
  --bg-2: #ffffff;
  --bg-3: #eef1f8;
  --navy: #ffffff;
  --navy-2: #f4f6fb;
  --navy-3: #e6ebf5;
  --card: #ffffff;
  --card-2: #f4f6fb;
  --card-3: #e6ebf5;
  --card-hover: #dde3f0;
  --ink: #1a1d2e;
  --ink-2: #4a5068;
  --muted: #7a8098;
  --brand: #a02939;
  --brand-2: #c9364a;
  --accent: #2d8a6a;
  --warn: #c88a2e;
  --danger: #a02939;
  --info: #3a68b8;
  --border: #e5e8f0;
  --border-2: #d0d6e5;
  --border-3: #c9364a;
  --ring: rgba(160,41,57,0.20);
  --glow: rgba(160,41,57,0.25);
  --glow-accent: rgba(45,138,106,0.25);
  --shadow-sm: 0 2px 8px rgba(26,29,46,0.06);
  --shadow-md: 0 8px 30px rgba(26,29,46,0.10);
  --shadow-lg: 0 24px 60px -20px rgba(26,29,46,0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: Vazirmatn, Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01";
  font-weight: 400;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 700px 500px at 90% 5%, rgba(201,54,74,0.10), transparent 60%),
    radial-gradient(ellipse 600px 500px at 5% 95%, rgba(62,180,137,0.05), transparent 60%),
    radial-gradient(ellipse 800px 600px at 50% 50%, rgba(12,16,32,0.4), transparent 70%);
  animation: ambientGlow 25s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ambientGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.08); opacity: 0.9; }
}

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 1280px) { .layout { grid-template-columns: 220px 1fr; } }
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: var(--navy);
  border-left: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  animation: sidebarIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sidebarIn {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-logo {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-weight: 700; font-size: 17px; color: #fff;
  box-shadow: 0 6px 18px -4px var(--glow), inset 0 1px 0 rgba(255,255,255,0.18);
  flex-shrink: 0;
}
.sidebar-brand-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.sidebar-brand-text small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 1px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 16px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  background: var(--navy-2);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar-user:hover {
  background: var(--navy-3);
  border-color: var(--brand);
  transform: translateY(-2px);
}
.sidebar-avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-weight: 600;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
  position: relative;
}
.sidebar-avatar::after {
  content: "";
  position: absolute;
  bottom: -2px; left: -2px;
  width: 10px; height: 10px;
  background: var(--accent);
  border: 2px solid var(--navy-2);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 400;
}

.sidebar-nav { flex: 1; padding: 0 12px; }
.sidebar-section {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 13px 10px 7px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 400;
  margin-bottom: 2px;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  transform: translateX(-3px);
}
.nav-item.active {
  background: var(--navy-2);
  color: var(--ink);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 55%;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px var(--glow);
}
.nav-icon {
  width: 20px;
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
  opacity: 0.9;
}

/* ============================================================
   MAIN
   ============================================================ */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--navy);
  border-bottom: 1px solid var(--border);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: slideDown 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.topbar-crumb {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  flex: 1;
  min-width: 0;
}
.topbar-crumb strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

/* 3D Action Buttons */
.action-3d {
  width: 40px; height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  border: 0;
  background: linear-gradient(145deg, #1e1a30, #14122a);
  box-shadow:
    5px 5px 12px rgba(0,0,0,0.55),
    -2px -2px 6px rgba(80,50,80,0.10),
    inset 0 1px 0 rgba(255,255,255,0.06);
}
.action-3d::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(255,255,255,0.05), transparent 60%);
  pointer-events: none;
}
.action-3d:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow:
    7px 9px 20px rgba(0,0,0,0.65),
    -2px -2px 8px rgba(80,50,80,0.15),
    inset 0 1px 0 rgba(255,255,255,0.10);
}
.action-3d:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow:
    inset 3px 3px 8px rgba(0,0,0,0.55),
    inset -2px -2px 6px rgba(80,50,80,0.10);
}
.action-3d svg {
  width: 19px;
  height: 19px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6));
}
.action-3d.profile svg {
  color: #e0a8b8;
  filter: drop-shadow(0 0 8px rgba(224,168,184,0.55)) drop-shadow(0 2px 3px rgba(0,0,0,0.6));
}
.action-3d.logout svg {
  color: #ff6b7d;
  filter: drop-shadow(0 0 8px rgba(255,107,125,0.6)) drop-shadow(0 2px 3px rgba(0,0,0,0.6));
}
.action-3d.profile::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 17px;
  background: radial-gradient(circle, rgba(201,54,74,0.5), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}
.action-3d.logout::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 17px;
  background: radial-gradient(circle, rgba(224,75,95,0.55), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}
.action-3d:hover::before { opacity: 1; }

/* ============================================================
   CONTENT
   ============================================================ */
.content {
  padding: 24px 26px;
  flex: 1;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-title {
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 10px;
  letter-spacing: -0.3px;
}
.page-title small {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
}

/* ============================================================
   STAT CARDS ROW
   ============================================================ */
.mini-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) {
  .mini-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .mini-stat-row { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  min-height: 105px;
}
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }
@keyframes cardIn {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,54,74,0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.stat-card:hover {
  border-color: var(--border-2);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,0.6);
}
.stat-card:hover::before { opacity: 1; }

.stat-body { flex: 1; min-width: 0; }
.stat-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}

/* Value row — all on one line, aligned baseline */
.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
  min-width: 0;
}
.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -1.2px;
  line-height: 1;
}
.stat-value.small {
  font-size: 17px;
  letter-spacing: -0.3px;
  font-weight: 500;
}
.stat-value.medium {
  font-size: 22px;
  letter-spacing: -0.6px;
  font-weight: 600;
}

/* Big / XX next to value */
.stat-of {
  font-size: 22px;
  font-weight: 600;
  color: var(--brand-2);
  letter-spacing: -0.6px;
  line-height: 1;
}

/* Legacy */
.stat-delta {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-2);
  background: rgba(62,180,137,0.12);
  padding: 4px 10px;
  border-radius: 7px;
  letter-spacing: -0.2px;
}
.stat-delta.down {
  color: #ff8b8b;
  background: rgba(201,54,74,0.14);
}
.stat-delta.blood {
  color: #ff8b98;
  background: rgba(201,54,74,0.15);
  border: 1px solid rgba(201,54,74,0.30);
}

.stat-icon-box {
  width: 50px; height: 50px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 8px 20px -6px var(--glow), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.stat-icon-box::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255,255,255,0.22), transparent 60%);
  pointer-events: none;
}
.stat-card:hover .stat-icon-box {
  transform: scale(1.08) rotate(-6deg);
}
.stat-icon-box.green {
  background: var(--grad-accent);
  box-shadow: 0 8px 20px -6px var(--glow-accent), inset 0 1px 0 rgba(255,255,255,0.18);
}
.stat-icon-box.red {
  background: var(--grad-blood);
  box-shadow: 0 8px 20px -6px var(--glow), inset 0 1px 0 rgba(255,255,255,0.18);
}
.stat-icon-box.purple {
  background: linear-gradient(135deg, #6a4a8b, #4a3068);
  box-shadow: 0 8px 20px -6px rgba(106,74,139,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
}
.stat-icon-box.orange {
  background: linear-gradient(135deg, #e0a84e, #c88a2e);
  box-shadow: 0 8px 20px -6px rgba(224,168,78,0.4), inset 0 1px 0 rgba(255,255,255,0.18);
}

/* ============================================================
   PANELS / GRID
   ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.panel-title {
  margin: 0 0 14px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel-title small {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
}

/* ============================================================
   WELCOME CARD (animated blood hover)
   ============================================================ */
.welcome-card {
  background: linear-gradient(135deg, #0f1220 0%, #2a1020 55%, #4a1020 100%);
  background-size: 200% 200%;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  overflow: hidden;
  color: #fff;
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  min-height: 190px;
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: default;
}
.welcome-card:hover {
  background: linear-gradient(135deg, #0f1220 0%, #3a0f24 40%, #6a1030 70%, #c9364a 100%);
  background-size: 300% 300%;
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1),
             bloodFlow 4s ease-in-out infinite;
  border-color: var(--border-3);
  box-shadow: 0 24px 60px -20px rgba(201,54,74,0.5);
}
@keyframes bloodFlow {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.welcome-card::before {
  content: "";
  position: absolute;
  top: -50%; right: -20%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(201,54,74,0.35), transparent 60%);
  filter: blur(40px);
  animation: rotateGlow 25s linear infinite;
  transition: opacity 0.5s;
  opacity: 0.6;
}
.welcome-card:hover::before {
  opacity: 1;
}
@keyframes rotateGlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.welcome-card::after {
  content: "";
  position: absolute;
  bottom: -30px; right: 20px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(62,180,137,0.18), transparent 60%);
  filter: blur(30px);
  animation: bounceGlow 9s ease-in-out infinite;
}
@keyframes bounceGlow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-22px); }
}
.welcome-content { position: relative; z-index: 1; }
.welcome-label {
  font-size: 12.5px;
  opacity: 0.85;
  font-weight: 400;
  margin-bottom: 8px;
}
.welcome-name {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.4px;
}
.welcome-text {
  font-size: 13.5px;
  opacity: 0.9;
  line-height: 1.75;
  max-width: 70%;
  font-weight: 400;
}

/* ============================================================
   PROGRESS CARD
   ============================================================ */
.progress-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-title {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 10px;
}
.progress-big {
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -1.4px;
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}
.progress-big .pct {
  font-size: 15px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
}
.progress-big .max {
  font-size: 24px;
  color: var(--brand-2);
  font-weight: 600;
  letter-spacing: -0.8px;
}
.progress-sub {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 400;
  margin-bottom: 16px;
  opacity: 0.9;
}
.progress-bar {
  height: 8px;
  background: var(--navy-3);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px var(--glow);
}
.progress-fill.green {
  background: var(--grad-accent);
  box-shadow: 0 0 12px var(--glow-accent);
}
.progress-fill.warn {
  background: linear-gradient(90deg, #e0a84e, #c88a2e);
  box-shadow: 0 0 12px rgba(224,168,78,0.45);
}
.progress-fill.danger {
  background: var(--grad-blood);
  box-shadow: 0 0 12px var(--glow);
}

/* ============================================================
   LISTS
   ============================================================ */
.project-list { display: grid; gap: 5px; }
.project-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
}
.project-item:hover {
  background: var(--navy-2);
  border-color: var(--border-2);
  transform: translateX(-3px);
}
.project-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 16px;
  flex-shrink: 0;
  color: #fff;
  font-weight: 600;
  transition: all 0.3s;
  position: relative;
}
.project-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255,255,255,0.18), transparent 60%);
  pointer-events: none;
}
.project-icon.bg-blue { background: linear-gradient(135deg, #4a7fd9, #3a68b8); }
.project-icon.bg-green { background: linear-gradient(135deg, #3eb489, #2d8a6a); }
.project-icon.bg-purple { background: linear-gradient(135deg, #8b6ac0, #6a4a9e); }
.project-icon.bg-red { background: var(--grad-blood); }
.project-icon.bg-orange { background: linear-gradient(135deg, #e0a84e, #c88a2e); }
.project-item:hover .project-icon {
  transform: scale(1.08) rotate(-6deg);
}
.project-body { flex: 1; min-width: 0; }
.project-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
.project-desc {
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 400;
  opacity: 0.9;
}
.project-meta {
  text-align: left;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.tx-list { display: grid; gap: 5px; }
.tx-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.22s;
}
.tx-item:hover {
  background: var(--navy-2);
  transform: translateX(-3px);
}
.tx-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--navy-3);
  border: 1px solid var(--border);
}
.tx-body { flex: 1; min-width: 0; }
.tx-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
.tx-sub {
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 400;
  opacity: 0.85;
}
.tx-amount {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  direction: ltr;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary,
.btn-secondary,
button.primary,
button.secondary,
a.btn-primary,
a.btn-secondary,
a.primary,
a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.btn-primary,
button.primary,
a.btn-primary,
a.primary {
  background: var(--grad-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 22px -8px var(--glow);
}
.btn-primary::before,
button.primary::before,
a.btn-primary::before,
a.primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.30) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.7s;
}
.btn-primary:hover,
button.primary:hover,
a.btn-primary:hover,
a.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -10px var(--glow);
}
.btn-primary:hover::before,
button.primary:hover::before,
a.btn-primary:hover::before,
a.primary:hover::before {
  transform: translateX(100%);
}
.btn-primary.small,
button.primary.small { padding: 7px 13px; font-size: 11.5px; }

.btn-secondary,
button.secondary,
a.btn-secondary,
a.secondary {
  background: var(--navy-2);
  color: var(--ink);
  border-color: var(--border);
}
.btn-secondary:hover,
button.secondary:hover,
a.btn-secondary:hover,
a.secondary:hover {
  background: var(--navy-3);
  border-color: var(--brand);
  color: var(--brand-2);
  transform: translateY(-2px);
}

/* ============================================================
   TABLE
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
.data-table thead th {
  padding: 12px 14px;
  text-align: right;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--navy-2);
  border-bottom: 1px solid var(--border);
}
.data-table thead th:first-child { border-top-right-radius: var(--radius-sm); }
.data-table thead th:last-child { border-top-left-radius: var(--radius-sm); }
.data-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
  font-weight: 400;
}
.data-table tbody tr:hover td { background: var(--navy-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table code {
  background: var(--navy-2);
  padding: 3px 9px;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  direction: ltr;
  display: inline-block;
  color: var(--brand-2);
  font-weight: 500;
  border: 1px solid var(--border);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  background: var(--navy-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-green {
  background: rgba(62,180,137,0.12);
  color: var(--accent-2);
  border-color: rgba(62,180,137,0.3);
}
.badge-red {
  background: rgba(201,54,74,0.14);
  color: #ff8b98;
  border-color: rgba(201,54,74,0.35);
}
.badge-admin {
  background: var(--grad-primary);
  color: #fff;
  border-color: transparent;
}
.badge-admin::before { display: none; }
.badge-warn {
  background: rgba(224,168,78,0.15);
  color: var(--warn);
  border-color: rgba(224,168,78,0.3);
}

/* ============================================================
   FORMS
   ============================================================ */
.stack-form { display: grid; gap: 14px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-row-2 { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.field .req { color: var(--brand-2); }
.field input,
.field select,
.field textarea {
  padding: 11px 14px;
  background: var(--navy-2);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  transition: all 0.22s;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 0.7; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f88a3' stroke-width='2.5' stroke-linecap='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 36px;
  cursor: pointer;
}
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* ============================================================
   STAT ROWS
   ============================================================ */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 400;
}
.stat-row:last-child { border-bottom: 0; }
.stat-row span { color: var(--ink-2); font-weight: 400; opacity: 0.9; }
.stat-row strong { color: var(--ink); font-weight: 600; direction: ltr; }

/* ============================================================
   PROFILE
   ============================================================ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 780px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: var(--radius-lg);
  background: var(--grad-primary);
  display: grid; place-items: center;
  font-size: 32px;
  font-weight: 600;
  color: #fff;
  margin: 0 auto 16px;
  box-shadow: 0 12px 30px -8px var(--glow);
}
.profile-name { font-size: 17px; font-weight: 600; text-align: center; margin: 0 0 4px; }
.profile-username {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-2);
  margin: 0 0 20px;
  font-weight: 400;
  opacity: 0.9;
}

/* ============================================================
   PENDING / EMPTY
   ============================================================ */
.pending-icon {
  font-size: 72px;
  text-align: center;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(3deg); }
}
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty-state .icon {
  font-size: 56px;
  margin-bottom: 14px;
  opacity: 0.4;
}
.empty-state .text { font-size: 13px; font-weight: 500; }

/* ============================================================
   LOGIN — centered
   ============================================================ */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(201,54,74,0.18), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(62,180,137,0.08), transparent 55%);
  animation: ambientGlow 18s ease-in-out infinite;
  pointer-events: none;
}
.login-card {
  max-width: 440px;
  width: 100%;
  padding: 42px 38px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  position: relative;
  overflow: hidden;
  animation: loginPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
}
@keyframes loginPop {
  0%   { transform: scale(0.92) translateY(30px); opacity: 0; }
  100% { transform: scale(1)   translateY(0);    opacity: 1; }
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-primary);
  box-shadow: 0 0 20px var(--glow);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand-logo {
  width: 70px; height: 70px;
  border-radius: var(--radius-lg);
  background: var(--grad-primary);
  display: inline-grid; place-items: center;
  font-size: 30px; font-weight: 700; color: #fff;
  box-shadow: 0 14px 32px -8px var(--glow), inset 0 2px 0 rgba(255,255,255,0.18);
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}
.login-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}
.login-sub {
  color: var(--ink-2);
  font-size: 12.5px;
  margin: 0;
  font-weight: 400;
  opacity: 0.85;
}
.login-form { display: grid; gap: 14px; }
.login-form .field { display: grid; gap: 6px; }
.login-form label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.login-form input {
  padding: 12px 14px;
  background: var(--navy-2);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
  transition: all 0.22s;
}
.login-form input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}
.login-form button[type=submit] {
  margin-top: 4px;
  padding: 13px 22px;
  background: var(--grad-primary);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 30px -8px var(--glow);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.login-form button[type=submit]:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px -10px var(--glow);
}
.login-hint {
  margin-top: 22px;
  font-size: 12.5px;
  text-align: center;
  color: var(--ink-2);
  font-weight: 400;
  opacity: 0.9;
}
.login-hint a {
  color: var(--brand-2);
  font-weight: 600;
  text-decoration: none;
}
.login-hint a:hover { text-decoration: underline; }

/* FLASH */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  font-weight: 400;
  border: 1px solid;
  display: flex; align-items: center; gap: 10px;
}
.flash-error {
  background: rgba(201,54,74,0.12);
  border-color: rgba(201,54,74,0.4);
  color: #ffa8b3;
}
.flash-success {
  background: rgba(62,180,137,0.10);
  border-color: rgba(62,180,137,0.35);
  color: var(--accent-2);
}

/* LIMIT BANNER */
.limit-banner {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: rgba(201,54,74,0.12);
  border: 1px solid rgba(201,54,74,0.45);
  color: #ffa8b3;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.limit-banner .icon { font-size: 24px; }
.limit-banner .text { flex: 1; }
.limit-banner .text .title { font-size: 14px; font-weight: 600; margin-bottom: 3px; color: #ffc5cd; }
.limit-banner .text .sub { font-size: 12px; opacity: 0.95; font-weight: 400; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(24px) scale(0.95);
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--brand);
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999;
  box-shadow: 0 20px 40px -12px rgba(0,0,0,0.7), 0 0 24px -4px var(--glow);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--navy-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

@media (max-width: 640px) {
  .content { padding: 16px; }
  .topbar { padding: 11px 14px; }
}


/* ===== nav badge ===== */
.nav-badge {
  margin-inline-start: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 0 12px rgba(201,54,74,0.5);
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(201,54,74,0.5); }
  50%      { transform: scale(1.08); box-shadow: 0 0 18px rgba(201,54,74,0.7); }
}

/* ===== bigger, more readable secondary text ===== */
.stat-label {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--ink-2) !important;
  opacity: 1 !important;
  margin-bottom: 10px;
}
.stat-value.small { font-size: 18px; }
.stat-of { font-size: 24px; }

.progress-title {
  font-size: 13.5px !important;
  color: var(--ink-2) !important;
  opacity: 1 !important;
  font-weight: 500 !important;
}
.progress-sub {
  font-size: 13px !important;
  color: var(--ink-2) !important;
  opacity: 1 !important;
  line-height: 1.9;
}
.progress-big .pct {
  font-size: 17px !important;
  color: var(--ink-2) !important;
  opacity: 1 !important;
}
.progress-big .max {
  font-size: 26px !important;
}

.welcome-label {
  font-size: 13.5px !important;
  opacity: 1 !important;
  color: rgba(255,255,255,0.92) !important;
  font-weight: 500 !important;
}
.welcome-text {
  font-size: 14.5px !important;
  opacity: 1 !important;
  color: rgba(255,255,255,0.95) !important;
  line-height: 1.85;
}

.project-title { font-size: 13.5px !important; font-weight: 600; }
.project-desc {
  font-size: 12.5px !important;
  color: var(--ink-2) !important;
  opacity: 1 !important;
  font-weight: 400;
}
.project-meta { font-size: 12px !important; }

.tx-title { font-size: 13.5px !important; font-weight: 600; }
.tx-sub {
  font-size: 12.5px !important;
  color: var(--ink-2) !important;
  opacity: 1 !important;
}
.tx-amount { font-size: 12px !important; color: var(--ink-2) !important; opacity: 1 !important; }

.panel-title small {
  font-size: 12.5px !important;
  color: var(--ink-2) !important;
  opacity: 1 !important;
}

/* sidebar items */
.sidebar-user-name { font-size: 13.5px !important; }
.sidebar-user-role {
  font-size: 11.5px !important;
  color: var(--ink-2) !important;
  opacity: 0.85;
}
.sidebar-section { font-size: 11px !important; opacity: 0.85; }
.nav-item { font-size: 13.5px !important; }

/* topbar */
.topbar-crumb { font-size: 13.5px !important; }
.topbar-crumb strong { font-size: 16px !important; }

/* login/register secondary text */
.login-sub {
  font-size: 14px !important;
  color: var(--ink-2) !important;
  opacity: 1 !important;
  font-weight: 400;
}
.login-hint {
  font-size: 13.5px !important;
  color: var(--ink-2) !important;
  opacity: 1 !important;
}
.login-form label {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--ink-2) !important;
}
.field label {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--ink-2) !important;
}
.login-form input { font-size: 14px !important; }

/* stat-row */
.stat-row span {
  font-size: 13.5px !important;
  color: var(--ink-2) !important;
  opacity: 1 !important;
}
.stat-row strong { font-size: 14px !important; }

/* table */
.data-table { font-size: 13.5px !important; }
.data-table thead th {
  font-size: 12px !important;
  color: var(--ink-2) !important;
  opacity: 1 !important;
}
.data-table tbody td { font-size: 13.5px !important; }

/* badges */
.badge { font-size: 11.5px !important; }

/* empty state */
.empty-state .text { font-size: 14px !important; color: var(--ink-2) !important; opacity: 1 !important; }

/* pending page text */
.pending-text {
  font-size: 15px;
  line-height: 2.2;
  color: var(--ink-2);
}


/* ===== app footer ===== */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 20px 26px;
  background: var(--bg-2);
  margin-top: auto;
}
.app-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.app-footer-text {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.app-footer-text strong {
  color: var(--ink);
  font-weight: 600;
}
.app-footer-version {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  direction: ltr;
  padding: 4px 12px;
  background: var(--navy-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: ui-monospace, monospace;
}
@media (max-width: 640px) {
  .app-footer-inner { justify-content: center; text-align: center; }
}

/* soft text weight override for headings */
.card h2, .panel-title, .page-title, .welcome-name { font-weight: 600; }
.stat-value { font-weight: 600; }
.price-tag { font-weight: 600; }
