/* ============================================================
   FM Operations - Design System
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #eff6ff;
  --secondary: #6b7280;
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-dark: #065f46;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #3b82f6;
  --purple: #8b5cf6;
  --teal: #14b8a6;
  --orange: #f97316;
  --indigo: #6366f1;

  --bg-primary: #ffffff;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --border: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --sidebar-width: 260px;
  --topbar-height: 56px;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1);
  --transition: 200ms ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg-secondary); color: var(--text-primary); line-height: 1.5; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; }
strong { font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.link-subtle { color: var(--text-muted); font-size: .875rem; }
.link-subtle:hover { color: var(--primary); }

/* ---------- App Layout ---------- */
.app-layout { display: flex; min-height: 100vh; }
.main-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0;
  overflow-y: auto; flex-shrink: 0;
  z-index: 200;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--topbar-height);
}
.sidebar-logo { display: flex; align-items: center; gap: .5rem; }
.logo-icon { font-size: 1.5rem; }
.logo-text { font-size: 1.2rem; color: var(--primary); letter-spacing: -.5px; }
.sidebar-close { display: none; background: none; border: none; font-size: 1.5rem; color: var(--text-muted); padding: .25rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem 0; }
.nav-section { padding: .5rem 0; }
.nav-section-label {
  padding: .375rem 1.25rem;
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted);
}
.nav-item {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem 1.25rem;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: all var(--transition);
  font-size: .875rem;
}
.nav-item:hover { background: var(--bg-secondary); color: var(--text-primary); text-decoration: none; }
.nav-item.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: .625rem; margin-bottom: .75rem; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem; flex-shrink: 0;
}
.user-avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .75rem;
}
.user-name { font-size: .8rem; font-weight: 600; }
.user-role { font-size: .7rem; color: var(--text-muted); }
.logout-btn { width: 100%; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 150; }

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1.25rem;
  position: sticky; top: 0; z-index: 100;
}
.topbar-menu-btn { display: none; background: none; border: none; font-size: 1.25rem; padding: .25rem; }
.topbar-title { font-size: 1rem; font-weight: 600; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }

/* ---------- Main Content ---------- */
.main-content { flex: 1; padding: 1.25rem; min-height: calc(100vh - var(--topbar-height)); }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem; }
.page-title { font-size: 1.25rem; font-weight: 700; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.card-header {
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: .95rem; font-weight: 600; }
.card-body { padding: 1.25rem; }
.card-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--border); background: var(--bg-secondary); }
.p-0 { padding: 0 !important; }

/* ---------- Stats Grid ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .875rem; margin-bottom: 1.25rem; }
.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  display: flex; align-items: center; gap: .875rem;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
}
.stat-card-blue { border-left-color: var(--primary); }
.stat-card-green { border-left-color: var(--success); }
.stat-card-yellow { border-left-color: var(--warning); }
.stat-card-red { border-left-color: var(--danger); }
.stat-card-purple { border-left-color: var(--purple); }
.stat-card-teal { border-left-color: var(--teal); }
.stat-card-orange { border-left-color: var(--orange); }
.stat-card-gray { border-left-color: var(--secondary); }
.stat-icon { font-size: 1.75rem; }
.stat-value { font-size: 1.625rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: .75rem; color: var(--text-muted); }

/* ---------- Dashboard Grids ---------- */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  padding: .5rem 1rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-xs { padding: .2rem .45rem; font-size: .75rem; border-radius: var(--radius-sm); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-secondary:hover:not(:disabled) { background: #4b5563; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-secondary); color: var(--text-primary); }
.btn-group { display: flex; gap: .25rem; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .35rem; color: var(--text-secondary); }
.form-control {
  display: block; width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem; font-family: inherit;
  background: var(--bg-primary); color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none; appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }
.required { color: var(--danger); }
.form-error-global { background: var(--danger-light); color: var(--danger); padding: .75rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .875rem; }
.input-with-icon { position: relative; }
.input-with-icon .form-control { padding-right: 2.5rem; }
.input-icon-btn { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); background: none; border: none; padding: .25rem; color: var(--text-muted); }
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .875rem; }
.checkbox-label input { width: 16px; height: 16px; }
.fieldset-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.fieldset-section legend { font-size: .8rem; font-weight: 600; padding: 0 .5rem; color: var(--text-secondary); }

/* ---------- Filter Bar ---------- */
.filter-bar { margin-bottom: 1.25rem; padding: .875rem 1.25rem !important; }
.filter-bar-inner { display: flex; gap: .625rem; flex-wrap: wrap; align-items: center; }
.filter-search { flex: 1; min-width: 180px; }
.filter-select { min-width: 140px; max-width: 200px; }

/* ---------- Table ---------- */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: .8rem; white-space: nowrap; }
.data-table th {
  padding: .6rem .875rem;
  text-align: left; font-size: .7rem;
  font-weight: 600; text-transform: uppercase;
  letter-spacing: .03em; color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: .6rem .875rem; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.data-table tbody tr:hover { background: var(--bg-secondary); }
.data-table tbody tr:last-child td { border-bottom: none; }
.actions-cell { white-space: nowrap; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.pagination-info { font-size: .75rem; color: var(--text-muted); }
.pagination-btns { display: flex; gap: .25rem; }
.pagination-btn.btn-primary { pointer-events: none; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .5rem;
  border-radius: 999px;
  font-size: .7rem; font-weight: 600; white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f1f5f9; color: #475569; border: 1px solid var(--border); }
.badge-neutral { background: #f1f5f9; color: #64748b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.6);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 1000; padding: 1.5rem 1rem;
  opacity: 0; transition: opacity .25s;
  overflow-y: auto;
}
.modal-overlay.show { opacity: 1; }
.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform .25s;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.25rem; color: var(--text-muted); padding: .25rem; line-height: 1; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: .875rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .5rem; }

/* ---------- Toast ---------- */
#toast-container { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: .625rem;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .875rem; font-weight: 500;
  min-width: 240px; max-width: 380px;
  pointer-events: all;
  opacity: 0; transform: translateX(100%);
  transition: all .35s ease;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { background: #166534; color: #fff; }
.toast-error { background: #991b1b; color: #fff; }
.toast-warning { background: #92400e; color: #fff; }
.toast-info { background: var(--primary-dark); color: #fff; }
.toast-icon { font-size: 1rem; }

/* ---------- Loading Spinner ---------- */
.loading-spinner { display: flex; align-items: center; justify-content: center; padding: 3rem; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Empty State ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state h2 { font-size: 1.125rem; margin-bottom: .5rem; }

/* ---------- Alerts ---------- */
.alert { padding: .75rem 1rem; border-radius: var(--radius); font-size: .875rem; margin-bottom: 1rem; }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: var(--success-light); color: var(--success-dark); }
.alert-warning { background: var(--warning-light); color: #92400e; }

/* ---------- Login Page ---------- */
.login-page { min-height: 100vh; background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { background: var(--bg-primary); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2rem; width: 100%; max-width: 400px; }
.login-header { text-align: center; margin-bottom: 1.75rem; }
.login-logo { font-size: 3rem; margin-bottom: .5rem; }
.login-title { font-size: 1.5rem; color: var(--primary); margin-bottom: .25rem; }
.login-subtitle { color: var(--text-muted); font-size: .875rem; }
.login-footer { text-align: center; margin-top: 1.25rem; }

/* ---------- Charts ---------- */
.bar-chart { display: flex; flex-direction: column; gap: .5rem; }
.bar-item { display: flex; align-items: center; gap: .625rem; }
.bar-label { width: 120px; font-size: .75rem; text-align: right; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; background: var(--bg-tertiary); border-radius: 999px; height: 20px; overflow: hidden; }
.bar-fill { background: var(--primary); height: 100%; border-radius: 999px; display: flex; align-items: center; justify-content: flex-end; padding-right: .375rem; min-width: 28px; transition: width .5s ease; }
.bar-value { font-size: .7rem; color: #fff; font-weight: 600; }
.line-chart-wrap { overflow-x: auto; }
.line-chart-svg { width: 100%; height: 120px; }
.line-path { stroke: var(--primary); stroke-width: 2; }
.line-dot { fill: var(--primary); }
.chart-x-label { font-size: 8px; fill: var(--text-muted); }

/* ---------- Calendar ---------- */
.calendar-nav { flex-wrap: wrap; gap: .5rem; }
.calendar-month-label { font-size: 1rem; font-weight: 700; }
.calendar-filters { display: flex; gap: .625rem; flex-wrap: wrap; margin-left: auto; }
.filter-check { display: flex; align-items: center; gap: .3rem; font-size: .75rem; cursor: pointer; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
.cal-day-header { padding: .5rem; text-align: center; font-size: .7rem; font-weight: 700; color: var(--text-muted); background: var(--bg-secondary); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 90px; padding: .375rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
.cal-cell:hover { background: var(--bg-secondary); }
.cal-cell-empty { background: var(--bg-secondary); cursor: default; }
.cal-today { background: var(--primary-light); }
.cal-day-num { font-size: .8rem; font-weight: 600; margin-bottom: .25rem; }
.today-num { background: var(--primary); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.cal-event-dot { background: var(--primary); color: #fff; font-size: .65rem; padding: .1rem .3rem; border-radius: var(--radius-sm); margin-bottom: .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { font-size: .65rem; color: var(--text-muted); }
.cal-color-blue { background: #3b82f6; }
.cal-color-green { background: #10b981; }
.cal-color-purple { background: #8b5cf6; }
.cal-color-orange { background: #f97316; }
.cal-color-red { background: #ef4444; }
.cal-color-teal { background: #14b8a6; }
.cal-color-yellow { background: #f59e0b; }
.cal-color-indigo { background: #6366f1; }
.cal-color-gray { background: #9ca3af; }
.cal-event-sidebar { position: fixed; right: 0; top: var(--topbar-height); width: 300px; height: calc(100vh - var(--topbar-height)); background: var(--bg-primary); box-shadow: var(--shadow-lg); border-left: 1px solid var(--border); overflow-y: auto; z-index: 50; padding: 1rem; }
.cal-event-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-weight: 600; }
.cal-event-item { padding: .75rem; border-radius: var(--radius); border-left: 3px solid var(--primary); background: var(--bg-secondary); margin-bottom: .625rem; }
.cal-color-border-blue { border-left-color: #3b82f6; }
.cal-color-border-green { border-left-color: #10b981; }
.cal-color-border-red { border-left-color: #ef4444; }
.cal-color-border-yellow { border-left-color: #f59e0b; }
.cal-color-border-teal { border-left-color: #14b8a6; }
.cal-event-type { font-size: .65rem; text-transform: uppercase; font-weight: 700; color: var(--text-muted); margin-bottom: .2rem; }
.cal-event-title { font-size: .8rem; font-weight: 600; }
.cal-event-branch { font-size: .75rem; color: var(--text-muted); }

/* ---------- Profile ---------- */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.profile-avatar-lg { width: 72px; height: 72px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; margin: 0 auto 1rem; }
.profile-info { display: flex; flex-direction: column; gap: .625rem; }
.profile-row { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.profile-label { font-weight: 600; color: var(--text-muted); }

/* ---------- Responsive: Tablet (≤900px) ---------- */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Responsive: Mobile (≤768px) ---------- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: 0; left: 0;
    height: 100vh; z-index: 300;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-overlay.show { display: block; }
  .topbar-menu-btn { display: block; }
  .main-content { padding: .875rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .625rem; }
  .stat-card { padding: .875rem; }
  .stat-value { font-size: 1.25rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .filter-bar-inner { flex-direction: column; }
  .filter-search, .filter-select { width: 100%; max-width: 100%; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .data-table { font-size: .75rem; }
  .data-table th, .data-table td { padding: .5rem .625rem; }
  .modal-overlay { padding: .75rem .5rem; align-items: flex-end; }
  .modal { max-height: 95vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  #toast-container { bottom: .75rem; right: .75rem; left: .75rem; }
  .toast { max-width: 100%; }
  .cal-event-sidebar { width: 100%; right: 0; }
  .calendar-grid { font-size: .75rem; }
  .cal-cell { min-height: 60px; }
  .cal-event-dot-label { display: none; }
}

/* ---------- Responsive: Small mobile (≤480px) ---------- */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 1.1rem; }
  .btn-group { flex-wrap: nowrap; }
  .profile-grid { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .btn, .pagination, .filter-bar, .page-actions { display: none !important; }
  .main-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ---------- Bulk Select & Toolbar ---------- */
.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(59,130,246,.4);
  box-shadow: 0 4px 16px rgba(59,130,246,.25);
  animation: slideDown .2s ease;
}

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

#bulk-count {
  font-weight: 600;
  color: #fff;
  font-size: .9rem;
  flex: 1;
}

/* Checkbox style in table */
.row-checkbox,
#select-all-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.data-table th:first-child:has(input[type="checkbox"]),
.data-table td:first-child:has(input[type="checkbox"]) {
  width: 44px;
  text-align: center;
  padding: 8px 4px;
}

/* ================================================================
   Import Data Awal Page
   ================================================================ */

/* Info box */
.import-info-box {
  background: var(--primary-light);
  border: 1px solid rgba(59,130,246,.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.import-info-box h3 { color: var(--primary-dark); margin-bottom: 8px; font-size: .95rem; }
.import-info-box p  { color: var(--text-secondary); font-size: .85rem; margin-bottom: 12px; }

.import-sheet-list  { display: flex; flex-wrap: wrap; gap: 6px; }
.import-sheet-tag {
  background: rgba(59,130,246,.12);
  color: var(--primary-dark);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: .75rem;
  font-weight: 500;
}

/* Upload zone */
.import-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.import-upload-zone:hover,
.import-upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-icon    { font-size: 3rem; line-height: 1; }
.upload-text    { display: flex; flex-direction: column; gap: 4px; }
.upload-text strong { color: var(--text-primary); font-size: 1rem; }
.upload-text span   { color: var(--text-muted); font-size: .85rem; }
.upload-hint    { font-size: .75rem; color: var(--text-muted); }

/* File info bar */
.file-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: .875rem;
  font-weight: 500;
  margin-top: 8px;
}

/* Progress elements */
.import-progress-wrap { max-width: 480px; margin: 0 auto; }
.import-progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 99px;
  overflow: hidden;
}
.import-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
  border-radius: 99px;
  transition: width .4s ease;
}
.import-status-text {
  color: var(--text-secondary);
  font-size: .875rem;
  margin-top: 8px;
}

/* Duplicate strategy options */
.dup-options { display: flex; gap: 12px; flex-wrap: wrap; }
.dup-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  flex: 1;
  min-width: 220px;
  transition: border-color var(--transition), background var(--transition);
}
.dup-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.dup-option input[type="radio"] { margin-top: 3px; accent-color: var(--primary); }
.dup-option-text strong { display: block; font-size: .9rem; color: var(--text-primary); }
.dup-option-text span   { font-size: .8rem; color: var(--text-secondary); }

/* Preview header */
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.preview-header h3 { font-size: .95rem; margin: 0; }

/* Preview table row states */
.data-table tr.row-ok:hover    { background: rgba(16,185,129,.05); }
.data-table tr.row-error td    { background: rgba(239,68,68,.04); }
.data-table tr.row-skipped td  { opacity: .6; }

/* Error detail */
.error-sheet-block { padding: 0 0 16px; }
.error-sheet-title {
  padding: 10px 20px;
  font-weight: 600;
  color: var(--danger);
  font-size: .875rem;
  background: rgba(239,68,68,.05);
  border-bottom: 1px solid rgba(239,68,68,.15);
}
.error-table { font-size: .8rem; }
.error-msg   { color: var(--danger); line-height: 1.5; }

/* Import steps list */
.import-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
}
.import-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  font-size: .875rem;
}
.step-item-icon  { font-size: 1rem; flex-shrink: 0; }
.step-item-label { flex: 1; color: var(--text-primary); }
.step-item-count { color: var(--text-muted); font-size: .8rem; }
.step-item-status{ flex-shrink: 0; }

/* Summary */
.import-summary-header { text-align: center; padding-bottom: 20px; }
.summary-icon   { font-size: 3.5rem; line-height: 1; margin-bottom: 8px; }
.summary-title  { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin: 0; }

.import-summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.summary-stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border);
}
.summary-stat-card.success { background: var(--success-light); border-color: rgba(16,185,129,.3); }
.summary-stat-card.danger  { background: var(--danger-light);  border-color: rgba(239,68,68,.3); }
.summary-stat-card.info    { background: var(--primary-light); border-color: rgba(59,130,246,.3); }
.summary-stat-card.neutral { background: var(--bg-tertiary); }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* Action bar */
.import-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.mb-12 { margin-bottom: 12px; }


