* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #07070a;
  color: #fafafa;
}
a { color: #fda4af; }

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(252, 99, 107, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 20%, rgba(249, 115, 22, 0.14), transparent 50%),
    #07070a;
}
.bg-fx canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.page { position: relative; z-index: 1; min-height: 100vh; }

/* ── Login ── */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px 28px;
  border-radius: 22px;
  background: rgba(12, 12, 15, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  margin: 0 auto 14px;
  display: block;
  box-shadow: 0 8px 28px rgba(252, 99, 107, 0.25);
}
.login-card h1 {
  margin: 0 0 4px;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}
.login-card .login-tag {
  color: #a1a1aa;
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.5;
}
.login-card label { text-align: left; }
.login-card button[type="submit"],
.login-card .login-btn { width: 100%; margin-top: 4px; }

/* ── App shell (sidebar) ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: rgba(12, 12, 15, 0.92);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  text-align: center;
  padding: 8px 8px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
}
.sidebar-brand img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  margin: 0 auto 10px;
  display: block;
}
.sidebar-brand .brand-title {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.sidebar-brand .brand-sub {
  font-size: 11px;
  color: #71717a;
  margin-top: 4px;
  line-height: 1.4;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #d4d4d8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.nav-item.active {
  background: rgba(252, 99, 107, 0.16);
  border-color: rgba(252, 99, 107, 0.28);
  color: #fda4af;
}
.sidebar-logout {
  margin-top: auto;
  width: 100%;
}
.main-content {
  flex: 1;
  padding: 24px 22px 40px;
  min-width: 0;
}
.main-head {
  margin-bottom: 18px;
}
.main-head h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}
.main-head p {
  margin: 0;
  color: #71717a;
  font-size: 13px;
}

label {
  display: block;
  font-size: 11px;
  color: #a1a1aa;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(9, 9, 11, 0.85);
  color: #fafafa;
  margin-bottom: 12px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(252, 99, 107, 0.45);
  box-shadow: 0 0 0 3px rgba(252, 99, 107, 0.12);
}
button {
  padding: 11px 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #FC636B, #f97316);
}
button.secondary {
  background: rgba(39, 39, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
button:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: rgba(24, 24, 27, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
}
.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}
th { color: #a1a1aa; font-weight: 600; }
code { color: #fda4af; word-break: break-all; font-size: 11px; }
.ok { color: #22c55e; }
.warn { color: #f59e0b; }
.bad { color: #ef4444; }
.hidden { display: none !important; }
.msg { min-height: 18px; font-size: 13px; margin-top: 8px; }
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
}
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button { padding: 7px 10px; font-size: 11px; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.sidebar-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  opacity: 0.75;
}
.sidebar-foot img { width: 22px; height: 22px; border-radius: 6px; }
.sidebar-foot span { font-size: 10px; color: #71717a; font-weight: 600; }
.preview-box {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(9, 9, 11, 0.85);
  border: 1px dashed rgba(252, 99, 107, 0.28);
  font-size: 12px;
  color: #fda4af;
  word-break: break-all;
  font-family: ui-monospace, monospace;
}
.preview-label {
  font-size: 10px;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

table tbody tr.click-row { cursor: pointer; }
table tbody tr.click-row:hover { background: rgba(252, 99, 107, 0.06); }

.lb-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lb-modal {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  border-radius: 18px;
  background: #111114;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.lb-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lb-modal-head h3 { margin: 0; font-size: 16px; }
.lb-modal-x {
  border: none;
  background: transparent;
  color: #a1a1aa;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.lb-modal-body { padding: 16px 18px; }
.lb-modal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.lb-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 16px;
}
.lb-detail-wide { grid-column: 1 / -1; }
.lb-detail-label {
  display: block;
  font-size: 10px;
  color: #71717a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.lb-modal-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.lb-modal-hint {
  margin: 4px 0 10px;
  font-size: 12px;
  color: #71717a;
}
.lb-duration-custom { margin-top: 8px; }
button.bad {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
button.bad:hover { background: rgba(239, 68, 68, 0.28); }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px;
  }
  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    border-bottom: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 180px;
  }
  .sidebar-brand img { margin: 0; width: 40px; height: 40px; }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 2;
  }
  .nav-item { width: auto; padding: 8px 12px; font-size: 12px; }
  .sidebar-logout { width: auto; margin-top: 0; }
}
