/* LigaTech Admin Dashboard — dark metallic theme */
:root {
  --blue: #2f7bff;
  --blue-dark: #082a66;
  --accent: #f5a623;
  --accent-dark: #c9820f;

  --bg: #14161b;
  --bg-2: #191c22;
  --panel: #1e222a;
  --panel-2: #262b35;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .14);
  --text: #e7e9ee;
  --text-muted: #9399a6;
  --text-faint: #656c79;

  --sidebar-w: 240px;
  --sidebar-w-collapsed: 72px;
  --radius: 12px;

  --metal-sheen: linear-gradient(155deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, .03) 100%);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .04);
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 15% 0%, #1b2028 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; }

/* ===== App shell ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1a1d24 0%, #14161b 100%);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: width .22s ease;
  overflow-x: hidden;
  z-index: 20;
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 68px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; overflow: hidden; }
.brand-mark {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  color: #1a1207;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
}
.brand-text { font-weight: 800; color: #fff; white-space: nowrap; font-size: 1.02rem; }
.brand-text em { color: var(--accent); font-style: normal; }
body.sidebar-collapsed .brand-text { display: none; }

.sidebar-toggle {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer;
}
.toggle-bar { width: 14px; height: 2px; background: var(--text-muted); border-radius: 2px; }
.sidebar-toggle:hover .toggle-bar { background: var(--accent); }

.sidebar-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: .93rem;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar-link:hover { background: var(--panel); color: var(--text); }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(245, 166, 35, .16), rgba(245, 166, 35, .03));
  border-color: rgba(245, 166, 35, .25);
  color: var(--accent);
  font-weight: 700;
}
.sidebar-icon { flex-shrink: 0; width: 22px; text-align: center; font-size: 1.05rem; }
body.sidebar-collapsed .sidebar-label { display: none; }
body.sidebar-collapsed .sidebar-link { justify-content: center; }

.sidebar-bottom { padding: 12px 10px 16px; border-top: 1px solid var(--border); }
.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; margin-bottom: 4px;
  color: var(--text-faint); font-size: .85rem;
}
body.sidebar-collapsed .sidebar-user .sidebar-label { display: none; }
.sidebar-logout:hover { color: #ff6b6b; }

.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-main { padding: 28px 30px; max-width: 1300px; width: 100%; margin: 0 auto; }

/* ===== Cards ===== */
.card, .admin-card {
  background: linear-gradient(155deg, var(--panel-2), var(--panel));
  background-image: var(--metal-sheen), linear-gradient(155deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  color: var(--text);
}
.card-title { color: #fff; font-weight: 700; }
.card-body { color: var(--text); }

.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: linear-gradient(155deg, var(--panel-2), var(--panel));
  background-image: var(--metal-sheen), linear-gradient(155deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow-card);
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.stat-card .stat-label { color: var(--text-muted); font-size: .85rem; }

/* health cards */
.health-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: linear-gradient(155deg, var(--panel-2), var(--panel));
  background-image: var(--metal-sheen), linear-gradient(155deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow-card);
}
.health-card .health-label { color: var(--text-muted); font-size: .82rem; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.health-card .health-value { font-size: 1.5rem; font-weight: 800; color: #fff; }
.health-card .health-sub { color: var(--text-faint); font-size: .78rem; margin-top: 2px; }
.health-bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; margin-top: 10px; }
.health-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--blue), var(--accent)); }
.health-bar-fill.warn { background: linear-gradient(90deg, #e0a327, #e05d27); }
.health-bar-fill.crit { background: linear-gradient(90deg, #e05d27, #e02727); }

/* ===== Forms (Bootstrap overrides) ===== */
.form-control, .form-select {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 .2rem rgba(245, 166, 35, .15);
}
.form-control::placeholder { color: var(--text-faint); }
.form-label, label { color: var(--text-muted); }
.text-muted { color: var(--text-faint) !important; }
.form-check-input { background-color: var(--bg-2); border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-label { color: var(--text-muted); }

/* ===== Table ===== */
.table { color: var(--text); border-color: var(--border); }
.table > :not(caption) > * > * { background: transparent; color: var(--text); border-bottom-color: var(--border); }
.table thead th { color: var(--text-muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; border-bottom-color: var(--border-strong); }
.table-hover > tbody > tr:hover > * { background: var(--panel); }

/* ===== Buttons ===== */
.btn-primary { background: linear-gradient(155deg, var(--blue), #1a4fc4); border-color: transparent; font-weight: 600; }
.btn-primary:hover { background: linear-gradient(155deg, #4a90ff, var(--blue)); }
.btn-success { background: linear-gradient(155deg, #34a870, #1f7a4f); border-color: transparent; }
.btn-outline-primary { color: var(--blue); border-color: var(--blue); }
.btn-outline-primary:hover { background: var(--blue); color: #fff; }
.btn-outline-danger { color: #ff8080; border-color: rgba(255, 107, 107, .5); }
.btn-outline-danger:hover { background: #d64545; border-color: #d64545; color: #fff; }
.btn-outline-secondary { color: var(--text-muted); border-color: var(--border-strong); }
.btn-outline-secondary:hover { background: var(--panel-2); color: var(--text); border-color: var(--border-strong); }

/* ===== Pagination / alerts / misc ===== */
.pagination .page-link { background: var(--panel); border-color: var(--border); color: var(--text-muted); }
.pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #1a1207; font-weight: 700; }
.alert-danger { background: rgba(214, 69, 69, .15); border-color: rgba(214, 69, 69, .4); color: #ff9d9d; }
hr { border-color: var(--border); }
h1, h2, h3, h4, h5, h6 { color: #fff; }

/* ===== Login page ===== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 10%, #232833 0%, var(--bg) 60%);
}
.login-wrap { width: 100%; max-width: 380px; padding: 20px; }
.login-card {
  background: linear-gradient(155deg, var(--panel-2), var(--panel));
  background-image: var(--metal-sheen), linear-gradient(155deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.login-brand { font-weight: 800; font-size: 1.4rem; color: #fff; text-align: center; margin-bottom: 4px; }
.login-brand span { color: var(--accent); }
.login-sub { text-align: center; color: var(--text-muted); margin-bottom: 22px; font-size: .9rem; }

/* ===== Toast notifikasi ===== */
.admin-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  min-width: 220px;
  padding: 12px 18px;
  border-radius: 8px;
  background: linear-gradient(155deg, var(--blue), #1a4fc4);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .25s, transform .25s;
}
.admin-toast.show { opacity: 1; transform: translateY(0); }
.admin-toast.error { background: linear-gradient(155deg, #d64545, #a52f2f); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { position: fixed; height: 100vh; }
  body.sidebar-collapsed .sidebar { width: 0; border: none; }
  .admin-main { padding: 20px 16px; }
}
