:root {
  --bg: #06101d;
  --bg-2: #0b1728;
  --panel: rgba(10, 21, 39, 0.84);
  --panel-2: rgba(15, 28, 49, 0.95);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #eef4ff;
  --muted: #97a8c9;
  --primary: #4f9cff;
  --primary-2: #7b61ff;
  --success: #17c964;
  --danger: #ff5c7c;
  --warning: #f5a524;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.24);
  --radius: 22px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(79,156,255,.18), transparent 26%),
    radial-gradient(circle at top right, rgba(123,97,255,.15), transparent 24%),
    linear-gradient(180deg, #09111f 0%, #050a14 100%);
  min-height: 100vh;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 290px;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  background: rgba(4, 12, 24, 0.78);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  z-index: 1001;
}

.sidebar-head {
  margin-bottom: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 16px 32px rgba(79,156,255,.25);
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .86rem;
}

.nav-links {
  display: grid;
  gap: 10px;
  flex: 1;
}

.nav-links a,
.logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  color: #dbe7ff;
  transition: .25s ease;
  position: relative;
  overflow: hidden;
}

.nav-links a i,
.logout-btn i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: .92;
  flex-shrink: 0;
}

.nav-links a span,
.logout-btn span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links a:hover {
  transform: translateX(3px);
  background: linear-gradient(135deg, rgba(79,156,255,.16), rgba(123,97,255,.14));
  border-color: var(--line);
}

.nav-links a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(79,156,255,.24), rgba(123,97,255,.22));
  border-color: rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}

.nav-links a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}

.sidebar-bottom {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.logout-btn {
  background: rgba(255,92,124,.10);
  border-color: rgba(255,92,124,.20);
  color: #ffd9e1;
}

.logout-btn:hover {
  background: rgba(255,92,124,.16);
  border-color: rgba(255,92,124,.30);
}

.sidebar-overlay {
  display: none;
}

/* Main */
.main-content {
  flex: 1;
  padding: 24px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-intro h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-intro p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .95rem;
}

.menu-btn {
  width: 46px;
  height: 46px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  color: #fff;
  cursor: pointer;
  transition: .2s ease;
}

.menu-btn:hover {
  background: rgba(255,255,255,.08);
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(23,201,100,.18), rgba(79,156,255,.14));
  border: 1px solid var(--line);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

/* Alert */
.alert {
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.alert.success {
  background: rgba(23,201,100,.15);
  border-color: rgba(23,201,100,.28);
  color: #d5ffea;
}

.alert.error {
  background: rgba(255,92,124,.14);
  border-color: rgba(255,92,124,.26);
  color: #ffdce4;
}

.alert.warning {
  background: rgba(245,165,36,.15);
  border-color: rgba(245,165,36,.28);
  color: #ffe8bd;
}

/* Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.card {
  padding: 20px;
}

.panel {
  padding: 22px;
  margin-bottom: 20px;
}

.panel h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  font-size: .92rem;
}

.stat-value {
  margin-top: 10px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.layout-2 {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 20px;
}

/* Tables */
.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: #cedcff;
  font-size: .9rem;
  font-weight: 700;
}

td {
  color: #f7faff;
  font-size: .94rem;
}

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #dbe7ff;
  font-size: .9rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: #fff;
  outline: none;
  transition: .2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(79,156,255,.45);
  box-shadow: 0 0 0 4px rgba(79,156,255,.10);
}

input::placeholder,
textarea::placeholder {
  color: #7c91b4;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Buttons */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 16px 32px rgba(79,156,255,.20);
  transition: .2s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255,255,255,.08);
}

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

.small {
  font-size: .86rem;
}

.stack {
  display: grid;
  gap: 16px;
}

.thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0d1420;
}

.kpi-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.kpi-line:last-child {
  border-bottom: none;
}

/* Login */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
}

.login-hero {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79,156,255,.16), rgba(123,97,255,.12));
}

.login-hero h1 {
  margin: 0 0 16px;
  max-width: 540px;
  font-size: 3rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.login-hero p {
  max-width: 540px;
  color: #d3e0ff;
  font-size: 1.05rem;
}

.hero-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-badges span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}

.login-panel-wrap {
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-panel {
  width: min(100%, 460px);
  padding: 28px;
  border-radius: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.login-panel h2 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.login-panel p {
  margin: 0 0 24px;
  color: var(--muted);
}

.footer-note {
  color: var(--muted);
  text-align: center;
  padding: 8px 0 24px;
}

/* Responsive */
@media (max-width: 1100px) {
  .grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    height: 100vh;
    transition: left .28s ease;
  }

  .sidebar.show {
    left: 0;
  }

  .sidebar-overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 1000;
  }

  .menu-btn {
    display: inline-flex;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero {
    padding: 34px 22px;
  }

  .login-hero h1 {
    font-size: 2.3rem;
  }
}

@media (max-width: 680px) {
  .main-content {
    padding: 16px;
  }

  .topbar {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-left,
  .topbar-right {
    width: 100%;
  }

  .topbar-right {
    justify-content: flex-start;
  }

  .grid-cards,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .card {
    padding: 18px;
  }

  .page-intro h2 {
    font-size: 1.18rem;
  }

  .page-intro p {
    font-size: .9rem;
  }
}


.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.status-badge.active {
  color: #d9ffea;
  background: rgba(23, 201, 100, 0.16);
  border: 1px solid rgba(23, 201, 100, 0.28);
}

.status-badge.inactive {
  color: #ffd9df;
  background: rgba(255, 92, 124, 0.14);
  border: 1px solid rgba(255, 92, 124, 0.26);
}

.btn-danger {
  background: linear-gradient(135deg, #ff5c7c, #ff7b54);
  color: #fff;
}

.btn-danger:hover {
  transform: translateY(-1px);
}