/* Finance Tracker KM - Premium Blue & White Theme */
:root {
  --primary-blue: #2563eb;
  --royal-blue: #1d4ed8;
  --deep-navy: #1e3a8a;
  --light-blue-bg: #eff6ff;
  --border-blue: #bfdbfe;
  
  --bg-light: #f8fafc;
  --surface-white: #ffffff;
  --border-light: #e2e8f0;
  
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  --emerald-green: #10b981;
  --green-bg: #ecfdf5;
  --amber-warning: #f59e0b;
  --amber-bg: #fffbeb;
  --crimson-alert: #ef4444;
  --red-bg: #fef2f2;
  --purple-accent: #8b5cf6;
  --purple-bg: #f5f3ff;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(37, 99, 235, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Roboto', 'Tiro Bangla', sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background-color: var(--bg-light);
  color: var(--text-dark);
  overflow: hidden;
  font-family: 'Roboto', 'Tiro Bangla', sans-serif;
}

/* App Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Navbar */
.navbar {
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

.brand-info h2 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.brand-info span {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Navbar Buttons */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 16px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 16px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all 0.2s ease;
}

.btn-emerald:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-outline-blue {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 14px;
  transition: all 0.2s ease;
}

.btn-outline-blue:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #f8fafc, #eff6ff);
  border: 1px solid #bfdbfe;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

.avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Workspace */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 275px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 14px;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
}

.menu-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 12px;
  padding-left: 10px;
  letter-spacing: 0.8px;
}

.nav-tabs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  color: #334155;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-item .menu-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

/* Color-coded icons for each menu item */
.nav-item[data-tab="dashboard"] .menu-icon-box { background: #eff6ff; color: #2563eb; }
.nav-item[data-tab="clients"] .menu-icon-box { background: #ecfdf5; color: #059669; }
.nav-item[data-tab="members"] .menu-icon-box { background: #f5f3ff; color: #7c3aed; }
.nav-item[data-tab="payment-history"] .menu-icon-box { background: #fef3c7; color: #d97706; }
.nav-item[data-tab="projects"] .menu-icon-box { background: #fff1f2; color: #e11d48; }
.nav-item[data-tab="shooting"] .menu-icon-box { background: #f0fdfa; color: #0d9488; }
.nav-item[data-tab="expenses"] .menu-icon-box { background: #fdf2f8; color: #db2777; }
.nav-item[data-tab="canvas"] .menu-icon-box { background: #faf5ff; color: #9333ea; }

.nav-item:hover {
  background: #f8fafc;
  color: #2563eb;
  transform: translateX(3px);
}

.nav-item:hover .menu-icon-box {
  transform: scale(1.1);
}

.nav-item.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.nav-item.active .menu-icon-box {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

.sidebar-card {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #a7f3d0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.08);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sidebar-card .card-title {
  font-size: 12px;
  font-weight: 800;
  color: #065f46;
}

.sidebar-card .card-subtitle {
  font-size: 10.5px;
  color: #047857;
  font-weight: 600;
}

/* Viewport & Scrolling for All Pages */
.content-viewport {
  flex: 1;
  height: 100%;
  padding: 24px 30px 60px 30px;
  overflow-y: auto !important;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
  min-height: 100%;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Alert Banner */
.alert-banner {
  background: var(--red-bg);
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fee2e2;
  color: var(--crimson-alert);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.alert-content {
  flex: 1;
}

.alert-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: #991b1b;
}

.alert-content p {
  font-size: 12px;
  color: #7f1d1d;
}

/* Financial Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: none;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.metric-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  opacity: 0.95;
}

.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* 1. Team Due: Warm Sunset Amber / Orange Gradient */
.card-amber {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #ea580c 100%);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.28);
}

/* 2. Client Due: Royal Indigo / Violet Gradient */
.card-green {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.28);
}

/* 3. Total Expenses: Vivid Rose / Crimson Gradient */
.card-blue {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 50%, #be123c 100%);
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.28);
}

/* 4. Client Received: Lush Emerald / Mint Gradient */
.card-purple {
  background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.28);
}

.metric-value {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.metric-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}

.metric-footer {
  font-size: 11px;
  color: var(--text-dim);
}

/* Quick Actions */
.section-block {
  margin-bottom: 24px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.action-btn {
  background: var(--surface-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.action-btn span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.bg-green { background: var(--green-bg); color: var(--emerald-green); }
.bg-blue { background: var(--light-blue-bg); color: var(--primary-blue); }
.bg-red { background: var(--red-bg); color: var(--crimson-alert); }
.bg-royal { background: #dbeafe; color: var(--royal-blue); }
.bg-purple { background: var(--purple-bg); color: var(--purple-accent); }

/* Panels & Grids */
.two-column-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.panel {
  background: var(--surface-white);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* Member Cards Grid */
.member-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.member-web-card {
  background: var(--surface-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.member-web-card:hover {
  border-color: var(--border-blue);
  box-shadow: var(--shadow-md);
}

.member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--light-blue-bg);
  color: var(--primary-blue);
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-monthly {
  background: #ffe4e6;
  color: #e11d48;
}

.member-info {
  flex: 1;
}

.member-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
}

.badge-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-monthly {
  background: #ffe4e6;
  color: #e11d48;
}

.badge-daily {
  background: #fef3c7;
  color: #d97706;
}

.member-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.member-balance {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.member-balance strong {
  color: var(--text-dark);
  font-weight: 700;
}

.member-balance strong.positive { color: var(--emerald-green); }
.member-balance strong.negative { color: var(--crimson-alert); }

.member-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Project Cards */
.project-card-box {
  background: var(--surface-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.project-card-box.over-budget {
  border-color: var(--crimson-alert);
}

.crew-rate-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.crew-rate-chip {
  background: var(--light-blue-bg);
  border: 1px solid var(--border-blue);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.crew-rate-chip .rate-text {
  font-weight: 700;
  color: var(--royal-blue);
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-primary { background: var(--primary-blue); color: #fff; }
.btn-primary:hover { background: var(--royal-blue); }

.btn-emerald { background: var(--emerald-green); color: #fff; }
.btn-emerald:hover { background: #059669; }

.btn-danger { background: var(--crimson-alert); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-secondary { background: #e2e8f0; color: var(--text-dark); }
.btn-secondary:hover { background: #cbd5e1; }

.btn-outline-blue { background: transparent; border: 1px solid var(--primary-blue); color: var(--primary-blue); }
.btn-outline-blue:hover { background: var(--light-blue-bg); }

.btn-outline-danger { background: transparent; border: 1px solid var(--crimson-alert); color: var(--crimson-alert); }
.btn-outline-danger:hover { background: var(--red-bg); }

.btn-sm { padding: 4px 10px; font-size: 11px; }

/* Canvas Board */
.canvas-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-white);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.canvas-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface-white);
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tool-btn.active {
  background: var(--light-blue-bg);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.canvas-board-wrapper {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-blue);
  box-shadow: var(--shadow-sm);
  height: 520px;
  overflow: hidden;
}

#webDrawingCanvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.canvas-watermark {
  position: absolute;
  bottom: 14px;
  right: 18px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(148, 163, 184, 0.4);
  letter-spacing: 1px;
  pointer-events: none;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

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

.modal-box {
  background: var(--surface-white);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.2s ease;
}

.modal-lg { max-width: 650px; }

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 20px;
}

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

/* Forms */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Payment Method Selector Grid */
.payment-method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.method-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 700;
}

.method-card input { display: none; }

.method-card.active {
  border-color: var(--primary-blue);
  background: var(--light-blue-bg);
  box-shadow: 0 0 0 2px var(--primary-blue);
}

.text-pink { color: #e2136e; }
.text-orange { color: #f7941d; }
.text-blue { color: #0284c7; }
.text-green { color: var(--emerald-green); }

.due-badge-card {
  background: var(--amber-bg);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.due-badge-card .label { font-size: 11px; color: var(--text-muted); }
.due-badge-card .amount { font-size: 15px; font-weight: 700; }

.crew-selection-box {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: var(--bg-light);
}

.crew-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  border: 1px solid var(--border-light);
}

.radio-chip {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Utilities */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-primary { color: var(--primary-blue); }
.text-emerald { color: var(--emerald-green); }
.text-danger { color: var(--crimson-alert); }
.text-amber { color: var(--amber-warning); }
.font-bold { font-weight: 700; }
