:root {
  --bg-base: #000000;
  --bg-sidebar: #080808;
  --bg-card: #0f0f0f;
  --bg-card-hover: #141414;
  --bg-input: #080808;
  --border-color: #202020;
  --border-subtle: #171717;
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --primary: #ffffff;
  --primary-hover: #e4e4e7;
  --primary-text: #000000;
  --primary-glow: rgba(255, 255, 255, 0.08);
  --success: #d4d4d8;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.12);
  --sidebar-width: 250px;
  --radius: 9px;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
}

code, .mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Solar Duotone SVG styling */
.solar-icon, .hugeicon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* App Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: #ffffff;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  flex-shrink: 0;
}

.brand-icon .hugeicon {
  width: 18px;
  height: 18px;
}

.brand-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #ffffff;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: #ffffff;
  background: #141414;
}

.nav-link.active {
  color: #000000;
  background: #ffffff;
  font-weight: 600;
}

.nav-link.active .hugeicon path[opacity] {
  opacity: 0.45 !important;
}

.sidebar-footer {
  height: var(--header-height);
  padding: 0 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  background: #171717;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: #ffffff;
  border: 1px solid var(--border-color);
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.user-role {
  font-size: 11px;
  color: var(--text-dim);
}

.btn-icon-logout {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s;
}

.btn-icon-logout:hover {
  color: #ffffff;
  border-color: #525252;
  background: #171717;
}

/* Main Content */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-body {
  padding: 28px 32px;
  flex: 1;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  height: 60px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s, background-color 0.15s;
}

.stat-card:hover {
  border-color: #3f3f46;
  background: var(--bg-card-hover);
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #171717;
  border: 1px solid var(--border-color);
  color: #ffffff;
}

.stat-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.stat-info .stat-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-info .stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

/* Card Container */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  height: var(--header-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.card-body {
  padding: 20px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  height: 38px;
  padding: 0 12px;
  width: 280px;
  transition: border-color 0.2s;
}

.search-box:focus-within {
  border-color: #52525b;
}

.search-box .hugeicon {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13px;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

select.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #d4d4d8;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

select.filter-select:focus {
  border-color: #52525b;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table th {
  background: #09090b;
  color: var(--text-dim);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

table.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: #d4d4d8;
  vertical-align: middle;
}

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

table.data-table tr:hover {
  background: var(--bg-card-hover);
}

/* Badges (Minimalist Black / White / Grey) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid var(--border-color);
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
}

.badge-active {
  background: #171717;
  color: #ffffff;
  border-color: #3f3f46;
}
.badge-active .badge-dot {
  background: #ffffff;
}

.badge-inactive {
  background: #141414;
  color: #a1a1aa;
  border-color: #27272a;
}
.badge-inactive .badge-dot {
  background: #71717a;
}

.badge-suspended {
  background: #1a1a1a;
  color: #e4e4e7;
  border-color: #3f3f46;
}
.badge-suspended .badge-dot {
  background: #a1a1aa;
}

.badge-revoked {
  background: #171717;
  color: #f87171;
  border-color: #451a1a;
}
.badge-revoked .badge-dot {
  background: #ef4444;
}

.badge-expired {
  background: #141414;
  color: #71717a;
  border-color: #27272a;
}
.badge-expired .badge-dot {
  background: #52525b;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn .hugeicon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}
.btn-primary:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

.btn-outline {
  background: #141414;
  border: 1px solid var(--border-color);
  color: #d4d4d8;
}
.btn-outline:hover {
  background: #1f1f1f;
  border-color: #52525b;
  color: #ffffff;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: var(--radius);
}

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

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: #0f0f0f;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: modalFade 0.15s ease;
}

@keyframes modalFade {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  height: var(--header-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h4 {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.btn-close:hover {
  color: #ffffff;
  background: #1f1f1f;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  height: var(--header-height);
  padding: 0 20px;
  background: #080808;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-control {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: #ffffff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.form-control:focus {
  border-color: #71717a;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

textarea.form-control {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
}

.checkbox-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #d4d4d8;
  cursor: pointer;
}

.checkbox-custom input {
  width: 16px;
  height: 16px;
  accent-color: #ffffff;
  border-radius: 4px;
}

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #18181b;
  border: 1px solid var(--border-color);
  color: #ffffff;
  height: 48px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.2s ease;
}

.toast-success { border-left: 3px solid #ffffff; }
.toast-error { border-left: 3px solid var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 20px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-dim);
}

.page-buttons {
  display: flex;
  gap: 6px;
}

/* Key Display Banner */
.key-reveal-box {
  background: #0a0a0a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
  text-align: center;
}

.key-reveal-code {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 12px;
}

/* Minimal Login Screen */
.login-screen-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: #000000;
}

.login-box {
  background: #0a0a0a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 100%;
  max-width: 380px;
  padding: 32px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.8);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-brand h2 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.login-brand p {
  font-size: 12px;
  color: var(--text-dim);
}
