:root {
  --bg: #0f172a;
  --bg-alt: #111826;
  --panel: #1e293b;
  --panel-alt: #1b2537;
  --text: #f8fafc;
  --text-muted: #cbd5f5;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Cairo", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(160deg, var(--bg) 0%, #020617 100%);
  color: var(--text);
  min-height: 100vh;
  direction: ltr;
  text-align: left;
}

a {
  color: inherit;
  text-decoration: none;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 3rem;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(15, 23, 42, 0.72);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.2rem;
  direction: ltr;
}

.logo span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: var(--bg);
  font-weight: 800;
  letter-spacing: 1px;
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

nav a:hover {
  color: var(--text);
  transform: translateY(-2px);
}

.nav-user {
  font-weight: 600;
  color: var(--text);
}

.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  padding: 0.05rem 0.5rem;
  margin-left: 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: center;
  gap: 2rem;
  padding: 5rem 3rem 3rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  margin: 0;
  line-height: 1.1;
}

.hero p {
  margin: 1.5rem 0 2rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

.btn-primary {
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: var(--bg);
  box-shadow: 0 18px 30px rgba(14, 165, 233, 0.35);
}

.btn-outline {
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--text-muted);
  background: transparent;
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
}

main {
  padding: 0 3rem 3rem;
}

.panel {
  background: linear-gradient(160deg, var(--panel), var(--panel-alt));
  border-radius: 1.5rem;
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2.5rem;
  border: 1px solid rgba(56, 189, 248, 0.1);
}

.panel-lite {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 1.1rem;
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
}

.panel-lite h3 {
  margin: 0;
}

.panel-lite button {
  justify-self: start;
}

.table-scroll {
  overflow-x: auto;
}

.upload-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 0.85rem;
  color: var(--text);
}

.chip-list button {
  background: none;
  border: none;
  color: var(--danger);
  font-weight: 600;
  cursor: pointer;
}

.chip-list button:hover {
  text-decoration: underline;
}

.field-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.image-preview .image-chip {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview button {
  position: absolute;
  top: 4px;
  right: 4px;
  border: none;
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  cursor: pointer;
}

.image-preview button:hover {
  background: rgba(56, 189, 248, 0.8);
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

input,
select,
textarea {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font: inherit;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.laptop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}

.laptop-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 1.25rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.25s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}

.laptop-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 22px 40px rgba(14, 165, 233, 0.18);
}

.laptop-card img {
  width: 100%;
  border-radius: 1rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.laptop-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: left;
}

.price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: rgba(15, 23, 42, 0.55);
  border-radius: 1rem;
  padding: 1.75rem;
  border: 1px solid rgba(56, 189, 248, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stat-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.stat-card strong {
  font-size: 2rem;
  color: var(--text);
}

footer {
  padding: 2rem 3rem 3rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(56, 189, 248, 0.1);
  background: rgba(15, 23, 42, 0.7);
}

footer a {
  color: var(--accent);
}

.detail-layout {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  margin-top: 2rem;
}

.gallery {
  display: grid;
  gap: 1rem;
}

.gallery img {
  width: 100%;
  border-radius: 1rem;
  object-fit: cover;
  aspect-ratio: 3 / 2;
}

.spec-list {
  display: grid;
  gap: 0.75rem;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.spec-item strong {
  color: var(--text);
}

.order-form {
  display: grid;
  gap: 1rem;
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-actions {
  align-items: stretch;
}

.cart-table td,
.cart-table th {
  vertical-align: middle;
}

.catalog-table td,
.catalog-table th {
  vertical-align: middle;
}

.status-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--text);
  border-radius: 0.75rem;
  padding: 0.35rem 0.75rem;
}

.status-select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 0.9rem;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.quantity-input {
  width: 72px;
  text-align: center;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 0.75rem;
  padding: 0.4rem 0.5rem;
}

.quantity-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.link-button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.link-button:hover {
  text-decoration: underline;
}

.link-button[disabled] {
  color: var(--text-muted);
  cursor: not-allowed;
  text-decoration: none;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0 1rem;
  font-size: 1.2rem;
}

.cart-summary strong {
  color: var(--accent);
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.summary-list strong {
  display: block;
  margin-bottom: 0.25rem;
}

.summary-list .field-hint {
  display: block;
  margin-top: 0.2rem;
}

.order-status {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

.orders-table th,
.orders-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.orders-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: capitalize;
}

.status-pill.pending {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

.status-pill.confirmed {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.status-pill.completed {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent);
}

.status-pill.cancelled {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: 0.8rem;
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.35);
  margin-top: 1rem;
}

.toast.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.35);
}

@media (max-width: 900px) {
  header {
    padding: 1.25rem 1.75rem;
  }

  .hero {
    padding: 4rem 1.75rem 2.5rem;
  }

  main {
    padding: 0 1.75rem 2rem;
  }

  footer {
    padding: 1.5rem 1.75rem 2rem;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  nav {
    display: none;
  }

  .panel {
    padding: 1.5rem;
  }

  header {
    justify-content: center;
  }
}
