:root {
  --bg: #031820;
  --panel: #0a2f3a;
  --panel-light: #0d3845;
  --ink: #e8fffa;
  --muted: #8fb0aa;
  --line: rgba(26, 212, 177, 0.18);
  --teal: #1ad4b1;
  --teal-dim: rgba(26, 212, 177, 0.12);
  --danger: #d94848;
  --sidebar: #021218;
  --grad: linear-gradient(135deg, #1ad4b1, #0b9f86 55%, #067a6f);
  --font: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* Admin Grid Layout */
.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--sidebar);
  color: #e8eefc;
  padding: 1.3rem 1.1rem;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(26, 212, 177, 0.1);
}
.sidebar .logo {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar .logo img {
  height: 42px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.logo-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--teal);
  background: rgba(26, 212, 177, 0.14);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sidebar-close {
  display: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  line-height: 1;
  transition: color 0.2s ease;
}
.sidebar-close:hover { color: #fff; }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  color: rgba(232, 238, 252, 0.85);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.sidebar-nav a svg {
  flex-shrink: 0;
  color: var(--muted);
  transition: color 0.2s ease;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(26, 212, 177, 0.18);
  color: #fff;
}
.sidebar-nav a:hover svg,
.sidebar-nav a.active svg {
  color: var(--teal);
}

.sidebar-dev-credit {
  margin-top: auto;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sidebar-dev-credit__brand {
  font-weight: 700;
  color: rgba(232, 255, 250, 0.9);
}
.sidebar-dev-credit__link {
  font-size: 0.76rem;
  color: rgba(232, 255, 250, 0.65);
}
.sidebar-dev-credit__link a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}
.sidebar-dev-credit__link a:hover {
  color: #fff;
}

/* Mobile App Bar Header */
.admin-mob-bar {
  display: none;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 85;
  background: #021218;
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 1rem;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.admin-mob-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 38px;
  height: 38px;
  padding: 10px 8px;
  background: rgba(26, 212, 177, 0.12);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.admin-mob-toggle:hover {
  background: rgba(26, 212, 177, 0.22);
  border-color: var(--teal);
}
.admin-mob-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.2s ease;
}
.admin-mob-logo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
}
.admin-mob-logo img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
}
.admin-mob-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--teal);
  color: #031820;
  text-transform: uppercase;
}

/* Backdrop */
.sidebar-backdrop {
  display: none;
}

/* Main Content Area */
.content {
  padding: 1.4rem;
  max-width: 100%;
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.4rem;
  gap: 1rem;
}
.topbar-title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar__user {
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* Cards & Layout */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.stat strong {
  display: block;
  font-size: 1.5rem;
  color: var(--teal);
}
.stat span {
  color: var(--muted);
  font-size: 0.84rem;
}
.stat--clickable {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}
.stat--clickable:hover {
  transform: translateY(-3px);
  border-color: var(--teal);
  box-shadow: 0 6px 18px rgba(26, 212, 177, 0.14);
}
.stat--active {
  border-color: var(--teal);
  background: rgba(26, 212, 177, 0.12);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  background: var(--grad);
  color: #031820;
  transition: all 0.2s ease;
  min-height: 42px;
}
.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.btn-secondary {
  background: #0f3d42;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover {
  background: #144e54;
  border-color: var(--teal);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  min-height: 34px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 580px;
}
th, td {
  text-align: left;
  padding: 0.75rem 0.55rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  vertical-align: middle;
}
th {
  font-weight: 700;
  color: var(--teal);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr:hover td {
  background: rgba(26, 212, 177, 0.04);
}

/* Forms */
.form-grid {
  display: grid;
  gap: 0.9rem;
}
.form-grid.two {
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
label {
  display: grid;
  gap: 0.35rem;
  font-weight: 650;
  font-size: 0.88rem;
  color: var(--ink);
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  background: #031820;
  color: var(--ink);
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 42px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 212, 177, 0.2);
}
textarea {
  min-height: 110px;
  resize: vertical;
}

/* Checkbox and inline labels */
label input[type="checkbox"] {
  width: auto;
  min-height: auto;
  display: inline-block;
  margin-right: 0.4rem;
  cursor: pointer;
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 650;
  font-size: 0.92rem;
}
.alert-success { background: rgba(26, 212, 177, 0.16); color: #1ad4b1; border: 1px solid rgba(26, 212, 177, 0.35); }
.alert-error { background: rgba(217, 72, 72, 0.18); color: #ff9b9b; border: 1px solid rgba(217, 72, 72, 0.35); }

/* Login View */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background:
    radial-gradient(700px 380px at 20% 0%, rgba(26, 212, 177, 0.2), transparent 55%),
    radial-gradient(600px 320px at 90% 10%, rgba(6, 122, 111, 0.25), transparent 50%),
    #031820;
}
.login-card {
  width: min(100%, 420px);
}
.login-card img {
  height: 64px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto 0.8rem;
  display: block;
  filter: brightness(0) invert(1);
}

/* Badges & Pills */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(26, 212, 177, 0.16);
  color: #1ad4b1;
  font-size: 0.75rem;
  font-weight: 700;
}
.nav-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}
.nav-badge--alert {
  background: #f59e0b;
  color: #031820;
}

.topbar-enquiry-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(10, 47, 58, 0.9);
  border: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--ink);
  transition: all 0.2s ease;
}
.topbar-enquiry-pill:hover {
  border-color: var(--teal);
  background: rgba(26, 212, 177, 0.14);
}
.topbar-enquiry-pill--mob {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  display: inline-block;
}
.status-dot--live {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.filter-tab {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(3, 24, 32, 0.7);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.filter-tab:hover {
  color: var(--ink);
  border-color: var(--teal);
}
.filter-tab--active {
  background: var(--teal);
  color: #031820;
  border-color: var(--teal);
  font-weight: 700;
}

.product-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-select {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--line);
  cursor: pointer;
  background: #031820;
  color: var(--ink);
  min-height: 32px;
}
.status-select--new { border-color: rgba(245, 158, 11, 0.6); color: #f59e0b; }
.status-select--contacted { border-color: rgba(16, 185, 129, 0.6); color: #10b981; }
.status-select--read { border-color: rgba(56, 189, 248, 0.6); color: #38bdf8; }
.status-select--completed { border-color: rgba(168, 85, 247, 0.6); color: #c084fc; }

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.status-badge--new { background: rgba(245, 158, 11, 0.18); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.4); }
.status-badge--contacted { background: rgba(16, 185, 129, 0.18); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.status-badge--read { background: rgba(56, 189, 248, 0.18); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.status-badge--completed { background: rgba(168, 85, 247, 0.18); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  min-height: 28px;
  transition: opacity 0.2s ease;
}
.btn-action:hover { opacity: 0.85; }
.btn-action--wa { background: #25d366; color: #fff; }
.btn-action--call { background: #0284c7; color: #fff; }

.actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}
.row-highlight {
  background: rgba(245, 158, 11, 0.05);
}

/* ========================================================
   RESPONSIVE MEDIA QUERIES (TABLETS & SMARTPHONES)
   ======================================================== */

@media (max-width: 860px) {
  .admin-mob-bar {
    display: flex;
  }
  .admin-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(1, 10, 14, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 98;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-backdrop.sidebar-backdrop--active {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 310px);
    z-index: 99;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.65);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-right: 1px solid rgba(26, 212, 177, 0.3);
  }
  .sidebar.sidebar--open {
    transform: translateX(0);
  }
  .sidebar-close {
    display: block;
  }
  .content {
    padding: 1.1rem 0.9rem;
  }
  .form-grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .topbar__right {
    width: 100%;
    justify-content: space-between;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
  .stat {
    padding: 0.8rem 0.7rem;
  }
  .stat strong {
    font-size: 1.3rem;
  }
  .stat span {
    font-size: 0.78rem;
  }
  .card {
    padding: 1rem 0.85rem;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .topbar-title {
    font-size: 1.22rem;
  }
  .topbar-enquiry-pill__total {
    display: none;
  }
  .topbar__user {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
}
