/* ============================================================
   SMK VETERAN 1 SUKOHARJO — INVENTARIS BARANG
   Style Sheet — Professional School Theme
   ============================================================ */

/* ---- VARIABLES & RESET ---- */
:root {
  --primary: #1a237e;       /* Deep Navy - Identitas SMK */
  --primary-dark: #0d1657;
  --primary-light: #3949ab;
  --accent: #d32f2f;         /* Merah Veteran */
  --accent-light: #ef5350;
  --gold: #f9a825;           /* Emas - Aksen */
  --success: #2e7d32;
  --success-light: #43a047;
  --warning: #e65100;
  --warning-light: #fb8c00;
  --danger: #b71c1c;
  --danger-light: #e53935;

  --bg-main: #f0f2f8;
  --bg-card: #ffffff;
  --bg-sidebar: #0d1657;
  --bg-topbar: #ffffff;

  --text-primary: #1a1f36;
  --text-secondary: #5a6072;
  --text-muted: #9aa0b4;
  --text-white: #ffffff;
  --text-sidebar: #c5cae9;

  --border: #e1e4ed;
  --border-light: #f0f2f8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(26,35,126,0.10);
  --shadow-lg: 0 8px 32px rgba(26,35,126,0.15);

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --font: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); border: none; outline: none; }
input, select, textarea { font-family: var(--font); }
table { border-collapse: collapse; width: 100%; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--border-light); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(0,0,0,0.2);
}

/* Decorative gradient overlay */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(135deg, rgba(211,47,47,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.school-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(211,47,47,0.4);
}

.school-info {
  display: flex;
  flex-direction: column;
}

.school-name {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

.school-sub {
  font-size: 10px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-close {
  display: none;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text-sidebar);
  width: 30px; height: 30px;
  border-radius: 6px;
  font-size: 14px;
  align-items: center;
  justify-content: center;
}

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

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 12px 20px 6px;
}

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

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-item span { flex: 1; }

.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(211,47,47,0.3) 0%, rgba(211,47,47,0.05) 100%);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-sidebar);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #9e9e9e;
  flex-shrink: 0;
  animation: pulse-status 2s infinite;
}

.status-dot.connected { background: #4caf50; }
.status-dot.disconnected { background: var(--accent); animation: none; }

@keyframes pulse-status {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  display: none;
  align-items: center;
  justify-content: center;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.breadcrumb-root { color: var(--text-muted); }
.breadcrumb-root + i { color: var(--text-muted); font-size: 10px; }
.breadcrumb-current { font-weight: 700; color: var(--primary); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

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

.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.user-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================================
   PAGES
   ============================================================ */
.page {
  display: none;
  padding: 28px 28px 40px;
  flex: 1;
  animation: fadeIn 0.3s ease;
}

.page.active { display: block; }

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

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

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

.page-title i {
  color: var(--primary-light);
  margin-right: 8px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

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

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-blue .stat-icon { background: rgba(26,35,126,0.1); color: var(--primary); }
.stat-green .stat-icon { background: rgba(46,125,50,0.1); color: var(--success); }
.stat-yellow .stat-icon { background: rgba(230,81,0,0.12); color: var(--warning); }
.stat-red .stat-icon { background: rgba(183,28,28,0.1); color: var(--danger); }

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

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

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

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

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

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

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

.card-header h3 i {
  color: var(--primary-light);
  margin-right: 8px;
}

.card-link {
  font-size: 12px;
  color: var(--primary-light);
  font-weight: 600;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.qa-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition);
}

.qa-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.qa-btn i {
  font-size: 16px;
  color: var(--primary-light);
  transition: color var(--transition);
}

.qa-btn:hover i { color: #fff; }

/* Location List */
.location-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.location-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.location-row .loc-name { color: var(--text-primary); font-weight: 500; }
.location-row .loc-count {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.loading-placeholder {
  color: var(--text-muted);
  font-size: 13px;
  padding: 10px;
  text-align: center;
}

/* Mini table */
.mini-table { font-size: 13px; }
.mini-table th { font-size: 12px; }

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

.search-box {
  flex: 1;
  min-width: 220px;
  max-width: 380px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 9px 36px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(57,73,171,0.1);
}

#searchClear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

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

.btn-print:hover { background: var(--success); border-color: var(--success); }

/* ============================================================
   TABLE
   ============================================================ */
.table-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pg-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: var(--bg-main);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.pg-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pg-info { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  font-size: 13px;
}

.data-table th {
  background: var(--primary);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table th.th-center,
.data-table th.th-no,
.data-table th.th-num { text-align: center; }

.data-table .th-sub th {
  background: #283593;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
}

.cond-baik { border-bottom: 2px solid #4caf50 !important; }
.cond-ringan { border-bottom: 2px solid var(--gold) !important; }
.cond-berat { border-bottom: 2px solid var(--accent-light) !important; }

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td {
  background: rgba(57,73,171,0.04);
}

.data-table tbody tr:nth-child(even) td {
  background: #fafbff;
}

.data-table tbody tr:nth-child(even):hover td {
  background: rgba(57,73,171,0.06);
}

/* Kondisi badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-ya-baik { background: #e8f5e9; color: #2e7d32; }
.badge-ya-ringan { background: #fff3e0; color: #e65100; }
.badge-ya-berat { background: #ffebee; color: #b71c1c; }
.badge-tidak { background: #f5f5f5; color: #9e9e9e; }

/* Action buttons */
.action-btns {
  display: flex;
  gap: 5px;
  align-items: center;
}

.act-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.act-btn-edit {
  background: rgba(26,35,126,0.08);
  color: var(--primary);
  border-color: rgba(26,35,126,0.15);
}

.act-btn-edit:hover { background: var(--primary); color: #fff; }

.act-btn-delete {
  background: rgba(183,28,28,0.08);
  color: var(--danger);
  border-color: rgba(183,28,28,0.15);
}

.act-btn-delete:hover { background: var(--danger); color: #fff; }

/* Empty row */
.empty-row {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
  font-size: 13px;
}

.empty-row i { margin-right: 6px; }

/* Kode styling */
.kode-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  background: rgba(26,35,126,0.06);
  padding: 3px 8px;
  border-radius: 5px;
  display: inline-block;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(26,35,126,0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26,35,126,0.35);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: var(--bg-main);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover { background: var(--border); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

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

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger:hover { background: var(--accent); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,15,40,0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

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

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.modal-header-danger {
  background: linear-gradient(90deg, var(--danger), var(--accent-light));
}

.modal-close {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.modal-close:hover { background: rgba(255,255,255,0.25); }

.modal-body { padding: 24px; }

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

/* ============================================================
   FORM
   ============================================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-row > .form-group { margin-bottom: 0; }

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.req { color: var(--accent); }
.opt-tag {
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(57,73,171,0.1);
}

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

/* Kondisi Group */
.kondisi-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kondisi-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

.cond-baik-label:hover { border-color: #4caf50; }
.cond-ringan-label:hover { border-color: var(--gold); }
.cond-berat-label:hover { border-color: var(--accent); }

.kondisi-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cond-baik-label .kondisi-name i { color: #4caf50; }
.cond-ringan-label .kondisi-name i { color: var(--gold); }
.cond-berat-label .kondisi-name i { color: var(--accent); }

.toggle-group {
  display: flex;
  gap: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
}

.radio-option input { cursor: pointer; accent-color: var(--primary); }

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input { flex: 1; }

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

.settings-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.settings-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.settings-card h3 i { color: var(--primary-light); margin-right: 8px; }

.test-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
}

.test-result.success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; display: block; }
.test-result.error { background: #ffebee; color: #b71c1c; border: 1px solid #ffcdd2; display: block; }

.info-list { display: flex; flex-direction: column; gap: 12px; }

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.info-row span { color: var(--text-secondary); }
.info-row strong { color: var(--text-primary); }

/* ============================================================
   TUTORIAL
   ============================================================ */
.tutorial-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tutorial-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.tutorial-section h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tutorial-section h2 .step-num {
  background: var(--primary);
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.tutorial-section p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.tutorial-section ol, .tutorial-section ul {
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 2;
}

.code-block {
  background: #0d1657;
  color: #c5cae9;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  overflow-x: auto;
  margin: 12px 0;
  border-left: 3px solid var(--accent);
}

.code-block .cmt { color: #546e7a; }
.code-block .key { color: var(--gold); }
.code-block .str { color: #80cbc4; }
.code-block .url { color: #90caf9; text-decoration: underline; cursor: pointer; }

.alert-box {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin: 10px 0;
}

.alert-warning { background: #fff8e1; border: 1px solid #ffe082; color: #e65100; }
.alert-info { background: #e3f2fd; border: 1px solid #90caf9; color: #1565c0; }
.alert-success { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; }
.alert-box i { margin-top: 1px; flex-shrink: 0; }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  font-size: 13px;
}

.toast-success { border-left-color: #4caf50; }
.toast-error { border-left-color: var(--accent); }
.toast-info { border-left-color: var(--primary-light); }

.toast-icon { font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.toast-success .toast-icon { color: #4caf50; }
.toast-error .toast-icon { color: var(--accent); }
.toast-info .toast-icon { color: var(--primary-light); }

.toast-msg { flex: 1; font-size: 13px; color: var(--text-primary); line-height: 1.5; }

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

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,15,40,0.5);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}

.loading-overlay.show { display: flex; }

.loading-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.loading-spinner {
  width: 42px; height: 42px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}

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

.loading-box p {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================================
   DELETE CONFIRM
   ============================================================ */
.delete-confirm-text {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.delete-item-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  background: var(--bg-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   PRINT STYLES — Kop Surat SMK VETERAN 1 SUKOHARJO
   ============================================================ */

/* Sembunyikan elemen print saat di layar biasa */
@media screen {
  .print-kop-header,
  .print-doc-title,
  .print-doc-meta,
  .print-footer,
  [id^="printAllTable-"] {
    display: none !important;
  }
}
@media print {
  /* === SEMBUNYIKAN ELEMEN UI === */
  .sidebar, .topbar, .toolbar, .filter-bar,
  .table-info-bar, .pagination-controls,
  .btn-primary, .btn-secondary, .btn-outline,
  .btn-icon, .btn-print, .action-btns,
  .modal-overlay, .loading-overlay, .toast-container,
  .login-overlay, .jurusan-overlay, .sidebar-overlay,
  .page-header .btn-primary, .page-header .btn-outline,
  .quick-actions, .stats-grid, .dashboard-grid,
  .page:not(.active), .nav-badge,
  .page-header,
  .th-action, td:last-child { /* sembunyikan kolom Aksi */
    display: none !important;
  }

  /* === LAYOUT RESET === */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
  html, body { background: #fff !important; margin: 0; padding: 0; }
  .main-wrapper { margin-left: 0 !important; padding: 0 !important; }
  .page.active { padding: 0 !important; display: block !important; }

  /* === KOP SURAT HEADER === */
  .print-kop-header {
    display: flex !important;
    align-items: center;
    border-bottom: 3px solid #000;
    padding-bottom: 8px;
    margin-bottom: 12px;
    width: 100%;
    gap: 16px;
  }
  .print-kop-logo {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  .print-kop-logo img {
    width: 72px;
    height: 72px;
    object-fit: contain;
  }
  .print-kop-text {
    flex: 1;
    text-align: center;
    line-height: 1.3;
    font-family: Arial, sans-serif;
    color: #000 !important;
  }
  .print-kop-yayasan {
    font-size: 10pt;
    font-weight: normal;
  }
  .print-kop-sekolah {
    font-size: 16pt;
    font-weight: bold;
    letter-spacing: 0.5px;
  }
  .print-kop-alamat {
    font-size: 9pt;
    font-weight: normal;
  }
  .print-kop-email {
    font-size: 9pt;
    font-weight: normal;
  }
  .print-doc-title {
    display: block !important;
    text-align: center;
    font-size: 11pt;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: underline;
    margin: 8px 0 10px;
    font-family: Arial, sans-serif;
    letter-spacing: 0.5px;
    color: #000 !important;
  }
  .print-doc-meta {
    display: flex !important;
    justify-content: space-between;
    font-size: 8.5pt;
    color: #000 !important;
    margin-bottom: 8px;
    font-family: Arial, sans-serif;
  }

  /* === TABEL === */
  .table-container, .table-wrapper {
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
    width: 100% !important;
  }
  .data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 7.5pt !important;
    font-family: Arial, sans-serif !important;
    table-layout: fixed !important;
    page-break-inside: auto !important;
  }
  .data-table thead { display: table-header-group !important; }
  .data-table tr { page-break-inside: avoid !important; }
  .data-table th {
    background: #1a237e !important;
    color: #fff !important;
    padding: 5px 4px !important;
    font-size: 7pt !important;
    text-align: center !important;
    border: 1px solid #999 !important;
    font-weight: bold !important;
    word-wrap: break-word !important;
    white-space: normal !important;
  }
  .data-table td {
    padding: 4px 4px !important;
    border: 1px solid #bbb !important;
    font-size: 7.5pt !important;
    vertical-align: middle !important;
    word-wrap: break-word !important;
    white-space: normal !important;
    overflow: hidden !important;
    color: #000 !important;
    background: #fff !important;
  }
  .data-table tr:nth-child(even) td {
    background: #f5f5f5 !important;
  }

  /* === KOLOM LEBAR PROPORSIONAL === */
  .data-table .th-no, .data-table td:nth-child(1)  { width: 3% !important; }
  .data-table td:nth-child(2)  { width: 7% !important; }   /* Kode */
  .data-table td:nth-child(3)  { width: 5% !important; }   /* Jenis */
  .data-table td:nth-child(4)  { width: 18% !important; }  /* Nama */
  .data-table td:nth-child(5)  { width: 4% !important; }   /* Jml */
  .data-table td:nth-child(6)  { width: 5% !important; }   /* Satuan */
  .data-table td:nth-child(7)  { width: 4% !important; }   /* Baik */
  .data-table td:nth-child(8)  { width: 5% !important; }   /* Rusak Ringan */
  .data-table td:nth-child(9)  { width: 5% !important; }   /* Rusak Berat */
  .data-table td:nth-child(10) { width: 11% !important; }  /* Sumber Dana */
  .data-table td:nth-child(11) { width: 7% !important; }   /* Tgl */
  .data-table td:nth-child(12) { width: 11% !important; }  /* Lokasi */
  .data-table td:nth-child(13) { width: 11% !important; }  /* Keterangan */
  .data-table td:nth-child(14) { width: 4% !important; }   /* Foto */

  /* Sembunyikan badge/status icons pada sel */
  .badge, .tag-alat, .tag-bahan,
  .kondisi-baik, .kondisi-ringan, .kondisi-berat {
    background: none !important;
    color: #000 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 7.5pt !important;
    box-shadow: none !important;
  }
  /* Foto: tampilkan sebagai tanda centang atau URL kecil */
  .foto-thumb { width: 24px !important; height: 24px !important; }

  /* === EMPTY STATE === */
  .empty-row td { text-align: center; padding: 20px !important; color: #666 !important; }

  /* === PAGE SETUP === */
  @page {
    size: A4 landscape;
    margin: 10mm 12mm 12mm 12mm;
  }

  /* === FOOTER PRINT === */
  .print-footer {
    display: block !important;
    margin-top: 14px;
    font-family: Arial, sans-serif;
    font-size: 8.5pt;
    color: #000 !important;
  }
  .print-footer-ttd {
    display: flex !important;
    justify-content: flex-end;
    gap: 60px;
    margin-top: 8px;
  }
  .print-ttd-box {
    text-align: center;
    font-size: 8.5pt;
  }
  .print-ttd-box .ttd-space {
    height: 48px;
    display: block;
  }
}

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

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }

  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: flex; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; display: none; }
  .sidebar-overlay.show { display: block; }

  .page { padding: 16px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .kondisi-group { gap: 8px; }
  .kondisi-item { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 14px; }
  .page { padding: 12px 14px; }
  .quick-actions { grid-template-columns: 1fr; }
  .toast-container { left: 16px; right: 16px; max-width: unset; }
  .page-header { flex-direction: column; }
  .page-header .btn-primary { width: 100%; justify-content: center; }
  .user-label { display: none; }
  .topbar-time { display: none; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 14px; }
}

/* ============================================================
   TAMBAHAN v2.0 — Jurusan Overlay, Folder, QR Code
   ============================================================ */

/* ---- JURUSAN OVERLAY ---- */
.jurusan-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  display: none; align-items: center; justify-content: center;
  overflow-y: auto; padding: 24px;
}
.jurusan-overlay.open { display: flex; }

.jurusan-modal {
  background: var(--bg-card); border-radius: 20px;
  padding: 36px; max-width: 680px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}

.jurusan-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.logo-icon-big {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; flex-shrink: 0;
}
.jurusan-header h1 { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.jurusan-header p  { font-size: 13px; color: var(--text-secondary); }

.jurusan-step h2   { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.step-desc         { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.hidden            { display: none !important; }

.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary); background: none; border: none;
  padding: 0; margin-bottom: 16px; cursor: pointer;
  transition: color var(--transition);
}
.back-btn:hover { color: var(--primary); }

/* Jenis Grid */
.jenis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.jenis-card {
  border: 2px solid var(--border); border-radius: 14px; padding: 28px 20px;
  background: var(--bg-main); cursor: pointer; text-align: center;
  transition: all var(--transition); display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.jenis-card:hover { border-color: var(--primary); background: #eef0fb; transform: translateY(-2px); }
.jenis-icon { font-size: 32px; color: var(--primary); }
.jenis-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.jenis-sub   { font-size: 12px; color: var(--text-secondary); }

/* Jurusan Grid */
.jurusan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.jurusan-card {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 16px;
  background: var(--bg-main); cursor: pointer; text-align: left;
  transition: all var(--transition); display: flex; flex-direction: column; gap: 6px;
}
.jurusan-card:hover { border-color: var(--primary); background: #eef0fb; transform: translateY(-1px); }
.jurusan-icon { font-size: 22px; color: var(--primary); }
.jurusan-nama { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.jurusan-sub  { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* Folder Step */
.folder-selected-info { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.folder-form label    { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.folder-form input    { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-family: var(--font); font-size: 14px; margin-bottom: 8px; }
.folder-form input:focus { outline: none; border-color: var(--primary); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; display: flex; align-items: flex-start; gap: 6px; }
.btn-full  { width: 100%; justify-content: center; }

.existing-label       { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 600; }
.existing-folder-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.existing-folder-btn  {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1.5px solid var(--primary-light); border-radius: 20px; background: #eef0fb;
  color: var(--primary); font-size: 12px; font-family: var(--font); cursor: pointer;
  transition: all var(--transition);
}
.existing-folder-btn:hover { background: var(--primary); color: #fff; }

/* ---- CONTEXT BADGES ---- */
.ctx-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.ctx-jenis-alat   { background: #e3f2fd; color: #0d47a1; }
.ctx-jenis-bahan  { background: #fff3e0; color: #e65100; }
.ctx-jurusan      { background: #f3e5f5; color: #6a1b9a; }
.ctx-folder       { background: #fff8e1; color: #f57f17; }

/* Sidebar context panel */
.sidebar-context { padding: 10px 16px; }
.ctx-panel { background: rgba(255,255,255,0.07); border-radius: 8px; padding: 10px 12px; }
.ctx-row    { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sidebar); font-weight: 600; }
.ctx-row-sub { font-size: 11px; color: rgba(197,202,233,0.7); margin-top: 3px; }
.ctx-dot { width: 8px; height: 8px; border-radius: 50%; }
.ctx-alat  { background: #64b5f6; }
.ctx-bahan { background: #ffb74d; }

.btn-ganti-jurusan {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 12px; margin-bottom: 10px; border-radius: 8px;
  background: rgba(255,255,255,0.1); color: var(--text-sidebar); font-size: 12px;
  font-family: var(--font); border: 1px solid rgba(255,255,255,0.15);
  transition: all var(--transition); cursor: pointer;
}
.btn-ganti-jurusan:hover { background: rgba(255,255,255,0.2); }

/* Topbar context badge */
.topbar-ctx-badge { }
.topbar-context-badge .topbar-ctx-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-secondary); background: var(--bg-main);
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border);
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- FILTER BAR ---- */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.filter-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.filter-btn {
  padding: 5px 14px; border-radius: 20px; font-size: 12px; font-family: var(--font);
  border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition); display: inline-flex; align-items: center; gap: 5px;
}
.filter-btn:hover  { border-color: var(--primary-light); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- JENIS BADGE IN TABLE ---- */
.jenis-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
}
.jenis-badge.jenis-alat   { background: #e3f2fd; color: #0d47a1; }
.jenis-badge.jenis-bahan  { background: #fff3e0; color: #e65100; }

/* ---- QR MANAGER PAGE ---- */
.qr-jurusan-group { margin-bottom: 28px; }
.qr-group-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.qr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

.qr-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-sm); transition: box-shadow var(--transition);
}
.qr-card:hover { box-shadow: var(--shadow-md); }

.qr-card-header { display: flex; flex-direction: column; gap: 4px; }
.qr-card-jenis  { font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.qr-jenis-alat  { color: #0d47a1; }
.qr-jenis-bahan { color: #e65100; }
.qr-card-nama   { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.qr-card-qr { display: flex; justify-content: center; align-items: center; min-height: 90px; }
.qr-card-qr img, .qr-card-qr canvas { border-radius: 6px; }

.qr-card-actions { display: flex; gap: 8px; }
.btn-sm {
  flex: 1; padding: 6px 8px; border-radius: 6px; font-size: 11px; font-family: var(--font);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: all var(--transition);
}
.btn-sm.btn-primary { background: var(--primary); color: #fff; border: none; }
.btn-sm.btn-primary:hover { background: var(--primary-light); }
.btn-sm.btn-outline { background: none; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-sm.btn-outline:hover { background: var(--primary); color: #fff; }

.empty-qr { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-qr i { font-size: 48px; display: block; margin-bottom: 12px; opacity: 0.4; }

/* ---- QR MODAL ---- */
.modal-qr .qr-modal-body { text-align: center; }
.qr-info-section  { margin-bottom: 16px; }
.qr-folder-name   { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.qr-meta          { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.qr-canvas-wrap   { display: flex; justify-content: center; margin: 16px 0; }
.qr-canvas-wrap canvas, .qr-canvas-wrap img { border-radius: 10px; border: 4px solid var(--primary); }
.qr-hint   { font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.qr-url-box {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary);
  background: var(--bg-main); padding: 8px 12px; border-radius: 6px;
  word-break: break-all; margin-bottom: 16px; text-align: left;
}
.qr-actions { display: flex; gap: 10px; justify-content: center; }

/* ---- FORM CONTEXT INFO ---- */
.form-context-info {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
  padding: 10px; background: var(--bg-main); border-radius: 8px;
}

/* ---- AKSI QR di table ---- */
.act-btn-qr { color: var(--primary-light) !important; }
.act-btn-qr:hover { background: #eef0fb !important; }

@media (max-width: 640px) {
  .jenis-grid   { grid-template-columns: 1fr; }
  .jurusan-grid { grid-template-columns: 1fr; }
  .qr-cards     { grid-template-columns: 1fr 1fr; }
  .jurusan-modal { padding: 20px; }
}
/* ============================================================
   LOGIN OVERLAY — KODE ADMIN
   ============================================================ */
.login-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  display: none; align-items: center; justify-content: center;
  overflow-y: auto; padding: 24px;
}
.login-overlay.open { display: flex; }

.login-modal {
  background: var(--bg-card); border-radius: 20px;
  padding: 40px; max-width: 460px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  display: flex; flex-direction: column; gap: 24px;
}

.login-logo {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.login-logo-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 24px; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(26,35,126,0.4);
}
.login-logo h1 { font-size: 17px; font-weight: 800; color: var(--primary); margin-bottom: 3px; }
.login-logo p  { font-size: 12px; color: var(--text-secondary); }

.login-form-box h2 {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 6px; display: flex; align-items: center; gap: 8px;
}
.login-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }

.login-input-wrap {
  display: flex; gap: 10px; align-items: center;
}
.login-input-wrap input {
  flex: 1; padding: 12px 16px; border: 2px solid var(--border);
  border-radius: var(--radius); font-family: var(--font); font-size: 15px;
  letter-spacing: 2px; transition: border-color var(--transition);
}
.login-input-wrap input:focus { outline: none; border-color: var(--primary); }
.login-btn { padding: 12px 20px; white-space: nowrap; border-radius: var(--radius); font-size: 14px; }

.login-error {
  margin-top: 10px; font-size: 13px; color: var(--danger);
  font-weight: 600; min-height: 18px;
}

.login-footer {
  text-align: center; font-size: 12px; color: var(--text-muted);
  padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.input-shake { animation: shake 0.4s ease; }

/* ============================================================
   DASHBOARD EMPTY STATE
   ============================================================ */
.dashboard-empty-state {
  text-align: center;
  padding: 60px 40px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  box-shadow: var(--shadow-sm);
}

.empty-state-icon {
  font-size: 56px;
  color: var(--primary-light);
  opacity: 0.5;
  margin-bottom: 20px;
}

.dashboard-empty-state h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.dashboard-empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ============================================================
   SETUP PANEL DI HALAMAN PILIH KONTEKS
   ============================================================ */
.setup-panel {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 32px;
  box-shadow: var(--shadow-md); margin-bottom: 24px;
}

.setup-header {
  text-align: center; margin-bottom: 28px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.setup-header i {
  font-size: 36px; color: var(--primary); display: block; margin-bottom: 12px;
}
.setup-header h2 { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.setup-header p  { font-size: 13px; color: var(--text-secondary); }

.setup-step { margin-bottom: 8px; }

.setup-step-title {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; font-size: 15px; color: var(--text-primary);
}
.setup-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.setup-back-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-secondary); background: none;
  border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 12px; cursor: pointer; transition: all var(--transition);
  font-family: var(--font);
}
.setup-back-btn:hover { color: var(--primary); border-color: var(--primary); }

.setup-selected-info { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* Sheet form */
.sheet-form label { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.sheet-form input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-family: var(--font); font-size: 14px; margin-bottom: 8px;
}
.sheet-form input:focus { outline: none; border-color: var(--primary); }
.sheet-existing { margin-bottom: 12px; }

/* Jurusan overlay — sembunyikan (sudah dipindah ke dashboard) */
.jurusan-overlay { display: none !important; }

@media (max-width: 640px) {
  .setup-panel { padding: 20px; }
  .login-input-wrap { flex-direction: column; }
  .login-btn { width: 100%; justify-content: center; }
}
/* ============================================================
   TAMBAHAN v4 — JURUSAN TERPISAH, DASHBOARD LANGSUNG
   ============================================================ */

/* Jurusan stat list di dashboard */
.jurusan-stat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.jurusan-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: background var(--transition);
}

.jurusan-stat-row:hover {
  background: var(--border-light);
}

.jurusan-stat-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.jurusan-stat-label {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
}

.jurusan-stat-count {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}

/* Context badge di form */
.ctx-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.ctx-jurusan {
  background: rgba(26,35,126,0.1);
  color: var(--primary);
  border: 1px solid rgba(26,35,126,0.2);
}

/* QR Card */
.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.qr-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.qr-card-header {
  padding: 14px 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qr-card-nama {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.qr-placeholder {
  width: 100px; height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 6px 14px !important;
  font-size: 12px !important;
}

/* Connection status box di settings */
.conn-status-box {
  background: var(--bg-main);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.conn-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* Hide old elements */
#dashboardEmptyState { display: none !important; }
#setupPanel { display: none !important; }

/* Quick actions 4 columns for dashboard jurusan shortcuts */
.dashboard-card .quick-actions {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .dashboard-card .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .jurusan-stat-row { padding: 6px 8px; }
  .qr-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 480px) {
  .dashboard-card .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* jurusan banner di halaman data */
.jurusan-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}
.jurusan-banner i { font-size: 16px; flex-shrink: 0; }
.jurusan-banner strong { color: var(--text-primary); }
.jurusan-stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
  margin-left: 0;
}
/* ============================================================
   FOTO UPLOAD STYLES — v2.1
   ============================================================ */

/* Modal lebih lebar untuk form foto */
.modal-lg {
  max-width: 720px;
  width: 95%;
}

/* Dropzone area */
.foto-upload-area {
  margin-top: 4px;
}

.foto-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-main);
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.foto-dropzone:hover,
.foto-dropzone.dragover {
  border-color: var(--primary-light);
  background: #e8eaf620;
}

.foto-dropzone.dragover {
  background: #e8eaf640;
  transform: scale(1.01);
}

.foto-upload-icon {
  font-size: 36px;
  color: var(--primary-light);
  opacity: 0.7;
  margin-bottom: 10px;
  display: block;
}

.foto-upload-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.foto-upload-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Preview foto */
.foto-preview-wrap {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.foto-preview-img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: block;
}

.foto-preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Progress bar */
.foto-progress {
  margin-top: 8px;
}

.foto-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.foto-progress-fill {
  height: 100%;
  background: var(--primary-light);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.foto-progress-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* Thumbnail foto di tabel */
.foto-thumb-link {
  display: inline-block;
  line-height: 0;
}

.foto-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.foto-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.foto-no {
  color: var(--text-muted);
  font-size: 13px;
}

/* Btn-sm helper */
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-danger.btn-sm {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}

.btn-danger.btn-sm:hover {
  background: var(--danger-light);
}

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

.btn-outline.btn-sm:hover {
  background: var(--primary);
  color: #fff;
}

/* Responsif foto preview */
@media (max-width: 600px) {
  .foto-preview-img {
    max-height: 140px;
  }
  .foto-dropzone {
    padding: 20px 12px;
  }
  .foto-upload-icon {
    font-size: 28px;
  }
}

/* ============================================================
   LOGO IMAGES — sidebar, topbar, login
   ============================================================ */
.login-logo-img {
  width: 56px; height: 56px;
  object-fit: contain; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
}
.login-logo-fallback { font-size: 28px; display: flex; align-items: center; justify-content: center; }
.sidebar-logo-img {
  width: 28px; height: 28px;
  object-fit: contain; border-radius: 4px;
}
.sidebar-logo-fallback { font-size: 16px; display: flex; align-items: center; justify-content: center; }
.topbar-logo-img {
  width: 28px; height: 28px;
  object-fit: contain; border-radius: 4px;
}

/* ============================================================
   IMPORT MODAL STYLES
   ============================================================ */
.import-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-main);
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
  margin-bottom: 14px;
}
.import-dropzone:hover, .import-dropzone.dragover {
  border-color: var(--primary-light);
  background: #e8eaf620;
}
.import-dropzone.dragover { transform: scale(1.01); }

.import-drop-icon {
  font-size: 40px;
  color: #21a158;
  opacity: 0.8;
  margin-bottom: 10px;
  display: block;
}
.import-drop-text { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.import-drop-hint { font-size: 12px; color: var(--text-muted); }

.import-template-hint {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.import-template-hint i { color: var(--gold); margin-right: 4px; }
.import-template-hint code {
  display: block;
  background: #f0f2f8;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--primary);
  word-break: break-word;
}

.import-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.import-preview-info { font-size: 13px; color: var(--text-secondary); }
.import-count-ok { color: var(--success); font-weight: 600; margin-right: 12px; }
.import-count-err { color: var(--warning); font-weight: 600; }

.import-preview-table-wrap {
  max-height: 260px;
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.import-errors {
  background: #fff3e0;
  border: 1px solid #ffcc02;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 8px;
}
.import-err-title { font-weight: 700; color: var(--warning); margin-bottom: 4px; }
.import-err-item { color: var(--text-secondary); padding: 1px 0; }

/* ============================================================
   FOTO UPLOAD STYLES
   ============================================================ */
.foto-upload-area { margin-top: 4px; }

.foto-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-main);
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.foto-dropzone:hover, .foto-dropzone.dragover {
  border-color: var(--primary-light);
  background: #e8eaf620;
}
.foto-upload-icon { font-size: 34px; color: var(--primary-light); opacity: 0.7; margin-bottom: 8px; display: block; }
.foto-upload-text { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.foto-upload-hint { font-size: 11px; color: var(--text-muted); }

.foto-preview-wrap {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.foto-preview-img { max-width: 100%; max-height: 180px; object-fit: contain; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.foto-preview-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.foto-progress { margin-top: 8px; }
.foto-progress-bar { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.foto-progress-fill { height: 100%; background: var(--primary-light); border-radius: 3px; transition: width 0.3s; width: 0%; }
.foto-progress-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: block; }

/* Thumbnail tabel */
.foto-thumb-link { display: inline-block; line-height: 0; }
.foto-thumb {
  width: 38px; height: 38px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.foto-thumb:hover { transform: scale(1.12); box-shadow: var(--shadow-md); }
.foto-no { color: var(--text-muted); font-size: 13px; }

/* btn-sm helper */
.btn-sm {
  padding: 5px 12px; font-size: 12px;
  border-radius: var(--radius-sm); font-weight: 600;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer;
}
.btn-danger.btn-sm { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
.btn-danger.btn-sm:hover { background: var(--danger-light); }
.btn-outline.btn-sm { background: transparent; color: var(--primary); border: 1.5px solid var(--primary-light); }
.btn-outline.btn-sm:hover { background: var(--primary); color: #fff; }

/* modal-lg */
.modal-lg { max-width: 720px; width: 95%; }

/* import-context-info */
.import-context-info { margin-bottom: 8px; }

@media (max-width: 600px) {
  .foto-preview-img { max-height: 130px; }
  .foto-dropzone, .import-dropzone { padding: 18px 12px; }
  .import-drop-icon { font-size: 28px; }
  .foto-upload-icon { font-size: 26px; }
}