/* mobile/css/mobile.css - PKB Mobile Kader Lapangan Stylesheet */
:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #10b981;
  --primary-soft: rgba(16, 185, 129, 0.12);
  --primary-glow: rgba(16, 185, 129, 0.25);
  --accent: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-float: 0 8px 24px rgba(5, 150, 105, 0.25);
}

[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: #131b2e;
  --bg-glass: rgba(19, 27, 46, 0.88);
  --border-color: #1e293b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  padding-top: var(--safe-top);
  padding-bottom: calc(72px + var(--safe-bottom));
  overflow-x: hidden;
  user-select: none;
}

/* App Container */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg-main);
}

/* Top App Bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.brand-text h1 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.territory-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  margin-top: 3px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.92);
}

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.badge-dot.offline {
  background: var(--danger);
}

/* Bottom Tab Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding-bottom: var(--safe-bottom);
}

.bottom-nav-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 64px;
  padding: 0 6px;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 0;
  transition: all 0.2s ease;
  font-size: 10px;
  font-weight: 600;
}

.nav-tab svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.nav-tab.active svg {
  transform: translateY(-2px) scale(1.1);
  stroke: var(--primary);
}

/* Views & Containers */
.tab-view {
  display: none;
  padding: 16px;
  animation: fadeIn 0.25s ease-out;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Compact Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.card-hero {
  background: linear-gradient(135deg, #065f46 0%, #047857 50%, #059669 100%);
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(4, 120, 87, 0.3);
  position: relative;
  overflow: hidden;
}

.card-hero::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

/* Quick Action Grid */
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-main);
  text-align: center;
}

.action-btn:active {
  transform: scale(0.94);
  background: var(--primary-soft);
}

.action-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.action-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

/* Stats Counter Pill */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-val {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

/* Form Styles */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

textarea.form-control {
  height: 76px;
  padding: 10px 12px;
  resize: vertical;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.filter-pill {
  flex-shrink: 0;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px var(--primary-glow);
}

/* Floating Action Button (FAB) */
.fab-btn {
  position: fixed;
  bottom: calc(76px + var(--safe-bottom));
  right: 16px;
  z-index: 45;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-btn:active {
  transform: scale(0.9) rotate(90deg);
}

/* Modals & Slide-up Sheets */
.modal-overlay,
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.active,
.modal-backdrop.active {
  display: flex;
}

.modal-sheet {
  background: var(--bg-card);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 16px calc(20px + var(--safe-bottom)) 16px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* Permission Status Pill */
.perm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.perm-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.perm-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.status-granted {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
}

.status-denied {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.status-prompt {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
}

/* GPS Geotag Indicator Pill */
.gps-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  margin-top: 4px;
}

.gps-pill.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Photo Preview Box */
.photo-box {
  width: 100%;
  height: 120px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  background: var(--bg-main);
  color: var(--text-muted);
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.photo-box:hover {
  border-color: var(--primary);
}

.photo-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Item List Cards */
.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.item-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.item-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-color);
  padding-top: 6px;
  margin-top: 4px;
}

/* Auth View */
.auth-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg-main);
}

/* Auth Tabs & Switcher */
.auth-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.auth-tab-btn svg {
  stroke-width: 2.2;
}

/* Alert Boxes */
.alert-box {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  line-height: 1.45;
}

.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #1d4ed8;
}

[data-theme="dark"] .alert-info {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #047857;
}

[data-theme="dark"] .alert-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #b45309;
}

[data-theme="dark"] .alert-warning {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #b91c1c;
}

[data-theme="dark"] .alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.badge-role-mobile {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

