/* ============================================
   Akun Baligen - Mobile-First CSS
   ============================================ */

:root {
  --brand-primary: #1a237e;
  --brand-primary-light: #3949ab;
  --brand-primary-dark: #0d1642;
  --brand-bg: #f5f6fa;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --bottom-nav-height: 64px;
  --header-height: 56px;
  --touch-target: 44px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--brand-bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* App Shell */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: var(--brand-primary);
  color: #fff;
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
}

.header-brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
}

.header-user {
  display: flex;
  align-items: center;
}

.user-name {
  font-size: 14px;
  opacity: 0.9;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main Content */
.app-content {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(var(--bottom-nav-height) + 24px);
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #e0e0e0;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
  gap: 2px;
  transition: color 0.15s;
}

.nav-item i { font-size: 22px; }
.nav-item.active { color: var(--brand-primary); }
.nav-item:active { opacity: 0.7; }

/* Page Header */
.page-header {
  margin-bottom: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

/* Stat Cards */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-icon {
  font-size: 28px;
  color: var(--brand-primary);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Card */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding: 12px 16px;
  font-size: 15px;
}

.card-body {
  padding: 16px;
}

/* Location Cards */
.location-card {
  display: flex;
  align-items: center;
  padding: 14px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.15s;
  gap: 12px;
}

.location-card:active { background: #f0f0f8; }

.location-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.location-info { flex: 1; min-width: 0; }
.location-name { font-weight: 600; font-size: 15px; }
.location-meta { font-size: 12px; margin-top: 2px; }

.location-akun-count {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* List group items */
.list-group-item {
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid #f0f0f0;
}

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

/* Touch-friendly inputs */
.form-control, .form-select {
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(26,35,126,0.15);
}

/* Buttons */
.btn { border-radius: 8px; font-weight: 500; }
.btn-primary { background: var(--brand-primary); border-color: var(--brand-primary); }
.btn-primary:hover, .btn-primary:active { background: var(--brand-primary-light); border-color: var(--brand-primary-light); }

/* Detail table */
.detail-table td { padding: 10px 8px; font-size: 15px; }
.detail-table .w-label { width: 100px; color: var(--text-secondary); }
@media (min-width: 768px) {
  .detail-table .w-label { width: 150px; }
}

/* Fixed Action Button (FAB) */
.fixed-action-btn {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 24px);
  right: 20px;
  z-index: 999;
}

.fixed-action-btn .btn {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Filter bar */
.filter-bar select {
  font-size: 16px;
  height: 44px;
}

/* Avatar */
.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
}

/* SweetAlert overrides */
.swal2-popup { font-size: 15px; border-radius: 12px; }
.swal2-confirm { border-radius: 8px; }
.swal2-cancel { border-radius: 8px; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* Desktop adjustments */
@media (min-width: 768px) {
  .app-content { padding: 24px 32px; padding-bottom: 32px; }
  .bottom-nav { max-width: 500px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
  .page-title { font-size: 26px; }
}
