:root {
  --primary-color: rgb(79, 172, 254);
  --primary-hover: #2f96ea;
  --primary-soft: #e8f5ff;
  --success-color: #10B981;
  --warning-color: #F59E0B;
  --danger-color: #EF4444;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-light: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-medium: 0 10px 25px -5px rgba(15, 23, 42, 0.1);
  --sidebar-width: 256px;
  --header-height: 52px;
  --sb-bg: #ffffff;
  --sb-border: #f1f5f9;
  --sb-link-color: #475569;
  --sb-link-hover-bg: #f8fafc;
  --sb-active-bg: #f0f9ff;
  --sb-active-color: #0ea5e9;
  --sb-label: #0ea5e9;
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  --sb-bg: #0f172a;
  --sb-border: #1e293b;
  --sb-link-color: #94a3b8;
  --sb-link-hover-bg: #1e293b;
  --sb-active-bg: rgba(14, 165, 233, 0.15);
  --sb-active-color: #38bdf8;
  --sb-label: #38bdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}

body.preload * {
  transition: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  min-width: 76px;
}

.language-switcher-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.language-switcher select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0 30px 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.language-switcher select:hover {
  border-color: var(--primary-color);
}

.language-switcher select:focus {
  outline: 2px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
  outline-offset: 2px;
}

.password-field-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field-shell input {
  width: 100%;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--primary-color);
  background: var(--bg-tertiary);
  outline: none;
}

.password-toggle-icon {
  font-size: 16px;
  line-height: 1;
}

.top-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  z-index: 1020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  transition: left 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

body.no-sidebar .top-bar {
  left: 0;
}

.top-bar-left,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger-btn,
.sidebar-toggle,
.notification-btn,
.top-bar-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.sidebar-toggle,
.notification-btn,
.top-bar-profile {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.hamburger-btn {
  display: none;
  width: 36px;
  height: 34px;
  border-radius: 8px;
  flex-direction: column;
  gap: 4px;
}

.hamburger-btn span {
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.sidebar-toggle:hover,
.notification-btn:hover,
.top-bar-profile:hover,
.hamburger-btn:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: var(--bg-tertiary);
}

.breadcrumbs {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
}

.tenant-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-color);
  flex: 0 0 auto;
}

.status-dot.meta {
  background: var(--primary-color);
}

.profile-initials-sm,
.sidebar-initials,
.popover-profile-pic,
.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color), var(--success-color));
  color: #fff;
  font-weight: 800;
}

.profile-initials-sm {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 11px;
}

img.profile-initials-sm,
img.sidebar-initials,
img.popover-profile-pic {
  object-fit: cover;
}

.notification-wrapper {
  position: relative;
}

.notification-btn {
  position: relative;
  font-weight: 800;
}

.unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger-color);
  color: #fff;
  font-size: 10px;
  border: 2px solid var(--bg-secondary);
}

.notification-dropdown,
.profile-popover {
  position: fixed;
  z-index: 1100;
  width: min(280px, calc(100vw - 32px));
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-medium);
  display: none;
  overflow: hidden;
}

.notification-dropdown {
  top: 58px;
  right: 64px;
  width: 380px;
  max-height: 500px;
  display: none;
  flex-direction: column;
}

.notification-dropdown.active {
  display: flex;
}

.profile-popover.active {
  display: block;
}

.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.notifications-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.notifications-header a,
.text-btn {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 700;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.16s ease;
}

.text-btn:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.notification-list {
  overflow-y: auto;
  flex: 1;
  max-height: 380px;
  scroll-behavior: smooth;
}

/* Custom scrollbar for premium feel */
.notification-list::-webkit-scrollbar {
  width: 6px;
}

.notification-list::-webkit-scrollbar-track {
  background: transparent;
}

.notification-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.notifications-footer {
  padding: 12px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.notifications-footer a {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
}

.notifications-footer a:hover {
  color: var(--primary-color);
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s ease;
}

.notification-item:hover {
  background: var(--bg-tertiary);
}

.notification-item.unread {
  background: var(--sb-active-bg);
  border-left: 3px solid var(--primary-color);
}

.notification-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

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

.notification-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.notification-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.notification-empty {
  padding: 40px 20px;
  text-align: center;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  z-index: 1015;
}

.sidebar-overlay.active {
  display: block;
}

.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  z-index: 1025;
  display: flex;
  flex-direction: column;
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

body.no-sidebar .sidebar-nav {
  transform: translateX(calc(-1 * var(--sidebar-width)));
}

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

.sidebar-brand img {
  height: 34px;
  width: 34px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-brand-name {
  min-width: 0;
  color: var(--text-primary);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav-section {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 18px;
}

.sidebar-nav-section::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav-section::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 999px;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 10px;
}

.sidebar-section-label {
  margin: 16px 10px 6px;
  color: var(--sb-label);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--sb-link-color);
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: var(--sb-active-bg);
  color: var(--sb-active-color);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.sidebar-link .nav-icon,
.popover-actions .nav-icon,
.notification-btn .nav-icon {
  width: 34px;
  min-width: 34px;
  color: var(--text-muted);
  text-align: center;
}

.submenu {
  display: none;
  margin: 4px 0 8px 12px !important;
  padding: 4px 0 4px 8px !important;
  border-left: 1px solid var(--border-color);
}

.submenu.active {
  display: block;
}

.submenu .sidebar-link {
  min-height: 34px;
  font-size: 13px;
}

.submenu.item-children {
  margin: 0 0 6px 28px !important;
  padding: 2px 0 2px 8px !important;
}

.submenu.item-children .sidebar-link {
  min-height: 30px;
  font-size: 12.5px;
  font-weight: 700;
}

.sidebar-profile-section {
  padding: 12px;
  border-top: 1px solid var(--border-color);
}

.sidebar-profile {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  cursor: pointer;
  text-align: left;
}

.sidebar-profile:hover {
  border-color: var(--primary-color);
}

.sidebar-initials {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: 0 0 auto;
}

.sidebar-user {
  display: grid;
  min-width: 0;
  flex: 1;
}

.sidebar-username,
.sidebar-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-username {
  font-size: 13px;
  font-weight: 800;
}

.sidebar-email {
  color: var(--text-muted);
  font-size: 12px;
}

.profile-caret {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}

.profile-popover {
  left: 16px;
  bottom: 74px;
}

.profile-popover.sidebar-triggered {
  width: var(--sidebar-width);
  left: 16px;
  right: auto;
}

.popover-profile-header {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px 12px 12px;
  border-bottom: 1px solid var(--border-color);
}

.popover-profile-pic {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.popover-profile-header span:last-child {
  color: var(--text-muted);
  font-size: 13px;
}

.theme-switcher-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 800;
}

.theme-switcher {
  width: 48px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-tertiary);
  padding: 3px;
  cursor: pointer;
}

.theme-toggle {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  transition: transform 0.2s ease;
}

[data-theme="dark"] .theme-toggle {
  transform: translateX(22px);
}

.popover-actions {
  display: grid;
  padding: 6px;
}

.popover-actions a {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  padding: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.popover-actions a:hover {
  background: var(--bg-tertiary);
  color: var(--primary-color);
}

.popover-actions span {
  width: 24px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 900;
}

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: calc(var(--header-height) + 28px) 28px 28px;
  transition: margin-left 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

body.no-sidebar .main-content {
  margin-left: 0;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.page-header p {
  margin: 6px 0 0;
  color: var(--text-muted);
}

.metric-grid,
.welcome-quick-grid,
.settings-grid,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.metric-card,
.table-card,
.empty-state,
.content-card,
.welcome-card,
.settings-card,
.profile-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-light);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-value {
  font-size: 28px;
  font-weight: 900;
}

.table-card {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

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

.data-table th {
  background: var(--bg-tertiary);
  font-weight: 800;
}

.no-data,
.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 28px;
}

.btn-primary,
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.btn-primary {
  border: 1px solid var(--primary-color);
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary,
.btn-outline {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.btn-secondary:hover,
.btn-outline:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
}

#toast-messages {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  right: 18px;
  z-index: 1200;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-medium);
  color: var(--text-primary);
  font-weight: 700;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.toast-success {
  border-color: rgba(5, 150, 105, 0.35);
}

.toast-error {
  border-color: rgba(220, 38, 38, 0.35);
}

.welcome-container,
.settings-container,
.profile-container {
  max-width: 1180px;
  margin: 0 auto;
}

.welcome-hero,
.profile-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--success-color));
  color: #fff;
  border-radius: 18px;
  padding: 34px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-medium);
}

.welcome-hero::after,
.profile-hero::after {
  content: "";
  position: absolute;
  inset: auto -12% -60% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  border: 4px solid rgba(255, 255, 255, 0.26);
  font-size: 34px;
  flex: 0 0 auto;
}

.welcome-hero-content,
.profile-hero-content {
  position: relative;
  z-index: 1;
}

.welcome-hero h1,
.profile-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.08;
}

.welcome-hero p,
.profile-hero p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.context-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.context-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.section-title {
  margin: 28px 0 14px;
  font-size: 18px;
}

.welcome-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 116px;
  padding: 18px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.welcome-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: var(--shadow-medium);
}

.card-code {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--primary-color);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.welcome-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.welcome-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.settings-card,
.profile-card {
  padding: 22px;
}

.settings-card h2,
.profile-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.settings-card p,
.profile-card p {
  color: var(--text-muted);
}

.settings-form,
.toggle-list,
.profile-detail-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.segment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
  cursor: pointer;
  font-weight: 800;
}

.segment-option input:checked+span {
  border-color: var(--primary-color);
  background: var(--sb-active-bg);
  color: var(--primary-color);
}

.profile-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.profile-detail:last-child {
  border-bottom: 0;
}

.profile-detail span:first-child {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
}

.profile-detail span:last-child {
  font-weight: 800;
  text-align: right;
}

.photo-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
}

.modal-content {
  max-width: min(720px, 92vw);
  max-height: 86vh;
  border-radius: 14px;
}

@media (max-width: 900px) {
  .top-bar {
    left: 0;
  }

  .hamburger-btn {
    display: inline-flex;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar-nav,
  body.no-sidebar .sidebar-nav {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }

  .sidebar-nav.active {
    transform: translateX(0);
  }

  .main-content,
  body.no-sidebar .main-content {
    margin-left: 0;
    padding: calc(var(--header-height) + 20px) 18px 24px;
  }

  .tenant-pill {
    display: none;
  }

  .notification-dropdown {
    right: 16px;
  }

  .profile-popover {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }

  .profile-popover.sidebar-triggered {
    width: auto;
  }

  .welcome-hero,
  .profile-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px;
  }
}

@media (max-width: 560px) {
  .breadcrumbs {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-header {
    flex-direction: column;
  }

  .profile-detail {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-detail span:last-child {
    text-align: left;
  }
}
/* Announcement Banners */
.announcement-banners-container {
  display: flex;
  flex-direction: column;
  gap: 1px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
}

.announcement-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  font-size: 14px;
  color: white;
  min-height: 48px;
  z-index: 1000;
  animation: slideDown 0.4s ease-out;
}

body.has-announcement-banners .top-bar {
  top: var(--announcement-banner-height, 0px);
}

body.has-announcement-banners .sidebar-nav {
  top: var(--announcement-banner-height, 0px);
  height: calc(100vh - var(--announcement-banner-height, 0px));
}

body.has-announcement-banners .main-content {
  padding-top: calc(var(--header-height) + var(--announcement-banner-height, 0px) + 28px);
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.announcement-banner.announcement-info { background: #3b82f6; }
.announcement-banner.announcement-warning { background: #f59e0b; color: #1e1b4b; }
.announcement-banner.announcement-danger { background: #ef4444; }
.announcement-banner.announcement-success { background: #10b981; }
.announcement-banner.announcement-primary { background: var(--primary-color); }

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-icon {
  font-size: 18px;
}

.banner-title {
  font-weight: 800;
  margin-right: 8px;
}

.banner-message {
  opacity: 0.95;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.banner-link {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 4px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  transition: background 0.2s;
  white-space: nowrap;
}

.announcement-warning .banner-link {
  background: rgba(0, 0, 0, 0.1);
  color: #1e1b4b;
}

.banner-link:hover {
  background: rgba(255, 255, 255, 0.3);
}

.banner-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
  padding: 0;
  line-height: 1;
}

.announcement-warning .banner-close {
  color: #1e1b4b;
}

.banner-close:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .announcement-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }
  
  .banner-actions {
    width: 100%;
    justify-content: space-between;
  }
}

.wiki-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.wiki-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border-color);
}

.wiki-eyebrow {
  margin: 0 0 10px;
  color: var(--primary-color);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wiki-hero h1,
.wiki-article h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 42px;
  line-height: 1.08;
}

.wiki-hero p,
.wiki-section-heading p,
.wiki-article header p {
  max-width: 740px;
  color: var(--text-secondary);
}

.wiki-home-link {
  flex: 0 0 auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 800;
}

.wiki-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 36px;
  padding-top: 32px;
}

.wiki-sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  border-right: 1px solid var(--border-color);
  padding-right: 20px;
}

.wiki-sidebar h2 {
  margin: 0 0 14px;
  font-size: 15px;
}

.wiki-sidebar a {
  display: block;
  padding: 9px 0;
  color: var(--text-secondary);
  font-weight: 700;
}

.wiki-sidebar a.wiki-sidebar-child {
  padding-left: 14px;
  font-size: 14px;
  font-weight: 750;
}

.wiki-section {
  padding: 0 0 36px;
}

.wiki-section-heading h2 {
  margin: 0;
  font-size: 26px;
}

.wiki-section-heading h3 {
  margin: 0;
  font-size: 20px;
}

.wiki-subsection {
  margin-top: 24px;
  padding-left: 18px;
  border-left: 2px solid var(--border-color);
}

.wiki-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.wiki-page-card {
  display: flex;
  min-height: 106px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-light);
}

.wiki-page-card span {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
}

.wiki-page-card small {
  color: var(--primary-color);
  font-weight: 800;
}

.wiki-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 28px;
}

.wiki-article {
  max-width: 880px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--shadow-light);
}

.wiki-article header {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
  padding-bottom: 22px;
}

.wiki-markdown h2 {
  margin-top: 34px;
  font-size: 24px;
}

.wiki-markdown h3 {
  margin-top: 24px;
  font-size: 19px;
}

.wiki-markdown p,
.wiki-markdown li {
  color: var(--text-secondary);
}

.wiki-markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
}

.wiki-markdown th,
.wiki-markdown td {
  border: 1px solid var(--border-color);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.wiki-markdown th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

@media (max-width: 760px) {
  .wiki-hero {
    flex-direction: column;
  }

  .wiki-hero h1,
  .wiki-article h1 {
    font-size: 32px;
  }

  .wiki-layout {
    grid-template-columns: 1fr;
  }

  .wiki-sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 0 0 18px;
  }

  .wiki-article {
    padding: 22px;
  }
}

.admin-center-shell {
  max-width: 1240px;
}

.admin-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.admin-product-card,
.admin-panel,
.admin-editor-panel {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-light);
}

.admin-product-card {
  display: flex;
  min-height: 118px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
}

.admin-product-name {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 900;
}

.admin-product-meta,
.admin-list-row span,
.admin-table-row small,
.admin-editor-help {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-actions,
.admin-form-actions,
.admin-editor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-actions {
  justify-content: flex-end;
}

.admin-primary-action,
.admin-secondary-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.admin-primary-action {
  border: 1px solid var(--primary-color);
  background: var(--primary-color);
  color: white;
}

.admin-secondary-action {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.admin-two-column {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.admin-panel,
.admin-editor-panel {
  padding: 22px;
}

.admin-panel h2,
.admin-editor-panel h1 {
  margin-top: 0;
}

.admin-list-row,
.admin-table-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border-color);
  padding: 13px 0;
}

.admin-list-row {
  flex-direction: column;
  gap: 4px;
}

.admin-list-row .admin-subsection-row {
  margin-left: 12px;
  color: var(--text-secondary);
}

.admin-table-row {
  align-items: center;
}

.admin-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
}

.admin-status.is-live {
  background: #dcfce7;
  color: #166534;
}

.admin-messages {
  margin: 0 0 18px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  padding: 12px 14px;
  font-weight: 800;
}

.admin-messages p {
  margin: 0;
}

.admin-editor-panel {
  max-width: 980px;
  margin: 0 auto;
}

.admin-editor-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 22px;
  padding-bottom: 18px;
}

.admin-form {
  display: grid;
  gap: 18px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-form label {
  display: grid;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 900;
}

.admin-form input[type="text"],
.admin-form input[type="url"],
.admin-form input[type="number"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="slug"],
.admin-form select,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  color: var(--text-primary);
  padding: 11px 12px;
  font: inherit;
  font-weight: 600;
}

.admin-form textarea {
  min-height: 140px;
  resize: vertical;
}

.admin-page-form textarea {
  min-height: 520px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  padding: 8px;
}

.editor-toolbar button {
  display: inline-flex;
  width: 36px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: white;
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.editor-toolbar button:hover,
.editor-toolbar button:focus-visible {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.editor-toolbar button:disabled {
  cursor: progress;
  opacity: 0.55;
}

.editor-upload-input {
  display: none;
}

.admin-checkbox {
  display: flex !important;
  min-height: 46px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  align-self: end;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.admin-checkbox input {
  width: 18px;
  height: 18px;
}

.admin-form .errorlist {
  margin: 0;
  padding-left: 18px;
  color: var(--danger-color);
  font-size: 13px;
  font-weight: 800;
}

.admin-form-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
}

.wiki-doc-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 860px) 250px;
  gap: 32px;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 80px;
  transition: grid-template-columns 0.22s ease, width 0.22s ease;
}

.wiki-doc-shell.is-nav-collapsed {
  grid-template-columns: 64px minmax(0, 1060px) 250px;
  width: min(1480px, calc(100% - 40px));
}

.wiki-doc-nav,
.wiki-context-panel {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.wiki-doc-home,
.docs-editor-product {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--text-primary);
}

.wiki-nav-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-bottom: 18px;
}

.wiki-nav-toggle {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.wiki-nav-toggle:hover,
.wiki-nav-toggle:focus-visible {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.wiki-doc-home span,
.docs-editor-product span {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary-color);
  color: #fff;
  font-weight: 900;
}

.wiki-doc-shell.is-nav-collapsed .wiki-doc-nav,
.docs-editor-shell.is-nav-collapsed .docs-editor-nav {
  overflow: visible;
}

.wiki-doc-shell.is-nav-collapsed .wiki-nav-head,
.docs-editor-shell.is-nav-collapsed .wiki-nav-head {
  display: grid;
  justify-items: center;
}

.wiki-doc-shell.is-nav-collapsed .wiki-doc-home,
.docs-editor-shell.is-nav-collapsed .docs-editor-product {
  justify-content: center;
  margin-bottom: 0;
}

.wiki-doc-shell.is-nav-collapsed .wiki-doc-home strong,
.docs-editor-shell.is-nav-collapsed .docs-editor-product strong,
.docs-editor-shell.is-nav-collapsed .docs-editor-back,
.wiki-doc-shell.is-nav-collapsed .wiki-tree,
.docs-editor-shell.is-nav-collapsed .wiki-tree {
  display: none;
}

.wiki-tree details {
  border-top: 1px solid var(--border-color);
  padding: 12px 0;
}

.wiki-tree details.wiki-subtree {
  margin: 6px 0 0 14px;
  border-top: 0;
  padding: 4px 0;
}

.wiki-tree details.wiki-subtree summary {
  color: var(--text-secondary);
  font-size: 12px;
}

.wiki-tree summary {
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.wiki-tree summary::-webkit-details-marker {
  display: none;
}

.wiki-tree summary::before {
  content: "›";
  display: inline-block;
  margin-right: 7px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.wiki-tree details[open] summary::before {
  transform: rotate(90deg);
}

.wiki-tree a,
.wiki-tree span,
.wiki-tree p {
  display: block;
  margin-top: 4px;
  border-radius: 6px;
  padding: 7px 9px 7px 22px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
}

.wiki-tree a.active {
  background: #ecfdf5;
  color: var(--primary-color);
}

.wiki-doc-canvas {
  min-width: 0;
}

.wiki-doc-header {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
  padding-bottom: 26px;
}

.wiki-doc-header h1 {
  max-width: 820px;
  margin: 0;
  color: var(--text-primary);
  font-size: 46px;
  line-height: 1.08;
  letter-spacing: 0;
}

.wiki-doc-header p:last-child {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 17px;
}

.wiki-context-card {
  border-top: 1px solid var(--border-color);
  padding: 18px 0;
}

.wiki-context-card h2,
.docs-inspector-panel h2 {
  margin: 0 0 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.wiki-toc a,
.wiki-toc span,
.docs-live-outline button,
.docs-live-outline span {
  display: block;
  width: 100%;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 0 6px 10px;
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.wiki-toc a.is-nested,
.docs-live-outline .level-3 {
  padding-left: 22px;
}

.wiki-toc a:hover,
.docs-live-outline button:hover {
  border-left-color: var(--primary-color);
  color: var(--primary-color);
}

.wiki-meta-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.wiki-meta-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.wiki-meta-list dt {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.wiki-meta-list dd {
  margin: 0;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 900;
}

.wiki-context-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.wiki-context-actions a,
.wiki-context-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-height: 34px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.wiki-context-actions a {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.wiki-markdown {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.75;
}

.wiki-markdown > *:first-child {
  margin-top: 0;
}

.wiki-markdown h2,
.wiki-markdown h3 {
  color: var(--text-primary);
  letter-spacing: 0;
  scroll-margin-top: 110px;
}

.wiki-markdown h2 {
  margin: 42px 0 14px;
  font-size: 28px;
  line-height: 1.2;
}

.wiki-markdown h3 {
  margin: 30px 0 10px;
  font-size: 21px;
  line-height: 1.25;
}

.wiki-markdown p,
.wiki-markdown li {
  color: var(--text-secondary);
}

.wiki-markdown > p,
.wiki-markdown > ul,
.wiki-markdown > ol,
.wiki-markdown > blockquote,
.wiki-markdown > h2,
.wiki-markdown > h3 {
  max-width: 900px;
}

.wiki-markdown img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 28px 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.wiki-markdown p > img:only-child {
  margin: 32px 0;
}

.wiki-markdown pre {
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px;
  font-size: 14px;
  line-height: 1.6;
}

.wiki-markdown code {
  border-radius: 5px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 2px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

.wiki-markdown pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.wiki-markdown blockquote {
  margin: 26px 0;
  border-left: 3px solid var(--primary-color);
  border-radius: 0 8px 8px 0;
  background: #f8fafc;
  padding: 14px 18px;
}

.wiki-markdown table {
  display: block;
  max-width: 100%;
  overflow: auto;
}

.docs-editor-shell.admin-form {
  display: grid;
  grid-template-columns: 240px minmax(0, 840px) 280px;
  gap: 24px;
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
  transition: grid-template-columns 0.22s ease, max-width 0.22s ease;
}

.docs-editor-shell.admin-form.is-nav-collapsed {
  grid-template-columns: 64px minmax(0, 1fr) 280px;
  max-width: 1640px;
}

.docs-editor-nav,
.docs-editor-inspector {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.docs-editor-shell.admin-form .docs-editor-nav,
.docs-editor-shell.admin-form .docs-editor-inspector {
  max-height: none;
  overflow: visible;
}

.docs-editor-back {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 900;
}

.docs-editor-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.docs-editor-canvas {
  min-width: 0;
}

.docs-writing-surface {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-light);
}

.docs-title-field,
.docs-content-field {
  display: grid;
  gap: 8px;
}

.docs-title-field {
  padding: 34px 38px 18px;
}

.docs-content-field {
  padding: 22px 38px 38px;
}

.docs-title-field > span,
.docs-content-field > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.docs-title-field input[type="text"] {
  border: 0;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  padding: 0 0 18px;
  color: var(--text-primary);
  font-size: 40px;
  font-weight: 850;
  line-height: 1.12;
}

.docs-title-field input[type="text"]:focus,
.docs-content-field textarea:focus {
  outline: 0;
  border-color: var(--primary-color);
  box-shadow: none;
}

.docs-content-field textarea {
  min-height: 620px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--text-primary);
  font-family: Outfit, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.75;
  overflow: hidden;
  resize: none;
}

.docs-content-field textarea::placeholder {
  color: var(--text-muted);
}

.docs-editor-shell .editor-toolbar {
  position: sticky;
  top: 82px;
  z-index: 5;
  gap: 8px;
  margin: 0;
  border-width: 1px 0;
  border-radius: 0;
  background: rgba(248, 250, 252, 0.96);
  padding: 10px 38px;
  backdrop-filter: blur(10px);
}

.editor-toolbar-group {
  display: inline-flex;
  gap: 4px;
  border-right: 1px solid var(--border-color);
  padding-right: 8px;
}

.editor-toolbar-group:last-child {
  border-right: 0;
  padding-right: 0;
}

.docs-editor-shell .editor-toolbar button {
  min-width: 34px;
  width: auto;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 13px;
}

.docs-editor-inspector {
  display: grid;
  gap: 14px;
}

.docs-inspector-panel {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  padding: 16px;
  box-shadow: var(--shadow-light);
}

.docs-inspector-panel label {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
}

.docs-inspector-panel input[type="text"],
.docs-inspector-panel input[type="slug"],
.docs-inspector-panel select {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  background: #fff;
  color: var(--text-primary);
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.docs-inspector-panel .admin-primary-action {
  width: 100%;
  margin-top: 14px;
}

.docs-inspector-panel .admin-checkbox {
  display: flex !important;
  margin-top: 0;
}

@media (max-width: 1180px) {
  .wiki-doc-shell,
  .docs-editor-shell.admin-form {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .wiki-doc-shell.is-nav-collapsed,
  .docs-editor-shell.admin-form.is-nav-collapsed {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .wiki-context-panel,
  .docs-editor-inspector {
    position: static;
    grid-column: 2;
    max-height: none;
  }

  .docs-editor-inspector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .wiki-doc-shell,
  .docs-editor-shell.admin-form,
  .wiki-doc-shell.is-nav-collapsed,
  .docs-editor-shell.admin-form.is-nav-collapsed {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 760px);
  }

  .wiki-doc-nav,
  .docs-editor-nav {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 18px;
  }

  .wiki-doc-shell.is-nav-collapsed .wiki-doc-home strong,
  .docs-editor-shell.is-nav-collapsed .docs-editor-product strong,
  .docs-editor-shell.is-nav-collapsed .docs-editor-back,
  .wiki-doc-shell.is-nav-collapsed .wiki-tree,
  .docs-editor-shell.is-nav-collapsed .wiki-tree {
    display: block;
  }

  .wiki-doc-shell.is-nav-collapsed .wiki-nav-head,
  .docs-editor-shell.is-nav-collapsed .wiki-nav-head {
    display: flex;
    justify-items: initial;
  }

  .wiki-context-panel,
  .docs-editor-inspector {
    grid-column: auto;
  }

  .docs-editor-inspector {
    grid-template-columns: 1fr;
  }

  .wiki-doc-header h1,
  .docs-title-field input[type="text"] {
    font-size: 32px;
  }

  .docs-title-field,
  .docs-content-field {
    padding-left: 22px;
    padding-right: 22px;
  }

  .docs-editor-shell .editor-toolbar {
    top: 0;
    padding-left: 22px;
    padding-right: 22px;
  }
}

.admin-login-shell {
  width: min(1180px, calc(100% - 32px));
  padding-top: 54px;
}

.admin-login-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.8fr);
  gap: 44px;
  align-items: stretch;
  max-width: 1080px;
  margin: 32px auto 72px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: var(--bg-secondary);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
  padding: 0;
  overflow: hidden;
}

.admin-login-intro {
  display: flex;
  min-height: 520px;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(79, 172, 254, 0.16), rgba(15, 23, 42, 0.03)),
    var(--bg-tertiary);
  padding: 46px;
}

.admin-login-logo {
  width: 148px;
  height: auto;
  margin-bottom: 34px;
  filter: drop-shadow(0 18px 28px rgba(15, 23, 42, 0.12));
}

.admin-login-panel h1 {
  margin: 0 0 14px;
  color: var(--text-primary);
  font-size: clamp(40px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.admin-login-panel p {
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.65;
}

.admin-login-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.admin-login-proof span {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 850;
}

.admin-login-form {
  align-content: center;
  padding: 46px;
}

.admin-login-form-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.admin-login-form-head strong {
  color: var(--text-primary);
  font-size: 22px;
}

.admin-login-form-head span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 750;
}

.admin-login-form .admin-primary-action {
  min-height: 52px;
  margin-top: 6px;
  font-size: 16px;
}

.maarifa-admin-app {
  --admin-sidebar-width: 280px;
  display: grid;
  min-height: calc(100vh - 86px);
  grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(79, 172, 254, 0.08), rgba(248, 250, 252, 0) 260px),
    var(--bg-primary);
}

.maarifa-admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  background: #ffffff;
  padding: 18px;
}

.maarifa-admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  padding: 8px 6px 18px;
}

.maarifa-admin-brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgb(79, 172, 254);
  color: white;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(79, 172, 254, 0.28);
}

.maarifa-admin-brand strong,
.maarifa-admin-profile strong {
  display: block;
  line-height: 1.2;
}

.maarifa-admin-brand small,
.maarifa-admin-profile small,
.maarifa-nav-link small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.maarifa-admin-nav {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  padding: 6px 0;
}

.maarifa-nav-section-label {
  margin: 18px 8px 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.maarifa-nav-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  color: var(--text-secondary);
  padding: 9px 10px;
  font-weight: 850;
}

.maarifa-nav-link.active,
.maarifa-nav-link:hover {
  background: var(--primary-soft);
  color: #075985;
}

.maarifa-nav-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.maarifa-nav-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #eef7ff;
  color: #075985;
  font-size: 12px;
  font-weight: 900;
}

.maarifa-admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border-top: 1px solid var(--border-color);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  margin-top: auto;
  padding-top: 16px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.maarifa-admin-profile:hover {
  color: #075985;
}

.maarifa-admin-profile > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.maarifa-admin-profile strong,
.maarifa-admin-profile small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maarifa-avatar {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #0f172a;
  color: white;
  font-weight: 900;
}

.maarifa-profile-caret {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 900;
  transform: rotate(180deg);
}

.maarifa-profile-popover {
  position: fixed;
  left: 18px;
  bottom: 78px;
  width: 280px;
  z-index: 1200;
  display: none;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.maarifa-profile-popover.active {
  display: block;
}

.maarifa-popover-header {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border-color);
}

.maarifa-popover-avatar {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgb(79, 172, 254);
  color: white;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 12px 22px rgba(79, 172, 254, 0.28);
}

.maarifa-popover-header strong {
  color: var(--text-primary);
  font-size: 15px;
}

.maarifa-popover-header span,
.maarifa-popover-meta span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.maarifa-popover-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 14px;
}

.maarifa-popover-meta strong {
  color: #075985;
  font-size: 13px;
}

.maarifa-popover-actions {
  display: grid;
  padding: 8px;
}

.maarifa-popover-actions a,
.maarifa-popover-actions button {
  width: 100%;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 11px;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.maarifa-popover-actions a:hover,
.maarifa-popover-actions button:hover {
  background: var(--primary-soft);
  color: #075985;
}

.maarifa-admin-main {
  min-width: 0;
  padding: 24px;
}

.maarifa-admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 16px;
  box-shadow: var(--shadow-light);
}

.maarifa-admin-topbar p {
  margin: 0 0 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.maarifa-admin-topbar strong {
  font-size: 18px;
}

.maarifa-admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.maarifa-admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-top: 22px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: #ffffff;
  padding: 26px;
  box-shadow: var(--shadow-light);
}

.maarifa-admin-hero h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 34px;
  line-height: 1.08;
}

.maarifa-admin-hero p:not(.wiki-eyebrow) {
  max-width: 760px;
  color: var(--text-secondary);
}

.admin-product-card.is-disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.admin-product-permissions {
  width: fit-content;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #075985;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.admin-checkbox.is-disabled {
  background: #f8fafc;
  color: var(--text-muted);
}

.admin-checkbox small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-role-table {
  display: grid;
  gap: 0;
  overflow-x: auto;
}

.admin-role-row {
  display: grid;
  grid-template-columns: 140px repeat(3, minmax(150px, 1fr));
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding: 12px 0;
}

.admin-role-head {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.admin-role-row code {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #f8fafc;
  padding: 6px 8px;
  color: #075985;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 820px) {
  .maarifa-admin-app {
    grid-template-columns: 1fr;
  }

  .maarifa-admin-sidebar {
    position: static;
    height: auto;
  }

  .maarifa-profile-popover {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }

  .maarifa-admin-topbar,
  .maarifa-admin-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .maarifa-admin-topbar-actions {
    flex-wrap: wrap;
  }

  .admin-role-row {
    grid-template-columns: 1fr;
  }

  .admin-two-column,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions,
  .admin-form-actions,
  .admin-editor-header,
  .admin-login-panel {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .admin-login-panel {
    gap: 0;
  }

  .admin-login-intro {
    min-height: auto;
    padding: 30px;
  }

  .admin-login-form {
    padding: 30px;
  }
}
