/* StokBot Design System — Modern Minimalist */

/* ========== Font Face ========== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-600.woff2') format('woff2');
}

/* ========== CSS Custom Properties ========== */
:root {
  --color-white: #FFFFFF;
  --color-slate-50: #F8FAFC;
  --color-slate-100: #F1F5F9;
  --color-slate-200: #E2E8F0;
  --color-slate-300: #CBD5E1;
  --color-slate-400: #94A3B8;
  --color-slate-500: #64748B;
  --color-slate-600: #475569;
  --color-slate-900: #0F172A;
  --color-blue-50: #EFF6FF;
  --color-blue-100: #DBEAFE;
  --color-blue-500: #3B82F6;
  --color-blue-600: #2563EB;
  --color-blue-700: #1D4ED8;
  --color-red-50: #FEF2F2;
  --color-red-100: #FEE2E2;
  --color-red-300: #FCA5A5;
  --color-red-600: #DC2626;
  --color-red-700: #B91C1C;
  --color-red-800: #991B1B;
  --color-green-50: #F0FDF4;
  --color-green-100: #DCFCE7;
  --color-green-300: #86EFAC;
  --color-green-600: #16A34A;
  --color-green-700: #15803D;
  --color-green-800: #166534;
  --color-amber-50: #FFFBEB;
  --color-amber-100: #FEF3C7;
  --color-amber-300: #FCD34D;
  --color-amber-600: #D97706;
  --color-amber-700: #B45309;
  --color-amber-800: #92400E;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.06), 0 2px 4px -2px rgba(15,23,42,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,0.06), 0 4px 6px -4px rgba(15,23,42,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15,23,42,0.08), 0 8px 10px -6px rgba(15,23,42,0.04);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Base Reset ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--color-slate-900);
  background: var(--color-slate-50);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-blue-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-blue-700);
}

/* ========== Typography ========== */
.text-body {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-slate-600);
}

.text-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--color-slate-500);
}

.text-heading {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-slate-900);
}

.text-display {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-secondary {
  color: var(--color-slate-500);
}

/* ========== Focus Styles ========== */
:focus-visible {
  outline: 2px solid var(--color-blue-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ========== Buttons ========== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 10px 20px;
  background: var(--color-blue-600);
  color: var(--color-white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  box-shadow: 0 1px 2px rgba(37,99,235,0.2);
}

.btn-primary:hover {
  background: var(--color-blue-700);
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
  transform: translateY(-0.5px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(37,99,235,0.2);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 10px 20px;
  background: var(--color-white);
  color: var(--color-slate-600);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--color-slate-50);
  border-color: var(--color-slate-300);
  box-shadow: var(--shadow-sm);
}

.btn-destructive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  background: transparent;
  color: var(--color-red-600);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-destructive:hover {
  background: var(--color-red-50);
}

/* ========== Card ========== */
.card {
  background: var(--color-white);
  border: 1px solid rgba(226,232,240,0.6);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* ========== Input ========== */
.input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-slate-900);
  background: var(--color-white);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.input::placeholder {
  color: var(--color-slate-400);
}

.input:hover {
  border-color: var(--color-slate-300);
}

.input:focus {
  outline: none;
  border-color: var(--color-blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

textarea.input {
  min-height: 140px;
  resize: vertical;
}

/* ========== Badge ========== */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--color-green-50);
  color: var(--color-green-700);
  border: 1px solid var(--color-green-100);
}

.badge-warning {
  background: var(--color-amber-50);
  color: var(--color-amber-700);
  border: 1px solid var(--color-amber-100);
}

.badge-error {
  background: var(--color-red-50);
  color: var(--color-red-700);
  border: 1px solid var(--color-red-100);
}

.badge-info {
  background: var(--color-blue-50);
  color: var(--color-blue-700);
  border: 1px solid var(--color-blue-100);
}

/* ========== Pill Tabs ========== */
.pill-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: var(--space-sm) 0;
}

.pill-tabs::-webkit-scrollbar {
  display: none;
}

.pill-tab-active,
.pill-tab-inactive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.pill-tab-active {
  background: var(--color-slate-900);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.pill-tab-inactive {
  background: var(--color-white);
  color: var(--color-slate-500);
  border: 1px solid var(--color-slate-200);
}

.pill-tab-inactive:hover {
  background: var(--color-slate-50);
  color: var(--color-slate-600);
  border-color: var(--color-slate-300);
}

/* ========== Table ========== */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px 14px;
  text-align: left;
}

.table th {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-slate-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-slate-100);
}

.table td {
  font-size: 14px;
  color: var(--color-slate-600);
  border-bottom: 1px solid var(--color-slate-50);
}

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

.table-compact td, .table-compact th {
  padding: var(--space-xs) var(--space-sm);
}

/* ========== Alert ========== */
.alert-warning {
  background: var(--color-amber-50);
  color: var(--color-amber-800);
  border: 1px solid var(--color-amber-100);
  padding: 12px var(--space-md);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
}

.alert-error {
  background: var(--color-red-50);
  color: var(--color-red-800);
  border: 1px solid var(--color-red-100);
  padding: 12px var(--space-md);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
}

.alert-success {
  background: var(--color-green-50);
  color: var(--color-green-800);
  border: 1px solid var(--color-green-100);
  padding: 12px var(--space-md);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
}

/* ========== Skeleton Loading ========== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-50) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ========== Header ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226,232,240,0.5);
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--space-md);
  max-width: 100%;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-slate-900);
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--color-slate-400);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.header-icon-link:hover {
  background: var(--color-slate-100);
  color: var(--color-slate-600);
  text-decoration: none;
}

.header-text-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-slate-400);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.header-text-link:hover {
  color: var(--color-slate-600);
  background: var(--color-slate-100);
  text-decoration: none;
}

/* ========== Sidebar (Desktop) ========== */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 220px;
  background: var(--color-white);
  border-right: 1px solid rgba(226,232,240,0.5);
  padding: var(--space-md) var(--space-sm);
  display: none;
  z-index: 90;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-slate-500);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.sidebar-item:hover {
  background: var(--color-slate-50);
  color: var(--color-slate-700);
  text-decoration: none;
}

.sidebar-active {
  color: var(--color-slate-900);
  background: var(--color-slate-50);
  font-weight: 600;
}

.sidebar-active svg {
  color: var(--color-blue-600);
}

/* ========== Bottom Nav (Mobile) ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(226,232,240,0.5);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-slate-400);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

.bottom-nav-item:hover {
  text-decoration: none;
  color: var(--color-slate-500);
}

.bottom-nav-active {
  color: var(--color-blue-600);
  font-weight: 600;
}

.bottom-nav-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--color-blue-600);
  border-radius: 0 0 2px 2px;
}

/* ========== Page Content ========== */
.page-content {
  padding-top: 72px;
  padding-bottom: 80px;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  min-height: 100vh;
}

.page-content > .text-heading:first-child {
  margin-bottom: var(--space-md);
}

/* ========== Login Page ========== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--color-slate-50);
  padding: var(--space-md);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-white);
  border: 1px solid rgba(226,232,240,0.6);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  box-shadow: var(--shadow-lg);
}

.login-card .text-heading {
  font-size: 24px;
  letter-spacing: -0.02em;
}

/* ========== Form Utilities ========== */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-slate-600);
}

/* ========== Icon Sizing ========== */
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ========== Stock Page ========== */
.stock-category {
  margin-bottom: var(--space-lg);
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226,232,240,0.6);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.category-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-slate-400);
  padding: 10px var(--space-md);
  background: var(--color-slate-50);
  border-bottom: 1px solid var(--color-slate-100);
}

.stock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px var(--space-md);
  min-height: 48px;
  border-bottom: 1px solid var(--color-slate-50);
  transition: background var(--transition-fast);
}

.stock-row:last-child {
  border-bottom: none;
}

.stock-row:hover {
  background: var(--color-slate-50);
}

.stock-product {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-slate-700);
}

.stock-qty {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
  margin-left: var(--space-md);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-slate-900);
  font-variant-numeric: tabular-nums;
}

.stock-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-slate-400);
}

.empty-state {
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
}

.skeleton-group {
  padding: var(--space-md) 0;
}

/* ========== Lapor Page ========== */
.btn-cancel-link {
  text-decoration: none;
  color: var(--color-slate-400);
  transition: color var(--transition-fast);
}

.btn-cancel-link:hover {
  color: var(--color-slate-600);
}

/* ========== Report Card (Riwayat page) ========== */
.report-card {
  background: var(--color-white);
  border: 1px solid rgba(226,232,240,0.6);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-sm);
  transition: box-shadow var(--transition-base);
}

.report-card:hover {
  box-shadow: var(--shadow-md);
}

.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  cursor: pointer;
}

.report-detail {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-slate-100);
}

/* ========== Anomaly Page ========== */
.anomaly-card {
  background: var(--color-white);
  border: 1px solid rgba(226,232,240,0.6);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-sm);
  transition: box-shadow var(--transition-base);
}

.anomaly-card:hover {
  box-shadow: var(--shadow-md);
}

.anomaly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.anomaly-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

/* ========== User Management Page ========== */
.user-card {
  background: var(--color-white);
  border: 1px solid rgba(226,232,240,0.6);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-sm);
  transition: box-shadow var(--transition-base);
}

.user-card:hover {
  box-shadow: var(--shadow-md);
}

.user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-blue-600);
  transition: color var(--transition-fast);
}

.btn-link:hover {
  color: var(--color-blue-700);
  text-decoration: none;
}

/* ========== Responsive: Tablet ========== */
@media (min-width: 768px) {
  textarea.input {
    min-height: 180px;
  }

  .page-content {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }

  .btn-primary,
  .btn-secondary {
    width: auto;
  }

  .login-card {
    padding: 40px 32px;
  }
}

/* ========== Responsive: Desktop ========== */
@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }

  .bottom-nav {
    display: none;
  }

  .page-content {
    padding-left: calc(220px + var(--space-xl));
    padding-right: var(--space-xl);
    padding-bottom: var(--space-xl);
    max-width: none;
    margin-left: 0;
  }

  .header-inner {
    padding-left: calc(220px + var(--space-md));
  }
}
