:root {
  /* Colors */
  --bg-body: #1c1c1e;
  --bg-sidebar: #252528;
  --bg-card: #2c2c2e;
  --bg-input: #252528;

  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.18);

  --text-primary: #ffffff;
  --text-secondary: #ffffff;
  --text-tertiary: #a1a1aa;

  --primary: #5e5ce6;
  --primary-hover: #4745d1;

  --success: #30d158;
  --warning: #ff9f0a;
  --danger: #ff453a;

  /* Spacing */
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

button,
input,
select,
textarea {
  font-family: inherit;
}

*:focus-visible {
  outline: none;
}

/* Base Typography - Ultra Compact (12px) */
/* Base Typography - Ultra Compact (12px) */
body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* Prevent body scroll, delegate to containers */
  height: 100%;
}

html {
  height: 100%;
  overflow: hidden;
}

/* ... headers ... */

/* Layout */
.app-container {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-body);
}

.sidebar {
  position: fixed;
  top: 12px;
  left: 12px;
  bottom: 12px;
  width: 240px;
  margin: 0;
  height: calc(100vh - 24px);
  height: calc(100dvh - 24px);
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  padding: 16px;
  z-index: 100; /* High z-index to be safe */
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-left: 8px;
  gap: 8px;
}

.brand-icon {
  color: var(--primary);
  font-size: 22px;
}

.nav-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(
    90deg,
    rgba(139, 92, 246, 0.1) 0%,
    transparent 100%
  );
  color: var(--primary);
  border-left: 3px solid var(--primary);
  border-radius: 4px var(--radius-md) var(--radius-md) 4px;
}

.nav-item i {
  font-size: 14px;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  padding: 12px 16px 6px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: auto;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: white;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 12px;
}

.user-role {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.main-content {
  position: absolute;
  top: 0;
  left: 264px; /* 240px width + 12px left + 12px gap */
  right: 0;
  bottom: 0;
  padding: 12px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  z-index: 1;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

/* Tables - Ultra Compact */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  padding: 2px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--text-tertiary);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 8px 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
}

tr:last-child td {
  border-bottom: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Utilities */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.status-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.mb-3 {
  margin-bottom: 1rem;
}
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}
.form-control,
.form-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 12px;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  outline: none;
}
.form-text {
  color: var(--text-tertiary);
  font-size: 11px;
  margin-top: 4px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -12px;
  margin-left: -12px;
}
.col-md-4,
.col-md-2 {
  position: relative;
  width: 100%;
  padding-right: 12px;
  padding-left: 12px;
}
@media (min-width: 768px) {
  .col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  .col-md-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
  }
}
.status-live {
  background: rgba(48, 209, 88, 0.15);
  color: var(--success);
}
.status-dev {
  background: rgba(255, 159, 10, 0.15);
  color: var(--warning);
}
/* Login styles from previous file preserved for auth pages if needed */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
}
.login-box {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}
.login-box .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.login-header h2 {
  color: var(--text-primary);
}
.login-box label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}
.login-box input[type="text"],
.login-box input[type="password"],
.login-box input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
}
.login-box input:focus {
  border-color: var(--primary);
  outline: none;
}
.auth-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: var(--primary);
  color: #fff;
  transition: all 0.2s;
}
.auth-btn:hover {
  background: var(--primary-hover);
}
.auth-footer {
  margin-top: 20px;
  text-align: center;
}
.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.auth-footer a:hover {
  text-decoration: underline;
}
