/* ============================================================
   ProTrack – Premium Dark ERP CSS
   ============================================================ */

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

:root {
  --bg-base:        #0b0f1a;
  --bg-surface:     #111827;
  --bg-elevated:    #1a2235;
  --bg-card:        #1e293b;
  --bg-input:       #0f172a;
  --border:         rgba(255,255,255,0.07);
  --border-active:  rgba(99,102,241,0.5);

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  --accent:         #6366f1;
  --accent-hover:   #818cf8;
  --accent-dim:     rgba(99,102,241,0.12);
  --green:          #10b981;
  --green-dim:      rgba(16,185,129,0.12);
  --orange:         #f59e0b;
  --orange-dim:     rgba(245,158,11,0.12);
  --red:            #ef4444;
  --red-dim:        rgba(239,68,68,0.12);
  --blue:           #3b82f6;
  --blue-dim:       rgba(59,130,246,0.12);
  --purple:         #8b5cf6;
  --purple-dim:     rgba(139,92,246,0.12);

  --sidebar-w:      260px;
  --topbar-h:       64px;
  --radius:         12px;
  --radius-sm:      8px;
  --radius-xs:      6px;
  --shadow:         0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --transition:     0.2s ease;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-body {
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(16,185,129,0.1) 0%, transparent 50%),
              radial-gradient(ellipse at 60% 80%, rgba(139,92,246,0.08) 0%, transparent 50%);
  z-index: 0;
}

.auth-particles { position: absolute; inset: 0; }
.particle {
  position: absolute;
  background: rgba(99,102,241,0.3);
  border-radius: 50%;
  animation: float linear infinite;
}
@keyframes float {
  0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

.auth-wrapper {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  padding: 24px;
}

.auth-card {
  background: rgba(30,41,59,0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
}

.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
  animation: spin 8s linear infinite;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.auth-logo-text { font-size: 28px; font-weight: 800; color: var(--text-primary); letter-spacing: -1px; }
.auth-logo-sub  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.auth-footer    { text-align: center; color: var(--text-muted); font-size: 11px; margin-top: 24px; }

/* ============================================================
   LAYOUT – SIDEBAR + MAIN
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 20px;
  animation: spin 12s linear infinite;
}
.brand-name  { font-size: 18px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.brand-sub   { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: var(--accent-dim);
  color: var(--accent-hover);
  border-color: var(--border-active);
}
.nav-item.active {
  background: linear-gradient(135deg, var(--accent-dim), rgba(139,92,246,0.1));
  color: var(--accent-hover);
  border-color: var(--border-active);
}
.nav-icon  { font-size: 16px; width: 20px; text-align: center; }
.nav-label { flex: 1; }
.nav-divider { height: 1px; background: var(--border); margin: 8px 0; }
.nav-logout:hover { background: var(--red-dim); color: var(--red); border-color: rgba(239,68,68,0.3); }

/* ============================================================
   TOPBAR
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--transition);
}

.topbar {
  position: sticky; top: 0;
  height: var(--topbar-h);
  background: rgba(17,24,39,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  z-index: 100;
}

.sidebar-toggle {
  display: none;
  flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px;
}
.sidebar-toggle span { width: 22px; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: var(--transition); }

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

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

.icon-btn {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 16px;
  display: grid; place-items: center;
  transition: all var(--transition);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--red);
  color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 17px; height: 17px;
  border-radius: 10px;
  display: grid; place-items: center;
  border: 2px solid var(--bg-surface);
}

.notif-wrapper { position: relative; }
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 300;
  display: none;
  overflow: hidden;
}
.notif-dropdown.open { display: block; animation: fadeDown 0.2s ease; }
@keyframes fadeDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
.notif-header { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-elevated); }
.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-item .notif-title { font-weight: 600; font-size: 12.5px; color: var(--text-primary); }
.notif-item .notif-msg   { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.notif-item .notif-time  { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

.user-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 6px 14px 6px 6px;
}
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); display: block; line-height: 1.2; }
.user-role { font-size: 10px; color: var(--text-muted); display: block; }

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

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash {
  margin: 12px 24px 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.flash-success { background: var(--green-dim);  border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.flash-error   { background: var(--red-dim);    border: 1px solid rgba(239,68,68,0.3);  color: #f87171; }
.flash-info    { background: var(--blue-dim);   border: 1px solid rgba(59,130,246,0.3); color: #60a5fa; }
.flash-close   { background: none; border: none; cursor: pointer; color: inherit; font-size: 16px; line-height: 1; }

/* ============================================================
   CARDS & SECTIONS
   ============================================================ */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background: radial-gradient(circle at top right, white, transparent);
}

.kpi-icon {
  font-size: 28px;
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  flex-shrink: 0;
}

.kpi-blue   .kpi-icon { background: var(--blue-dim);   }
.kpi-orange .kpi-icon { background: var(--orange-dim); }
.kpi-green  .kpi-icon { background: var(--green-dim);  }
.kpi-purple .kpi-icon { background: var(--purple-dim); }
.kpi-indigo .kpi-icon { background: var(--accent-dim); }

.kpi-blue   { border-top: 3px solid var(--blue);   }
.kpi-orange { border-top: 3px solid var(--orange); }
.kpi-green  { border-top: 3px solid var(--green);  }
.kpi-purple { border-top: 3px solid var(--purple); }
.kpi-indigo { border-top: 3px solid var(--accent); }

.kpi-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; margin-bottom: 4px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-sub   { font-size: 11px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Mini Progress */
.mini-progress { height: 4px; background: rgba(255,255,255,0.08); border-radius: 4px; width: 80px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.mini-bar      { height: 100%; background: var(--green); border-radius: 4px; transition: width 1s ease; }

/* Dots */
.dot-green, .dot-orange, .dot-blue, .dot-red, .dot-purple, .dot-warning {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
}
.dot-green   { background: var(--green);  }
.dot-orange  { background: var(--orange); }
.dot-blue    { background: var(--blue);   }
.dot-red     { background: var(--red);    }
.dot-purple  { background: var(--purple); }
.dot-warning { background: var(--orange); }

/* ============================================================
   CHARTS
   ============================================================ */
.charts-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.chart-card-wide { }
.chart-header { margin-bottom: 16px; }
.chart-title  { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.chart-body   { flex: 1; min-height: 200px; }
.chart-body-sm { min-height: 200px; }

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 4px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 700px;
}
.data-table thead tr {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.data-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-success   { background: var(--green-dim);  color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-warning   { background: var(--orange-dim); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-danger    { background: var(--red-dim);    color: #f87171; border: 1px solid rgba(239,68,68,0.25);  }
.badge-info      { background: var(--blue-dim);   color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.badge-purple    { background: var(--purple-dim); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25);  }
.badge-secondary { background: rgba(255,255,255,0.06); color: var(--text-secondary); border: 1px solid var(--border); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), #a78bfa);
  box-shadow: 0 6px 20px rgba(99,102,241,0.4);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.btn-ghost  { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.btn-info   { background: var(--blue-dim);   color: #60a5fa; border-color: rgba(59,130,246,0.2); }
.btn-info:hover { background: rgba(59,130,246,0.2); }
.btn-danger { background: var(--red-dim);    color: #f87171; border-color: rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-purple { background: var(--purple-dim); color: #a78bfa; border-color: rgba(139,92,246,0.2); }
.btn-purple:hover { background: rgba(139,92,246,0.2); }
.btn-success{ background: var(--green-dim);   color: #34d399; border-color: rgba(16,185,129,0.2); }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-xs  { padding: 4px 9px;  font-size: 11px; }
.btn-full { width: 100%; }

.action-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Input with icon */
.input-icon-wrap { position: relative; }
.input-icon      { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 14px; pointer-events: none; }
.input-icon-wrap .form-control { padding-left: 40px; }
.input-eye       { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 14px; color: var(--text-muted); }
.input-eye:hover { color: var(--text-primary); }

/* Filters */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-input  { flex: 1; min-width: 180px; max-width: 280px; }
.filter-select { width: auto; min-width: 150px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: none;
}
.modal-overlay.open { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal {
  position: fixed; inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  flex-direction: column;
}
.modal-xl { max-width: 760px; }
@keyframes modalIn { from { opacity:0; transform:scale(0.94) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px;
  width: 30px; height: 30px;
  border-radius: 6px;
  display: grid; place-items: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--red-dim); color: var(--red); }

.modal-box form,
.modal-box > *:not(.modal-header):not(.modal-footer) { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }

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

/* ============================================================
   MISC
   ============================================================ */
.ref-tag {
  background: var(--accent-dim);
  color: var(--accent-hover);
  border: 1px solid rgba(99,102,241,0.25);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
}
.action-tag {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
}

.fw-500    { font-weight: 500; color: var(--text-primary); }
.text-green  { color: #34d399 !important; font-weight: 600; }
.text-orange { color: #fbbf24 !important; font-weight: 600; }
.text-red    { color: #f87171 !important; font-weight: 600; }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.text-sm     { font-size: 12px; }
.py-8        { padding-top: 32px; padding-bottom: 32px; }
.mb-3        { margin-bottom: 12px; }
.mb-4        { margin-bottom: 16px; }
.mb-6        { margin-bottom: 24px; }
.mt-6        { margin-top: 24px; }
.mt-1        { margin-top: 4px; }
.divider     { height: 1px; background: var(--border); border: none; margin: 16px 0; }
.alert-info-box { background: var(--blue-dim); border: 1px solid rgba(59,130,246,0.2); border-radius: var(--radius-sm); padding: 12px 16px; color: #93c5fd; font-size: 13px; margin-top: 12px; }

/* Progress in table */
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar  { height: 6px; background: rgba(255,255,255,0.08); border-radius: 4px; flex: 1; min-width: 60px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 4px; }

/* Mini Stats bar */
.mini-stats {
  display: flex; gap: 20px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.mini-stat { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }
.mini-stat span:last-child { font-weight: 700; color: var(--text-primary); }

/* Tab Bar */
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all var(--transition);
}
.tab-btn:hover { background: var(--accent-dim); color: var(--accent-hover); }
.tab-btn.active { background: var(--accent-dim); color: var(--accent-hover); border-color: var(--border-active); }

/* Profile */
.profile-grid { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.profile-card { text-align: center; }
.profile-avatar-big {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 32px; font-weight: 800; color: #fff;
  margin: 0 auto 16px;
}
.profile-name  { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.profile-email { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.profile-role  { margin-bottom: 12px; }
.profile-since { font-size: 12px; color: var(--text-muted); }

/* User cell in table */
.user-cell       { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm  {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; }
.page-btn {
  min-width: 36px; height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  padding: 0 10px;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 360px;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
@keyframes toastIn { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }
.toast-success { border-left: 4px solid var(--green);  }
.toast-error   { border-left: 4px solid var(--red);    }
.toast-info    { border-left: 4px solid var(--blue);   }
.toast-icon    { font-size: 16px; flex-shrink: 0; }
.toast-out     { opacity: 0; transform: translateX(30px); }

/* ============================================================
   AUTH FORM (shared)
   ============================================================ */
.auth-form { display: flex; flex-direction: column; gap: 18px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .charts-row { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.5); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .filter-input, .filter-select { max-width: 100%; width: 100%; }
  .user-pill .user-info { display: none; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .modal-box { max-width: 100%; margin: 0; border-radius: 16px 16px 0 0; position: fixed; bottom: 0; width: 100%; max-height: 90vh; }
  .modal { align-items: flex-end; padding: 0; }
}
