/* ============================================================
   Finance Tracker — Monday.com-inspired Clean Design System
   Aesthetic: Clean / Flat / Colorful Status / Soft Shadows
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* ─── Core Palette ─── */
  --bg: #F5F6FA;
  --bg-page: #F5F6FA;

  --surface: #FFFFFF;
  --surface-solid: #FFFFFF;
  --surface-hover: #FAFBFF;
  --surface-2: #F8F9FD;

  --sidebar-bg: #292F4C;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(108, 99, 255, 0.22);

  /* Accent */
  --accent: #6C63FF;
  --accent-hover: #7B73FF;
  --accent-soft: rgba(108, 99, 255, 0.08);
  --accent-glow: rgba(108, 99, 255, 0.18);
  --gradient-1: linear-gradient(135deg, #6C63FF 0%, #8B5CF6 100%);
  --gradient-2: linear-gradient(135deg, #6C63FF 0%, #00C9DB 100%);
  --gradient-3: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);

  /* Monday.com Status Colors */
  --green: #00C875;
  --green-bg: rgba(0, 200, 117, 0.10);
  --green-solid: #00C875;

  --red: #E2445C;
  --red-bg: rgba(226, 68, 92, 0.10);
  --red-solid: #E2445C;

  --amber: #FDAB3D;
  --amber-bg: rgba(253, 171, 61, 0.10);
  --amber-solid: #FDAB3D;

  --blue: #0073EA;
  --blue-bg: rgba(0, 115, 234, 0.10);
  --blue-solid: #0073EA;

  --purple: #A25DDC;
  --purple-bg: rgba(162, 93, 220, 0.10);
  --purple-solid: #A25DDC;

  --pink: #FF158A;
  --pink-bg: rgba(255, 21, 138, 0.10);

  --teal: #00D2D2;
  --teal-bg: rgba(0, 210, 210, 0.10);

  /* Neutrals */
  --text: #323338;
  --text-2: #676879;
  --text-3: #C5C7D0;
  --text-inv: #FFFFFF;
  --border: #E6E9EF;
  --border-strong: #D0D4E4;

  /* Dimensions */
  --sidebar-w: 250px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.05);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.2s;
  --dur-slow: 0.3s;
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.85rem;
  font-weight: 700;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.05rem;
}

h4 {
  font-size: 0.92rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}


/* ═══════════════════════════════════════════════════════
   LOGIN PAGE — Dark Minimal Style
   ═══════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #181828;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(59, 91, 219, 0.12) 0%, transparent 60%);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  margin: 1rem;
  text-align: center;
}

/* Logo Block */
.login-logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2.25rem;
}

.login-company-logo {
  max-width: 360px;
  height: auto;
  object-fit: contain;
}

.login-app-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Title & Sub */
.login-title {
  font-size: 1.65rem;
  margin-bottom: 0.35rem;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-sub {
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.88rem;
  margin-bottom: 2rem;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
}

/* Input with Icon */
.login-input-wrap {
  position: relative;
}

.login-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.login-input-wrap input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem calc(3.25rem + 10px);
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  color: #ffffff;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  outline: none;
}

.login-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.25);
  font-weight: 400;
}

.login-input-wrap input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.login-input-wrap input:focus ~ .login-input-icon,
.login-input-wrap input:focus + .login-input-icon {
  color: var(--accent);
}

/* Login Button */
.btn-login {
  width: 100%;
  padding: 0.85rem 1.5rem;
  margin-top: 0.5rem;
  background: #3B5BDB;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.btn-login:hover {
  background: #4263EB;
  box-shadow: 0 6px 20px rgba(59, 91, 219, 0.35);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: scale(0.98);
}

/* Error alert in login */
.login-form .alert-error {
  background: rgba(226, 68, 92, 0.12);
  color: #ff6b7a;
  border: 1px solid rgba(226, 68, 92, 0.2);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
}


/* ═══════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════ */
.app {
  display: flex;
  min-height: 100vh;
}


/* ═══════════════════════════════════════════════════════
   SIDEBAR — Monday.com style dark sidebar
   ═══════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: none;
  border-right: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-company-logo {
  max-width: 160px;
  height: auto;
  object-fit: contain;
}

.sidebar-app-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.22);
  padding: 1rem 0.75rem 0.4rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: rgba(255, 255, 255, 0.92);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: white;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.65;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  opacity: 1;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-1);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Poppins', sans-serif;
}

.user-name {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.825rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 0.375rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  transition: all var(--dur);
  flex-shrink: 0;
}

.logout-btn:hover {
  color: var(--red);
  background: rgba(226, 68, 92, 0.1);
}

.logout-btn svg {
  width: 16px;
  height: 16px;
}


/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  background: var(--bg);
}

.page-container {
  padding: 2.25rem;
  max-width: 1100px;
  animation: pageReveal 0.35s var(--ease);
}

@keyframes pageReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ═══════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.page-header-left {
  flex: 1;
}

.page-title {
  font-size: 1.65rem;
  margin-bottom: 0.3rem;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.page-subtitle {
  color: var(--text-3);
  font-size: 0.875rem;
}


/* ═══════════════════════════════════════════════════════
   CARDS — Clean flat with subtle shadow
   ═══════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-body {
  padding: 1.5rem;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
}


/* ═══════════════════════════════════════════════════════
   STAT CARDS — Monday.com colored top border
   ═══════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-slow) var(--ease), box-shadow var(--dur-slow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card:nth-child(1)::before {
  background: var(--green);
}

.stat-card:nth-child(2)::before {
  background: var(--blue);
}

.stat-card:nth-child(3)::before {
  background: var(--purple);
}

.stat-card:nth-child(4)::before {
  background: var(--amber);
}

.stat-card:nth-child(5)::before {
  background: var(--red);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.625rem;
}

.stat-value {
  font-family: 'Poppins', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-bg-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.5rem;
  opacity: 0.06;
  pointer-events: none;
}


/* ═══════════════════════════════════════════════════════
   TABLES — Monday.com board style
   ═══════════════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: var(--surface-2);
  padding: 0.75rem 1.125rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--dur);
}

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

tbody tr:hover {
  background: var(--surface-hover);
}

tbody td {
  padding: 0.85rem 1.125rem;
  vertical-align: middle;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}


/* ═══════════════════════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════════════════════ */
.search-bar {
  position: relative;
}

.search-bar svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}

.search-bar input {
  padding-left: 2.5rem;
}


/* ═══════════════════════════════════════════════════════
   BUTTONS — Monday.com style
   ═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.125rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-secondary:hover {
  background: rgba(108, 99, 255, 0.15);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
}

.btn-danger:hover {
  background: rgba(226, 68, 92, 0.18);
}

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

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  border-radius: var(--radius-xs);
}

.btn-icon {
  padding: 0.4rem;
  border-radius: var(--radius-xs);
}

.btn-icon svg {
  width: 14px;
  height: 14px;
}

.btn-full {
  width: 100%;
}

.btn svg {
  width: 15px;
  height: 15px;
}


/* ═══════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
}

input[type="text"]:not(.login-form input),
input[type="email"]:not(.login-form input),
input[type="number"]:not(.login-form input),
input[type="date"]:not(.login-form input),
input[type="password"]:not(.login-form input),
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.9rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--dur), box-shadow var(--dur);
  outline: none;
}

input:focus:not(.login-form input:focus),
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: white;
}

input::placeholder:not(.login-form input::placeholder),
textarea::placeholder {
  color: var(--text-3);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23C5C7D0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.625rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}


/* ═══════════════════════════════════════════════════════
   BADGES / STATUS — Monday.com colored pills
   ═══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge-green {
  background: var(--green);
  color: white;
}

.badge-red {
  background: var(--red);
  color: white;
}

.badge-amber {
  background: var(--amber);
  color: white;
}

.badge-blue {
  background: var(--blue);
  color: white;
}

.badge-gray {
  background: var(--text-3);
  color: white;
}

.badge-purple {
  background: var(--purple);
  color: white;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}


/* ═══════════════════════════════════════════════════════
   PROGRESS BAR — Colored fill
   ═══════════════════════════════════════════════════════ */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--green);
  transition: width 0.6s var(--ease);
}

.progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  min-width: 2.5rem;
  text-align: right;
  font-family: 'DM Mono', monospace;
}


/* ═══════════════════════════════════════════════════════
   MODAL — Clean flat overlay
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(41, 47, 76, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: overlayIn 0.2s var(--ease);
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--surface-solid);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s var(--ease);
  border: 1px solid var(--border);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 0.375rem;
  border-radius: var(--radius-xs);
  display: flex;
  transition: all var(--dur);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-close:hover {
  color: var(--text);
  background: var(--surface-2);
}

.modal-body {
  padding: 1.5rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}


/* ═══════════════════════════════════════════════════════
   TOAST — Flat clean
   ═══════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--surface-solid);
  color: var(--text);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 250px;
  animation: toastSlide 0.25s var(--ease);
  border-left: 4px solid var(--accent);
}

.toast.toast-success {
  border-left-color: var(--green);
}

.toast.toast-error {
  border-left-color: var(--red);
}

.toast.toast-warning {
  border-left-color: var(--amber);
}

@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateX(2rem);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}


/* ═══════════════════════════════════════════════════════
   PAGE LOADER
   ═══════════════════════════════════════════════════════ */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 246, 250, 0.7);
  backdrop-filter: blur(2px);
}

.loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* ═══════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2rem;
  text-align: center;
  gap: 0.75rem;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-3);
  opacity: 0.4;
}

.empty-state h3 {
  color: var(--text-2);
  font-size: 1rem;
}

.empty-state p {
  color: var(--text-3);
  font-size: 0.875rem;
}


/* ═══════════════════════════════════════════════════════
   ALERT
   ═══════════════════════════════════════════════════════ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.alert-error {
  background: var(--red-bg);
  color: var(--red);
}

.alert-success {
  background: var(--green-bg);
  color: #047857;
}

.alert-info {
  background: var(--accent-soft);
  color: var(--accent);
}


/* ═══════════════════════════════════════════════════════
   TOOLBAR
   ═══════════════════════════════════════════════════════ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}


/* ═══════════════════════════════════════════════════════
   PROJECT SELECTOR
   ═══════════════════════════════════════════════════════ */
.section-selector {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.9rem;
  padding-right: 2.25rem;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  min-width: 220px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23C5C7D0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.section-selector:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}


/* ═══════════════════════════════════════════════════════
   MONEY FORMATTING
   ═══════════════════════════════════════════════════════ */
.amount {
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.amount-lg {
  font-family: 'DM Mono', monospace;
  font-size: 1.5rem;
  font-weight: 500;
}


/* ═══════════════════════════════════════════════════════
   GROUP HEADER (project groups) — Monday.com colored band
   ═══════════════════════════════════════════════════════ */
.group-header {
  background: var(--sidebar-bg);
  color: white;
  padding: 0.7rem 1.125rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-header .btn-icon {
  color: rgba(255, 255, 255, 0.6);
}

.group-header .btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}


/* ═══════════════════════════════════════════════════════
   VENDOR SECTION (payables)
   ═══════════════════════════════════════════════════════ */
.vendor-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--surface);
}

.vendor-header {
  background: var(--surface-2);
  padding: 0.8rem 1.125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.vendor-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  font-family: 'Poppins', sans-serif;
}


/* ═══════════════════════════════════════════════════════
   INFO CHIPS
   ═══════════════════════════════════════════════════════ */
.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}


/* ═══════════════════════════════════════════════════════
   TOP CLIENT RANKING
   ═══════════════════════════════════════════════════════ */
.client-rank-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.client-rank-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.rank-num {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-3);
  width: 2rem;
  text-align: center;
  flex-shrink: 0;
}

.rank-num.rank-1 {
  color: var(--accent);
}

.client-rank-info {
  flex: 1;
  min-width: 0;
}

.client-rank-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-rank-sub {
  font-size: 0.78rem;
  color: var(--text-3);
}

.client-rank-amount {
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(197, 199, 208, 0.35);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(197, 199, 208, 0.6);
}


/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════
   MOBILE — Hamburger Menu + Slide-in Sidebar
   ═══════════════════════════════════════════════════════ */

/* Hamburger button — hidden on desktop */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--sidebar-bg);
  color: white;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s var(--ease);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

.mobile-menu-btn:active {
  transform: scale(0.92);
}

/* Overlay behind sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(41, 47, 76, 0.45);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.sidebar-overlay.active {
  opacity: 1;
}

/* Close button inside sidebar — hidden on desktop */
.sidebar-close-wrap {
  display: none;
  padding: 0 1rem 0.5rem;
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0.375rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  transition: all var(--dur);
}

.sidebar-close-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-close-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }

  .sidebar-overlay.active {
    pointer-events: auto;
  }

  .sidebar-close-wrap {
    display: flex;
    justify-content: flex-end;
  }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
    transition: transform 0.3s var(--ease);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .main {
    margin-left: 0;
  }

  .page-container {
    padding: 1rem;
    padding-top: 3.5rem; /* room for hamburger */
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
  }
}


/* ═══════════════════════════════════════════════════════
   STATUS SELECT (inline)
   ═══════════════════════════════════════════════════════ */
.status-select {
  border: none !important;
  background: transparent !important;
  font-size: 0.78rem !important;
  cursor: pointer;
  color: var(--text) !important;
  padding: 0.2rem 1.5rem 0.2rem 0.2rem !important;
  box-shadow: none !important;
}


/* ═══════════════════════════════════════════════════════
   DASHBOARD — Chart Layout
   ═══════════════════════════════════════════════════════ */
.dashboard-charts-row {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

.dashboard-chart-card {
  min-height: 280px;
}

.dashboard-chart-card--small {
  min-height: 280px;
}

.dashboard-chart-card .card-body canvas {
  max-height: 260px;
}

@media (max-width: 768px) {
  .dashboard-charts-row {
    grid-template-columns: 1fr;
  }
}