/* ============================================================
   LoyaltyPoint — app.css
   ============================================================ */

:root {
  --teal:     #0F6E56;
  --teal-lt:  #E1F5EE;
  --teal-dk:  #0A4F3D;
  --dark:     #0D1B2A;
  --gray:     #64748B;
  --gray-lt:  #F1F5F9;
  --border:   #E2E8F0;
  --white:    #FFFFFF;
  --amber:    #F59E0B;
  --red:      #EF4444;
  --blue:     #3B82F6;
  --radius:   10px;
  --shadow:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  color: var(--dark);
  background: var(--gray-lt);
  line-height: 1.5;
}

/* ── LAYOUT ─────────────────────────────────────────── */
.app-layout   { display: flex; min-height: 100vh; }
.main-content { flex: 1; padding: 2rem; overflow-y: auto; }
.page-title   { font-size: 20px; font-weight: 600; margin-bottom: 1.5rem; color: var(--dark); }
.page-sub     { font-size: 13px; color: var(--gray); margin-top: 4px; }

/* ── SIDEBAR ────────────────────────────────────────── */
.sidebar {
  width: 220px;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  flex-shrink: 0;
  min-height: 100vh;
}
.sidebar-brand {
  padding: .75rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: .5rem;
}
.brand-name { font-size: 16px; font-weight: 600; color: #fff; }
.plan-badge {
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  background: var(--teal); color: #fff;
  letter-spacing: .5px;
}
.plan-badge.admin { background: #7C3AED; }
.sidebar-store {
  font-size: 11px; color: rgba(255,255,255,.45);
  padding: 0 1.25rem .75rem;
}
.sidebar-nav { flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: .6rem 1.25rem;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: 13px;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover    { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active   { background: rgba(15,110,86,.3); color: #fff; border-left-color: var(--teal); }
.nav-logout        { margin-top: auto; color: rgba(255,255,255,.4) !important; font-size: 12px; }

/* ── CARDS ──────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--dark); margin-bottom: 1rem; }

/* ── STATS GRID ─────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.stat-val { font-size: 24px; font-weight: 600; color: var(--dark); }
.stat-lbl { font-size: 12px; color: var(--gray); margin-top: 3px; }
.stat-card.teal { background: var(--teal); border-color: var(--teal); }
.stat-card.teal .stat-val, .stat-card.teal .stat-lbl { color: #fff; }

/* ── TABLE ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 500; color: var(--gray);
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  background: var(--gray-lt);
  white-space: nowrap;
}
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td      { background: #fafbfc; }

/* ── FORMS ──────────────────────────────────────────── */
.form-group  { margin-bottom: 1rem; }
.form-label  { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--dark); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--dark);
  background: var(--white);
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15,110,86,.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ── BUTTONS ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; font-size: 13px; font-weight: 500;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--white); color: var(--dark);
  cursor: pointer; text-decoration: none;
  transition: all .15s; font-family: inherit;
}
.btn:hover        { background: var(--gray-lt); }
.btn-primary      { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-dk); }
.btn-danger       { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm           { padding: 5px 12px; font-size: 12px; }
.btn-block        { width: 100%; justify-content: center; }

/* ── BADGES ─────────────────────────────────────────── */
.badge {
  display: inline-block; font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 20px;
}
.badge-green    { background: #D1FAE5; color: #065F46; }
.badge-amber    { background: #FEF3C7; color: #92400E; }
.badge-red      { background: #FEE2E2; color: #991B1B; }
.badge-blue     { background: #DBEAFE; color: #1E40AF; }
.badge-gray     { background: var(--gray-lt); color: var(--gray); }
.badge-teal     { background: var(--teal-lt); color: var(--teal); }
.pts-pill       { background: #DBEAFE; color: #1E40AF; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }

/* ── ALERTS ─────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 13px; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.alert-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.alert-info    { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }

/* ── LOGIN PAGE ─────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: var(--dark);
}
.login-card {
  background: var(--white); border-radius: 14px;
  padding: 2.5rem; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo { text-align: center; margin-bottom: 1.5rem; }
.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--teal); }
.login-logo p  { font-size: 13px; color: var(--gray); margin-top: 4px; }

/* ── POS SCREEN ─────────────────────────────────────── */
.pos-wrap { max-width: 540px; margin: 0 auto; }
.pos-result {
  background: var(--teal-lt); border: 1px solid var(--teal);
  border-radius: var(--radius); padding: 1rem; margin-top: 1rem;
}
.pos-result .pts-big { font-size: 32px; font-weight: 700; color: var(--teal); }

/* ── PROGRESS BAR ───────────────────────────────────── */
.progress-wrap { background: var(--border); border-radius: 4px; height: 8px; overflow: hidden; }
.progress-bar  { height: 100%; background: var(--teal); border-radius: 4px; transition: width .5s; }

/* ── UTILITIES ──────────────────────────────────────── */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-gray   { color: var(--gray); }
.text-green  { color: #059669; }
.text-red    { color: var(--red); }
.text-teal   { color: var(--teal); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem;  }
.mt-3 { margin-top: 1.5rem;}
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap  { display: flex; gap: .75rem; align-items: center; }
.w-full    { width: 100%; }
.hidden    { display: none; }
.divider   { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .main-content { padding: 1rem; }
}
