/* assets/css/app.css — GharFix Global Styles */

:root {
  --primary:       #1B3A6B;
  --primary-light: #2563EB;
  --primary-bg:    #EFF6FF;
  --accent:        #F59E0B;
  --accent-bg:     #FEF3C7;
  --success:       #16A34A;
  --success-bg:    #DCFCE7;
  --danger:        #DC2626;
  --danger-bg:     #FEE2E2;
  --warning:       #D97706;
  --warning-bg:    #FEF3C7;
  --gray-50:       #F9FAFB;
  --gray-100:      #F3F4F6;
  --gray-200:      #E5E7EB;
  --gray-400:      #9CA3AF;
  --gray-500:      #6B7280;
  --gray-700:      #374151;
  --gray-900:      #111827;
  --white:         #FFFFFF;
  --radius-sm:     6px;
  --radius:        12px;
  --radius-lg:     18px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
  --shadow:        0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.12);
  --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
  --nav-height:    64px;
  --bottom-nav:    68px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family:      var(--font);
  background:       var(--gray-50);
  color:            var(--gray-700);
  min-height:       100vh;
  padding-bottom:   var(--bottom-nav);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }

/* ── Top Nav ─────────────────────────────────────────────────── */
.top-nav {
  position:      fixed;
  top:           0;
  left:          0;
  right:         0;
  height:        var(--nav-height);
  background:    var(--primary);
  display:       flex;
  align-items:   center;
  justify-content: space-between;
  padding:       0 16px;
  z-index:       100;
  box-shadow:    var(--shadow);
}
.top-nav .nav-logo {
  display:     flex;
  align-items: center;
  gap:         10px;
  color:       var(--white);
}
.top-nav .nav-logo img { width: 32px; border-radius: 6px; }
.top-nav .nav-logo span { font-size: 1.2rem; font-weight: 700; }
.top-nav .nav-right {
  display:     flex;
  align-items: center;
  gap:         12px;
}
.nav-icon-btn {
  background:  rgba(255,255,255,0.15);
  border:      none;
  color:       var(--white);
  width:       36px;
  height:      36px;
  border-radius: 50%;
  display:     flex;
  align-items: center;
  justify-content: center;
  font-size:   1.1rem;
  transition:  background 0.2s;
}
.nav-icon-btn:hover { background: rgba(255,255,255,0.25); }
.nav-avatar {
  width:         36px;
  height:        36px;
  border-radius: 50%;
  background:    var(--accent);
  color:         var(--primary);
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-weight:   700;
  font-size:     0.9rem;
}

/* ── Page Wrapper ─────────────────────────────────────────────── */
.page-wrapper {
  margin-top:  var(--nav-height);
  min-height:  calc(100vh - var(--nav-height));
  padding:     16px;
  max-width:   640px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Bottom Nav ───────────────────────────────────────────────── */
.bottom-nav {
  position:      fixed;
  bottom:        0;
  left:          0;
  right:         0;
  height:        var(--bottom-nav);
  background:    var(--white);
  border-top:    1.5px solid var(--gray-200);
  display:       flex;
  align-items:   center;
  justify-content: space-around;
  z-index:       100;
  box-shadow:    0 -2px 12px rgba(0,0,0,0.06);
}
.bottom-nav a {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            3px;
  color:          var(--gray-400);
  font-size:      0.68rem;
  font-weight:    500;
  padding:        8px 16px;
  transition:     color 0.2s;
}
.bottom-nav a .nav-icon { font-size: 1.3rem; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active .nav-icon { transform: scale(1.1); }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background:    var(--white);
  border-radius: var(--radius);
  padding:       16px;
  box-shadow:    var(--shadow-sm);
  border:        1px solid var(--gray-200);
}

/* ── Stat Cards ───────────────────────────────────────────────── */
.stats-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   10px;
  margin-bottom:         16px;
}
.stat-card {
  background:    var(--white);
  border-radius: var(--radius);
  padding:       14px 10px;
  text-align:    center;
  box-shadow:    var(--shadow-sm);
  border:        1px solid var(--gray-200);
}
.stat-card .stat-icon  { font-size: 1.4rem; margin-bottom: 4px; }
.stat-card .stat-value { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 0.7rem; color: var(--gray-500); margin-top: 2px; }

/* ── Section Header ───────────────────────────────────────────── */
.section-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   12px;
}
.section-title {
  font-size:   1rem;
  font-weight: 700;
  color:       var(--gray-900);
}
.section-link {
  font-size:  0.8rem;
  color:      var(--primary-light);
  font-weight: 600;
}

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display:       inline-flex;
  align-items:   center;
  padding:       3px 10px;
  border-radius: 99px;
  font-size:     0.72rem;
  font-weight:   600;
}
.badge-success  { background: var(--success-bg);  color: var(--success); }
.badge-warning  { background: var(--warning-bg);  color: var(--warning); }
.badge-danger   { background: var(--danger-bg);   color: var(--danger); }
.badge-primary  { background: var(--primary-bg);  color: var(--primary); }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display:       inline-flex;
  align-items:   center;
  justify-content: center;
  gap:           6px;
  padding:       10px 20px;
  border-radius: var(--radius-sm);
  font-size:     0.9rem;
  font-weight:   600;
  border:        none;
  transition:    all 0.2s;
}
.btn-primary   { background: var(--primary); color: var(--white); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-accent    { background: var(--accent); color: var(--primary); }
.btn-danger    { background: var(--danger-bg); color: var(--danger); }
.btn-full      { width: 100%; }
.btn:hover     { opacity: 0.9; transform: translateY(-1px); }
.btn:active    { transform: translateY(0); }

/* ── Alert ────────────────────────────────────────────────────── */
.alert {
  padding:       12px 16px;
  border-radius: var(--radius-sm);
  font-size:     0.875rem;
  margin-bottom: 16px;
  display:       flex;
  align-items:   flex-start;
  gap:           10px;
}
.alert-warning { background: var(--warning-bg); color: var(--warning); border-left: 3px solid var(--warning); }
.alert-success { background: var(--success-bg); color: var(--success); border-left: 3px solid var(--success); }
.alert-info    { background: var(--primary-bg); color: var(--primary); border-left: 3px solid var(--primary-light); }

/* ── Toggle Switch ────────────────────────────────────────────── */
.toggle-wrap {
  display:     flex;
  align-items: center;
  gap:         10px;
}
.toggle {
  position: relative;
  width:    52px;
  height:   28px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position:      absolute;
  inset:         0;
  background:    var(--gray-200);
  border-radius: 99px;
  cursor:        pointer;
  transition:    0.3s;
}
.toggle-slider::before {
  content:       '';
  position:      absolute;
  width:         22px;
  height:        22px;
  left:          3px;
  top:           3px;
  background:    var(--white);
  border-radius: 50%;
  transition:    0.3s;
  box-shadow:    var(--shadow-sm);
}
.toggle input:checked + .toggle-slider { background: var(--success); }
.toggle input:checked + .toggle-slider::before { transform: translateX(24px); }

/* ── Progress Bar ─────────────────────────────────────────────── */
.progress-bar {
  background:    var(--gray-200);
  border-radius: 99px;
  height:        8px;
  overflow:      hidden;
}
.progress-fill {
  height:        100%;
  border-radius: 99px;
  background:    linear-gradient(90deg, var(--primary-light), var(--primary));
  transition:    width 0.5s ease;
}

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
  text-align:  center;
  padding:     32px 16px;
  color:       var(--gray-400);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; }

/* ── Utility ──────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.mt-8     { margin-top: 8px; }
.mt-12    { margin-top: 12px; }
.mt-16    { margin-top: 16px; }
.mb-16    { margin-bottom: 16px; }
.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.75rem; }
.text-muted { color: var(--gray-500); }
.fw-600   { font-weight: 600; }
.fw-700   { font-weight: 700; }

@media (min-width: 640px) {
  .page-wrapper { padding: 24px; }
}
