/* =====================================================
   BengkelPro — Stylesheet
   Palet: Biru Tua, Putih, Abu-abu, Aksen Oranye
   ===================================================== */

:root{
  --color-primary: #0F2A4A;
  --color-primary-light: #1E3A5F;
  --color-primary-soft: #E8EEF5;
  --color-accent: #F97316;
  --color-accent-dark: #EA580C;
  --color-accent-soft: #FFF1E6;
  --color-white: #FFFFFF;
  --color-bg: #F4F5F7;
  --color-border: #E5E7EB;
  --color-text: #1F2937;
  --color-text-soft: #6B7280;
  --color-text-faint: #9CA3AF;

  --status-gray-bg: #EEF0F2;   --status-gray-fg: #4B5563;
  --status-blue-bg: #E4EEFB;   --status-blue-fg: #1D4ED8;
  --status-orange-bg: #FFF0E1; --status-orange-fg: #C2410C;
  --status-yellow-bg: #FEF6DC; --status-yellow-fg: #92700C;
  --status-purple-bg: #F1E9FB; --status-purple-fg: #6D28D9;
  --status-green-bg: #E3F7EA;  --status-green-fg: #15803D;
  --status-red-bg: #FCE8E8;    --status-red-fg: #B91C1C;

  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 10px 30px rgba(15,42,74,.08);
  --shadow-pop: 0 16px 40px rgba(15,42,74,.14);

  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1,h2,h3,h4{ font-family: var(--font-heading); margin:0; color: var(--color-primary); }
p{ margin:0; }
button{ font-family: inherit; cursor:pointer; }
input, select, textarea{ font-family: inherit; }
a{ color: inherit; text-decoration:none; }
.hidden{ display:none !important; }
::selection{ background: var(--color-accent-soft); }

::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-thumb{ background:#D1D5DB; border-radius:8px; }

/* =================== LOGIN =================== */
.login-screen{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(circle at 15% 10%, rgba(249,115,22,.18), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(30,58,95,.5), transparent 45%),
    linear-gradient(160deg, var(--color-primary), #0A1B30 70%);
  padding: 24px;
}
.login-card{
  width:100%;
  max-width: 420px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 32px 28px;
}
.login-logo{ display:flex; align-items:center; gap:12px; margin-bottom: 24px; }
.logo-mark{
  width:44px; height:44px; border-radius:12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-family: var(--font-heading); font-weight:700; font-size:15px;
  box-shadow: 0 6px 14px rgba(15,42,74,.35);
  flex-shrink:0;
}
.logo-text{ display:flex; flex-direction:column; line-height:1.25; }
.logo-text strong{ font-family: var(--font-heading); font-size:16px; color: var(--color-primary); }
.logo-text span{ font-size:11.5px; color: var(--color-text-soft); }
.login-title{ font-size: 22px; margin-bottom:6px; }
.login-sub{ color: var(--color-text-soft); font-size: 14px; margin-bottom: 24px; }
.login-form{ display:flex; flex-direction:column; gap:16px; }
.login-hint{
  margin-top:20px; padding:12px 14px; background: var(--color-bg);
  border-radius: var(--radius-sm); font-size:12.5px; color: var(--color-text-soft);
}
.login-hint code{ background:#fff; padding:2px 6px; border-radius:6px; border:1px solid var(--color-border); }
.btn-link{
  background:none; border:none; color: var(--color-primary); font-size: 13px;
  text-align:center; margin-top:4px; text-decoration: underline;
}

/* =================== FORM ELEMENTS =================== */
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size: 13px; font-weight:600; color: var(--color-text); }
.field-hint{ font-size:12px; color: var(--color-text-faint); }
.field-error{ font-size:12px; color: var(--status-red-fg); min-height:14px; display:block; }
input[type=text], input[type=password], input[type=number], input[type=tel],
input[type=email], input[type=date], input[type=file], select, textarea{
  width:100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-size: 14.5px;
  color: var(--color-text);
  transition: border-color .15s, box-shadow .15s;
}
textarea{ resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus{
  outline:none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
}
input.invalid, select.invalid, textarea.invalid{
  border-color: var(--status-red-fg);
  box-shadow: 0 0 0 4px var(--status-red-bg);
}
.form-grid{ display:grid; grid-template-columns: 1fr; gap:16px; }
@media (min-width:640px){ .form-grid.cols-2{ grid-template-columns:1fr 1fr; } }
.form-actions{ display:flex; gap:12px; justify-content:flex-end; margin-top:8px; flex-wrap:wrap; }

/* =================== BUTTONS =================== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border:none;
  font-size: 14.5px;
  font-weight:600;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active{ transform: scale(.97); }
.btn-primary{ background: var(--color-primary); color:#fff; box-shadow: 0 8px 18px rgba(15,42,74,.25); }
.btn-primary:hover{ background: var(--color-primary-light); }
.btn-accent{ background: var(--color-accent); color:#fff; box-shadow: 0 8px 18px rgba(249,115,22,.3); }
.btn-accent:hover{ background: var(--color-accent-dark); }
.btn-outline{ background:#fff; color: var(--color-primary); border:1.5px solid var(--color-border); }
.btn-outline:hover{ border-color: var(--color-primary); }
.btn-ghost{ background: transparent; color: var(--color-text-soft); }
.btn-ghost:hover{ background: var(--color-bg); }
.btn-danger{ background: var(--status-red-bg); color: var(--status-red-fg); }
.btn-sm{ padding: 8px 14px; font-size:13px; border-radius:10px; }
.btn-block{ width:100%; }
.btn-wa{ background:#25D366; color:#fff; box-shadow: 0 8px 18px rgba(37,211,102,.3); }
.btn-wa:hover{ background:#1EBE5A; }
.icon-btn{
  width:40px; height:40px; border-radius:12px; border:none; background: var(--color-bg);
  display:flex; align-items:center; justify-content:center; color: var(--color-primary);
  flex-shrink:0;
}
.icon-btn:hover{ background: var(--color-primary-soft); }

/* =================== APP SHELL / LAYOUT =================== */
.app-shell{ display:flex; min-height:100vh; }
.sidebar{
  width:260px; flex-shrink:0;
  background: linear-gradient(180deg, var(--color-primary), #0B2038);
  color:#fff;
  display:flex; flex-direction:column;
  position:fixed; top:0; left:0; bottom:0;
  z-index:40;
  transform: translateX(0);
  transition: transform .25s ease;
}
.sidebar .logo-text strong{ color:#fff; }
.sidebar .logo-text span{ color: rgba(255,255,255,.6); }
.sidebar-brand{ display:flex; align-items:center; gap:12px; padding:22px 20px; border-bottom:1px solid rgba(255,255,255,.08); }
.sidebar-nav{ flex:1; overflow-y:auto; padding: 14px 12px; display:flex; flex-direction:column; gap:2px; }
.nav-item{
  display:flex; align-items:center; gap:12px;
  padding: 11px 14px; border-radius: 12px;
  color: rgba(255,255,255,.72);
  font-size: 14px; font-weight:500;
  cursor:pointer;
  border:none; background:none; text-align:left; width:100%;
}
.nav-item svg{ flex-shrink:0; }
.nav-item:hover{ background: rgba(255,255,255,.06); color:#fff; }
.nav-item.active{ background: var(--color-accent); color:#fff; box-shadow: 0 6px 14px rgba(249,115,22,.35); }
.sidebar-footer{ padding: 16px 20px 22px; border-top:1px solid rgba(255,255,255,.08); }
.btn-logout{
  display:flex; align-items:center; gap:10px; width:100%;
  background: rgba(255,255,255,.06); border:none; color:#fff;
  padding: 10px 14px; border-radius:12px; font-size:13.5px;
}
.btn-logout:hover{ background: rgba(255,255,255,.14); }

.sidebar-overlay{
  position:fixed; inset:0; background: rgba(10,20,35,.5); z-index:35;
}

.main-wrapper{ flex:1; margin-left:260px; display:flex; flex-direction:column; min-height:100vh; }
.topbar{
  height:64px; flex-shrink:0;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  display:flex; align-items:center; gap:14px;
  padding: 0 20px;
  position: sticky; top:0; z-index:20;
}
.page-title{ font-size:18px; flex:1; }
.topbar-right{ display:flex; align-items:center; gap:12px; }
.role-chip{
  font-size:12px; font-weight:600; color: var(--color-primary);
  background: var(--color-primary-soft); padding:6px 12px; border-radius:999px;
}
.avatar{
  width:36px; height:36px; border-radius:50%;
  background: var(--color-accent); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-family: var(--font-heading); font-size:14px;
}
.main-content{ padding: 20px; flex:1; max-width:1280px; width:100%; margin:0 auto; padding-bottom: 100px; }

.hide-desktop{ display:none; }

.bottom-nav{
  display:none;
}

/* =================== DRAWER (mobile "lainnya") =================== */
.drawer{
  position:fixed; inset:0; z-index:60;
  background: rgba(10,20,35,.5);
  display:flex; align-items:flex-end;
}
.drawer-sheet{
  background:#fff; width:100%; border-radius: 22px 22px 0 0;
  padding: 10px 20px 26px; max-height:75vh; overflow-y:auto;
}
.drawer-handle{ width:44px; height:5px; background:#D1D5DB; border-radius:99px; margin: 8px auto 14px; }
.drawer-sheet h3{ font-size:15px; margin-bottom:14px; }
.drawer-grid{ display:grid; grid-template-columns: repeat(4,1fr); gap:14px; }
.drawer-item{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  background:none; border:none; color: var(--color-text);
  font-size:11.5px; text-align:center;
}
.drawer-item .drawer-icon{
  width:48px; height:48px; border-radius:14px; background: var(--color-bg);
  display:flex; align-items:center; justify-content:center; color: var(--color-primary);
}
.drawer-item.active .drawer-icon{ background: var(--color-accent); color:#fff; }

/* =================== CARDS / STAT / SECTIONS =================== */
.section-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.section-head h2{ font-size: 17px; }
.card{
  background:#fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
  padding: 20px; border: 1px solid rgba(15,42,74,.04);
}
.stat-grid{ display:grid; grid-template-columns: repeat(2,1fr); gap:14px; margin-bottom:20px; }
@media(min-width:720px){ .stat-grid{ grid-template-columns: repeat(4,1fr); } }
.stat-card{
  background:#fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
  padding: 18px; display:flex; flex-direction:column; gap:8px;
  border: 1px solid rgba(15,42,74,.04);
}
.stat-card .stat-icon{
  width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center;
}
.stat-card .stat-label{ font-size:12.5px; color: var(--color-text-soft); font-weight:600; }
.stat-card .stat-value{ font-size:22px; font-family: var(--font-heading); font-weight:700; color: var(--color-primary); }
.stat-card .stat-sub{ font-size:11.5px; color: var(--color-text-faint); }

.grid-2{ display:grid; grid-template-columns:1fr; gap:16px; }
@media(min-width:960px){ .grid-2{ grid-template-columns: 1.4fr 1fr; } }

/* Bar chart mini (CSS only) */
.bar-chart{ display:flex; align-items:flex-end; gap:8px; height:140px; padding-top:10px; }
.bar-chart .bar-col{ flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; height:100%; justify-content:flex-end; }
.bar-chart .bar{ width:100%; max-width:26px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--color-accent), var(--color-accent-dark)); }
.bar-chart .bar-label{ font-size:10.5px; color: var(--color-text-faint); }

.list-simple{ display:flex; flex-direction:column; gap:2px; }
.list-row{ display:flex; align-items:center; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--color-border); font-size:13.5px; }
.list-row:last-child{ border-bottom:none; }
.list-row .rank{
  width:24px; height:24px; border-radius:8px; background: var(--color-primary-soft); color: var(--color-primary);
  display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; margin-right:8px;
}

/* =================== BADGES =================== */
.badge{
  display:inline-flex; align-items:center; gap:5px;
  padding: 5px 11px; border-radius: 999px; font-size:12px; font-weight:700;
  white-space:nowrap;
}
.badge::before{ content:''; width:6px; height:6px; border-radius:50%; background:currentColor; }
.badge-gray{ background: var(--status-gray-bg); color: var(--status-gray-fg); }
.badge-blue{ background: var(--status-blue-bg); color: var(--status-blue-fg); }
.badge-orange{ background: var(--status-orange-bg); color: var(--status-orange-fg); }
.badge-yellow{ background: var(--status-yellow-bg); color: var(--status-yellow-fg); }
.badge-purple{ background: var(--status-purple-bg); color: var(--status-purple-fg); }
.badge-green{ background: var(--status-green-bg); color: var(--status-green-fg); }
.badge-red{ background: var(--status-red-bg); color: var(--status-red-fg); }

/* =================== TOOLBAR / SEARCH / FILTER =================== */
.toolbar{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px; align-items:center; }
.search-box{
  display:flex; align-items:center; gap:8px; background:#fff; border:1.5px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 10px 14px; flex:1; min-width:180px;
}
.search-box input{ border:none; padding:0; flex:1; }
.search-box input:focus{ box-shadow:none; }
.search-box svg{ color: var(--color-text-faint); flex-shrink:0; }
.chip-filter{ display:flex; gap:8px; flex-wrap:wrap; }
.chip-filter button{
  padding:8px 14px; border-radius:999px; border:1.5px solid var(--color-border); background:#fff;
  font-size:12.5px; font-weight:600; color: var(--color-text-soft);
}
.chip-filter button.active{ background: var(--color-primary); color:#fff; border-color: var(--color-primary); }

/* =================== TABLE =================== */
.table-wrap{ background:#fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); overflow:hidden; border: 1px solid rgba(15,42,74,.04); }
table{ width:100%; border-collapse: collapse; font-size:13.5px; }
thead th{
  text-align:left; padding: 13px 16px; background: var(--color-bg); color: var(--color-text-soft);
  font-weight:700; font-size:11.5px; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap;
}
tbody td{ padding: 13px 16px; border-top:1px solid var(--color-border); vertical-align:middle; }
tbody tr:hover{ background: #FBFBFC; }
.table-scroll{ overflow-x:auto; }
.cell-strong{ font-weight:600; color: var(--color-text); }
.cell-muted{ color: var(--color-text-soft); font-size:12.5px; }
.row-actions{ display:flex; gap:6px; }

/* Mobile: cards list instead of wide tables where useful */
.mobile-cards{ display:flex; flex-direction:column; gap:12px; }
.data-card{
  background:#fff; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); padding:16px;
  display:flex; flex-direction:column; gap:8px; border: 1px solid rgba(15,42,74,.04);
}
.data-card-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.data-card-title{ font-weight:700; color: var(--color-text); font-size:14.5px; }
.data-card-sub{ font-size:12.5px; color: var(--color-text-soft); }
.data-card-meta{ display:flex; flex-wrap:wrap; gap:6px 16px; font-size:12.5px; color: var(--color-text-soft); }
.data-card-actions{ display:flex; gap:8px; margin-top:4px; flex-wrap:wrap; }

/* =================== EMPTY / LOADING STATE =================== */
.empty-state{
  text-align:center; padding: 48px 20px; color: var(--color-text-soft);
  display:flex; flex-direction:column; align-items:center; gap:12px;
}
.empty-state .empty-icon{
  width:64px; height:64px; border-radius:18px; background: var(--color-primary-soft);
  display:flex; align-items:center; justify-content:center; color: var(--color-primary);
}
.empty-state strong{ color: var(--color-text); font-size:15px; }
.loading-state{ display:flex; align-items:center; justify-content:center; padding:40px; gap:10px; color: var(--color-text-soft); }
.spinner{
  width:20px; height:20px; border-radius:50%; border: 3px solid var(--color-border);
  border-top-color: var(--color-accent); animation: spin .7s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* =================== MODAL =================== */
.modal-overlay{
  position:fixed; inset:0; background: rgba(10,20,35,.55); z-index:80;
  display:flex; align-items:center; justify-content:center; padding:16px;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn{ from{opacity:0;} to{opacity:1;} }
.modal-box{
  background:#fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  width:100%; max-width:560px; max-height:90vh; overflow-y:auto;
  padding: 24px;
}
.modal-box.modal-lg{ max-width: 760px; }
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.modal-head h3{ font-size:17px; }
.modal-close{ background: var(--color-bg); border:none; width:32px; height:32px; border-radius:10px; color: var(--color-text-soft); display:flex; align-items:center; justify-content:center; }

/* =================== CONFIRM DIALOG =================== */
.confirm-box{ text-align:center; max-width:380px; }
.confirm-box .empty-icon{ margin: 0 auto 14px; background: var(--status-red-bg); color: var(--status-red-fg); }

/* =================== TOAST =================== */
.toast-root{ position:fixed; top:16px; right:16px; left:16px; z-index:100; display:flex; flex-direction:column; align-items:center; gap:10px; pointer-events:none; }
@media(min-width:640px){ .toast-root{ left:auto; align-items:flex-end; } }
.toast{
  background: var(--color-primary); color:#fff; padding: 13px 18px; border-radius: 14px;
  box-shadow: var(--shadow-pop); font-size:13.5px; font-weight:600; max-width: 380px;
  display:flex; align-items:center; gap:10px;
  animation: toastIn .2s ease;
}
.toast.success{ background: #15803D; }
.toast.error{ background: #B91C1C; }
@keyframes toastIn{ from{ transform: translateY(-10px); opacity:0;} to{ transform:translateY(0); opacity:1; } }

/* =================== STEPPER =================== */
.stepper{ display:flex; align-items:center; gap:4px; margin-bottom:20px; flex-wrap:wrap; }
.stepper .step{ display:flex; align-items:center; gap:8px; font-size:12px; color: var(--color-text-faint); font-weight:600; }
.stepper .step .dot{ width:22px; height:22px; border-radius:50%; background: var(--color-bg); display:flex; align-items:center; justify-content:center; font-size:11px; }
.stepper .step.done .dot{ background: var(--status-green-fg); color:#fff; }
.stepper .step.current .dot{ background: var(--color-accent); color:#fff; }
.stepper .step.current{ color: var(--color-primary); }
.stepper .sep{ width:16px; height:2px; background: var(--color-border); }

/* =================== INVOICE PREVIEW =================== */
.invoice-preview{ background:#fff; border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-soft); }
.invoice-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:16px; border-bottom:2px dashed var(--color-border); padding-bottom:18px; margin-bottom:18px; flex-wrap:wrap; }
.invoice-head h2{ font-size:20px; }
.invoice-num{ color: var(--color-accent); font-weight:700; }
.invoice-cols{ display:grid; grid-template-columns:1fr; gap:16px; margin-bottom:18px; }
@media(min-width:600px){ .invoice-cols{ grid-template-columns:1fr 1fr; } }
.invoice-cols .label{ font-size:11px; text-transform:uppercase; color: var(--color-text-faint); font-weight:700; margin-bottom:4px; }
.invoice-total-row{ display:flex; justify-content:space-between; padding:8px 0; font-size:14px; }
.invoice-total-row.grand{ border-top:2px solid var(--color-border); margin-top:8px; padding-top:14px; font-size:18px; font-weight:800; color: var(--color-primary); }

/* =================== CHECKLIST (QC) =================== */
.checklist{ display:flex; flex-direction:column; gap:2px; }
.checklist-item{
  display:flex; align-items:center; gap:12px; padding:13px 6px; border-bottom:1px solid var(--color-border);
}
.checklist-item:last-child{ border-bottom:none; }
.checklist-item input[type=checkbox]{
  width:22px; height:22px; accent-color: var(--color-accent); flex-shrink:0;
}
.checklist-item label{ font-size:14px; flex:1; }

/* =================== UTIL =================== */
.text-soft{ color: var(--color-text-soft); }
.text-accent{ color: var(--color-accent); }
.text-right{ text-align:right; }
.mt-8{ margin-top:8px; } .mt-16{ margin-top:16px; } .mt-24{ margin-top:24px; }
.flex-between{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.tag-cat{ font-size:11px; background: var(--color-bg); color: var(--color-text-soft); padding:3px 9px; border-radius:8px; font-weight:600;}

/* =================== RESPONSIVE: MOBILE =================== */
@media (max-width: 900px){
  .sidebar{ transform: translateX(-100%); box-shadow: var(--shadow-pop); }
  .sidebar.open{ transform: translateX(0); }
  .main-wrapper{ margin-left:0; }
  .hide-desktop{ display:flex; }
  .main-content{ padding: 16px; padding-bottom: 96px; }

  .bottom-nav{
    display:flex; position:fixed; bottom:0; left:0; right:0; height:66px;
    background:#fff; border-top:1px solid var(--color-border);
    box-shadow: 0 -8px 24px rgba(15,42,74,.08);
    z-index:30; padding: 6px 4px;
  }
  .bottom-nav button{
    flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
    background:none; border:none; color: var(--color-text-faint); font-size:10.5px; font-weight:600;
    padding:4px;
  }
  .bottom-nav button.active{ color: var(--color-accent); }
  .bottom-nav button.active svg{ color: var(--color-accent); }

  .table-wrap.desktop-only{ display:none; }
}
@media (min-width:901px){
  .mobile-cards.mobile-only{ display:none; }
}

@media (max-width:480px){
  .stat-grid{ grid-template-columns: repeat(2,1fr); }
  .modal-box{ padding:18px; }
  .login-card{ padding:26px 20px; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
