:root {
  --card: rgba(255, 255, 255, 0.86);
  --border: rgba(148, 163, 184, 0.35);
  --sidebar-a: #020617;
  --sidebar-b: #0f172a;
  --sidebar-c: #1d4ed8;
}

* {
  box-sizing: border-box;
}

body.app-shell {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: #0f172a;
  line-height: 1.35;
  background:
    radial-gradient(circle at 10% 10%, rgba(14, 165, 233, 0.2) 0, transparent 30%),
    radial-gradient(circle at 90% 5%, rgba(59, 130, 246, 0.18) 0, transparent 28%),
    linear-gradient(160deg, #f8fafc 0%, #eef2ff 45%, #ecfeff 100%);
}

.app-backdrop {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.app-sidebar {
  width: 290px;
  background:
    radial-gradient(circle at 0% 0%, rgba(30, 64, 175, 0.5), transparent 35%),
    linear-gradient(180deg, var(--sidebar-a), var(--sidebar-b) 55%, var(--sidebar-c) 140%);
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 20px 0 50px rgba(2, 6, 23, 0.35);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 40;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #cbd5e1;
  padding: 0.66rem 0.92rem;
  border-radius: 0.78rem;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.menu-link:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.18);
  transform: translateX(2px);
}

.menu-link-active {
  color: #fff;
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.35);
}

.panel-card,
.card {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(6px);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.08);
}

.panel-card {
  padding: 1rem 1.2rem;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.64rem 0.78rem;
  font-size: 0.92rem;
  background: #fff;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.btn {
  border-radius: 0.78rem;
  padding: 0.62rem 1rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(90deg, #0f172a 0%, #1d4ed8 100%);
}

.btn-secondary {
  background: #fff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.table-ui {
  width: 100%;
  border-collapse: collapse;
}

.table-ui thead th {
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-ui th,
.table-ui td {
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.74rem;
  font-size: 0.87rem;
}

.table-ui tbody tr:hover {
  background: rgba(241, 245, 249, 0.9);
}

.badge {
  display: inline-flex;
  padding: 0.2rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.badge-ok {
  background: #dcfce7;
  color: #166534;
}

.badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

@media (max-width: 1023px) {
  .app-backdrop {
    opacity: 0.65;
  }

  .app-sidebar {
    width: min(88vw, 340px);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    overflow-y: auto;
  }

  .app-sidebar.sidebar-open {
    transform: translateX(0);
  }

  .panel-card,
  .card {
    border-radius: 0.9rem;
  }

  .panel-card {
    padding: 0.9rem;
  }

  .table-ui {
    min-width: 720px;
  }

  .table-ui th,
  .table-ui td {
    padding: 0.64rem;
    font-size: 0.82rem;
  }

  .btn {
    padding: 0.58rem 0.85rem;
    font-size: 0.88rem;
  }

  .input,
  .select,
  .textarea {
    font-size: 16px;
  }
}

@media print {
  .no-print {
    display: none !important;
  }
}
