:root {
  --bg-start: #f6efe5;
  --bg-end: #e8f2f1;
  --ink: #1b1f24;
  --muted: #5b6470;
  --accent: #c46b3c;
  --accent-strong: #9c4b23;
  --panel: #ffffff;
  --panel-border: rgba(27, 31, 36, 0.08);
  --shadow: 0 20px 40px rgba(27, 31, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 10% 0%, #fef7ee 0%, transparent 60%),
    radial-gradient(1200px 600px at 90% 10%, #e6f5f5 0%, transparent 55%),
    linear-gradient(135deg, var(--bg-start), var(--bg-end));
  min-height: 100vh;
}

.mordor-shell {
  min-height: 100vh;
  padding: 24px;
}

.mordor-card {
  background: var(--panel);
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.brand {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--accent-strong);
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  gap: 24px;
  padding: 24px;
}

.app-main {
  padding: 8px 0 40px;
}

.sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  height: calc(100vh - 48px);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow);
}

.sidebar-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sidebar-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-section {
  margin-top: 12px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  border: 1px solid transparent;
}

.sidebar-link.active,
.sidebar-link:hover {
  color: var(--accent-strong);
  border-color: rgba(196, 107, 60, 0.25);
  background: rgba(196, 107, 60, 0.08);
}

.sidebar-footer {
  margin-top: auto;
}

.app-footer {
  margin-top: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-verse {
  font-weight: 600;
}

.footer-copy {
  margin-top: 6px;
}

.action-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
}

.action-btn:hover {
  background: var(--accent-strong);
}

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

.badge-status {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
}

.badge-active {
  background: rgba(34, 160, 115, 0.15);
  color: #1e7d57;
}

.badge-inactive {
  background: rgba(196, 107, 60, 0.15);
  color: var(--accent-strong);
}

.form-control, .form-select {
  border-radius: 12px;
}

.modal-content {
  border-radius: 18px;
}

.footer-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.kpi-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.kpi-label {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.kpi-stores .kpi-icon {
  background: rgba(13, 110, 253, 0.15);
  color: #0b5ed7;
}

.kpi-lives .kpi-icon {
  background: rgba(220, 53, 69, 0.15);
  color: #b02a37;
}

.kpi-customers .kpi-icon {
  background: rgba(25, 135, 84, 0.15);
  color: #146c43;
}

.kpi-tickets .kpi-icon {
  background: rgba(255, 193, 7, 0.2);
  color: #8a6d1f;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 14px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 4px;
}

.stat-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }
}
