/* ============================================
   BENGKELFLOWMOTO DATASYS v3 - ORANGE FINTECH THEME
   ============================================ */

:root {
  --primary: #f26522;
  --primary-light: #ff7a3d;
  --primary-dark: #d94f0f;
  --primary-soft: rgba(242, 101, 34, 0.1);
  --accent: #f26522;
  --accent-light: #ff7a3d;
  --accent-glow: rgba(242, 101, 34, 0.15);
  --bg-body: #f8f9fb;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-input: #f5f7fa;
  --bg-hover: #f0f2f5;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-light: #d1d5db;
  --text-on-dark: #ffffff;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-soft: rgba(16, 185, 129, 0.1);
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-soft: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --info: #3b82f6;
  --info-bg: #eff6ff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-xl: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-accent: 0 4px 16px rgba(242, 101, 34, 0.25);
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   APP SHELL
   ============================================ */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg-body);
  padding-bottom: 90px;
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
  background: var(--bg-header);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-light);
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.app-header .brand-text {
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.app-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .header-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.app-header .header-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.app-header .header-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content-area {
  padding: 16px;
  min-height: calc(100vh - 140px);
}

/* ============================================
   PAGE TITLE
   ============================================ */
.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ============================================
   SHORTCUT CARDS (Dashboard)
   ============================================ */
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.shortcut-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
  cursor: pointer;
}

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

.shortcut-card:active {
  transform: scale(0.98);
}

.shortcut-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 1.4rem;
}

.shortcut-icon.orange {
  background: var(--primary-soft);
  color: var(--primary);
}

.shortcut-icon.green {
  background: var(--success-soft);
  color: var(--success);
}

.shortcut-icon.blue {
  background: var(--info-bg);
  color: var(--info);
}

.shortcut-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ============================================
   CHART CARD
   ============================================ */
.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chart-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.chart-container {
  position: relative;
  height: 200px;
}

/* ============================================
   MONEY CARDS (Money In / Money Out)
   ============================================ */
.money-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.money-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.money-card.in {
  border-left: 4px solid var(--success);
}

.money-card.out {
  border-left: 4px solid var(--danger);
}

.money-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.money-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.money-value.in {
  color: var(--success);
}

.money-value.out {
  color: var(--danger);
}

.money-arrow {
  font-size: 0.9rem;
  margin-left: 4px;
}

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

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ============================================
   WIDGET CARDS
   ============================================ */
.widget-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.widget-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.widget-action {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* ============================================
   ORDER / LIST ITEMS
   ============================================ */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.order-item {
  background: var(--bg-card);
  padding: 14px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
}

.order-item:last-child {
  border-bottom: none;
}

.order-item:hover {
  background: var(--bg-hover);
  margin: 0 -16px;
  padding: 14px 16px;
  border-radius: var(--radius);
}

.order-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.order-icon.doc {
  background: var(--primary-soft);
  color: var(--primary);
}

.order-content {
  flex: 1;
  min-width: 0;
}

.order-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.order-amount {
  text-align: right;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.order-amount.positive {
  color: var(--primary);
}

.order-amount.negative {
  color: var(--danger);
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 1000;
  width: 100%;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  border-top: 1px solid var(--border-light);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  transition: all 0.2s;
  flex: 1;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  transition: all 0.2s;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active svg {
  stroke-width: 2.5;
}

.nav-center {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: -16px;
}

.nav-center .fab {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(242, 101, 34, 0.4);
  color: white;
  text-decoration: none;
  transition: all 0.2s;
  border: 3px solid var(--bg-body);
}

.nav-center .fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(242, 101, 34, 0.5);
}

.nav-center .fab:active {
  transform: scale(0.95);
}

.nav-center .fab svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.5;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(242, 101, 34, 0.35);
}

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

.btn-sm {
  padding: 10px 16px;
  font-size: 0.8rem;
}

/* ============================================
   SEARCH
   ============================================ */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-bar input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  font-size: 0.95rem;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-bar .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

/* ============================================
   FILTER CHIPS
   ============================================ */
.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.filter-chip.active,
.filter-chip:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 700;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ============================================
   DIVIDER
   ============================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}

/* ============================================
   SHEET / BOTTOM MODAL
   ============================================ */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

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

.sheet {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  animation: sheetUp 0.3s ease-out;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.sheet-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.sheet-close {
  background: var(--bg-hover);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.4rem;
  font-weight: 300;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  width: 50px;
  height: 28px;
  background: var(--border);
  border-radius: var(--radius-full);
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(22px);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-primary {
  background: var(--info-bg);
  color: var(--info);
}

.badge-warning {
  background: var(--warning-bg);
  color: #92400e;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.35s ease-out;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

/* ============================================
   DESKTOP
   ============================================ */
@media (min-width: 768px) {
  .app-shell {
    max-width: 420px;
  }
}
.app-header .brand-icon img,
.auth-top .brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
