/* MyPOS AI — V1.2 Neon Premium (Dark Glassmorphism) */
:root {
  --bg-deep: #07091F;
  --bg-grad-top: #13082F;
  --bg-grad-bottom: #071735;
  --glass-bg: rgba(28, 24, 68, 0.90);
  --glass-bg-soft: rgba(28, 24, 68, 0.72);
  --glass-border: rgba(160, 130, 255, 0.25);
  --glass-shadow: 0 14px 36px rgba(133, 60, 255, 0.12);

  --neon-grad: linear-gradient(135deg, #F000FF 0%, #853CFF 52%, #315CFF 100%);
  --text-grad: linear-gradient(90deg, #F000FF 0%, #B23DFF 45%, #00DCFF 100%);
  --nav-mobile-grad: linear-gradient(135deg, rgba(69, 35, 112, 0.96), rgba(11, 43, 91, 0.97));

  --accent: #B23DFF;
  --accent-light: #D58BFF;
  --accent-lighter: #E3B0FF;
  --gold: #FFD64A;
  --success: #3DDC97;
  --success-soft: #5EE6A8;
  --danger: #FF5C7A;
  --danger-soft: #FF8AA0;

  --text-main: #FBF9FF;
  --text-secondary: #ECE4FF;
  --text-muted: rgba(226, 212, 255, 0.78);

  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

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

html, body {
  min-height: 100%;
  background: linear-gradient(180deg, var(--bg-grad-top) 0%, var(--bg-deep) 48%, var(--bg-grad-bottom) 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Background grid & neon radial glows */
.bg-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(160, 130, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(160, 130, 255, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 20%, transparent 80%);
}

.glow-blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(88px);
}

.glow-magenta {
  width: 440px;
  height: 440px;
  top: -120px;
  left: -80px;
  background: rgb(240 0 255 / 0.20);
}

.glow-blue {
  width: 480px;
  height: 480px;
  top: 22%;
  right: -120px;
  background: rgb(49 92 255 / 0.22);
}

.glow-cyan {
  width: 380px;
  height: 380px;
  bottom: -100px;
  left: 30%;
  background: rgb(0 220 255 / 0.12);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* Typography & Utility */
h1, h2, h3, .num {
  font-family: var(--font-display);
}

.grad-text {
  background: var(--text-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.muted {
  color: var(--text-muted);
}

.text-success { color: var(--success-soft); }
.text-gold { color: var(--gold); }
.text-danger { color: var(--danger-soft); }

/* Glass Cards */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--glass-shadow);
  padding: 20px;
}

.glass-sub {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(160, 130, 255, 0.18);
  border-radius: 14px;
  padding: 14px;
}

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: none;
  background: var(--neon-grad);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(133, 60, 255, 0.36);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(240, 0, 255, 0.35);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(160, 130, 255, 0.38);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--accent-light);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 10px;
}

.btn-success {
  background: linear-gradient(135deg, #1EB980, #3DDC97);
  color: #041E14;
  box-shadow: 0 6px 18px rgba(61, 220, 151, 0.25);
}

.btn-danger {
  background: rgba(255, 92, 122, 0.18);
  border: 1px solid rgba(255, 92, 122, 0.45);
  color: var(--danger-soft);
}

.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(160, 130, 255, 0.28);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select option {
  background: #141236;
  color: var(--text-main);
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(178, 61, 255, 0.22);
}

.label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Badges & Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(160, 130, 255, 0.35);
  background: rgba(178, 61, 255, 0.14);
  color: var(--accent-lighter);
}

.pill-success {
  background: rgba(61, 220, 151, 0.14);
  border-color: rgba(61, 220, 151, 0.4);
  color: var(--success-soft);
}

.pill-gold {
  background: rgba(255, 214, 74, 0.14);
  border-color: rgba(255, 214, 74, 0.4);
  color: var(--gold);
}

.pill-danger {
  background: rgba(255, 92, 122, 0.16);
  border-color: rgba(255, 92, 122, 0.45);
  color: var(--danger-soft);
}

/* Landing & Login Layout */
.landing-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--neon-grad);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 22px rgba(240, 0, 255, 0.32);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 42px;
}

.hero-title {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  font-weight: 800;
  margin: 14px 0 16px;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 560px;
  margin-bottom: 24px;
}

.steps-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

/* Authenticated Panel Shell */
.panel-layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  background: rgba(15, 13, 42, 0.88);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(178, 61, 255, 0.18);
  border-color: rgba(178, 61, 255, 0.42);
  color: var(--text-main);
  box-shadow: 0 6px 18px rgba(133, 60, 255, 0.18);
}

.main-area {
  padding: 22px 26px 96px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

/* Two-Card Morning View (from karta.jpg) */
.two-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.card-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(160, 130, 255, 0.22);
}

.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-tile {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(160, 130, 255, 0.20);
  border-radius: 14px;
  padding: 13px 14px;
}

.kpi-tile .kpi-val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  margin-top: 2px;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 98px;
  padding-top: 12px;
}

.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.trend-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #B23DFF 0%, #315CFF 100%);
  min-height: 8px;
}

.trend-bar.latest {
  background: linear-gradient(180deg, #5EE6A8 0%, #1EB980 100%);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--neon-grad);
}

.task-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(160, 130, 255, 0.22);
  margin-bottom: 10px;
}

.task-row.done {
  border-color: rgba(61, 220, 151, 0.42);
  background: rgba(61, 220, 151, 0.07);
}

/* Tables & Grid Helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.flex-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(160, 130, 255, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(160, 130, 255, 0.14);
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: var(--neon-grad);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* Mobile Bottom Nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--nav-mobile-grad);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(160, 130, 255, 0.30);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  justify-content: space-around;
}

.mobile-nav button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
}

.mobile-nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 20, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 60;
}

.modal-box {
  width: 100%;
  max-width: 520px;
}

.toast-root {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: rgba(28, 24, 68, 0.96);
  border: 1px solid var(--accent);
  color: var(--text-main);
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

/* Mobile Helpers, Card Switcher & Notification Bell */
.mobile-only {
  display: none;
}

.mobile-card-switcher {
  display: none;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(19, 15, 52, 0.92);
  border: 1px solid rgba(160, 130, 255, 0.28);
  margin-bottom: 14px;
  position: sticky;
  top: calc(8px + env(safe-area-inset-top));
  z-index: 30;
  backdrop-filter: blur(16px);
}

.mobile-card-switcher button {
  flex: 1;
  min-height: 42px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-card-switcher button.active {
  background: var(--neon-grad);
  color: #fff;
  box-shadow: 0 6px 16px rgba(133, 60, 255, 0.35);
}

.notif-btn {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 0 10px rgba(255, 92, 122, 0.65);
}

@media (max-width: 980px) {
  .hero-grid, .two-cards, .grid-2, .grid-3, .steps-3 {
    grid-template-columns: 1fr;
  }
  .panel-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .mobile-only {
    display: inline-flex;
  }
  .mobile-card-switcher {
    display: flex;
  }
  .mobile-hide-card {
    display: none !important;
  }
  .mobile-nav {
    display: flex;
  }
  .mobile-nav button {
    min-height: 46px;
    flex: 1;
  }
  .main-area {
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(98px + env(safe-area-inset-bottom));
  }
  .landing-wrap {
    padding: calc(14px + env(safe-area-inset-top)) 14px 48px;
  }
  .glass-card {
    padding: 16px;
    border-radius: 16px;
  }
  .btn, .btn-ghost {
    min-height: 44px;
  }
  .btn-sm {
    min-height: 40px;
    padding: 8px 13px;
  }
}

@media (max-width: 720px) {
  /* Prevent iOS Safari input auto-zoom */
  .input, .select, .textarea {
    font-size: 16px;
    min-height: 46px;
  }
  .kpi-tile .kpi-val {
    font-size: 20px;
  }
  /* Turn wide tables into clean stacked mobile cards */
  .table-wrap {
    border: none;
    overflow: visible;
  }
  table.resp-table,
  table.resp-table tbody,
  table.resp-table tr,
  table.resp-table td {
    display: block;
    width: 100%;
  }
  table.resp-table thead {
    display: none;
  }
  table.resp-table tr {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(160, 130, 255, 0.22);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
  }
  table.resp-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(160, 130, 255, 0.10);
    text-align: right;
  }
  table.resp-table td:last-child {
    border-bottom: none;
    padding-top: 10px;
  }
  table.resp-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
  }
}
