@charset "utf-8";

/* =========================
   Core Theme Tokens
   ========================= */
:root {
  --bg-page: #020617;
  --bg-panel: #020817;
  --bg-input: #020617;

  --border-main: #1f2937;
  --border-soft: #334155;

  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --text-label: #cbd5e1;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-focus: #6366f1;

  --danger: #b91c1c;
}

/* =========================
   Base Layout
   ========================= */
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

.page {
  padding: 16px;
  max-width: 1300px;
  margin: 0 auto;
}

/* =========================
   Panels / Cards
   ========================= */
.card,
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  border-radius: 10px;
  padding: 12px;
}

/* =========================
   Typography
   ========================= */
h1 {
  font-size: 1.4rem;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 10px;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

label {
  color: var(--text-label);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 4px;
}

/* =========================
   Inputs
   ========================= */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(96,165,250,0.15);
}

textarea {
  min-height: 300px;
  max-height: 70vh;
  resize: vertical;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* File input button */
input[type="file"]::file-selector-button {
  background: #111827;
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 5px 8px;
  margin-right: 8px;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: #0b1220;
}

/* =========================
   Buttons
   ========================= */
button,
.btn,
input[type="submit"] {
  background: #111827;
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.btn:hover {
  background: #0b1220;
  border-color: #475569;
}

/* Variants */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-danger {
  background: #3a0d0d;
  border-color: #5b1b1b;
}

.btn-danger:hover {
  background: var(--danger);
}

/* =========================
   Layout Helpers
   ========================= */
.stack > * + * {
  margin-top: 10px;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================
   Tables (File Manager)
   ========================= */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border-main);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-main);
  text-align: left;
}

th {
  color: var(--text-muted);
  font-weight: 600;
}

tr:hover td {
  background: #0b1220;
}

/* =========================
   Breadcrumbs
   ========================= */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.crumbs a {
  color: #60a5fa;
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

/* =========================
   Messages
   ========================= */
.alert {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-main);
  font-size: 0.9rem;
}

.alert-error {
  background: #2a0f12;
  border-color: #5b1b22;
  color: #fecaca;
}

/* =========================
   Topbar
   ========================= */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 700px) {
  .page {
    padding: 10px;
  }

  th,
  td {
    padding: 6px;
  }
}

/* =========================
   Links (admin style)
   ========================= */
a {
  color: inherit;
  text-decoration: none;
}

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