/* ============================================================
   CODFacile — Design System
   Dark theme · Green #96bf3c · Font: Poppins
   ============================================================ */

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

/* ── CSS Variables ── */
:root {
  --green:        #96bf3c;
  --green-dark:   #7a9a2f;
  --green-light:  #b4d85a;
  --green-dim:    rgba(150,191,60,.15);
  --green-glow:   rgba(150,191,60,.25);

  --bg-base:      #0a0a0a;
  --bg-surface:   #111111;
  --bg-card:      #181818;
  --bg-elevated:  #1f1f1f;
  --bg-hover:     #252525;
  --bg-input:     #151515;

  --border:       #252525;
  --border-light: #2e2e2e;

  --text-primary:   #f0f0f0;
  --text-secondary: #8a8a8a;
  --text-muted:     #555555;
  --text-inverse:   #0a0a0a;

  --red:     #e05252;
  --orange:  #e08c3c;
  --blue:    #4ca8e0;
  --purple:  #9b6de0;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  --shadow-sm:  0 1px 4px rgba(0,0,0,.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.6);
  --shadow-glow: 0 0 20px var(--green-glow);

  --sidebar-w:  260px;
  --topbar-h:   64px;

  --transition: .18s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

img { max-width: 100%; display: block; }

ul, ol { list-style: none; }

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

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: var(--green);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  color: var(--text-inverse);
  flex-shrink: 0;
}

.sidebar-logo-text { line-height: 1.2; }
.sidebar-logo-text strong { display: block; font-weight: 700; font-size: 15px; color: var(--text-primary); }
.sidebar-logo-text span { font-size: 11px; color: var(--text-secondary); font-weight: 400; }

.sidebar-role-badge {
  margin: 16px 16px 8px;
  padding: 6px 12px;
  background: var(--green-dim);
  border: 1px solid rgba(150,191,60,.2);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.sidebar-nav { padding: 8px 0; flex: 1; }

.sidebar-section-label {
  padding: 14px 20px 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  margin: 1px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

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

.sidebar-item.active {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(150,191,60,.15);
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--green);
  border-radius: 0 3px 3px 0;
}

.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.sidebar-item.active svg { opacity: 1; }

.sidebar-item .badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--green);
  color: var(--text-inverse);
}

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}
.sidebar-user:hover { background: var(--bg-hover); }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--green-dim);
  border: 2px solid rgba(150,191,60,.3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  color: var(--green);
  flex-shrink: 0;
}
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 64px; height: 64px; font-size: 20px; }

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { font-size: 11px; color: var(--text-secondary); }

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-weight: 700;
  font-size: 17px;
  flex: 1;
}

.topbar-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

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

.icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  position: relative;
}
.icon-btn:hover { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.icon-btn svg { width: 16px; height: 16px; }

.notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  border: 1.5px solid var(--bg-surface);
}

/* ── Page Content ── */
.page-content {
  flex: 1;
  padding: 28px;
  overflow-x: hidden;
}

/* ── Section header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header-left h2 {
  font-size: 22px;
  font-weight: 700;
}

.page-header-left p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition);
}

.card:hover { border-color: var(--border-light); }

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

.card-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg { width: 16px; height: 16px; color: var(--green); }

.card-body { padding: 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0; height: 2px;
  background: var(--green);
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover::after { opacity: 1; }

.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  background: var(--green-dim);
  color: var(--green);
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.blue { background: rgba(76,168,224,.15); color: var(--blue); }
.stat-icon.orange { background: rgba(224,140,60,.15); color: var(--orange); }
.stat-icon.red { background: rgba(224,82,82,.15); color: var(--red); }
.stat-icon.purple { background: rgba(155,109,224,.15); color: var(--purple); }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-change {
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }
.stat-change svg { width: 13px; height: 13px; }

/* ── Grid Layouts ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-cols-3-1 { display: grid; grid-template-columns: 3fr 1fr; gap: 20px; }
.grid-cols-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* ── Tables ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

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

thead th {
  background: var(--bg-elevated);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

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

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

tbody td {
  padding: 13px 16px;
  vertical-align: middle;
}

.td-mono { font-family: 'Courier New', monospace; font-size: 12px; }

/* ── Badges / Status ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-green  { background: rgba(150,191,60,.15); color: var(--green);  border: 1px solid rgba(150,191,60,.2); }
.badge-green::before  { background: var(--green); }
.badge-red    { background: rgba(224,82,82,.15);  color: var(--red);    border: 1px solid rgba(224,82,82,.2); }
.badge-red::before    { background: var(--red); }
.badge-orange { background: rgba(224,140,60,.15); color: var(--orange); border: 1px solid rgba(224,140,60,.2); }
.badge-orange::before { background: var(--orange); }
.badge-blue   { background: rgba(76,168,224,.15); color: var(--blue);   border: 1px solid rgba(76,168,224,.2); }
.badge-blue::before   { background: var(--blue); }
.badge-gray   { background: rgba(100,100,100,.15); color: var(--text-secondary); border: 1px solid rgba(100,100,100,.2); }
.badge-gray::before   { background: var(--text-secondary); }
.badge-purple { background: rgba(155,109,224,.15); color: var(--purple); border: 1px solid rgba(155,109,224,.2); }
.badge-purple::before { background: var(--purple); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--green);
  color: var(--text-inverse);
  border-color: var(--green);
}
.btn-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  box-shadow: 0 4px 14px var(--green-glow);
  transform: translateY(-1px);
}

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

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

.btn-danger {
  background: rgba(224,82,82,.15);
  color: var(--red);
  border-color: rgba(224,82,82,.3);
}
.btn-danger:hover { background: var(--red); color: white; }

.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-icon { padding: 9px; }

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

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 13.5px;
  transition: all var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}

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

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238a8a8a' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
  -webkit-appearance: none;
}

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

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

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .form-control { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.input-addon {
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex; align-items: center;
  white-space: nowrap;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--green);
  cursor: pointer;
}

/* ── Search bar ── */
.search-bar {
  position: relative;
  max-width: 300px;
}
.search-bar svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-bar input {
  padding-left: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  height: 36px;
  width: 100%;
  outline: none;
  transition: border-color var(--transition);
}
.search-bar input:focus { border-color: var(--green); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

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

.tab:hover { color: var(--text-primary); }

.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 600;
}

/* ── Progress bars ── */
.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 99px;
  transition: width .5s ease;
}
.progress-fill.orange { background: var(--orange); }
.progress-fill.red { background: var(--red); }
.progress-fill.blue { background: var(--blue); }

/* ── Chart placeholder ── */
.chart-container {
  position: relative;
  width: 100%;
}

/* ── Timeline / Steps ── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex;
  gap: 16px;
  padding-bottom: 20px;
  position: relative;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg-card);
  flex-shrink: 0;
  margin-top: 5px;
  position: relative;
  z-index: 1;
}

.timeline-dot.gray { background: var(--text-muted); }

.timeline-item::before {
  content: '';
  position: absolute;
  left: 4px; top: 15px; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }

.timeline-content { flex: 1; }
.timeline-title { font-weight: 600; font-size: 13px; }
.timeline-meta { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

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

.page-btn:hover { border-color: var(--green); color: var(--green); }
.page-btn.active { background: var(--green); color: var(--text-inverse); border-color: var(--green); }

.pagination-info { font-size: 12px; color: var(--text-secondary); margin-left: auto; }

/* ── Alerts / Notices ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 20px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-green { background: rgba(150,191,60,.1); border: 1px solid rgba(150,191,60,.2); color: var(--green-light); }
.alert-orange { background: rgba(224,140,60,.1); border: 1px solid rgba(224,140,60,.2); color: var(--orange); }
.alert-red { background: rgba(224,82,82,.1); border: 1px solid rgba(224,82,82,.2); color: var(--red); }
.alert-blue { background: rgba(76,168,224,.1); border: 1px solid rgba(76,168,224,.2); color: var(--blue); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal.lg { max-width: 720px; }
.modal.xl { max-width: 900px; }

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

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

.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  background: var(--bg-elevated);
  border: none;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-close svg { width: 16px; height: 16px; }

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

/* ── Empty state ── */
.empty-state {
  padding: 60px 20px;
  text-align: center;
}
.empty-state-icon {
  width: 60px; height: 60px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  color: var(--text-muted);
}
.empty-state-icon svg { width: 28px; height: 28px; }
.empty-state h4 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { font-size: 13px; color: var(--text-secondary); max-width: 320px; margin: 0 auto 20px; }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── Tooltip ── */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11.5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 99;
  font-weight: 500;
}

/* ── Tag / Chips ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Utility ── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(150,191,60,.07) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.login-logo-icon {
  width: 48px; height: 48px;
  background: var(--green);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-inverse);
  box-shadow: 0 4px 16px var(--green-glow);
}

.login-logo-text h1 {
  font-size: 20px;
  font-weight: 800;
}
.login-logo-text span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .grid-cols-3-1 { grid-template-columns: 1fr; }
  .grid-cols-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); --sidebar-w: 260px; }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
