/* ════════════════════════════════════════════════════════════
   Partner Portal — styled to match the MAIN crms web app
   (C:\test\crms\public\css\dashboard.css). Dark theme by default.
   Tokens, sidebar/main-content shell, and component classes
   (.btn / .card / .table / .modal / .badge / .stat-card / inputs)
   are copied/adapted from dashboard.css so the portal looks like
   the main CRMS, not the admin console.
════════════════════════════════════════════════════════════ */

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

:root {
  --primary: #0a0a0f;
  --secondary: #13131a;
  --tertiary: #1a1a24;
  --accent: #2d5ee5;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --text: #ffffff;
  --text-muted: #9ca3af;
  --text-dark: #6b7280;
  --border: #2a2a35;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --sidebar-width: 280px;
  --sidebar-collapsed-width: 80px;
  --header-height: 70px;
  --transition: all 0.3s ease;
}

/* Light Theme Variables (optional override; dark is default) */
body.light-theme {
  --primary: #f5f5f7;
  --secondary: #ffffff;
  --tertiary: #f8f8f8;
  --text: #1a1a1f;
  --text-muted: #6b7280;
  --text-dark: #9ca3af;
  --border: #d1d5db;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--primary);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ════════════════════════════════════════════════════════════
   AUTH / LOGIN SCREEN — dark, accent #2d5ee5
════════════════════════════════════════════════════════════ */
#auth-screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(45, 94, 229, 0.12), transparent 60%),
    var(--primary);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px 40px 36px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo img.logo-img { height: 40px; margin-bottom: 8px; }

.auth-logo .logo-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--accent);
  border-radius: 16px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px -8px rgba(45, 94, 229, 0.55);
}
.auth-logo .logo-icon-wrap svg {
  width: 30px; height: 30px;
  fill: none; stroke: #fff; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.auth-logo .logo-icon-wrap i { font-size: 28px; color: #fff; }

.auth-logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.auth-logo p { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

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

.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════
   FORM CONTROLS (shared by auth + modals)
════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.input-wrap { position: relative; }
.input-wrap .input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-group input,
.form-group select,
.toolbar-input,
.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, background .15s;
  font-family: inherit;
}

.input-wrap input { padding-left: 40px; }

.form-group input::placeholder,
.toolbar-input::placeholder { color: var(--text-muted); }

.form-group input:focus,
.form-group select:focus,
.toolbar-input:focus {
  border-color: var(--accent);
  background: var(--tertiary);
}

.form-group select { cursor: pointer; }
.form-group .field-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.form-group input[type="color"] { padding: 4px; height: 42px; cursor: pointer; background: var(--tertiary); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ════════════════════════════════════════════════════════════
   BUTTONS — main-crms .btn / .btn-primary / .btn-secondary / .btn-danger
════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px -10px rgba(45, 94, 229, 0.5);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* full-width primary used on the login form */
#auth-screen .btn-primary { width: 100%; margin-top: 8px; }
.btn-primary.btn-inline { width: auto; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--tertiary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-secondary:hover { border-color: var(--accent); background: rgba(45, 94, 229, 0.1); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-danger:hover { background: var(--danger); color: #fff; }

/* compact buttons used in toolbars / table rows */
.btn-sm {
  padding: 7px 14px;
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent-light); background: rgba(45, 94, 229, 0.1); }

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

.btn-sm.btn-danger-sm { color: var(--danger); border-color: var(--border); }
.btn-sm.btn-danger-sm:hover { background: rgba(239, 68, 68, 0.12); border-color: var(--danger); color: var(--danger); }

/* ════════════════════════════════════════════════════════════
   APP SHELL — fixed sidebar + main-content (mirrors dashboard.html)
════════════════════════════════════════════════════════════ */
#app-screen { display: none; }
#app-screen.active { display: block; }

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: var(--transition);
}

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

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.sidebar-header .logo img.logo-img {
  display: block;
  max-width: 180px;
  max-height: 38px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}
.sidebar-header .brand-icon {
  width: 38px; height: 38px;
  flex-shrink: 0;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-header .brand-icon svg { width: 19px; height: 19px; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.sidebar-header .brand-icon i { color: #fff; font-size: 17px; }
.sidebar-header .logo-text {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar navigation (.nav-list / .nav-item / .nav-link) */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--tertiary);
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: var(--tertiary); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.nav-list { list-style: none; }
.nav-item { margin: 4px 12px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.nav-link i:first-child { width: 20px; text-align: center; font-size: 18px; flex-shrink: 0; }
.nav-link:hover { background: var(--tertiary); color: var(--text); }
.nav-link.active { background: rgba(45, 94, 229, 0.15); color: var(--accent-light); }
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

/* Sidebar footer (user avatar / name / role + logout) */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.user-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.user-avatar {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  color: #fff; flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }

.logout-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logout-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.logout-btn:hover { border-color: var(--danger); color: var(--danger); background: rgba(239, 68, 68, 0.1); }

/* Main content + sticky top header */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: var(--transition);
}

.top-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}
body.light-theme .top-header { background: rgba(245, 245, 247, 0.8); }

.header-left { display: flex; align-items: center; gap: 16px; }
.breadcrumb { font-size: 18px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }
.topbar-time { font-size: 13px; color: var(--text-muted); font-weight: 500; display: none; }
@media (min-width: 700px) { .topbar-time { display: block; } }

.page-container {
  padding: 24px;
  min-height: calc(100vh - var(--header-height));
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .page-container { padding: 16px; }
  .top-header { padding: 0 16px; }
}

/* ════════════════════════════════════════════════════════════
   PAGE HEADER (section title row)
════════════════════════════════════════════════════════════ */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-left h2 { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; }
.page-header-left p { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.page-header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.toolbar-input { width: auto; min-width: 240px; padding: 10px 16px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px; font-weight: 600;
  color: var(--success);
}
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.85); } }

/* ════════════════════════════════════════════════════════════
   CARDS / PANELS (.card radius 16px) — .panel is an alias re-skin
════════════════════════════════════════════════════════════ */
.card,
.panel {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 20px;
  overflow: hidden;
}
.card { padding: 24px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title { font-size: 18px; font-weight: 600; }

.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--tertiary);
}
.panel-header h3 { font-size: 16px; font-weight: 600; color: var(--text); }
.panel-body { padding: 8px 24px 20px; }

.info-list { list-style: none; }
.info-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.info-list li:last-child { border-bottom: none; }
.info-list li .key { color: var(--text-muted); font-weight: 500; }
.info-list li .val { font-weight: 600; color: var(--text); max-width: 55%; text-align: right; word-break: break-all; }
.info-list li .val.ok  { color: var(--success); }
.info-list li .val.err { color: var(--danger); }

/* ════════════════════════════════════════════════════════════
   STAT CARDS (.stat-card / .stat-icon / .stat-value / .stat-label)
════════════════════════════════════════════════════════════ */
.stats-grid,
.grid {
  display: grid;
  gap: 24px;
}
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 24px;
}

.stat-card {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.stat-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-icon.primary { background: rgba(45, 94, 229, 0.15); color: var(--accent-light); }
.stat-icon.success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-icon.info    { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.stat-icon.danger  { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.stat-content,
.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 28px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.stat-label { font-size: 14px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   TABLES (.table — uppercase th, hover rows) — .data-table re-skin
════════════════════════════════════════════════════════════ */
.table-container { overflow-x: auto; }

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

.table th, .table td,
.data-table th, .data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th,
.data-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--tertiary);
  white-space: nowrap;
}
.table th:first-child, .data-table th:first-child { border-radius: 8px 0 0 8px; }
.table th:last-child,  .data-table th:last-child  { border-radius: 0 8px 8px 0; }

.table tr:hover td,
.data-table tbody tr:hover td { background: rgba(45, 94, 229, 0.05); }

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.table-loading { text-align: center; color: var(--text-muted); padding: 28px; }

/* ════════════════════════════════════════════════════════════
   BADGES (.badge / .badge-success|warning|danger|primary, radius 6px)
   plus the legacy color-modifier aliases the JS still emits
════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.badge-primary, .badge.blue  { background: rgba(45, 94, 229, 0.15); color: var(--accent-light); }
.badge-success, .badge.green { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-warning, .badge.amber { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger,  .badge.red   { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* table row pills (status, type) */
.tag-pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
}
.tag-pill.green { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.tag-pill.blue  { background: rgba(45, 94, 229, 0.15); color: var(--accent-light); }
.tag-pill.amber { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.tag-pill.red   { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.tag-pill.gray  { background: var(--tertiary); color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   SPINNER / LOADING / EMPTY STATES
════════════════════════════════════════════════════════════ */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-muted); font-size: 14px; }
.no-data-msg { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 14px; }

/* ════════════════════════════════════════════════════════════
   MODAL (.modal-overlay / .modal radius 12px / header / body / footer / close)
   Section JS uses .modal-box / .modal-close-btn aliases — both styled.
════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal,
.modal-box {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-box-large { max-width: 880px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title-group { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.modal-header h3 { font-size: 17px; font-weight: 600; color: var(--text); margin: 0; }
.modal-meta { font-size: 12px; color: var(--text-muted); }

.modal-close,
.modal-close-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.modal-close:hover,
.modal-close-btn:hover { background: rgba(239, 68, 68, 0.1); border-color: var(--danger); color: var(--danger); }

.modal-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--tertiary); flex-shrink: 0; overflow-x: auto; }
.modal-tab {
  padding: 12px 20px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.modal-tab.active { color: var(--accent-light); border-bottom-color: var(--accent); background: var(--secondary); }
.modal-tab:hover:not(.active) { color: var(--text); }

.modal-body { flex: 1; overflow-y: auto; padding: 24px; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-body .alert { margin-bottom: 16px; }

/* ════════════════════════════════════════════════════════════
   ALERTS
════════════════════════════════════════════════════════════ */
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
  font-weight: 500;
}
.alert.error   { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.alert.success { background: rgba(34, 197, 94, 0.12); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.4); }
.alert.show    { display: block; }

/* ════════════════════════════════════════════════════════════
   COPY-CODE CELL / KEY REVEAL
════════════════════════════════════════════════════════════ */
.copy-code { display: inline-flex; align-items: center; gap: 8px; }
.copy-code code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12px;
  background: var(--tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text);
  word-break: break-all;
}
.btn-copy {
  border: 1px solid var(--border);
  background: var(--tertiary);
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent-light); background: rgba(45, 94, 229, 0.1); }

.key-reveal {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.key-reveal .key-reveal-label { font-size: 12px; font-weight: 700; color: var(--success); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.key-reveal .key-reveal-value {
  display: flex; align-items: center; gap: 10px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 14px; font-weight: 700; color: var(--text);
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; word-break: break-all;
}

/* row action group / detail tab panes */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); }
.pagination .page-info { font-size: 12px; color: var(--text-muted); }
.pagination .page-controls { display: flex; gap: 6px; }

/* ════════════════════════════════════════════════════════════
   TOASTS
════════════════════════════════════════════════════════════ */
.toast-host { position: fixed; top: calc(var(--header-height) + 16px); right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 220px; max-width: 360px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  color: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
  opacity: 1;
  transform: translateX(0);
  transition: opacity .3s, transform .3s;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-out { opacity: 0; transform: translateX(20px); }

/* meta-grid for overview tab */
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .meta-grid { grid-template-columns: 1fr; } }
.meta-item { background: var(--tertiary); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.meta-item .meta-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.meta-item .meta-value { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 4px; word-break: break-word; }

/* usage bar */
.usage-row { margin-bottom: 14px; }
.usage-row .usage-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.usage-row .usage-head .um-metric { font-weight: 700; color: var(--text); text-transform: capitalize; }
.usage-row .usage-head .um-count { color: var(--text-muted); }
.usage-bar { height: 8px; background: var(--tertiary); border-radius: 6px; overflow: hidden; }
.usage-bar .usage-fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width .3s; }
.usage-bar .usage-fill.warn { background: var(--warning); }
.usage-bar .usage-fill.over { background: var(--danger); }
