/* ═══════════════════════════════════════════════════════════════════════════
 *  GALA FOTO STUDIO — Design System (Light Theme, ADK-POS Inspired)
 *  Include via: <link rel="stylesheet" href="assets/gala-theme.css">
 *  Versi: v2026.06-light-1
 * ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── PRIMARY (Indigo) ── */
  --primary-50:  #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  /* ── SECONDARY (Purple) ── */
  --secondary-500: #a855f7;
  --secondary-600: #9333ea;
  --secondary-700: #7e22ce;

  /* ── NEUTRAL / GRAY ── */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* ── SEMANTIC ── */
  --success: #10b981;
  --success-50: #ecfdf5;
  --success-100: #d1fae5;
  --warning: #f59e0b;
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --danger:  #ef4444;
  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --info:    #3b82f6;
  --info-50: #eff6ff;
  --info-100: #dbeafe;

  /* ── ROLE COLORS ── */
  --role-owner:   #ef4444;
  --role-owner-bg:   #fee2e2;
  --role-manager: #a855f7;
  --role-manager-bg: #f3e8ff;
  --role-kasir:   #3b82f6;
  --role-kasir-bg:   #dbeafe;
  --role-editor:  #f59e0b;
  --role-editor-bg:  #fef3c7;

  /* ── LEGACY ALIASES (untuk gala-api.js compat) ── */
  --bg: var(--gray-100);
  --bg2: #ffffff;
  --surface: #ffffff;
  --border: var(--gray-200);
  --text: var(--gray-900);
  --text2: var(--gray-600);
  --text3: var(--gray-500);
  --green: var(--primary-600);
  --green-dim: var(--primary-50);
  --blue: var(--info);
  --blue-dim: var(--info-50);
  --red: var(--danger);
  --red-dim: var(--danger-50);
  --amber: var(--warning);
  --amber-dim: var(--warning-50);
  --purple: var(--secondary-500);
  --purple-dim: #f3e8ff;

  /* ── SHADOW & RADIUS ── */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow:    0 1px 3px 0 rgba(0,0,0,0.06), 0 1px 2px -1px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.06);

  --radius-sm: 6px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --sidebar-w: 256px;
  --topbar-h: 64px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--primary-600); text-decoration: none; }
a:hover { color: var(--primary-700); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ═══════════════════════════════════════════════════════════════
 *  APP SHELL: SIDEBAR + TOPBAR + MAIN
 * ═══════════════════════════════════════════════════════════════ */

.app-shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.app-sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-200);
}
.app-sidebar__logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-600));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.app-sidebar__logo i { font-size: 20px; color: #fff; }
.app-sidebar__logo img { width: 100%; height: 100%; object-fit: contain; }

.app-sidebar__brand-text { line-height: 1.2; }
.app-sidebar__brand-name {
  font-size: 15px; font-weight: 700; color: var(--gray-900);
  margin: 0;
}
.app-sidebar__brand-sub {
  display: block;
  font-size: 10.5px;
  color: var(--gray-500);
  margin-top: 2px;
}
.app-sidebar__version {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--primary-700);
  background: var(--primary-50);
  border-radius: 4px;
}

.app-sidebar__nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}

.app-sidebar__divider {
  margin: 14px 12px 6px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-200);
}
.app-sidebar__label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  border-right: 2px solid transparent;
}
.nav-link i { font-size: 18px; flex-shrink: 0; }
.nav-link:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}
.nav-link.active {
  background: var(--primary-50);
  color: var(--primary-700);
  border-right-color: var(--primary-500);
}
.nav-link .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--danger-100);
  color: var(--danger);
}
.nav-link .nav-badge.success { background: var(--success-100); color: var(--success); }

.app-sidebar__footer {
  border-top: 1px solid var(--gray-200);
  padding: 14px;
}
.app-sidebar__user {
  display: flex; align-items: center; gap: 10px;
}
.app-sidebar__user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-600));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.app-sidebar__user-info { line-height: 1.3; min-width: 0; }
.app-sidebar__user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.app-sidebar__user-role {
  font-size: 10.5px;
  color: var(--gray-500);
  text-transform: capitalize;
}

/* ── MAIN AREA ── */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.app-topbar {
  height: var(--topbar-h);
  background: #ffffff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.app-topbar__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-900);
}
.app-topbar__breadcrumb {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 1px;
}
.app-topbar__actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
}

/* ── CONTENT ── */
.app-content {
  flex: 1;
  padding: 24px 28px;
}
@media (max-width: 640px) {
  .app-content { padding: 16px; }
}

/* ── MOBILE MENU ── */
.app-mobile-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--gray-200);
  align-items: center; justify-content: center;
  color: var(--gray-600);
}
.app-mobile-toggle i { font-size: 18px; }

@media (max-width: 1023px) {
  .app-sidebar {
    position: fixed;
    left: -260px;
    transition: left 0.25s ease;
  }
  .app-sidebar.open { left: 0; box-shadow: 8px 0 24px rgba(0,0,0,0.12); }
  .app-mobile-toggle { display: inline-flex; }
  .app-sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.4);
    z-index: 35;
  }
  .app-sidebar-backdrop.show { display: block; }
}

/* ═══════════════════════════════════════════════════════════════
 *  COMPONENTS: CARD, BUTTON, INPUT, BADGE
 * ═══════════════════════════════════════════════════════════════ */

/* ── CARD ── */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
}
.card__subtitle {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}
.card__body { padding: 20px; }

/* ── STAT CARD (like ADK-POS dashboard) ── */
.stat-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card--solid {
  color: #fff;
  border: none;
}
.stat-card--primary  { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.stat-card--purple   { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.stat-card--green    { background: linear-gradient(135deg, #10b981, #047857); }
.stat-card--amber    { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card--rose     { background: linear-gradient(135deg, #f43f5e, #be123c); }
.stat-card--blue     { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat-card__label {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
  margin-bottom: 6px;
}
.stat-card__value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}
.stat-card__meta {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
}
.stat-card__icon {
  position: absolute;
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
}
.stat-card__icon i { font-size: 20px; }

/* ── BUTTON ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn i { font-size: 16px; }
.btn--sm { padding: 6px 11px; font-size: 12px; }
.btn--lg { padding: 12px 22px; font-size: 14px; }

.btn--primary {
  background: var(--primary-600);
  color: #fff;
}
.btn--primary:hover:not(:disabled) { background: var(--primary-700); }

.btn--secondary {
  background: #fff;
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { background: #dc2626; }

.btn--success { background: var(--success); color: #fff; }
.btn--success:hover:not(:disabled) { background: #059669; }

.btn--ghost {
  background: transparent;
  color: var(--gray-600);
}
.btn--ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-900); }

.btn--gradient {
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-600));
  color: #fff;
  box-shadow: var(--shadow);
}
.btn--gradient:hover:not(:disabled) {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ── INPUT ── */
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gray-900);
  transition: border 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}
.input::placeholder { color: var(--gray-400); }

.input--with-icon {
  padding-left: 38px;
}
.input-wrap { position: relative; }
.input-wrap__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 16px;
  pointer-events: none;
}

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

/* ── BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  background: var(--gray-100);
  color: var(--gray-700);
  text-transform: capitalize;
  letter-spacing: 0.01em;
}
.badge--primary  { background: var(--primary-100); color: var(--primary-700); }
.badge--success  { background: var(--success-100); color: #047857; }
.badge--warning  { background: var(--warning-100); color: #b45309; }
.badge--danger   { background: var(--danger-100); color: #b91c1c; }
.badge--info     { background: var(--info-100); color: #1e40af; }

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.role-badge--owner   { background: var(--role-owner-bg);   color: var(--role-owner); }
.role-badge--manager { background: var(--role-manager-bg); color: var(--role-manager); }
.role-badge--admin   { background: var(--role-manager-bg); color: var(--role-manager); }
.role-badge--kasir   { background: var(--role-kasir-bg);   color: var(--role-kasir); }
.role-badge--editor  { background: var(--role-editor-bg);  color: var(--role-editor); }

/* ── TABLE ── */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 11px 16px;
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }

/* ── EMPTY & LOADING ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}
.empty-state i {
  font-size: 48px;
  color: var(--gray-300);
  display: block;
  margin-bottom: 12px;
}
.empty-state__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.empty-state__desc {
  font-size: 12.5px;
  line-height: 1.6;
}

.loading-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}
.loading-state i {
  font-size: 24px;
  display: block;
  margin-bottom: 8px;
  animation: spin 1s linear infinite;
}

/* ── UTILS ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.grid { display: grid; }
.w-full { width: 100%; }

.text-xs { font-size: 11px; }
.text-sm { font-size: 12.5px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 22px; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-900 { color: var(--gray-900); }
.text-primary { color: var(--primary-600); }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ── ANIMATIONS ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.25s ease both; }

/* ── PRINT ── */
@media print {
  .app-sidebar, .app-topbar, .no-print { display: none !important; }
  .app-main { display: block; }
  .app-content { padding: 0; }
}
