/* ============================================================
   assets/styles.css — Portal PKL Kecamatan Ajibarang
   Design System v2.0 | PHP Native Edition
   ============================================================ */

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

/* ===== CSS VARIABLES ===== */
:root {
  --c1: #F1D500;
  --c2: #CFB700;
  --c3: #FADD00;
  --c4: #AD9900;
  --c5: #8B7B00;
  --c6: #695D00;
  --c3-alpha: rgba(250,221,0,0.12);
  --c5-alpha: rgba(139,123,0,0.10);
  --gold-soft: #fffbe0;
  --gold-wash: #fff8b8;
  --gold-ink: #2a2500;

  --text:       #241f00;
  --text-muted: #675d18;
  --text-light: #9b8e30;
  --bg:         #fffdf2;
  --border:     #eee4a5;
  --border-dark:#d8c75b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 4px rgba(105,93,0,.08);
  --shadow-md: 0 8px 22px rgba(105,93,0,.14);
  --shadow-lg: 0 14px 38px rgba(105,93,0,.16);
  --shadow-xl: 0 20px 60px rgba(105,93,0,.20);
  --lift-shadow: 0 14px 32px rgba(105,93,0,.18);
  --hover-fill: linear-gradient(90deg, rgba(250,221,0,.20), rgba(173,153,0,.10));

  --sidebar-w: 240px;
  --sidebar-collapsed-w: 64px;
  --topbar-h: 64px;
  --transition: all .22s cubic-bezier(.2,.8,.2,1);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ===== GLOBAL HOVER LIFT + FILL ===== */
:where(.card,.stat-card,.btn,.icon-btn,.topbar-user,.nav-item,.tab-btn,.user-card,.toast,.modal-close,.stat-card-hero,.login-card,.btn-login,.feature-item,.page-header,.table-wrap .data-table tr,.siswa-lap-card,.jurnal-mon-card,.attend-row,.progress,.input-group,.topbar-search,.form-control,.form-select) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
:where(.card,.stat-card,.btn,.icon-btn,.topbar-user,.nav-item,.tab-btn,.user-card,.toast,.modal-close,.stat-card-hero,.login-card,.btn-login,.feature-item,.page-header,.table-wrap .data-table tr,.siswa-lap-card,.jurnal-mon-card,.attend-row,.progress,.input-group,.topbar-search,.form-control,.form-select)::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--hover-fill);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .34s cubic-bezier(.2,.8,.2,1), opacity .22s ease;
  opacity: .9;
  pointer-events: none;
}
:where(.card,.stat-card,.btn,.icon-btn,.topbar-user,.nav-item,.tab-btn,.user-card,.toast,.modal-close,.stat-card-hero,.login-card,.btn-login,.feature-item,.page-header,.table-wrap .data-table tr,.siswa-lap-card,.jurnal-mon-card,.attend-row,.progress,.input-group,.topbar-search,.form-control,.form-select):hover::after {
  transform-origin: left center;
  transform: scaleX(1);
}
:where(.card,.stat-card,.btn,.icon-btn,.topbar-user,.nav-item,.tab-btn,.user-card,.toast,.modal-close,.stat-card-hero,.login-card,.btn-login,.feature-item) > * {
  position: relative;
  z-index: 1;
}
:where(.card,.stat-card,.btn,.icon-btn,.topbar-user,.tab-btn,.user-card,.toast,.modal-close,.stat-card-hero,.login-card,.btn-login,.feature-item):hover {
  transform: translateY(-4px);
  box-shadow: var(--lift-shadow);
}
:where(a,button,[onclick],[style*="cursor:pointer"]) {
  transition: var(--transition);
  background-image: linear-gradient(90deg, rgba(250,221,0,.18), rgba(105,93,0,.08));
  background-repeat: no-repeat;
  background-size: 0 100%;
  background-position: left center;
}
:where(a,button,[onclick],[style*="cursor:pointer"]):hover {
  background-size: 100% 100%;
  transform: translateY(-3px);
}

#userDropdown a,
#userDropdown button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  color: var(--text);
  background: white;
  border: none;
  text-align: left;
  font-size: 14px;
  transition: background .2s ease, color .2s ease;
}

#userDropdown a:hover,
#userDropdown button:hover,
#userDropdown a:focus,
#userDropdown button:focus,
#userDropdown a:active,
#userDropdown button:active {
  background: #1d4ed8;
  color: white;
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  width: 100%;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: white;
  border-radius: 12px;
  padding: 13px 14px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  border-left: 4px solid #9ca3af;
  animation: slideIn .3s cubic-bezier(.34,1.56,.64,1);
  transition: all .3s ease;
}
.toast-success { border-left-color: #22c55e; }
.toast-error   { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }
.toast-info    { border-left-color: var(--c5); }
.toast-icon    { font-size: 18px; flex-shrink: 0; }
.toast-body    { flex: 1; }
.toast-title   { font-size: 13px; font-weight: 700; }
.toast-msg     { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toast-out     { opacity: 0; transform: translateX(20px); }
@keyframes slideIn { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }

/* ===== APP SHELL ===== */
.app-shell { display: flex; min-height: 100vh; flex: 1; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #171300 0%, var(--c6) 55%, #2d2800 100%);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--c6), var(--c3));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(250,221,0,.34);
}
.sidebar-brand { flex: 1; overflow: hidden; }
.sidebar-brand .name { font-size: 13px; font-weight: 900; color: white; white-space: nowrap; }
.sidebar-brand .sub  { font-size: 10px; color: rgba(255,255,255,.4); white-space: nowrap; }
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-toggle { display: none; }

.sidebar-toggle {
  background: none; border: none; color: rgba(255,255,255,.4);
  cursor: pointer; font-size: 16px; padding: 4px;
  transition: var(--transition);
}
.sidebar-toggle:hover { color: white; }

/* NAV */
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 8px; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

.nav-section { margin-bottom: 4px; }
.nav-section-title {
  font-size: 9px; font-weight: 700; color: rgba(255,255,255,.25);
  text-transform: uppercase; letter-spacing: .12em;
  padding: 12px 10px 5px;
  white-space: nowrap; overflow: hidden;
  transition: var(--transition);
}
.sidebar.collapsed .nav-section-title { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.55);
  font-size: 13px; font-weight: 500;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(250,221,0,.12);
  color: rgba(255,255,255,.9);
  transform: translateY(-2px) translateX(2px);
}
.nav-item.active {
  background: rgba(250,221,0,.18);
  color: var(--c3);
  font-weight: 700;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--c3);
  border-radius: 0 3px 3px 0;
}
.nav-item .icon { font-size: 18px; flex-shrink: 0; }
.nav-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .badge {
  background: #ef4444; color: white;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
  flex-shrink: 0;
}
.sidebar.collapsed .nav-item .label,
.sidebar.collapsed .nav-item .badge { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 54px; top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.85);
  color: white;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 200;
}

/* SIDEBAR FOOTER */
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.user-card {
  display: flex; align-items: center; gap: 8px;
  padding: 10px; border-radius: 10px;
  background: rgba(255,255,255,.05);
}
.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--c6), var(--c3));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: white;
  flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-info .uname { font-size: 12px; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .urole { font-size: 10px; color: rgba(255,255,255,.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn {
  background: none; border: none; color: rgba(255,255,255,.3);
  cursor: pointer; font-size: 16px;
  transition: var(--transition); padding: 4px; flex-shrink: 0;
}
.logout-btn:hover { color: #ef4444; }
.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn { display: none; }
.sidebar.collapsed .user-card { justify-content: center; }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .3s cubic-bezier(.4,0,.2,1);
}
.main-content.sidebar-collapsed { margin-left: var(--sidebar-collapsed-w); }

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.topbar-breadcrumb .sep { opacity: .5; }
.topbar-breadcrumb .current { font-weight: 700; color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 7px 12px; width: 200px;
  transition: var(--transition);
}
.topbar-search:focus-within { border-color: var(--c4); background: white; box-shadow: 0 0 0 3px var(--c3-alpha); }
.topbar-search input { border: none; background: none; outline: none; font-size: 13px; width: 100%; font-family: inherit; }
.search-icon { color: var(--text-light); font-size: 14px; }
.icon-btn {
  width: 36px; height: 36px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px;
  transition: var(--transition); color: var(--text-muted);
  position: relative;
}
.icon-btn:hover { background: white; border-color: var(--c4); color: var(--c6); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; background: #ef4444; border-radius: 50%;
  border: 1.5px solid white;
}
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 5px 10px;
  border-radius: 10px; border: 1.5px solid var(--border);
  transition: var(--transition); background: var(--bg);
}
.topbar-user:hover { background: white; border-color: var(--c4); }
.avatar-sm {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: white; flex-shrink: 0;
}
.topbar-user .info .name { font-size: 12.5px; font-weight: 700; }
.topbar-user .info .role { font-size: 10px; color: var(--text-muted); }

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

.page-header { margin-bottom: 24px; }
.page-title { font-size: clamp(20px,3vw,26px); font-weight: 900; color: var(--text); margin-bottom: 4px; letter-spacing: 0; }
.page-desc  { font-size: 13.5px; color: var(--text-muted); }

/* ===== CARDS ===== */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}
.card:not(.no-hover):hover {
  box-shadow: var(--lift-shadow);
  transform: translateY(-4px);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.card-title  { font-size: 14.5px; font-weight: 700; color: var(--text); }
.card-body   { padding: 18px 20px; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--stat-color-1, var(--c2)), var(--stat-color-2, var(--c3)));
}
.stat-card:hover { box-shadow: var(--lift-shadow); transform: translateY(-5px); }
.stat-card.orange { --stat-color-1: var(--c2); --stat-color-2: var(--c3); }
.stat-card.teal   { --stat-color-1: var(--c4); --stat-color-2: var(--c6); }
.stat-card.green  { --stat-color-1: #16a34a; --stat-color-2: #22c55e; }
.stat-card.red    { --stat-color-1: #dc2626; --stat-color-2: #ef4444; }
.stat-card.blue   { --stat-color-1: #1d4ed8; --stat-color-2: #3b82f6; }
.stat-card.purple { --stat-color-1: #7c3aed; --stat-color-2: #a855f7; }

.top-row   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-icon {
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-trend { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.stat-trend.up      { background: rgba(34,197,94,.1);  color: #16a34a; }
.stat-trend.down    { background: rgba(239,68,68,.1);   color: #dc2626; }
.stat-trend.neutral { background: rgba(0,0,0,.06);     color: var(--text-muted); }
.stat-value { font-size: 30px; font-weight: 900; color: var(--text); line-height: 1; letter-spacing: 0; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }
.stat-sub   { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(0,0,0,.04);
  vertical-align: middle;
}
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: rgba(250,221,0,.10); transform: translateY(-1px); box-shadow: inset 4px 0 0 var(--c3); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  white-space: nowrap;
}
.badge.success { background: rgba(34,197,94,.12);  color: #16a34a; }
.badge.warning { background: rgba(245,158,11,.12); color: #d97706; }
.badge.danger  { background: rgba(239,68,68,.12);  color: #dc2626; }
.badge.info    { background: rgba(59,130,246,.12); color: #1d4ed8; }
.badge.teal    { background: rgba(139,123,0,.12);  color: var(--c6); }
.badge.orange  { background: rgba(250,221,0,.18); color: var(--c6); }
.badge.muted   { background: rgba(0,0,0,.06);      color: var(--text-muted); }
.badge.blue    { background: rgba(59,130,246,.12); color: #1d4ed8; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 9px;
  font-family: inherit;
  font-size: 13.5px; font-weight: 700;
  cursor: pointer; border: none;
  transition: var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.btn-primary { background: linear-gradient(135deg,var(--c6),var(--c4) 48%,var(--c3)); color: #fffbe7; box-shadow: 0 3px 14px rgba(105,93,0,.28); }
.btn-primary:hover { transform: translateY(-4px); box-shadow: var(--lift-shadow); }

.btn-teal { background: linear-gradient(135deg,var(--c5),var(--c3)); color: var(--gold-ink); box-shadow: 0 3px 14px rgba(139,123,0,.22); }
.btn-teal:hover { transform: translateY(-4px); box-shadow: var(--lift-shadow); }

.btn-outline { background: white; border: 1.5px solid var(--border); color: var(--text-muted); }
.btn-outline:hover { border-color: var(--c4); color: var(--c6); background: var(--gold-soft); transform: translateY(-4px); }

.btn-ghost { background: none; border: none; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger-outline { background: white; border: 1.5px solid rgba(239,68,68,.3); color: #dc2626; }
.btn-danger-outline:hover { background: rgba(239,68,68,.06); border-color: #ef4444; transform: translateY(-1px); }

.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-xs { padding: 4px 10px; font-size: 11.5px; border-radius: 7px; }

/* Tab buttons */
.tab-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer; border: none;
  transition: var(--transition);
  background: transparent; color: var(--text-muted);
}
.tab-btn:hover { background: rgba(0,0,0,.05); color: var(--text); }
.tab-btn.active { background: white; color: var(--c2); font-weight: 700; box-shadow: var(--shadow-sm); }
.tab-btn .count { background: rgba(0,0,0,.08); font-size: 10px; padding: 1px 6px; border-radius: 10px; }
.tab-nav { display: flex; gap: 3px; background: var(--bg); border-radius: 10px; padding: 4px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 11.5px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 6px;
}
.form-label.required::after { content: ' *'; color: #ef4444; }
.form-hint { font-size: 11px; color: var(--text-light); margin-top: 5px; }

.form-control {
  width: 100%; padding: 11px 14px;
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 13.5px;
  outline: none; transition: var(--transition);
}
.form-control:focus { border-color: var(--c4); box-shadow: 0 0 0 3px var(--c3-alpha); transform: translateY(-2px); }
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group .form-control { padding-left: 40px; }
.input-addon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-light); font-size: 15px; pointer-events: none;
  z-index: 1;
}

/* ===== PROGRESS ===== */
.progress { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; transition: transform .24s ease, box-shadow .24s ease; }
.progress:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.progress-bar { height: 100%; border-radius: 3px; transition: width .65s ease, transform .24s ease, box-shadow .24s ease; transform-origin: left center; }
.progress:hover .progress-bar { transform: scaleY(1.08); box-shadow: 0 8px 18px rgba(0,0,0,.08); }
.progress-bar.orange { background: linear-gradient(90deg,var(--c2),var(--c3)); }
.progress-bar.teal   { background: linear-gradient(90deg,var(--c5),var(--c3)); }
.progress-bar.green  { background: linear-gradient(90deg,#16a34a,#22c55e); }

.link-button { all: unset; cursor: pointer; color: var(--c4); font-weight: 700; text-decoration: underline; }
.link-button:hover { color: var(--c5); }

/* =========================================
   MODERN FULL PROGRESS INPUT EFFECT
========================================= */

input:not([type="hidden"]),
textarea,
select {
    background-color: white;
    background-image: linear-gradient(90deg, var(--c4), var(--c5));
    background-repeat: no-repeat;
    background-size: 0% 100%;
    background-position: left center;
    color: var(--text);
    transition: background-size .38s ease, transform .24s ease, box-shadow .24s ease, border-color .24s ease, color .24s ease;
}

input:not([type="hidden"]):hover,
textarea:hover,
select:hover,
input:not([type="hidden"]):focus,
textarea:focus,
select:focus,
input:not([type="hidden"]):active,
textarea:active,
select:active {
    background-size: 100% 100%;
    color: white;
    transform: translateY(-2px);
    border-color: rgba(139,123,0,.6);
    box-shadow: 0 14px 32px rgba(105,93,0,.14);
}

option {
    background: white;
    color: var(--text);
    padding: 8px;
}

input::placeholder,
textarea::placeholder {
    transition: color .25s ease;
}

input:hover::placeholder,
textarea:hover::placeholder,
input:focus::placeholder,
textarea:focus::placeholder {
    color: rgba(255,255,255,.75);
}

/* ===== MODAL ===== */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  z-index: 500; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: white; border-radius: var(--radius-xl);
  width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn { from { opacity:0; transform:scale(.9) translateY(20px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title  { font-size: 16px; font-weight: 700; }
.modal-close  {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  transition: var(--transition);
}
.modal-close:hover { background: white; border-color: #ef4444; color: #ef4444; }
.modal-body   { padding: 20px 24px; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 48px 20px;
}
.empty-icon  { font-size: 48px; margin-bottom: 14px; opacity: .7; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.empty-desc  { font-size: 13px; color: var(--text-light); }

/* ===== SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== MISC ===== */
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes spin   { to { transform: rotate(360deg); } }

/* ===== MOBILE SIDEBAR ===== */
.sidebar.mobile-open { transform: translateX(0) !important; }

/* ===== PRINT ===== */
@media print {
  .sidebar, .topbar, .btn, #toast-container { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .topbar-search { display: none; }
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    width: var(--sidebar-w) !important;
  }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 20px 16px 30px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .topbar { padding: 0 16px; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  .topbar-user .info { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px 12px 24px; }
  .modal { border-radius: var(--radius-lg); }
}
