:root {
  /* KeyAuth Dark & Red Theme Palette */
  --bg-body: #0d0e11;
  --bg-sidebar: #111216;
  --bg-card: #15161b;
  --bg-card-hover: #191b21;
  --bg-input: #0b0c0f;
  --bg-secondary: #1a1b22;
  
  --border-subtle: #1f2128;
  --border-card: #252832;
  --border-card-hover: #323644;
  --border-focus: #dc2626;

  /* Red Accents (Matte / Non-flashy) */
  --red-primary: #dc2626;
  --red-hover: #b91c1c;
  --red-dark: #7f1d1d;
  --red-subtle: rgba(220, 38, 38, 0.12);
  --red-border: rgba(220, 38, 38, 0.3);
  --red-text: #ef4444;

  /* Text Colors */
  --text-white: #ffffff;
  --text-main: #e2e4e9;
  --text-muted: #848895;
  --text-dim: #545763;

  /* Status Colors */
  --status-active-bg: rgba(220, 38, 38, 0.14);
  --status-active-text: #f87171;
  --status-active-border: rgba(220, 38, 38, 0.35);

  --status-unused-bg: rgba(255, 255, 255, 0.04);
  --status-unused-text: #9ca3af;
  --status-unused-border: rgba(255, 255, 255, 0.1);

  --status-banned-bg: rgba(185, 28, 28, 0.22);
  --status-banned-text: #fca5a5;
  --status-banned-border: #991b1b;

  --status-expired-bg: rgba(127, 29, 29, 0.2);
  --status-expired-text: #f87171;
  --status-expired-border: rgba(185, 28, 28, 0.35);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Space Mono', Consolas, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: #252832;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #363a48;
}

/* App Shell */
#app {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  left: 0;
  height: 100vh;
  width: 250px;
  min-width: 250px;
  flex-shrink: 0;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.logo {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #181920;
  border: 1px solid var(--red-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-text);
  flex-shrink: 0;
}

.logo-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-white);
  line-height: 1.2;
}

.logo-title span {
  color: var(--red-text);
  font-weight: 800;
}



nav {
  padding: 14px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 12px 10px 6px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: #9499a8;
  margin-bottom: 4px;
  border: 1px solid transparent;
  background-image: linear-gradient(90deg, #991b1b 0%, #dc2626 40%, rgba(220, 38, 38, 0.4) 52%, transparent 60%, transparent 100%);
  background-size: 250% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
  transition: background-position 0.38s cubic-bezier(0.25, 1, 0.5, 1),
              color 0.38s ease,
              border-color 0.38s ease,
              box-shadow 0.38s ease;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  color: #ffffff;
  background-position: 0% 0;
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.nav-item.active {
  color: #ffffff;
  font-weight: 600;
  background-position: 0% 0;
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 4px 18px rgba(220, 38, 38, 0.45);
}

.nav-item.active:hover {
  box-shadow: 0 4px 22px rgba(220, 38, 38, 0.6);
}

.nav-icon {
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex-shrink: 0;
  transition: transform 0.38s ease, color 0.38s ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: #ffffff;
  transform: scale(1.06);
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 4px;
  transition: background 0.38s ease, color 0.38s ease, border-color 0.38s ease;
}

.nav-item:hover .nav-badge,
.nav-item.active .nav-badge {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  background: #0f1014;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.firebase-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4b5563;
  margin-right: 6px;
}

.status-dot.connected {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.status-dot.error {
  background: var(--red-text);
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.4);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 24px 36px 40px;
  overflow-x: hidden;
  background-color: var(--bg-body);
}

/* Breadcrumb Bar */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.breadcrumb-home {
  display: inline-flex;
  align-items: center;
  color: var(--text-dim);
}

.breadcrumb-text {
  color: #71717a;
  font-weight: 500;
}

.breadcrumb-separator {
  color: #52525b;
  font-size: 11px;
}

.breadcrumb-current {
  color: #71717a;
}

.app-tag {
  color: #a1a1aa;
}

/* Page Header */
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-white);
  margin-bottom: 4px;
}



.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 22px 20px;
  text-align: center;
  transition: border-color 0.2s, background-color 0.2s;
}

.metric-card:hover {
  border-color: var(--border-card-hover);
  background-color: var(--bg-card-hover);
}

.metric-card.accent:hover {
  border-color: var(--red-border);
}

.metric-val {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-white);
  line-height: 1.1;
  margin-bottom: 6px;
}

.metric-lbl {
  font-size: 13px;
  color: #848895;
  font-weight: 500;
}

.section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: #131419;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
  line-height: 1.4;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--red-primary);
  color: #ffffff;
  border-color: #ef4444;
}

.btn-primary:hover {
  background-color: var(--red-hover);
  border-color: #dc2626;
}

.btn-outline {
  background-color: #17181f;
  color: var(--text-main);
  border: 1px solid var(--border-card);
}

.btn-outline:hover {
  background-color: var(--bg-secondary);
  border-color: #3b3f4f;
  color: var(--text-white);
}

.btn-danger {
  background-color: rgba(220, 38, 38, 0.12);
  color: var(--red-text);
  border: 1px solid var(--red-border);
}

.btn-danger:hover {
  background-color: rgba(220, 38, 38, 0.24);
  color: #fca5a5;
  border-color: #dc2626;
}

.btn-secondary {
  background-color: #1e2029;
  color: #d1d5db;
  border: 1px solid #2d303d;
}

.btn-secondary:hover {
  background-color: #272a36;
  color: #ffffff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 5px;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  padding: 6px 12px;
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-white);
  font-family: var(--font-sans);
  font-size: 12px;
  width: 170px;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

input[type=text],
input[type=password],
input[type=number],
input[type=datetime-local],
select,
textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-white);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

select option {
  background-color: #15161b;
  color: var(--text-white);
}

label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 14px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

thead tr {
  background-color: #131418;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  padding: 10px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #71717a;
  font-weight: 600;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #1a1c22;
  vertical-align: middle;
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

tr.row-expired td {
  background-color: rgba(220, 38, 38, 0.03);
}

.key-code {
  font-family: var(--font-mono);
  font-size: 11px;
  background-color: #0f1013;
  border: 1px solid var(--border-card);
  padding: 4px 8px;
  border-radius: 5px;
  color: #f3f4f6;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.key-code:hover {
  background-color: rgba(220, 38, 38, 0.1);
  border-color: var(--red-border);
  color: var(--red-text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  font-family: var(--font-sans);
}

.badge-active {
  background-color: var(--status-active-bg);
  color: var(--status-active-text);
  border: 1px solid var(--status-active-border);
}

.badge-unused {
  background-color: var(--status-unused-bg);
  color: var(--status-unused-text);
  border: 1px solid var(--status-unused-border);
}

.badge-banned {
  background-color: var(--status-banned-bg);
  color: var(--status-banned-text);
  border: 1px solid var(--status-banned-border);
}

.badge-expired {
  background-color: var(--status-expired-bg);
  color: var(--status-expired-text);
  border: 1px solid var(--status-expired-border);
}

.badge-cat {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: #1b1c23;
  color: #cbd5e1;
  border: 1px solid #2d303e;
}

.cat-tag-0 { border-color: rgba(220, 38, 38, 0.4); color: #f87171; background: rgba(220, 38, 38, 0.1); }
.cat-tag-1 { border-color: #3b4252; color: #d8dee9; background: #242933; }
.cat-tag-2 { border-color: #4c566a; color: #eceff4; background: #2e3440; }
.cat-tag-3 { border-color: rgba(220, 38, 38, 0.3); color: #fca5a5; background: rgba(220, 38, 38, 0.08); }

.hwid-box {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-card);
  word-break: break-all;
  line-height: 1.7;
}

.hwid-none {
  color: var(--text-dim);
  font-size: 11px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card-hover);
  border-radius: 10px;
  width: 500px;
  max-width: 95vw;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title span {
  color: var(--red-text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text-white);
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

/* View switching */
.view {
  display: none;
}
.view.active {
  display: block;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background-color: #17181f;
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--red-primary);
  border-radius: 6px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  min-width: 250px;
}

.toast.success { border-left-color: #22c55e; }
.toast.error { border-left-color: var(--red-primary); }
.toast.info { border-left-color: #94a3b8; }
.toast.warn { border-left-color: #eab308; }

/* Category Cards */
.cat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 16px;
  transition: border-color 0.15s;
}

.cat-card:hover {
  border-color: var(--border-card-hover);
}

.cat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cat-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
}

.cat-card-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.cat-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-card);
  border-top-color: var(--red-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.sync-stat-box {
  flex: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}
.sync-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-white);
}
.sync-stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

#login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}



























.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.sidebar-credit {
  font-size: 9.5px;
  color: #525866;
  text-align: center;
  margin-top: 6px;
  line-height: 1.3;
  letter-spacing: 0.2px;
  user-select: none;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  margin-left: auto;
  padding: 4px;
  line-height: 1;
}

.sidebar-close-btn:hover {
  color: var(--text-white);
}

.mobile-topbar {
  display: none;
}

.dashboard-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 860px) {
  #app {
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: none;
    background-color: #0c0d10;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
  }

  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #0f1014;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 40;
    margin: -16px -14px 14px -14px;
  }

  .mobile-menu-btn {
    background: #181920;
    border: 1px solid var(--border-card);
    border-radius: 8px;
    color: var(--text-white);
    cursor: pointer;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
  }

  .mobile-menu-btn:hover,
  .mobile-menu-btn:active {
    background: #20222a;
    border-color: var(--red-border);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-brand-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
  }

  .mobile-brand-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-white);
  }

  .mobile-brand-title span {
    color: var(--red-text);
  }

  .mobile-gen-btn {
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
  }

  .main {
    padding: 16px 14px;
    width: 100%;
    min-width: 0;
  }

  .breadcrumb {
    font-size: 11px;
    padding: 8px 12px;
    margin-bottom: 14px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .page-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .page-header-row h1.page-title {
    font-size: 18px;
  }

  .topbar-actions {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }

  .topbar-actions .search-box {
    width: 100%;
    flex: 1 1 100%;
  }

  .topbar-actions .search-box input {
    width: 100%;
    height: 38px;
    font-size: 16px;
  }

  .topbar-actions select {
    flex: 1 1 calc(50% - 4px);
    min-width: 120px;
    height: 38px;
    font-size: 16px;
  }

  .topbar-actions button {
    flex: 1 1 auto;
    height: 38px;
    font-size: 12px;
    justify-content: center;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 14px;
  }

  .metric-card {
    padding: 12px 14px;
  }

  .metric-val {
    font-size: 20px;
  }

  .dashboard-two-col {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    margin-bottom: 16px;
  }

  .cat-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin: 0 -4px;
  }

  .table-wrap table {
    min-width: 680px;
  }

  .modal-overlay {
    padding: 10px;
    align-items: center;
  }

  .modal {
    width: 100% !important;
    max-width: 100% !important;
    padding: 18px 16px !important;
    margin: 0 !important;
    border-radius: 12px;
    max-height: 88vh;
    max-height: 88dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-title {
    font-size: 15px;
    margin-bottom: 14px;
  }

  .modal div[style*="grid-template-columns:1fr 1fr"],
  .modal div[style*="grid-template-columns: 1fr 1fr"],
  .modal div[style*="grid-template-columns:1fr 1fr 1fr"],
  .modal div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .modal-footer {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
  }

  .modal-footer button {
    flex: 1 1 auto;
    min-width: 90px;
    height: 40px;
    font-size: 13px;
    justify-content: center;
  }

  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="datetime-local"],
  select,
  textarea {
    font-size: 16px !important;
  }

  
}

@media (max-width: 480px) {
  .metric-grid {
    grid-template-columns: 1fr !important;
  }

  .topbar-actions select {
    flex: 1 1 100%;
  }
}




.mobile-logo-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #181920;
  border: 1px solid var(--red-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-text);
  flex-shrink: 0;
}
