/* ============================================
   Call Soft CRM - Main Stylesheet
   Premium Dark Theme with Blue Accents
   ============================================ */

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

:root {
  --primary: #1a6bff;
  --primary-dark: #0052d4;
  --primary-light: #4d8fff;
  --secondary: #f97316;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;

  --bg-dark: #0d1117;
  --bg-card: #161b22;
  --bg-sidebar: #0d1117;
  --bg-input: #21262d;
  --bg-hover: #1c2128;
  --bg-table-hover: #1a2233;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;

  --border: #30363d;
  --border-light: #21262d;

  --sidebar-width: 260px;
  --header-height: 64px;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);

  --transition: all 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

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

a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ========== AUTH PAGES ========== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d1117 0%, #1a2236 50%, #0d1117 100%);
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: slideUp 0.4s ease;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo img { max-height: 60px; max-width: 200px; object-fit: contain; }

.auth-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 28px;
}

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

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

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo img {
  max-height: 44px;
  max-width: 180px;
  object-fit: contain;
  filter: brightness(1.1);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(26, 107, 255, 0.12);
  color: var(--primary-light);
  border-left-color: var(--primary);
}

.nav-item svg, .nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active svg { opacity: 1; }

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

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

/* ========== HEADER ========== */
.topbar {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-spacer { flex: 1; }

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  gap: 8px;
  width: 280px;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 255, 0.15);
}

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

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

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--primary); }

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

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

.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ========== CARDS ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 22px; }

/* ========== STAT CARDS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.stat-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(26,107,255,0.2);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--icon-bg, rgba(26, 107, 255, 0.15));
  color: var(--icon-color, var(--primary-light));
  flex-shrink: 0;
}

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

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 107, 255, 0.3);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover { background: var(--bg-hover); border-color: var(--primary); color: var(--text-primary); }

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #16a34a; color: white; }

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

.btn-warning { background: var(--warning); color: #0d1117; border-color: var(--warning); }
.btn-warning:hover { background: #d97706; color: #0d1117; }

.btn-outline {
  background: transparent;
  color: var(--primary-light);
  border-color: var(--primary);
}

.btn-outline:hover { background: var(--primary); color: white; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 255, 0.15);
}

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

select.form-control { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

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

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-dark);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--border-light); transition: var(--transition); }
tbody tr:hover { background: var(--bg-table-hover); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 13px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

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

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-primary { background: rgba(26,107,255,0.15); color: var(--primary-light); }
.badge-success { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-danger { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-secondary { background: rgba(139,148,158,0.15); color: var(--text-secondary); }
.badge-info { background: rgba(6,182,212,0.15); color: #22d3ee; }
.badge-orange { background: rgba(249,115,22,0.15); color: #fb923c; }

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
}

.page-btn {
  min-width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  padding: 0 8px;
}

.page-btn:hover { border-color: var(--primary); color: var(--primary-light); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.3s ease;
}

.modal-lg { max-width: 900px; }
.modal-sm { max-width: 420px; }

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

.modal-title { font-size: 16px; font-weight: 700; }

.modal-close {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}

.modal-close:hover { background: var(--danger); color: white; border-color: var(--danger); }

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

/* ========== ALERTS ========== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.25); color: #4ade80; }
.alert-danger { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25); color: #fbbf24; }
.alert-info { background: rgba(6,182,212,0.12); border: 1px solid rgba(6,182,212,0.25); color: #22d3ee; }

.alert button { background: none; border: none; cursor: pointer; font-size: 18px; color: inherit; opacity: 0.7; line-height: 1; padding: 0; }
.alert button:hover { opacity: 1; }

/* ========== INVOICE ITEMS TABLE ========== */
.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.items-table th {
  padding: 10px 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.items-table td {
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  vertical-align: middle;
}

.items-table .form-control {
  padding: 7px 10px;
  font-size: 13px;
}

.items-table tr:hover { background: none; }
.items-table .btn-icon-del {
  width: 30px; height: 30px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 6px;
  color: var(--danger);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.items-table .btn-icon-del:hover { background: var(--danger); color: white; }

/* ========== TOTALS BOX ========== */
.totals-box {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.total-row.grand-total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 0;
}

.tab {
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--primary-light); border-bottom-color: var(--primary); }

/* ========== FILTERS BAR ========== */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.filter-select:focus { border-color: var(--primary); }

/* ========== PDF PREVIEW STYLES ========== */
.pdf-preview {
  background: white;
  color: #1a1a1a;
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc { font-size: 13px; margin-bottom: 20px; }

/* ========== PROGRESS ========== */
.progress {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
  transition: width 0.5s ease;
}

/* ========== TOGGLE SWITCH ========== */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  transition: 0.3s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ========== DASHBOARD CHARTS ========== */
.chart-placeholder {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 16px;
}

.chart-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, var(--primary), var(--primary-light));
  position: relative;
  min-height: 10px;
  transition: var(--transition);
  cursor: pointer;
}

.chart-bar:hover { opacity: 0.8; }

.chart-bar::after {
  content: attr(data-label);
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.spin { animation: spin 1s linear infinite; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .search-bar { width: 180px; }
}

/* ========== UTILITIES ========== */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.mr-1 { margin-right: 8px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }

.w-100 { width: 100%; }
.required { color: var(--danger); }

.loader {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ========== DROPDOWN ========== */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
  z-index: 500;
  box-shadow: var(--shadow);
  animation: slideDown 0.2s ease;
  overflow: hidden;
}

.dropdown-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}

.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.1); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ========== SIDEBAR TOGGLE ========== */
.sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .sidebar-toggle { display: flex; }
}

/* ========== NOTIFICATION DOT ========== */
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  position: absolute;
  top: 6px; right: 6px;
}

/* ========== REPORT CARDS ========== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

/* ========== COPY LINK ========== */
.copy-text {
  cursor: pointer;
  transition: var(--transition);
}
.copy-text:hover { color: var(--primary-light); }

/* ========== MEDIA PRINT OVERRIDES ========== */
@media print {
  body {
    background: white !important;
    color: #0f172a !important;
    font-size: 12px !important;
  }
  .sidebar, .topbar, .page-header no-print, .no-print, .tabs, .mb-3.no-print, .card-header .no-print {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  .page-content {
    padding: 0 !important;
  }
  .card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #0f172a !important;
  }
  .card-body {
    padding: 0 !important;
  }
  .card-header {
    border-bottom: 2px solid #cbd5e1 !important;
    padding: 10px 0 !important;
  }
  .card-title {
    color: #0f172a !important;
    font-size: 16px !important;
  }
  .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
  }
  .stat-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    padding: 10px !important;
    box-shadow: none !important;
  }
  .stat-card::before {
    display: none !important;
  }
  .stat-value {
    color: #0f172a !important;
    font-size: 18px !important;
  }
  .stat-label {
    color: #475569 !important;
  }
  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }
  thead th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 2px solid #cbd5e1 !important;
    padding: 8px !important;
  }
  tbody td {
    padding: 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
  }
  .badge {
    background: transparent !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    padding: 2px 6px !important;
  }
  a {
    color: #0f172a !important;
    text-decoration: none !important;
  }
}
