/* =============================================================
   DreenkaBot Panel — Colorful Brutalism Theme
   Design: Heavy black outlines, bold shadows, high contrast,
   neon accents, sharp edges, and flat brutalist shapes.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --bg:          #fffded; /* Warm creamy yellow paper */
  --surface:     #ffffff;
  --surface-2:   #ffd600; /* Neon yellow sidebar */
  --border:      #000000;
  --border-2:    #000000;

  --text:        #000000;
  --text-2:      #1a1a1a;
  --text-3:      #4a4a4a;

  --accent:      #ffd600; /* Neon Yellow */
  --accent-2:    #ff2a85; /* Hot Pink */
  --accent-3:    #2979ff; /* Electric Blue */

  --green:       #00e676; /* Neon green */
  --green-bg:    #adff2f;
  --green-border:#000000;

  --red:         #ff1744; /* Neon red */
  --red-bg:      #ff99b2;
  --red-border:  #000000;

  --yellow:      #ffd600;
  --yellow-bg:   #ffff8d;
  --yellow-border:#000000;

  --blue:        #2979ff;
  --blue-bg:     #82b1ff;
  --blue-border: #000000;

  --sidebar-w:   240px;
  --topbar-h:    60px;
  --r:           0px; /* Brutalist sharp corners */
  --r-sm:        0px;

  --font:        'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:        'JetBrains Mono', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 13px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); border-left: 2px solid #000; }
::-webkit-scrollbar-thumb { background: #000; border: 2px solid var(--bg); }

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--accent-2); /* Hot Pink Sidebar */
  border-right: 3px solid #000;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .2s ease;
  color: #000;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--topbar-h);
  border-bottom: 3px solid #000;
  flex-shrink: 0;
  background: #000;
  color: #fff;
}

.brand-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0px #fff;
}

.brand-icon svg { width: 16px; height: 16px; color: #000; }

.sidebar-brand span {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.02em;
  color: #fff;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
}

.nav-section {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #000;
  padding: 16px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid transparent;
  color: #000;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: all .1s;
  user-select: none;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.nav-item:hover {
  background: var(--accent);
  border-color: #000;
  box-shadow: 3px 3px 0px #000;
}

.nav-item.active {
  background: var(--accent);
  color: #000;
  border-color: #000;
  box-shadow: 4px 4px 0px #000;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 2.5; }

.sidebar-footer {
  border-top: 3px solid #000;
  background: #000;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ── Topbar ──────────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--accent); /* Neon Yellow Topbar */
  border-bottom: 3px solid #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 90;
}

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

.topbar-title {
  font-size: 15px;
  font-weight: 800;
  color: #000;
  text-transform: uppercase;
}

.mobile-toggle {
  display: none;
  background: #fff;
  border: 2px solid #000;
  box-shadow: 2px 2px 0px #000;
  cursor: pointer;
  color: #000;
  padding: 6px;
  transition: transform .05s;
}
.mobile-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px #000;
}

/* Status badge */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border: 2px solid #000;
  box-shadow: 2px 2px 0px #000;
  text-transform: uppercase;
}

.status-pill.online  { color: #000; background: var(--green); }
.status-pill.offline { color: #000; background: var(--red); }
.status-pill.loading { color: #000; background: var(--yellow); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: currentColor;
  border: 1px solid #000;
}

.status-pill.loading .status-dot {
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── Content ─────────────────────────────────────────────── */

.content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 24px;
}

/* ── Cards ───────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 3px solid #000;
  border-radius: 0px;
  padding: 20px;
  box-shadow: 6px 6px 0px #000;
  margin-bottom: 24px;
}

.card + .card { margin-top: 0; }

.card-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #000;
  margin-bottom: 16px;
  border-bottom: 2px solid #000;
  padding-bottom: 6px;
  display: inline-block;
}

/* ── Grid ────────────────────────────────────────────────── */

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ── Stat Cards ──────────────────────────────────────────── */

.stat-card {
  background: #ffffff;
  border: 3px solid #000;
  border-radius: 0px;
  padding: 16px 20px;
  box-shadow: 5px 5px 0px #000;
}

.stat-label {
  font-size: 11px;
  color: #000;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: #000;
  letter-spacing: -.02em;
  line-height: 1;
}

.stat-unit {
  font-size: 12px;
  font-weight: 800;
  color: #000;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 0px;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font);
  border: 2px solid #000;
  background: #ffffff;
  color: #000;
  cursor: pointer;
  box-shadow: 3px 3px 0px #000;
  transition: transform .05s, box-shadow .05s, background-color .1s;
  white-space: nowrap;
  line-height: 1;
  text-transform: uppercase;
}

.btn:hover:not(:disabled) { background: var(--accent); }
.btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #000;
}
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }

.btn-primary {
  background: var(--accent-3); /* Electric Blue */
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) { background: #1a56db; color: #fff; }

.btn-success {
  background: var(--green);
  color: #000;
}
.btn-success:hover:not(:disabled) { background: #00c853; }

.btn-danger {
  background: var(--red);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) { background: #d50000; color: #fff; }

.btn-warn {
  background: #ffab00;
  color: #000;
}
.btn-warn:hover:not(:disabled) { background: #ffc400; }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Forms ───────────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #000;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.form-hint {
  display: block;
  font-size: 11px;
  color: #333;
  margin-top: 5px;
  font-weight: 600;
}

.form-input,
input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  background: #ffffff;
  border: 2px solid #000;
  border-radius: 0px;
  color: #000;
  font-family: var(--font);
  font-weight: 600;
  font-size: 13px;
  outline: none;
  box-shadow: 2px 2px 0px #000;
  transition: all .1s;
  line-height: 1.5;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: #000;
  background-color: #fffde0;
  box-shadow: 3px 3px 0px #000;
}

.form-input::placeholder { color: #888; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 2px solid #000;
}
.toggle-row:last-child { border-bottom: none; }

.toggle-info strong { font-size: 13px; font-weight: 800; color: #000; display: block; }
.toggle-info small  { font-size: 11px; color: #333; font-weight: 600; }

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute;
  inset: 0;
  background: #fff;
  border: 2px solid #000;
  border-radius: 0px;
  cursor: pointer;
  transition: background .15s;
}
.switch-track::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #000;
  border-radius: 0%;
  transition: transform .15s;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(20px); background: #000; }

/* ── Tables ──────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border: 3px solid #000;
  border-radius: 0px;
  background: var(--surface);
  box-shadow: 4px 4px 0px #000;
}

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

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #000;
  border-bottom: 3px solid #000;
  background: var(--accent);
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #000;
  border-bottom: 2px solid #000;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* ── Badge ───────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 0px;
  border: 2px solid #000;
  box-shadow: 1.5px 1.5px 0px #000;
  text-transform: uppercase;
}

.badge-green  { color: #000; background: var(--green); }
.badge-red    { color: #000; background: var(--red); }
.badge-yellow { color: #000; background: var(--yellow); }
.badge-blue   { color: #000; background: var(--blue); }
.badge-neutral{ color: #000; background: #fff; }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 0%;
  background: #000;
  border: 1px solid #000;
  display: inline-block;
}

/* ── Terminal / Logs ─────────────────────────────────────── */

.terminal {
  background: #000000;
  border: 3px solid #000;
  border-radius: 0px;
  overflow: hidden;
  box-shadow: 6px 6px 0px #000;
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #111;
  border-bottom: 3px solid #000;
}

.terminal-bar-title {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  font-family: var(--mono);
  text-transform: uppercase;
}

.terminal-body {
  padding: 14px 16px;
  max-height: 420px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: #fff;
}

.log-line { padding: 0; word-break: break-all; }
.log-ts { color: #ffd600; margin-right: 8px; font-weight: bold; }
.log-error  { color: #ff5252; }
.log-warn   { color: #ffd740; }
.log-info   { color: #40c4ff; }
.log-stdout { color: #ffffff; }
.log-system { color: #b388ff; }

/* ── Charts ──────────────────────────────────────────────── */

.chart-wrap {
  width: 100%;
  height: 130px;
  position: relative;
  border: 2px solid #000;
  background: #fff;
  padding: 10px;
}

.chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Toast ───────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  background: #ffffff;
  border: 3px solid #000;
  border-radius: 0px;
  font-size: 12px;
  font-weight: 800;
  color: #000;
  box-shadow: 4px 4px 0px #000;
  animation: slideIn .15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.info    { background: var(--blue-bg); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Rental page ─────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: #000;
  text-transform: uppercase;
}

.tab-bar {
  display: flex;
  gap: 0;
  border: 2px solid #000;
  border-radius: 0px;
  overflow: hidden;
  background: #000;
  box-shadow: 3px 3px 0px #000;
}

.tab-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 800;
  border: none;
  border-right: 2px solid #000;
  background: #fff;
  color: #000;
  cursor: pointer;
  font-family: var(--font);
  transition: all .1s;
  text-transform: uppercase;
}

.tab-btn:last-child { border-right: none; }
.tab-btn:hover { background: var(--accent); }
.tab-btn.active { background: var(--accent); font-weight: 800; }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 800;
  border: 2px solid #000;
  border-radius: 0px;
  background: #ffffff;
  color: #000;
  cursor: pointer;
  font-family: var(--font);
  box-shadow: 2px 2px 0px #000;
  transition: all .05s;
  text-transform: uppercase;
}

.filter-btn:hover       { background: var(--accent); }
.filter-btn:active      { transform: translate(1px, 1px); box-shadow: 1px 1px 0px #000; }
.filter-btn.active-all  { background: #000; color: #fff; }
.filter-btn.active-ok   { background: var(--green); }
.filter-btn.active-warn { background: #ffab00; }
.filter-btn.active-bad  { background: var(--red); }

/* Sub progress bar */
.sub-bar-wrap {
  height: 6px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 0px;
  overflow: hidden;
  margin-top: 8px;
}
.sub-bar-fill {
  height: 100%;
  background: #000;
  transition: width .3s;
}
.sub-bar-fill.ok   { background: var(--green); }
.sub-bar-fill.warn { background: #ffab00; }
.sub-bar-fill.bad  { background: var(--red); }

/* Sub cards grid */
.sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.sub-card {
  background: var(--surface);
  border: 3px solid #000;
  border-radius: 0px;
  padding: 16px;
  box-shadow: 4px 4px 0px #000;
}

.sub-card.warn-card { border-color: #000; background: #fffdf0; }
.sub-card.bad-card  { border-color: #000; background: #fff3f3; }

/* Modals */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border: 3px solid #000;
  border-radius: 0px;
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 8px 8px 0px #000;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 2px solid #000;
  padding-bottom: 8px;
}

.modal-header h3 { font-size: 16px; font-weight: 800; text-transform: uppercase; }

.modal-close {
  background: #fff;
  border: 2px solid #000;
  font-size: 14px;
  font-weight: 800;
  color: #000;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  box-shadow: 2px 2px 0px #000;
}
.modal-close:hover { background: var(--red); color: #fff; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Leaderboard */
.lb { display: flex; flex-direction: column; gap: 8px; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lb-rank {
  font-size: 12px;
  font-weight: 800;
  color: #000;
  width: 24px;
  height: 24px;
  border: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 1.5px 1.5px 0px #000;
  flex-shrink: 0;
}

.lb-rank.top3 { background: var(--accent); }

.lb-bar-track {
  flex: 1;
  height: 8px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 0px;
  overflow: hidden;
}

.lb-bar-fill {
  height: 100%;
  background: var(--accent-3);
}

.lb-name { font-size: 12px; font-weight: 800; color: #000; margin-bottom: 3px; }
.lb-info { flex: 1; }
.lb-val  { font-size: 12px; font-weight: 800; color: #000; min-width: 50px; text-align: right; }

/* ── Analytics ───────────────────────────────────────────── */

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 2px solid #000;
  font-size: 12px;
  font-weight: 700;
}
.metric-row:last-child { border-bottom: none; }
.metric-key   { color: #000; }
.metric-val   { font-weight: 800; }
.metric-green { color: #00c853; }
.metric-blue  { color: #2979ff; }
.metric-yellow{ color: #ffab00; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); border-right: 3px solid #000; }
  .sidebar.open { transform: translateX(0); }
  .topbar, .content { left: 0; margin-left: 0; }
  .mobile-toggle { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}