/* ===================================================
   NEURALYS OS — Complete Design System
   =================================================== */

/* CSS Variables */
:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --secondary: #7C3AED;
  --secondary-light: #F5F3FF;
  --accent: #06B6D4;
  --accent-light: #ECFEFF;
  --bg: #FAFAFA;
  --card: #FFFFFF;
  --text: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.06);
  --shadow-primary: 0 4px 14px rgba(79,70,229,0.25);
  --green: #10B981;
  --green-light: #ECFDF5;
  --yellow: #F59E0B;
  --yellow-light: #FFFBEB;
  --red: #EF4444;
  --red-light: #FEF2F2;
  --blue: #3B82F6;
  --blue-light: #EFF6FF;
  --orange: #F97316;
  --orange-light: #FFF7ED;
  --transition: all 0.18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ===================================================
   SIDEBAR
   =================================================== */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.2px; }
.brand-sub { font-size: 10px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.3px; text-transform: uppercase; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-item:hover {
  background: var(--border-light);
  color: var(--text);
}

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

.nav-item.active svg { stroke: var(--primary); }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-light);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--text-muted); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ===================================================
   MAIN CONTENT
   =================================================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOP BAR ===== */
.topbar {
  height: var(--topbar-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-date {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
}

.mobile-menu-btn:hover { background: var(--border-light); color: var(--text); }

/* ===== PAGE CONTENT ===== */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79,70,229,0.3);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}
.btn-secondary:hover { background: #6D28D9; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border-light); color: var(--text); }

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover { background: #DC2626; }

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 12px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===================================================
   CARDS
   =================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 20px; }

/* ===== KPI CARDS ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.kpi-card.kpi-primary::before { background: var(--primary); }
.kpi-card.kpi-secondary::before { background: var(--secondary); }
.kpi-card.kpi-accent::before { background: var(--accent); }
.kpi-card.kpi-green::before { background: var(--green); }
.kpi-card.kpi-yellow::before { background: var(--yellow); }
.kpi-card.kpi-orange::before { background: var(--orange); }

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

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.kpi-primary .kpi-icon { background: var(--primary-light); color: var(--primary); }
.kpi-secondary .kpi-icon { background: var(--secondary-light); color: var(--secondary); }
.kpi-accent .kpi-icon { background: var(--accent-light); color: var(--accent); }
.kpi-green .kpi-icon { background: var(--green-light); color: var(--green); }
.kpi-yellow .kpi-icon { background: var(--yellow-light); color: var(--yellow); }
.kpi-orange .kpi-icon { background: var(--orange-light); color: var(--orange); }

.kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

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

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

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--border-light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

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

tbody tr {
  transition: var(--transition);
}

tbody tr:hover { background: #FAFBFF; }
tbody tr:last-child td { border-bottom: none; }

.table-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: var(--transition);
}

tbody tr:hover .table-actions { opacity: 1; }

.action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  border: 1px solid transparent;
}

.action-btn:hover { background: var(--border-light); color: var(--text); border-color: var(--border); }
.action-btn.delete:hover { background: var(--red-light); color: var(--red); border-color: #FCA5A5; }
.action-btn.view:hover { background: var(--primary-light); color: var(--primary); border-color: #C7D2FE; }

/* ===================================================
   BADGES / STATUS
   =================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

/* Client Status Badges */
.badge-lead { background: var(--border-light); color: var(--text-secondary); }
.badge-activated { background: var(--blue-light); color: var(--blue); }
.badge-awaiting { background: var(--yellow-light); color: var(--yellow); }
.badge-in-progress { background: var(--primary-light); color: var(--primary); }
.badge-revision { background: var(--orange-light); color: var(--orange); }
.badge-completed { background: var(--green-light); color: var(--green); }
.badge-maintenance { background: var(--secondary-light); color: var(--secondary); }

/* Payment Status Badges */
.badge-paid { background: var(--green-light); color: var(--green); }
.badge-pending { background: var(--yellow-light); color: var(--yellow); }
.badge-overdue { background: var(--red-light); color: var(--red); }

/* Task Status Badges */
.badge-todo { background: var(--border-light); color: var(--text-secondary); }
.badge-inprogress { background: var(--primary-light); color: var(--primary); }
.badge-waiting { background: var(--yellow-light); color: var(--yellow); }
.badge-done { background: var(--green-light); color: var(--green); }

/* ===================================================
   SEARCH & FILTERS
   =================================================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--card);
  color: var(--text);
  transition: var(--transition);
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
  font-weight: 500;
}

.filter-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

/* ===================================================
   FORMS
   =================================================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.required { color: var(--red); }

.form-input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  background: var(--card);
  transition: var(--transition);
  outline: none;
  width: 100%;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-input::placeholder { color: var(--text-muted); }

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

/* ===================================================
   MODALS
   =================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

.modal-xl { max-width: 860px; }
.modal-sm { max-width: 420px; }

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-muted);
  transition: var(--transition);
  line-height: 1;
}

.modal-close:hover { background: var(--border-light); color: var(--text); }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* ===================================================
   DASHBOARD GRID
   =================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dashboard-grid .card-full { grid-column: 1 / -1; }

/* ===================================================
   PAGE HEADER
   =================================================== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header-text {}
.page-header-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.page-header-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

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

/* ===================================================
   EMPTY STATE
   =================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-desc { font-size: 13px; max-width: 280px; }

/* ===================================================
   CLIENT DETAIL
   =================================================== */
.client-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.detail-section-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}

.detail-field:last-child { margin-bottom: 0; }

.detail-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.detail-field-value {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

.detail-section-full { grid-column: 1 / -1; }

/* ===================================================
   FILE UPLOAD
   =================================================== */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  color: var(--text-muted);
}

.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.file-drop-zone p { font-size: 13px; }
.file-hint { font-size: 11.5px; color: var(--text-muted) !important; }
.link-text { color: var(--primary); font-weight: 600; }

.file-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-top: 8px;
}

.file-preview-icon { color: var(--primary); flex-shrink: 0; }

/* ===================================================
   FILES GRID
   =================================================== */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.file-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: var(--transition);
  cursor: default;
}

.file-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.file-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 20px;
}

.file-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  margin-bottom: 4px;
}

.file-card-meta { font-size: 11.5px; color: var(--text-muted); }
.file-card-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ===================================================
   REPORTS
   =================================================== */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

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

.report-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.report-value { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.report-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===================================================
   SETTINGS
   =================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav-item {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.settings-nav-item:hover { background: var(--border-light); color: var(--text); }
.settings-nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.settings-section { display: none; }
.settings-section.active { display: block; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 20px;
}

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

.setting-info {}
.setting-label { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.setting-desc { font-size: 12px; color: var(--text-muted); }
.setting-control { flex-shrink: 0; }

/* ===================================================
   TOAST NOTIFICATIONS
   =================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--text);
  color: white;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 320px;
}

.toast.toast-success { background: #064E3B; }
.toast.toast-error { background: #7F1D1D; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(60px); }
}

.toast.removing { animation: toastOut 0.25s ease forwards; }

/* ===================================================
   UTILITY
   =================================================== */
.text-muted { color: var(--text-muted); }
.text-small { font-size: 12px; }
.font-semibold { font-weight: 600; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.client-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-name-cell strong { font-weight: 600; color: var(--text); }
.client-name-cell span { font-size: 12px; color: var(--text-muted); }

.amount { font-family: 'Inter', monospace; font-weight: 600; }
.amount-green { color: var(--green); }
.amount-red { color: var(--red); }
.amount-yellow { color: var(--yellow); }

/* ===================================================
   KANBAN BOARD
   =================================================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-column {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

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

.kanban-col-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kanban-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 100px;
}

.kanban-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.kanban-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.kanban-card-client { font-size: 11.5px; color: var(--text-muted); margin-bottom: 6px; }
.kanban-card-due { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .reports-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay.open { display: block; }

  .main-content { margin-left: 0; }

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

  .page-content { padding: 16px; }

  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .client-detail-grid { grid-template-columns: 1fr; }
  .reports-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-full { grid-column: 1; }

  .toolbar { flex-wrap: wrap; }
  .search-wrap { max-width: 100%; flex: 1 1 100%; }

  .modal { max-width: 100%; }
  .modal-xl { max-width: 100%; }

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

  .topbar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .files-grid { grid-template-columns: 1fr 1fr; }
}

/* ===================================================
   CHART CANVAS
   =================================================== */
.chart-wrap {
  position: relative;
  height: 200px;
}

/* ===================================================
   LOADING STATES
   =================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-wave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===================================================
   HOVER STATES & MICRO-ANIMATIONS
   =================================================== */
.nav-item svg,
.action-btn svg {
  transition: transform 0.15s ease;
}

.nav-item:hover svg { transform: scale(1.08); }

.btn svg { transition: transform 0.15s ease; }
.btn:hover svg { transform: translateX(1px); }

/* Print */
@media print {
  .sidebar, .topbar { display: none; }
  .main-content { margin-left: 0; }
}

/* ===================================================
   LOGIN SCREEN
   =================================================== */
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

#loginScreen {
  min-height: 100vh;
  width: 100%;
  display: flex;
}

.login-left {
  flex: 1;
  background: linear-gradient(145deg, #1E1B4B 0%, #312E81 40%, #4338CA 80%, #4F46E5 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.25);
  filter: blur(60px);
}

.login-left::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -40px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.15);
  filter: blur(50px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 56px;
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
}

.login-brand-name {
  font-size: 18px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.3px;
}

.login-brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.login-headline {
  font-size: 44px;
  font-weight: 800;
  color: white;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.login-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  max-width: 380px;
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.8);
  font-size: 14.5px;
  font-weight: 500;
}

.login-feature-icon {
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-right {
  width: 480px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.login-card {
  width: 100%;
  max-width: 360px;
}

.login-card-header {
  margin-bottom: 32px;
}

.login-card-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-card-sub {
  font-size: 14px;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-pw-wrap {
  position: relative;
}

.login-pw-wrap .form-input {
  padding-right: 44px;
}

.login-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.login-pw-toggle:hover { color: var(--text); background: var(--border-light); }

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--red-light);
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  animation: slideUp 0.2s ease;
}

.login-btn {
  width: 100%;
  justify-content: center;
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.login-footer-note {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* App shell */
#appShell {
  display: flex;
  width: 100%;
}

#appShell.hidden,
#loginScreen.hidden {
  display: none !important;
}

/* Login responsive */
@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { width: 100%; }
}

@media (max-width: 480px) {
  .login-right { padding: 32px 24px; }
}

