/* ========== IMPORT FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ========== RESET & GLOBAL VARIABLES ========== */
:root {
  --primary: #0b4387;
  --primary-dark: #072c5b;
  --primary-light: #1e5ba8;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --bg-main: linear-gradient(135deg, #f0f5fd 0%, #e9eff8 50%, #f4f7fc 100%);
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px -2px rgba(11,67,135,0.08), 0 2px 6px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px -4px rgba(11,67,135,0.12), 0 4px 12px -2px rgba(0,0,0,0.06);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-main);
  min-height: 100vh;
  color: var(--text-main);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ========== HEADER ========== */
header {
  background: linear-gradient(135deg, #1a237e, #283593);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

header h1 .logo-icon {
  font-size: 1.8rem;
}

header .user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.9rem;
}

header .user-info span {
  opacity: 0.9;
}

.btn-logout {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.25);
}

/* ========== CONTAINER ========== */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ========== CARD ========== */
.card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
  border: 1px solid #e8ecf1;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a237e;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid #e8ecf1;
}

/* ========== LOGIN PAGE ========== */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a237e 0%, #3949ab 50%, #5c6bc0 100%);
  padding: 1rem;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-card .logo-area {
  text-align: center;
  margin-bottom: 2rem;
  background: rgba(255,255,255,0.95);
  padding: 1.2rem;
  border-radius: 12px;
}

.login-card .logo-area .logo-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.3rem 0;
  letter-spacing: 0.5px;
}

.login-card .logo-area .logo-content p {
  font-size: 0.85rem;
  margin: 0.25rem 0;
  opacity: 0.95;
  line-height: 1.4;
}

.login-card .logo-area .logo-content .subtitle {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 1;
}

.login-card .logo-area .logo-icon {
  font-size: 3rem;
}

.login-card .logo-area h2 {
  color: #1a237e;
  font-size: 1.5rem;
  margin-top: 0.5rem;
}

.login-card .logo-area p {
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

/* ========== FORM ========== */
.form-group {
  margin-bottom: 0.75rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: #444;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 1rem 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s;
  outline: none;
  background: #fafafa;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #3949ab;
  background: white;
  box-shadow: 0 0 0 3px rgba(57,73,171,0.1);
}

.form-group input.error {
  border-color: #e53935;
  background: #fff5f5;
}

/* ========== BUTTONS ========== */
.btn {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}

.btn-primary {
  background: linear-gradient(135deg, #1a237e, #3949ab);
  color: white;
  width: 100%;
  justify-content: center;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #283593, #5c6bc0);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,35,126,0.3);
}

.btn-secondary {
  background: #e8ecf1;
  color: #444;
}

.btn-secondary:hover {
  background: #d5dbe3;
}

.btn-success {
  background: linear-gradient(135deg, #2e7d32, #43a047);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #388e3c, #66bb6a);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #c62828, #e53935);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #d32f2f, #ef5350);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

.btn-link {
  background: none;
  border: none;
  color: #3949ab;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.3rem 0;
}

.btn-link:hover {
  text-decoration: underline;
  color: #1a237e;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

/* ========== MODAL ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

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

.modal-box {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalFadeIn 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(135deg, #1a237e, #283593);
  border-radius: 16px 16px 0 0;
  border-bottom: 3px solid #3949ab;
}

.modal-header h3 {
  font-size: 1.3rem;
  color: white;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.modal-close {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  font-size: 1.4rem;
  cursor: pointer;
  color: white;
  padding: 0.4rem 0.7rem;
  line-height: 1;
  border-radius: 8px;
  transition: all 0.3s;
}

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

/* Modal form spacing */
.modal-box form {
  padding-top: 1.5rem;
}

/* ========== DASHBOARD ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.menu-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  border: 1px solid #e8ecf1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(26,35,126,0.15);
  border-color: #3949ab;
}

.menu-card .menu-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.menu-card h3 {
  color: #1a237e;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.menu-card p {
  color: #777;
  font-size: 0.85rem;
}

.menu-card .sub-menu {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e8ecf1;
  display: none;
}

.menu-card .sub-menu.active {
  display: block;
}

.menu-card .sub-menu a {
  display: block;
  padding: 0.6rem 1rem;
  color: #3949ab;
  border-radius: 6px;
  transition: background 0.3s;
  text-align: left;
}

.menu-card .sub-menu a:hover {
  background: #e8f0fe;
}

.greeting-banner {
  background: linear-gradient(135deg, #1a237e, #3949ab);
  color: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 15px rgba(26,35,126,0.2);
}

.greeting-banner h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.greeting-banner p {
  opacity: 0.9;
  font-size: 1rem;
}

/* ========== TABLE ========== */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table thead {
  background: linear-gradient(135deg, #1a237e, #283593);
  color: white;
}

table th {
  padding: 0.8rem 1rem;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
}

table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e8ecf1;
}

table tbody tr:hover {
  background: #f5f7fa;
}

table tbody tr:nth-child(even) {
  background: #fafbfc;
}

table tbody tr:nth-child(even):hover {
  background: #f0f2f5;
}

/* ========== BADGE ========== */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-diproses {
  background: #fff3e0;
  color: #e65100;
}

.badge-dikirim {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-sampai {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ========== QUICK SEARCH CHIPS ========== */
.quick-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chip-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: #0b4387;
  color: white;
  border-color: #0b4387;
  transform: translateY(-1px);
}

/* ========== TRACKING WAYBILL CARD ========== */
.tracking-result {
  display: none;
  margin-top: 1.5rem;
  animation: fadeIn 0.4s ease forwards;
}

.tracking-result.active {
  display: block;
}

.waybill-card {
  background: linear-gradient(135deg, #072c5b 0%, #0b4387 60%, #155e75 100%);
  color: white;
  border-radius: 16px;
  padding: 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 12px 30px -6px rgba(7,44,91,0.35);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
}

.waybill-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.waybill-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.waybill-dono {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fbbf24;
}

.waybill-dono span.icon {
  font-size: 1.3rem;
}

.waybill-student {
  margin: 1.2rem 0;
}

.waybill-student h3 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
  color: #ffffff;
}

.waybill-student .nik-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #e2e8f0;
  font-weight: 500;
}

/* Route visualization */
.waybill-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 1rem 1.4rem;
  border-radius: 12px;
  margin-top: 1rem;
}

.route-point {
  display: flex;
  flex-direction: column;
}

.route-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 2px;
}

.route-city {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.route-connector {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 1.5rem;
  position: relative;
}

.route-line {
  width: 100%;
  height: 2px;
  background: repeating-linear-gradient(to right, #fbbf24 0, #fbbf24 6px, transparent 6px, transparent 12px);
  position: relative;
}

.route-vehicle {
  font-size: 1.25rem;
  margin-bottom: 4px;
  animation: moveTruck 3s ease-in-out infinite alternate;
}

@keyframes moveTruck {
  from { transform: translateX(-15px); }
  to { transform: translateX(15px); }
}

/* ========== SHIPMENT STEPPER ========== */
.stepper-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.4rem;
  margin-bottom: 1.8rem;
}

.stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.stepper-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0b4387;
}

.stepper-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin-top: 0.8rem;
  padding: 0 1rem;
}

.stepper-progress-bg {
  position: absolute;
  top: 18px;
  left: 3rem;
  right: 3rem;
  height: 6px;
  background: #e2e8f0;
  z-index: 1;
  border-radius: 4px;
}

.stepper-progress-active {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #0b4387);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #94a3b8;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.step-node.completed .step-circle {
  background: #0b4387;
  border-color: #0b4387;
  color: #ffffff;
}

.step-node.current .step-circle {
  background: #ffffff;
  border-color: #f59e0b;
  color: #d97706;
  box-shadow: 0 0 0 4px rgba(245,158,11,0.25);
  animation: pulseStep 2s infinite;
}

@keyframes pulseStep {
  0% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}

.step-title {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.step-node.completed .step-title,
.step-node.current .step-title {
  color: #0b4387;
  font-weight: 700;
}

/* ========== DETAIL GRID ========== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.detail-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: #eff6ff;
  color: #1d4ed8;
  flex-shrink: 0;
}

.detail-item .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
}

.detail-item .value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ========== TIMELINE RIWAYAT ========== */
.timeline-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 1rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 10px;
  width: 2px;
  background: #cbd5e1;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.4rem;
}

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

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #94a3b8;
  z-index: 2;
  transition: all 0.3s;
}

.timeline-item:first-child .timeline-dot {
  background: #10b981;
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.3);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.timeline-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
}

.timeline-item:first-child .timeline-content {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.timeline-lokasi {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
}

.timeline-item:first-child .timeline-lokasi {
  color: #047857;
}

.timeline-waktu {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========== SEARCH BAR ENHANCED ========== */
.search-bar {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.search-bar input {
  flex: 1;
  padding: 0.85rem 1.1rem;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.25s;
  background: #ffffff;
}

.search-bar input:focus {
  border-color: #0b4387;
  box-shadow: 0 0 0 4px rgba(11,67,135,0.12);
}

.search-bar .btn {
  flex-shrink: 0;
  padding: 0.85rem 1.6rem;
  font-weight: 600;
  border-radius: 10px;
}

/* ========== STOK METRICS SUMMARY ========== */
.stok-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.metric-card.blue .metric-icon { background: #eff6ff; color: #1e40af; }
.metric-card.gold .metric-icon { background: #fef3c7; color: #b45309; }
.metric-card.red .metric-icon { background: #fef2f2; color: #b91c1c; }

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

/* ========== STOK TOOLBAR & VIEW TOGGLE ========== */
.stok-toolbar {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
  align-items: center;
  flex-wrap: wrap;
}

.stok-search-wrap {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: all 0.25s;
  background: #ffffff;
}

.search-input:focus {
  border-color: #0b4387;
  box-shadow: 0 0 0 4px rgba(11,67,135,0.12);
}

.search-icon-inside {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
}

.filter-select {
  padding: 0.75rem 1rem;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #ffffff;
  color: #1e293b;
  outline: none;
  cursor: pointer;
  transition: all 0.25s;
}

.filter-select:focus {
  border-color: #0b4387;
}

/* View switcher */
.view-switcher {
  display: flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 10px;
}

.view-btn {
  border: none;
  background: transparent;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.view-btn.active {
  background: #ffffff;
  color: #0b4387;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ========== CATALOG GRID VIEW (MODUL BUKU UT) ========== */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.4rem;
  margin-top: 1rem;
}

.book-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

/* Visual mockup cover buku materi UT */
.book-cover {
  height: 140px;
  background: linear-gradient(135deg, #072c5b 0%, #1e40af 60%, #0369a1 100%);
  position: relative;
  padding: 1.2rem;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.book-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 90% 10%, rgba(245,158,11,0.3) 0%, transparent 60%);
}

.book-cover-code {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  align-self: flex-start;
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.3);
}

.book-cover-title {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-body {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.book-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
  color: #64748b;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.6rem;
}

.book-stock-section {
  margin-top: 0.5rem;
}

.book-stock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.book-stock-number {
  font-weight: 800;
  font-size: 1.15rem;
  color: #0b4387;
}

.stock-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.stock-safe { background: #dcfce7; color: #15803d; }
.stock-warning { background: #fef3c7; color: #b45309; }
.stock-critical { background: #fee2e2; color: #b91c1c; animation: pulseRed 1.5s infinite; }

@keyframes pulseRed {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.stock-meter {
  height: 6px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.stock-meter-fill {
  height: 100%;
  border-radius: 4px;
}

.book-card-actions {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
}

/* ========== TABLE ENHANCEMENTS ========== */
table {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e2e8f0;
}

table thead {
  background: linear-gradient(135deg, #072c5b, #0b4387);
}

table th {
  padding: 0.9rem 1rem;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

table td {
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
}

/* ========== ADD STOK FORM (MODERN ACCORDION) ========== */
.add-stok-form {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1.4rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.add-stok-form.active {
  display: grid;
  animation: slideDown 0.3s ease;
}

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

.add-stok-form .form-group input,
.add-stok-form .form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
}

.add-stok-form .form-group input:focus,
.add-stok-form .form-group select:focus {
  border-color: #0b4387;
  outline: none;
  box-shadow: 0 0 0 3px rgba(11,67,135,0.1);
}

/* ========== SECTION TITLE ========== */
.section-subtitle {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0b4387;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========== ERROR TEXT ========== */
.error-text {
  display: block;
  color: #e53935;
  font-size: 0.78rem;
  margin-top: 0.3rem;
  min-height: 1rem;
}

/* ========== BTN ICON ========== */
.btn-icon {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.1);
}

/* ========== APP FOOTER ========== */
.app-footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  padding: 0.8rem;
  color: #666;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.9);
  border-top: 1px solid #e8ecf1;
  z-index: 1000;
}

/* ========== STOK TOOLBAR ========== */
.stok-toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s;
  min-width: 200px;
}

.search-input:focus {
  border-color: #3949ab;
  box-shadow: 0 0 0 3px rgba(57,73,171,0.1);
}

.stok-count {
  font-size: 0.85rem;
  color: #888;
  white-space: nowrap;
}

/* ========== DARK MODE ========== */
body.dark-mode {
  background: #1a1a2e;
  color: #e0e0e0;
}

body.dark-mode .card,
body.dark-mode .login-card,
body.dark-mode .menu-card {
  background: #16213e;
  border-color: #0f3460;
  color: #e0e0e0;
}

body.dark-mode .card-title {
  color: #90caf9;
  border-bottom-color: #0f3460;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .search-input,
body.dark-mode .search-bar input {
  background: #1a1a2e;
  border-color: #0f3460;
  color: #e0e0e0;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .search-input:focus,
body.dark-mode .search-bar input:focus {
  border-color: #64b5f6;
  background: #1a1a2e;
}

body.dark-mode table tbody tr:nth-child(even) {
  background: #1a1a3e;
}

body.dark-mode table tbody tr:hover,
body.dark-mode table tbody tr:nth-child(even):hover {
  background: #1a2a4e;
}

body.dark-mode table td {
  border-bottom-color: #0f3460;
}

body.dark-mode .detail-item {
  background: #1a1a2e;
}

body.dark-mode .detail-item .value {
  color: #e0e0e0;
}

body.dark-mode .location-arrow {
  background: #0f3460;
}

body.dark-mode .location-arrow .location-from,
body.dark-mode .location-arrow .location-to {
  color: #90caf9;
}

body.dark-mode .location-arrow .arrow-symbol {
  color: #64b5f6;
}

body.dark-mode .add-stok-form {
  background: #1a1a3e;
}

body.dark-mode .modal-box {
  background: #16213e;
  color: #e0e0e0;
}

body.dark-mode .modal-header h3 {
  color: #90caf9;
}

body.dark-mode .modal-header {
  border-bottom-color: #0f3460;
}

body.dark-mode .app-footer {
  background: #16213e;
  border-top-color: #0f3460;
  color: #888;
}

body.dark-mode .greeting-banner {
  background: linear-gradient(135deg, #0f3460, #1a237e);
}

body.dark-mode table thead {
  background: linear-gradient(135deg, #0f3460, #1a237e);
}

body.dark-mode .student-info-card {
  background: linear-gradient(135deg, #0f3460, #16213e);
}

body.dark-mode .login-page {
  background: linear-gradient(135deg, #0d0d2b 0%, #1a1a3e 50%, #16213e 100%);
}

body.dark-mode .logo-area p {
  color: #aaa;
}

body.dark-mode .form-group label {
  color: #ccc;
}

body.dark-mode .btn-secondary {
  background: #1a1a3e;
  color: #ccc;
}

body.dark-mode .btn-secondary:hover {
  background: #2a2a4e;
}

body.dark-mode .back-link {
  color: #64b5f6;
}

body.dark-mode .back-link:hover {
  color: #90caf9;
}

body.dark-mode .greeting-banner p {
  opacity: 0.8;
}

body.dark-mode .timeline::before {
  background: #0f3460;
}

body.dark-mode .timeline-lokasi {
  color: #ccc;
}

body.dark-mode .timeline-waktu {
  color: #888;
}

body.dark-mode .timeline-dot {
  background: #0f3460;
  border-color: #16213e;
}

body.dark-mode .menu-card h3 {
  color: #90caf9;
}

body.dark-mode .menu-card p {
  color: #aaa;
}

body.dark-mode .menu-card .sub-menu a {
  color: #64b5f6;
}

body.dark-mode .stepper-box {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .stepper-title {
  color: #93c5fd;
}

body.dark-mode .stepper-progress-bg {
  background: #334155;
}

body.dark-mode .step-circle {
  background: #0f172a;
  border-color: #475569;
  color: #94a3b8;
}

body.dark-mode .step-node.completed .step-circle {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

body.dark-mode .step-node.current .step-circle {
  background: #1e293b;
  border-color: #f59e0b;
  color: #fbbf24;
}

body.dark-mode .detail-item,
body.dark-mode .timeline-card,
body.dark-mode .metric-card,
body.dark-mode .book-card {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .detail-icon-box {
  background: #0f172a;
  color: #60a5fa;
}

body.dark-mode .metric-card.blue .metric-icon { background: #1e3a8a; color: #93c5fd; }
body.dark-mode .metric-card.gold .metric-icon { background: #78350f; color: #fde68a; }
body.dark-mode .metric-card.red .metric-icon { background: #7f1d1d; color: #fca5a5; }

body.dark-mode .metric-value,
body.dark-mode .book-stock-number {
  color: #f8fafc;
}

body.dark-mode .search-input,
body.dark-mode .filter-select,
body.dark-mode .search-bar input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

body.dark-mode .search-input:focus,
body.dark-mode .search-bar input:focus {
  border-color: #3b82f6;
}

body.dark-mode .view-switcher {
  background: #0f172a;
}

body.dark-mode .view-btn {
  color: #94a3b8;
}

body.dark-mode .view-btn.active {
  background: #1e293b;
  color: #60a5fa;
}

body.dark-mode .timeline-content {
  background: #0f172a;
  border-color: #334155;
}

body.dark-mode .timeline-item:first-child .timeline-content {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

body.dark-mode .timeline-item:first-child .timeline-lokasi {
  color: #34d399;
}

body.dark-mode .timeline-lokasi {
  color: #e2e8f0;
}

body.dark-mode .chip-btn {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}

body.dark-mode .chip-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

body.dark-mode .book-meta,
body.dark-mode .book-card-actions {
  border-color: #334155;
}

body.dark-mode .stock-meter {
  background: #334155;
}

/* ========== ENTRANCE ANIMATIONS ========== */
.menu-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.menu-card:nth-child(1) { animation-delay: 0.1s; }
.menu-card:nth-child(2) { animation-delay: 0.2s; }
.menu-card:nth-child(3) { animation-delay: 0.3s; }
.menu-card:nth-child(4) { animation-delay: 0.4s; }

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

.badge, .progress-fill {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  header {
    padding: 0.8rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  header h1 {
    font-size: 1.1rem;
  }

  .container {
    padding: 0 1rem;
    margin: 1rem auto;
  }

  .card {
    padding: 1.2rem;
  }

  .login-card {
    padding: 1.5rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .search-bar {
    flex-direction: column;
  }

  .add-stok-form {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .greeting-banner h2 {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
