﻿:root {
  --bg: #060707;
  --bg-2: #101214;
  --surface: #14171a;
  --surface-2: #1b2024;
  --line: #2a3138;
  --text: #f4f6f8;
  --muted: #b5bcc6;
  --primary: #e22020;
  --primary-2: #a40d0d;
  --ok: #14b86f;
  --warn: #f1b73e;
  --danger: #e24646;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(900px 460px at 110% -20%, rgba(226, 32, 32, 0.22), transparent 72%),
    radial-gradient(700px 380px at -10% 100%, rgba(226, 32, 32, 0.15), transparent 74%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

a { color: #ff6b6b; text-decoration: none; }
a:hover { text-decoration: underline; }

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

.sidebar {
  width: 260px;
  padding: 16px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #090a0b, #14171a 65%, #1a0e0e);
}

.brand {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #4d2222;
  background: linear-gradient(135deg, rgba(226, 32, 32, 0.2), rgba(226, 32, 32, 0.04));
  margin-bottom: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}

.brand p {
  margin: 4px 0 0;
  color: #f9baba;
  font-size: 12px;
}

.side-nav a {
  display: block;
  margin-bottom: 7px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #f1f3f5;
}

.side-nav a.active,
.side-nav a:hover {
  text-decoration: none;
  border-color: #793232;
  background: rgba(226, 32, 32, 0.18);
}

.main-content {
  flex: 1;
  padding: 20px;
}

.page-title {
  margin: 0 0 14px;
  font-size: 30px;
}

.card {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
}

.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-number {
  font-size: 30px;
  font-weight: 800;
  color: #ff6f6f;
}

label {
  display: block;
  margin-top: 9px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea,
button {
  width: 100%;
  border-radius: 10px;
  font-size: 14px;
  padding: 10px;
}

input,
select,
textarea {
  border: 1px solid #36404a;
  color: #f0f4f8;
  background: #101418;
}

input::placeholder,
textarea::placeholder { color: #8f98a3; }

button {
  border: none;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  margin-top: 12px;
  min-height: 44px;
}

button:hover { filter: brightness(0.95); }
button.danger { background: linear-gradient(135deg, #e24646, #ab1f1f); }
button.ok { background: linear-gradient(135deg, #16bb72, #0f8b56); }

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-actions form,
.inline-actions a {
  min-width: 120px;
}

.inline-actions button {
  margin-top: 0;
}

.small-note {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 0;
}

.btn-small {
  width: auto;
  min-height: auto;
  margin-top: 0;
  padding: 8px 14px;
  display: inline-block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid #343c45;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  padding: 14px;
}

.table-wrap { overflow: auto; }

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid #313a44;
  padding: 9px;
  text-align: left;
  font-size: 14px;
}

th {
  background: #1a2128;
  color: #ffd7d7;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.ok { background: #d7f8ea; color: #0f8652; }
.badge.warn { background: #fff1cf; color: #a06600; }
.badge.danger { background: #ffdcdc; color: #b62222; }

.msg-error {
  margin: 0 0 8px;
  color: #ff7d7d;
  font-weight: 700;
}

.msg-success {
  margin: 0 0 8px;
  color: #6ef0b7;
  font-weight: 700;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  border-radius: 16px;
  border: 1px solid #4f2a2a;
  background: linear-gradient(180deg, #111416, #1b1f23);
  box-shadow: var(--shadow);
  padding: 18px;
}

.login-title {
  margin: 0;
  font-size: 30px;
}

.login-sub {
  margin: 6px 0 14px;
  color: #c8d0da;
}

.auth-cta {
  margin: 12px 0 0;
  font-size: 14px;
  color: #c8d0da;
}

.auth-cta a {
  color: #ff6b6b;
  font-weight: 700;
}

.demo-box {
  margin-top: 12px;
  color: #cdd4dd;
  font-size: 12px;
  line-height: 1.55;
  border-top: 1px dashed #3e474f;
  padding-top: 10px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.auth-tab {
  margin-top: 0;
  min-height: 40px;
  background: #202732;
  border: 1px solid #3b4653;
  color: #dbe2ea;
}

.auth-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: #833434;
  color: #fff;
}

.auth-pane { display: none; }
.auth-pane.active { display: block; }

.ui-toast-wrap {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 12000;
  display: grid;
  gap: 8px;
}

.ui-toast {
  min-width: 240px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #3b4653;
  background: linear-gradient(180deg, #1a2129, #11161d);
  color: #e9eff6;
  box-shadow: var(--shadow);
}

.ui-toast.error { border-color: #8f2c2c; }
.ui-toast.ok { border-color: #2f7a54; }

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.62);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 13000;
  padding: 16px;
}

.confirm-overlay.show { display: flex; }

.confirm-card {
  width: 100%;
  max-width: 460px;
  border-radius: 14px;
  border: 1px solid #3a4451;
  background: linear-gradient(180deg, #171d25, #10151b);
  box-shadow: var(--shadow);
  padding: 14px;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 980px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .side-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  .side-nav a {
    white-space: nowrap;
    margin-bottom: 0;
  }
  .stats-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}
