/* TazWorld: Chocolate City — GTA Phone UI */
/* Mobile-first, dark theme, GTA V aesthetic */

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222;
  --text-primary: #f0f0f0;
  --text-secondary: #888;
  --text-muted: #555;
  --accent-blue: #2d8cf0;
  --accent-orange: #f0a030;
  --accent-green: #2ecc71;
  --accent-red: #e74c3c;
  --accent-pink: #ff6b9d;
  --health-color: #2ecc71;
  --armor-color: #3498db;
  --xp-color: #f1c40f;
  --wanted-color: #e74c3c;
  --border-color: #222;
  --phone-radius: 24px;
  --dock-height: 60px;
  --status-height: 30px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: #000;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Phone frame */
#phone {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Status bar */
#status-bar {
  height: var(--status-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #000;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Screen area */
#screen {
  flex: 1;
  position: relative;
  overflow: hidden;
  height: calc(100vh - var(--status-height) - var(--dock-height));
}

.screen {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.screen.active {
  display: flex;
}

/* Scrollable content area */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px;
  padding-bottom: 80px;
  -webkit-overflow-scrolling: touch;
}

/* Screen headers */
.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.screen-header span {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.back-btn, .filter-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
}

.screen-subheader {
  padding: 8px 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-orange);
  background: var(--bg-secondary);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

/* ===== HOME SCREEN ===== */
#screen-home {
  background: linear-gradient(145deg, #0a0a0a 0%, #111 50%, #0d0d1a 100%);
  position: relative;
  padding: 20px 16px 0;
}

.wallpaper-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(45, 140, 240, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* HUD Strip */
#hud-strip {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.hud-item {
  flex: 1;
}

.hud-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
  display: block;
}

.hud-bar-bg {
  height: 6px;
  background: #1a1a1a;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #222;
}

.hud-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.health-fill { background: linear-gradient(90deg, #2ecc71, #27ae60); }
.armor-fill { background: linear-gradient(90deg, #3498db, #2980b9); }

/* HUD Compact — Dual Cash */
#hud-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 2px 12px;
  font-size: 11px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

#hud-level { color: var(--accent-blue); }
#hud-wanted { color: var(--wanted-color); letter-spacing: 2px; }
#hud-streak { color: var(--accent-orange); }

/* Dual Cash display */
#hud-cash-dual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

#hud-cash-game {
  color: var(--accent-green);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

#hud-cash-real {
  color: var(--accent-blue);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  opacity: 0.8;
}

/* App Grid */
#app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px 8px;
  position: relative;
  z-index: 1;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

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

.app-icon-inner {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.mission-icon { background: linear-gradient(135deg, #1a1a2e, #16213e); border-color: var(--accent-blue); }
.stats-icon { background: linear-gradient(135deg, #1a2e1a, #1e3e16); border-color: var(--accent-green); }
.map-icon { background: linear-gradient(135deg, #2e1a2e, #3e162e); border-color: var(--accent-pink); }
.brief-icon { background: linear-gradient(135deg, #2e2e1a, #3e3e16); border-color: var(--accent-orange); }
.radio-icon { background: linear-gradient(135deg, #1a1a2e, #16213e); border-color: #555; }
.parlay-icon { background: linear-gradient(135deg, #2e1a1a, #3e1616); border-color: var(--accent-red); }
.shop-icon { background: linear-gradient(135deg, #1a2e2a, #163e2e); border-color: var(--accent-green); }
.financials-icon { background: linear-gradient(135deg, #2a1a2e, #3e163e); border-color: var(--accent-pink); }
.settings-icon { background: linear-gradient(135deg, #2e2e2e, #3e3e3e); border-color: var(--text-muted); }
.collab-icon { background: linear-gradient(135deg, #2e1a2e, #3e163e); border-color: #9b59b6; }
.debrief-icon { background: linear-gradient(135deg, #1a2e2e, #163e3e); border-color: var(--accent-blue); }

.app-icon span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

/* Home time */
#home-time {
  text-align: center;
  margin-top: auto;
  padding: 20px 0;
  position: relative;
  z-index: 1;
}

#home-time-lg {
  font-size: 48px;
  font-weight: 200;
  color: var(--text-primary);
  letter-spacing: 2px;
}

#home-date {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* ===== MISSIONS LIST ===== */
#missions-filter {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  overflow-x: auto;
  background: var(--bg-secondary);
  -webkit-overflow-scrolling: touch;
}

#missions-filter.hidden { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.mission-item {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.mission-item:active {
  transform: scale(0.98);
  background: var(--bg-card-hover);
}

.mission-item.completed {
  opacity: 0.5;
}

.mission-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  color: transparent;
  transition: all 0.2s;
}

.mission-check.done {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.mission-info {
  flex: 1;
  min-width: 0;
}

.mission-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.mission-meta {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
}

.mission-type-badge {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.type-story { background: rgba(45, 140, 240, 0.15); color: var(--accent-blue); }
.type-side { background: rgba(46, 204, 113, 0.15); color: var(--accent-green); }
.type-heist { background: rgba(241, 196, 15, 0.15); color: var(--accent-orange); }
.type-freeroam { background: rgba(136, 136, 136, 0.15); color: var(--text-secondary); }

.mission-reward {
  text-align: right;
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mission-reward .xp { color: var(--accent-orange); font-weight: 700; }
.mission-reward .cash { color: var(--accent-green); }

/* Floating Action Button for manual mission entry */
.fab-btn {
  position: absolute;
  bottom: 24px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: none;
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(45, 140, 240, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: transform 0.15s, box-shadow 0.15s;
}

.fab-btn:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(45, 140, 240, 0.3);
}

/* ===== STATS SCREEN ===== */
#player-card {
  background: linear-gradient(135deg, #1a1a2e, #111);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

#player-title {
  font-size: 12px;
  color: var(--accent-orange);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

#player-level-badge {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 12px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 10px;
}

.stat-row span:first-child {
  width: 50px;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.stat-bar-bg {
  flex: 1;
  height: 6px;
  background: #1a1a1a;
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}

.stat-row span:last-child {
  width: 35px;
  text-align: right;
  font-weight: 700;
  font-size: 10px;
}

.xp-fill { background: linear-gradient(90deg, #f1c40f, #f39c12); }

#stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.stat-label {
  font-size: 8px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

#today-stats, #achievements, #completion-feed {
  margin-bottom: 16px;
}

#today-stats h3, #achievements h3, #completion-feed h3,
#brief-templates h3, #brief-custom h3, #brief-actions h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.today-grid div {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.today-grid span {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-blue);
}

.today-grid small {
  font-size: 9px;
  color: var(--text-muted);
}

/* ===== MAP SCREEN ===== */
#map-container {
  margin-bottom: 16px;
}

#minimap {
  background: #0d0d1a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  position: relative;
}

.map-district {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #1a1a1a;
}

.map-district:last-child { border-bottom: none; }

.district-label {
  width: 65px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.district-bar {
  flex: 1;
  height: 8px;
  background: #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
}

.district-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-pink));
  transition: width 0.5s;
  width: 0%;
}

.district-pct {
  width: 35px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

#map-week1 .district-fill { background: linear-gradient(90deg, #2d8cf0, #5b9ef4); }
#map-week2 .district-fill { background: linear-gradient(90deg, #f0a030, #f4b85b); }
#map-week3 .district-fill { background: linear-gradient(90deg, #e74c3c, #f06b5b); }
#map-week4 .district-fill { background: linear-gradient(90deg, #2ecc71, #5bd98a); }

#map-level-info {
  display: flex;
  justify-content: space-between;
  padding: 8px 4px 0;
  font-size: 11px;
  color: var(--text-muted);
}

#map-level-info span:first-child {
  color: var(--accent-blue);
  font-weight: 700;
}

/* ===== BRIEF SCREEN ===== */
#template-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.template-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: 0.15s;
}

.template-chip:active {
  background: var(--bg-card-hover);
}

.template-name {
  font-size: 13px;
  font-weight: 600;
}

.template-count {
  font-size: 10px;
  color: var(--text-muted);
}

.brief-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}

#goals-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
}

#goals-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

/* ===== FORM INPUTS (shared) ===== */
.form-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

form-input option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ===== BUTTONS ===== */
.action-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--accent-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: 0.15s;
}

.action-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.action-btn.secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.action-btn.danger {
  background: var(--accent-red);
}

/* ===== RADIO FEED ===== */
#radio-feed {
  padding: 8px 0;
}

.radio-entry {
  padding: 10px 4px;
  border-bottom: 1px solid #1a1a1a;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.radio-entry .r-time {
  font-size: 9px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.radio-entry .r-msg {
  color: var(--text-primary);
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

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

#modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

#modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

#modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

#modal-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

#modal-deadline {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ===== TOAST ===== */
#toast {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 300;
  transition: opacity 0.3s;
  max-width: 90%;
  text-align: center;
}

#toast.hidden { opacity: 0; pointer-events: none; }

/* ===== DOCK ===== */
#dock {
  height: var(--dock-height);
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #0d0d0d;
  border-top: 1px solid var(--border-color);
  position: sticky;
  bottom: 0;
  z-index: 100;
  padding: 0 8px;
}

.dock-btn {
  background: none;
  border: none;
  font-size: 22px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.15s;
  color: var(--text-muted);
}

.dock-btn:active {
  background: var(--bg-card);
  transform: scale(0.9);
}

/* ===== AUTH OVERLAY ===== */
.auth-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
}

.auth-overlay.hidden { display: none; }

.auth-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.auth-logo {
  font-size: 48px;
  margin-bottom: 8px;
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.auth-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.auth-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 10px;
  font-family: inherit;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.auth-error {
  font-size: 12px;
  color: var(--accent-red);
  padding: 8px;
  margin-bottom: 6px;
}

.auth-error.hidden { display: none; }

/* ===== SHOP SCREEN ===== */
#shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.shop-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: 0.15s;
}

.shop-item-icon {
  font-size: 32px;
  margin-bottom: 4px;
}

.shop-item-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.shop-item-desc {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.3;
  min-height: 22px;
}

.shop-item-owned {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-green);
  letter-spacing: 1px;
  padding: 4px 12px;
  border: 1px solid var(--accent-green);
  border-radius: 6px;
  margin-top: 4px;
}

.shop-buy-btn {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: var(--accent-green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
  margin-top: 4px;
}

.shop-buy-btn:active {
  transform: scale(0.96);
}

.shop-buy-btn.disabled {
  background: #2a2a2a;
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Owned perks (Your Perks section) */
.owned-perk {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--accent-green);
}

.owned-perk .shop-item-icon {
  font-size: 24px;
  margin-bottom: 0;
}

.owned-perk .shop-item-name {
  flex: 1;
  text-align: left;
}

.shop-use-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent-orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: 0.15s;
  flex-shrink: 0;
}

.shop-use-btn:active {
  transform: scale(0.96);
}

#shop-perks-owned {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== FINANCIALS SCREEN ===== */
.fin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.fin-row span:last-child {
  font-weight: 700;
  color: var(--text-primary);
}

.fin-monthly-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 6px;
  gap: 10px;
  font-size: 12px;
}

.fin-month-label {
  flex: 1;
  font-weight: 700;
  color: var(--text-primary);
}

.fin-month-rev {
  color: var(--accent-green);
  font-weight: 700;
}

.fin-month-count {
  color: var(--text-muted);
  font-size: 10px;
  width: 50px;
  text-align: right;
}

/* Transactions */
.fin-tx-row {
  display: flex;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid #1a1a1a;
  gap: 10px;
  font-size: 12px;
}

.fin-tx-info {
  flex: 1;
  min-width: 0;
}

.fin-tx-desc {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.fin-tx-date {
  display: block;
  font-size: 9px;
  color: var(--text-muted);
}

.fin-tx-amount {
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.fin-tx-amount.income {
  color: var(--accent-green);
}

.fin-tx-amount.expense {
  color: var(--accent-red);
}

/* ===== SETTINGS SCREEN ===== */
#settings-profile .action-btn.danger {
  margin-bottom: 0;
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }

.empty-msg {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

/* Select styling */
select.form-input, select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  color: var(--text-primary);
}

select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/*= ===== TABLET / LARGER SCREENS ===== */
@media (min-width: 768px) {
  body {
    padding: 20px;
    background: #050505;
  }
  #phone {
    max-width: 420px;
    border-radius: var(--phone-radius);
    box-shadow: 0 0 60px rgba(45, 140, 240, 0.05), 0 20px 60px rgba(0,0,0,0.8);
    min-height: calc(100vh - 40px);
    max-height: 800px;
    overflow: hidden;
    border: 1px solid #1a1a1a;
  }
  @media (orientation: landscape) and (max-height: 600px) {
    #phone { max-height: 500px; }
    .screen { min-height: 400px; }
    #dock { height: 50px; }
    .dock-btn { font-size: 18px; padding: 4px 10px; }
  }
}

/* Scrollbar styling */
.scroll-content::-webkit-scrollbar {
  width: 3px;
}
.scroll-content::-webkit-scrollbar-track {
  background: transparent;
}
.scroll-content::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}

/* Loading shimmer */
@keyframes shimmer {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.loading {
  animation: shimmer 1.2s ease-in-out infinite;
}

/* Pulse effect for notifications */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse { animation: pulse 1s ease-in-out; }

/* ===== DEBRIEF SCREEN ===== */
.debrief-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.debrief-month {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.debrief-grade {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-orange);
  letter-spacing: 2px;
}

.debrief-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.debrief-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 6px;
  text-align: center;
}

.debrief-stat-num {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.debrief-stat-label {
  font-size: 8px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.debrief-section {
  margin-bottom: 16px;
}

.debrief-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.debrief-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--text-muted);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
}

.debrief-card-green {
  border-left-color: var(--accent-green);
}

.debrief-card-red {
  border-left-color: var(--accent-red);
}

.debrief-card-blue {
  border-left-color: var(--accent-blue);
}

.debrief-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.debrief-card-meta {
  font-size: 10px;
  color: var(--text-muted);
}

.debrief-download-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.debrief-download-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: 0.15s;
  color: #fff;
  text-align: center;
}

.debrief-download-btn:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.download-csv {
  background: var(--accent-green);
}

.download-md {
  background: var(--accent-orange);
}

.download-json {
  background: var(--accent-blue);
}
