/*
Theme Name: 3D Filament ERP
Author: AeroPrint 3D Systems
Description: A complete single-page 3D Filament Inventory, Procurement, Sales & GST Billing ERP system built as a WordPress theme with WordPress MySQL database persistence (REST API) and offline client caching.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: filament-erp-site
Tags: inventory, erp, billing, 3d-printing, custom-colors, full-width-template
*/

/* ==========================================================================
   CSS VARIABLES & DESIGN TOKENS (Minimal Slate Archetype)
   ========================================================================== */
:root {
  --page-bg: #f7f8fa;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --surface-active: #e2e8f0;
  --ink: #0f172a;
  --ink-secondary: #475569;
  --soft: #64748b;
  --muted: #94a3b8;
  --border: #e5e7eb;
  --border-light: #f1f5f9;
  --accent: #0f172a;
  --accent-contrast: #ffffff;
  --focus-ring: rgba(15, 23, 42, 0.15);

  /* Functional Status Colors */
  --green: #15803d;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;

  --amber: #b45309;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;

  --red: #b91c1c;
  --red-bg: #fef2f2;
  --red-border: #fecaca;

  --blue: #1d4ed8;
  --blue-bg: #eff6ff;
  --blue-border: #bfdbfe;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --header-height: 60px;
  --sidebar-width: 250px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --page-bg: #090d16;
  --surface: #111827;
  --surface-hover: #1f2937;
  --surface-active: #374151;
  --ink: #f8fafc;
  --ink-secondary: #cbd5e1;
  --soft: #94a3b8;
  --muted: #64748b;
  --border: #1e293b;
  --border-light: #162032;
  --accent: #f8fafc;
  --accent-contrast: #0f172a;
  --focus-ring: rgba(248, 250, 252, 0.2);

  --green: #4ade80;
  --green-bg: rgba(21, 128, 61, 0.2);
  --green-border: rgba(74, 222, 128, 0.3);

  --amber: #fbbf24;
  --amber-bg: rgba(180, 83, 9, 0.2);
  --amber-border: rgba(251, 191, 36, 0.3);

  --red: #f87171;
  --red-bg: rgba(185, 28, 28, 0.2);
  --red-border: rgba(248, 113, 113, 0.3);

  --blue: #60a5fa;
  --blue-bg: rgba(29, 78, 216, 0.2);
  --blue-border: rgba(96, 165, 250, 0.3);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--page-bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Clear WordPress default margins and bars if any */
body.filament-erp-body {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
}
#wpadminbar {
  display: none !important;
}
html {
  margin-top: 0 !important;
}

/* Typography utilities */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mono { font-family: var(--font-mono); }
.text-ink { color: var(--ink); }
.text-soft { color: var(--soft); }
.text-muted { color: var(--muted); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }

.text-right { text-align: right; }
.text-center { text-align: center; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   APP SHELL & LAYOUT
   ========================================================================== */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem;
  color: var(--ink);
  cursor: pointer;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  user-select: none;
}

.brand-logo {
  font-size: 1.5rem;
  line-height: 1;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.brand-subtitle {
  font-size: 0.6875rem;
  color: var(--soft);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.15s ease;
}
.theme-toggle-btn:hover {
  background: var(--surface-hover);
}

/* App Body (Sidebar + Content) */
.app-body {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

.nav-menu {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.75rem 0.5rem 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--ink-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.nav-item.active {
  background: var(--surface-active);
  color: var(--ink);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.sidebar-status {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green-border);
}

.status-sub {
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Main View */
.app-main {
  flex: 1;
  padding: 1.5rem;
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ==========================================================================
   BUTTONS & FORMS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.btn-primary:hover {
  opacity: 0.92;
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--surface-hover);
  border-color: var(--muted);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}
.btn-danger:hover {
  background: var(--red);
  color: #fff;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.875rem;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

/* ==========================================================================
   CARDS & GRIDS
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.grid {
  display: grid;
  gap: 1rem;
}
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .grid-cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-cols-6, .grid-cols-4, .grid-cols-3, .grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 96px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  line-height: 1.2;
}

.badge-green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-amber { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-red { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.badge-blue { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }
.badge-soft { background: var(--surface-hover); color: var(--soft); border: 1px solid var(--border); }

/* Filter Pills */
.filter-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-pill {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-pill:hover {
  border-color: var(--muted);
  color: var(--ink);
}
.filter-pill.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  text-align: left;
}

.data-table th {
  background: var(--page-bg);
  color: var(--soft);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--ink);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--surface-hover);
}

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

/* Color Dot */
.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.15);
  vertical-align: middle;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
  animation: modalScale 0.18s ease-out;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  background: var(--page-bg);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--ink);
  color: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.2s ease-out;
}

.toast.success { background: #15803d; color: #fff; }
.toast.error { background: #b91c1c; color: #fff; }
.toast.info { background: #0f172a; color: #fff; }

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

/* ==========================================================================
   PRINTABLE A4 TAX INVOICE
   ========================================================================== */
.print-container {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  *, *:before, *:after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 10pt !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .no-print,
  .app-header,
  .app-sidebar,
  .app-main,
  .modal-overlay,
  .toast-container {
    display: none !important;
  }

  .print-container {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .invoice-a4 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 768px) {
  .mobile-toggle {
    display: inline-flex;
  }

  .app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    z-index: 35;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-md);
  }

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

  .app-main {
    padding: 1rem;
  }
}

/* ==========================================================================
   ADMIN LOGIN GATE & RBAC STYLES
   ========================================================================== */
.admin-login-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page-bg);
  overflow-y: auto;
  padding: 1.5rem;
}

.admin-login-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  padding: 2rem;
  margin: auto;
}

.login-brand-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.login-logo {
  display: inline-flex;
  width: 52px;
  height: 52px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.login-app-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0;
}

.login-badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--ink-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.4rem 0 0.5rem;
}

.login-subtitle {
  font-size: 0.8125rem;
  color: var(--soft);
  line-height: 1.45;
  margin: 0;
}

.demo-access-box {
  background: var(--surface-hover);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}

.demo-access-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.725rem;
  font-weight: 800;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.badge-pill-xs {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.demo-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.btn-demo-quick {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.btn-demo-quick:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-demo-quick .demo-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.btn-demo-quick .demo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.btn-demo-quick .demo-text strong {
  font-size: 0.75rem;
  color: var(--ink);
}

.btn-demo-quick .demo-text small {
  font-size: 0.625rem;
  color: var(--muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--muted);
  pointer-events: none;
  font-size: 0.95rem;
}

.input-with-icon .form-control {
  padding-left: 2.35rem;
  padding-right: 2.35rem;
}

.btn-toggle-pwd {
  position: absolute;
  right: 0.65rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.95rem;
  opacity: 0.65;
  transition: opacity 0.15s ease;
}

.btn-toggle-pwd:hover {
  opacity: 1;
}

.login-hint-text {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.login-error-box {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.btn-login-submit {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.login-footer-security {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
  color: var(--muted);
}

/* Header User Profile */
.header-admin-profile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.6rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-left: 0.35rem;
}

.admin-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.admin-profile-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.admin-header-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-role {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
}

.badge-role.superadmin {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.badge-role.subadmin {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}

.badge-role-mini {
  background: var(--surface-active);
  color: var(--ink);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  margin-left: auto;
}

/* Admin Management Dashboard */
.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color 0.15s ease;
}

.admin-card:hover {
  border-color: var(--ink);
}

.admin-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-card-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.admin-card-details h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 2px;
}

.admin-card-details p {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
  font-family: var(--font-mono);
}

.admin-card-body {
  font-size: 0.8125rem;
  color: var(--soft);
  background: var(--surface-hover);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

