@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700&display=swap');@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap');@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');


:root {
  font-family: 'Plus Jakarta Sans', system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-weight: 400;
}

html[lang='he'],
html[dir='rtl'] {
  font-family: 'Heebo', 'Rubik', 'Noto Sans Hebrew', 'Segoe UI', Arial, sans-serif;
}

html[lang='ar'] {
  font-family: 'Noto Sans Arabic', 'Cairo', 'Tajawal', 'Segoe UI', Arial, sans-serif;
}

:root {
  color-scheme: light dark;
  color: var(--text-primary);
  background-color: var(--bg-light);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  text-decoration: inherit;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.025em;
}

/* h2 is a real heading again — the old global made EVERY h2 a small uppercase eyebrow, which
   forced pages to keep resetting it (and left section titles smaller than body text). The eyebrow
   look is now opt-in via .eyebrow for the section/card labels that actually want it. */
h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.25s;
}
/* Visible keyboard focus — cross-browser and keyboard-only, so the ring guides Tab navigation
   without flashing on every mouse click. */
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary, #25d366);
  outline-offset: 2px;
}
button:focus:not(:focus-visible) {
  outline: none;
}

html {
  /* Root/overscroll background follows the app theme token, so an explicit dark theme on a
     light-OS device doesn't reveal a white <html> background above/below the body (overscroll). */
  background-color: var(--bg-light);
}

@media (prefers-color-scheme: light) {
  /* Guarded with :not([data-theme='dark']): when the OS prefers light but the user explicitly
     picked the dark theme, the app's own choice must win (otherwise the root is force-whitened). */
  :root:not([data-theme='dark']) {
    color: #213547;
    background-color: #ffffff;
  }
}

/* Global select/dropdown styling */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-white, #fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

select:hover {
  border-color: var(--primary, #25d366);
}

select:focus {
  outline: none;
  border-color: var(--primary, #25d366);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

select:disabled {
  background-color: var(--bg-light, #f8fafc);
  color: var(--text-muted, #94a3b8);
  cursor: not-allowed;
}

/* GLOBAL MODAL STYLES */

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Card */
.modal {
  background: var(--bg-white, #fff);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 90%;
  max-width: 480px;
  animation: slideUp 0.3s ease;
  /* Cap height and lay out as a flex column so the body scrolls while the header and footer stay
     pinned — config-heavy modals no longer push the title/Save button off-screen. */
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

/* The install-plugin modal holds the catalog list — a bit wider on desktop for comfortable reading.
   The responsive rules below (<=768px: 95% width; <=480px: full-width bottom sheet) still apply, so
   it stays responsive on small screens. Lives here (global modal styles) rather than in a page CSS
   so it isn't subject to the page-root scoping rule. */
.modal.install-modal {
  max-width: 680px;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
}

.modal-body {
  padding: 1.5rem;
  /* Scroll the body (not the whole card) so the pinned header/footer stay visible. */
  overflow-y: auto;
  flex: 1 1 auto;
}

.modal-body > label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  margin-bottom: 0.5rem;
}

.modal-body input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font-size: 0.9375rem;
  background: var(--bg-light, #f8fafc);
  transition: all 0.2s;
  box-sizing: border-box;
}

.modal-body input:focus {
  outline: none;
  border-color: var(--primary, #25d366);
  background: var(--bg-white, #fff);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

/* The rule above is meant for TEXT inputs. Radios/checkboxes would otherwise stretch to width:100%
   and shove their labels far to the right; reset them back to their native box. The :not() excludes
   the visually-hidden toggle-switch checkbox (it must stay width:0) so this never ties with the
   per-page `.toggle-switch input { width:0 }` rule on specificity. */
.modal-body input[type='radio']:not(.toggle-switch input),
.modal-body input[type='checkbox']:not(.toggle-switch input) {
  width: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  flex: none;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
  flex-shrink: 0;
}

/* Icon Button (modal close X) */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-light, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary, #64748b);
}

.btn-icon:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--error);
}

.btn-icon:hover svg {
  stroke: var(--error);
}

/* Secondary Button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-light, #f8fafc);
  color: var(--text-secondary, #64748b);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-white, #fff);
  border-color: var(--text-muted, #94a3b8);
  color: var(--text-primary, #1e293b);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button — canonical definition; page-scoped copies were consolidated here so the
   primary CTA looks identical on every page (padding/radius/disabled used to drift per page). */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--primary, #25d366);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover, #1da851);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Danger Button — canonical definition (page copies also used two different base reds). */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--error, #ef4444);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Spin Animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Code element styling */
code {
  background: var(--bg-light, #f1f5f9);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  color: var(--text-primary, #1e293b);
}

/* RTL / Hebrew direction support */

/* Keep code, technical identifiers, and numbers LTR even inside RTL containers */
[dir='rtl'] code,
[dir='rtl'] .mono,
[dir='rtl'] pre {
  direction: ltr;
  text-align: left;
  unicode-bidi: embed;
}

/* Modal footer: actions should align to the start of the writing direction */
[dir='rtl'] .modal-footer {
  justify-content: flex-end;
  flex-direction: row-reverse;
}

/* Select dropdown caret on the opposite side */
[dir='rtl'] select {
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background-position: left 0.75rem center;
}

/* Inputs in modals: text aligns naturally */
[dir='rtl'] .modal-body input,
[dir='rtl'] .modal-body textarea,
[dir='rtl'] input[type='text'],
[dir='rtl'] input[type='url'],
[dir='rtl'] input[type='password'],
[dir='rtl'] input[type='number'],
[dir='rtl'] textarea {
  text-align: right;
}

/* URLs, emails, phones — force LTR even inside RTL */
[dir='rtl'] input[type='url'],
[dir='rtl'] input[type='email'],
[dir='rtl'] input[type='tel'] {
  direction: ltr;
  text-align: left;
}

/* Toast container — slide in from the opposite side */
[dir='rtl'] .toast-container {
  right: auto;
  left: 1rem;
}

/* Mobile Responsive - Global */
@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }

  .modal {
    width: 95%;
    max-width: none;
    margin: 1rem;
    border-radius: 12px;
  }

  .modal-header {
    padding: 1.25rem 1.25rem 0.875rem;
  }

  .modal-header h2 {
    font-size: 1.125rem;
  }

  .modal-body {
    padding: 1.25rem;
  }

  .modal-footer {
    padding: 0.875rem 1.25rem 1.25rem;
  }

  select {
    padding: 0.625rem 2.25rem 0.625rem 0.875rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.25rem;
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    /* max-height + body scroll already come from the base .modal rule; the bottom-sheet only
       changes width/anchoring. (Scrolling lives on .modal-body to avoid a double scrollbar.) */
  }
}
.layout {
  display: flex;
  min-height: 100vh;
}

/* ==================== Sidebar ==================== */
.sidebar {
  width: 260px;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition:
    width 0.3s ease,
    transform 0.3s ease;
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  min-height: 72px;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 1.5rem 1rem;
}

.sidebar-logo {
  width: 30px;
  height: 30px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.mobile-brand .sidebar-logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-version {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 1px;
}

/* Collapse Toggle Button - Circular design at edge */
.collapse-toggle {
  position: absolute;
  right: -14px;
  top: 36px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-white);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  z-index: 101;
  padding: 0;
}

.collapse-toggle:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.collapse-toggle svg {
  width: 16px;
  height: 16px;
}

.sidebar.collapsed .collapse-toggle {
  right: -14px;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.sidebar.collapsed .sidebar-nav {
  padding: 1rem 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0.7rem;
}

.nav-item:hover {
  background: var(--bg-light);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-item.active svg {
  color: var(--primary);
}

.sidebar-footer {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
}

.sidebar.collapsed .sidebar-footer {
  padding: 0.75rem 0.5rem;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
}

.appearance-button-cue {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  /* Plain icon, no brand orb — the green swatch belonged to the removed palette picker. */
  color: inherit;
}

.sidebar.collapsed .theme-toggle-btn,
.sidebar.collapsed .logout-btn {
  justify-content: center;
  padding: 0.6rem;
}

.theme-toggle-btn:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.language-menu,
.appearance-menu {
  position: relative;
}

.language-menu .theme-toggle-btn,
.appearance-menu .theme-toggle-btn {
  width: 100%;
}

.language-menu-list {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.35rem);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 160px;
  padding: 0.3rem;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  z-index: 120;
}

.language-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0.45rem 0.6rem;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.language-menu-item:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.language-menu-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar.collapsed .language-menu-list {
  right: auto;
  left: calc(100% + 0.5rem);
  bottom: 0;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--error);
}

/* ==================== Main Content ==================== */
.main-content {
  flex: 1;
  margin-left: 260px;
  width: calc(100% - 260px);
  background: var(--bg-light);
  min-height: 100vh;
  overflow-x: hidden;
  transition:
    margin-left 0.3s ease,
    width 0.3s ease;
}

.main-content.expanded {
  margin-left: 72px;
  width: calc(100% - 72px);
}

/* ==================== Mobile Styles ==================== */
.mobile-header {
  display: none;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 767px) {
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 1rem;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    z-index: 90;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent !important;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.2s;
    padding: 0;
  }

  .mobile-menu-btn svg {
    color: var(--text-primary);
    stroke: var(--text-primary);
  }

  .mobile-menu-btn:hover {
    background: var(--bg-light) !important;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .mobile-brand .brand-name {
    font-size: 1rem;
  }

  .sidebar.mobile {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
  }

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

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 95;
    animation: fadeIn 0.2s ease;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  .main-content.mobile {
    margin-left: 0;
    width: 100%;
    padding-top: 56px;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .collapse-toggle {
    display: none;
  }
}

/* ==================== RTL support ==================== */
[dir='rtl'] .sidebar {
  border-right: none;
  border-left: 1px solid var(--border);
}

[dir='rtl'] .collapse-toggle {
  right: auto;
  left: -14px;
}

[dir='rtl'] .collapse-toggle svg {
  transform: scaleX(-1);
}

[dir='rtl'] .language-menu-item {
  text-align: right;
}

[dir='rtl'] .sidebar.collapsed .language-menu-list {
  right: calc(100% + 0.5rem);
  left: auto;
}

[dir='rtl'] .main-content {
  margin-left: 0;
  margin-right: 260px;
  transition:
    margin-right 0.3s ease,
    width 0.3s ease;
}

[dir='rtl'] .main-content.expanded {
  margin-right: 72px;
}

@media (max-width: 768px) {
  [dir='rtl'] .main-content,
  [dir='rtl'] .main-content.mobile {
    margin-right: 0;
  }
}
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.08);
  border-left: 4px solid;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  border-color: #22c55e;
}

.toast-success .toast-icon {
  color: #22c55e;
}

.toast-error {
  border-color: #ef4444;
}

.toast-error .toast-icon {
  color: #ef4444;
}

.toast-warning {
  border-color: #f59e0b;
}

.toast-warning .toast-icon {
  color: #f59e0b;
}

.toast-info {
  border-color: #3b82f6;
}

.toast-info .toast-icon {
  color: #3b82f6;
}

.toast-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.toast-message {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.5;
}

.toast-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.toast-close:hover {
  background: var(--bg-light);
  color: var(--text-secondary);
}


:root {
  --primary: #25d366;
  --primary-hover: #1da851;
  --primary-soft: rgba(37, 211, 102, 0.12);
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #0f172a; /* Slate 900 */
  --text-secondary: #475569; /* Slate 600 */
  --text-muted: #94a3b8; /* Slate 400 */
  --border: #e2e8f0; /* Slate 200 */
  --error: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #2563eb; /* Blue 600 — info/permission/log badges + qr-ready pill */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 10px;
}

/* Dark Mode */
[data-theme='dark'] {
  /* Make native controls (select option popups, scrollbars, date pickers) follow the EXPLICIT
     app theme, not just the OS preference — otherwise toggling dark while the OS is light left
     native dropdowns rendered in the light scheme (#249). */
  color-scheme: dark;
  --bg-light: #0f172a; /* Slate 900 */
  --bg-white: #1e293b; /* Slate 800 */
  --bg-card: #1e293b;
  --text-primary: #f1f5f9; /* Slate 100 */
  --text-secondary: #cbd5e1; /* Slate 300 */
  --text-muted: #64748b; /* Slate 500 */
  --border: #334155; /* Slate 700 */
  --info: #60a5fa; /* Blue 400 — lighter so it reads over the dark translucent-blue tints */
  --primary-soft: color-mix(in srgb, var(--primary) 18%, transparent);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

/* Explicit light toggle: keep native controls light even if the OS prefers dark. */
[data-theme='light'] {
  color-scheme: light;
}

/* System preference dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    /* Match native controls (e.g. the Login page <select> option popup) to the dark theme.
       The Login screen never sets data-theme, so it relies solely on this block — without an
       explicit color-scheme the popup rendered light, leaving the light option text illegible (#249). */
    color-scheme: dark;
    --bg-light: #0f172a;
    --bg-white: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border: #334155;
    --info: #60a5fa;
    --primary-soft: color-mix(in srgb, var(--primary) 18%, transparent);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    'Plus Jakarta Sans',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.6;
}

button {
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  background: var(--bg-white);
  color: var(--text-primary);
  border-color: var(--border);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Error banner — shared across pages (moved out of Plugins.css so any page can use it). */
.error-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.error-banner svg {
  color: var(--error);
}

.error-banner-text {
  color: var(--error);
}

/* yarl theme — match dashboard dark palette. */
.yarl__container {
  --yarl__color_backdrop: rgba(0, 0, 0, 0.92);
}
.yarl__button {
  --yarl__color_button: rgba(255, 255, 255, 0.9);
}
