:root {
  --bg-canvas: #090d16;
  --bg-surface: #0e1626;
  --bg-card: #121c2e;
  --bg-hover: #18253d;
  --border: #1e2e4a;
  --border-subtle: #17243a;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  
  --accent: #22d3ee;
  --accent-hover: #06b6d4;
  --accent-subtle: rgba(34, 211, 238, 0.1);
  --accent-border: rgba(34, 211, 238, 0.3);
  
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.1);
  --success-border: rgba(52, 211, 153, 0.3);
  
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.1);
  --warning-border: rgba(251, 191, 36, 0.3);
  
  --danger: #fb7185;
  --danger-bg: rgba(251, 113, 133, 0.1);
  --danger-border: rgba(251, 113, 133, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-canvas);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-feature-settings: "tnum";
}

a {
  color: inherit;
  text-decoration: none !important;
}
a:hover, a:focus, a:active {
  text-decoration: none !important;
}

/* Base Layout System */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.sidebar {
  width: 250px;
  background: #080c14;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 20px;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  z-index: 45;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 54px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.content-body {
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Card & UI Containers (Strict 1px hairline border, no soft shadow slop) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-header {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-faint);
}

.btn-primary {
  background: var(--accent);
  color: #041017;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

/* Table Responsive Container */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

thead tr {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 10px 14px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

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

/* Form Elements */
input, select, textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: #0b111c;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

pre.code-block {
  background: #060910;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  overflow-x: auto;
  color: #7dd3fc;
  line-height: 1.5;
}

.mobile-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  color: var(--text-main);
  cursor: pointer;
}

/* Mobile Responsive Breakpoints */
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.7);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .mobile-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar {
    padding: 0 16px;
  }

  .content-body {
    padding: 16px;
  }

  .desktop-only {
    display: none !important;
  }
}
