/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
*, ::before, ::after {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

::backdrop {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}/*
! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com
*//*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  border-width: 0; /* 2 */
  border-style: solid; /* 2 */
  border-color: #e5e7eb; /* 2 */
}

::before,
::after {
  --tw-content: '';
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
7. Disable tap highlights on iOS
*/

html,
:host {
  line-height: 1.5; /* 1 */
  -webkit-text-size-adjust: 100%; /* 2 */
  -moz-tab-size: 4; /* 3 */
  -o-tab-size: 4;
     tab-size: 4; /* 3 */
  font-family: var(--font-default), IBM Plex Sans Arabic, IBM Plex Sans, system-ui, sans-serif; /* 4 */
  font-feature-settings: normal; /* 5 */
  font-variation-settings: normal; /* 6 */
  -webkit-tap-highlight-color: transparent; /* 7 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0; /* 1 */
  line-height: inherit; /* 2 */
}

/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/

hr {
  height: 0; /* 1 */
  color: inherit; /* 2 */
  border-top-width: 1px; /* 3 */
}

/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

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

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: IBM Plex Mono, SF Mono, Cascadia Code, Source Code Pro, Consolas, Courier New, monospace; /* 1 */
  font-feature-settings: normal; /* 2 */
  font-variation-settings: normal; /* 3 */
  font-size: 1em; /* 4 */
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0; /* 1 */
  border-color: inherit; /* 2 */
  border-collapse: collapse; /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit; /* 1 */
  font-feature-settings: inherit; /* 1 */
  font-variation-settings: inherit; /* 1 */
  font-size: 100%; /* 1 */
  font-weight: inherit; /* 1 */
  line-height: inherit; /* 1 */
  letter-spacing: inherit; /* 1 */
  color: inherit; /* 1 */
  margin: 0; /* 2 */
  padding: 0; /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button; /* 1 */
  background-color: transparent; /* 2 */
  background-image: none; /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}

/*
Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
Removes the default spacing and border for appropriate elements.
*/

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*
Reset default styling for dialogs.
*/
dialog {
  padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

input::placeholder,
textarea::placeholder {
  opacity: 1; /* 1 */
  color: #9ca3af; /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role="button"] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/* Make elements with the HTML hidden attribute stay hidden by default */
[hidden]:where(:not([hidden="until-found"])) {
  display: none;
}
.\!visible {
  visibility: visible !important;
}
.visible {
  visibility: visible;
}
.static {
  position: static;
}
.fixed {
  position: fixed;
}
.absolute {
  position: absolute;
}
.relative {
  position: relative;
}
.sticky {
  position: sticky;
}
.block {
  display: block;
}
.inline-block {
  display: inline-block;
}
.inline {
  display: inline;
}
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.table {
  display: table;
}
.grid {
  display: grid;
}
.hidden {
  display: none;
}
.min-h-screen {
  min-height: 100vh;
}
.transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.resize {
  resize: both;
}
.border {
  border-width: 1px;
}
.bg-surface-raised {
  --tw-bg-opacity: 1;
  background-color: rgb(250 250 250 / var(--tw-bg-opacity, 1));
}
.font-sans {
  font-family: var(--font-default), IBM Plex Sans Arabic, IBM Plex Sans, system-ui, sans-serif;
}
.uppercase {
  text-transform: uppercase;
}
.italic {
  font-style: italic;
}
.text-fg-primary {
  --tw-text-opacity: 1;
  color: rgb(26 26 26 / var(--tw-text-opacity, 1));
}
.underline {
  text-decoration-line: underline;
}
.line-through {
  text-decoration-line: line-through;
}
.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.outline {
  outline-style: solid;
}
.filter {
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}


/* ============================================================
 * TapRabt design tokens as CSS custom properties.
 *
 * Mirrors the Tailwind config so non-Tailwind code (inline styles,
 * third-party widgets, dynamic tenant brand overrides — see C03
 * §4.6) can read the same values. Source of truth for the values
 * is docs/c03_design_system.docx Section 18 / Tables 23–29.
 * ============================================================ */

:root {
  /* Brand */
  --color-brand: #1f7a4d;
  --color-brand-dark: #16593a;
  --color-brand-light: #e8f3ec;
  --color-brand-50: #f4f8f5;

  /* Accent — decorative only, do NOT use for body text. C03 §4.4 */
  --color-accent: #c9a227;
  --color-accent-light: #f4e9c2;

  /* Semantic */
  --color-success: #137333;
  --color-success-light: #e6f4ea;
  --color-warning: #b85c00;
  --color-warning-light: #fff1e6;
  --color-error: #b3261e;
  --color-error-light: #fce8e6;
  --color-info: #1a4d80;
  --color-info-light: #eaf4fb;

  /* Foreground / text */
  --color-text-primary: #1a1a1a;
  --color-text-secondary: #595959;
  --color-text-tertiary: #8c8c8c;
  --color-text-disabled: #bfbfbf;
  --color-text-inverse: #ffffff;

  /* Surfaces */
  --color-surface: #ffffff;
  --color-surface-alt: #f4f8f5;
  --color-surface-raised: #fafafa;
  --color-surface-overlay: rgba(0, 0, 0, 0.5);

  /* Borders / dividers */
  --color-border: #bfbfbf;
  --color-border-subtle: #e5e5e5;
  --color-border-strong: #8c8c8c;

  /* Spacing — 8px base. C03 §6.1 / Table 9. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radius — C03 §6.2 / Table 10. */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 9999px;

  /* Shadow (brand-tinted). C03 §6.3 / Table 11. */
  --shadow-sm: 0 1px 2px 0 rgba(31, 122, 77, 0.05);
  --shadow-md:
    0 4px 8px -2px rgba(31, 122, 77, 0.08),
    0 2px 4px -2px rgba(31, 122, 77, 0.06);
  --shadow-lg:
    0 12px 24px -8px rgba(31, 122, 77, 0.10),
    0 4px 8px -4px rgba(31, 122, 77, 0.06);

  /* Typography. C03 §5 / Tables 5, 6, 7. */
  --font-default:
    "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;
  --font-mono:
    "IBM Plex Mono", "SF Mono", "Cascadia Code", "Source Code Pro",
    Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Line heights — Latin and Arabic differ per C03 §5.5. */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-arabic: 1.6;
  --leading-relaxed: 1.7;

  /* Motion. C03 §11 / Tables 19–20. */
  --duration-fast: 100ms;
  --duration-base: 150ms;
  --duration-slow: 250ms;
  --duration-slower: 400ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* Breakpoints — C03 §6.4 / Table 12. Used by JS that needs to
   * read the values back (e.g., a custom matchMedia). */
  --breakpoint-sm: 480px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}


/* ============================================================
 * Base element resets.
 * ============================================================ */

html {
  /* Inter-character spacing of 0 in Arabic — letter-spacing is
   * forbidden (breaks ligature joining). C03 §5.5. */
  letter-spacing: 0;
}

html[dir="ar"],
html[lang="ar"] {
  font-family: var(--font-default);
  line-height: var(--leading-arabic);
}

html[dir="ltr"],
html[lang="en"] {
  font-family: var(--font-default);
  line-height: var(--leading-normal);
}

body {
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
  font-family: var(--font-default);
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Focus ring — always visible. C03 §8.1.3, §12.3. */
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* Hide the default focus ring on mouse-only interactions to keep
 * the visual quiet for non-keyboard users. Keyboard users get the
 * full ring above. */
:focus:not(:focus-visible) {
  outline: none;
}


/* ============================================================
 * Reduced-motion mode. C03 §11.4, §12.
 *
 * Users who set `prefers-reduced-motion: reduce` get opacity-only
 * fades (no movement). Essential feedback (toasts, validation)
 * still announces; movement is removed.
 * ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
 * IBM Plex font-face stubs.
 *
 * Per C03 §5.1 the fonts must be self-hosted (not Google Fonts)
 * for performance and data-residency reasons. Drop the WOFF2
 * files into `public/fonts/` and uncomment the @font-face blocks
 * below. Until then the OS fallback in `--font-default` renders.
 *
 * Sources:
 *   - https://github.com/IBM/plex (download the WOFF2 subsets)
 *   - License: SIL Open Font License, free for commercial use
 *
 * Recommended subsets to ship:
 *   IBMPlexSans-Regular.woff2     (Latin 400)
 *   IBMPlexSans-Medium.woff2      (Latin 500)
 *   IBMPlexSans-SemiBold.woff2    (Latin 600)
 *   IBMPlexSans-Bold.woff2        (Latin 700)
 *   IBMPlexSansArabic-Regular.woff2
 *   IBMPlexSansArabic-Medium.woff2
 *   IBMPlexSansArabic-SemiBold.woff2
 *   IBMPlexSansArabic-Bold.woff2
 *   IBMPlexMono-Regular.woff2
 * ============================================================ */

/*
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/IBMPlexSans-VariableFont.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/IBMPlexSansArabic-VariableFont.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/IBMPlexMono-VariableFont.woff2") format("woff2");
}
*/


/* ============================================================
 * Numeral system helpers. C03 §10.
 *
 * `font-feature-settings: "lnum"` forces tabular Latin digits
 * (used inside RTL paragraphs to keep digit alignment clean).
 * Apply to `.tabular-nums` cells in tables.
 * ============================================================ */

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Helper class for the C03 §7.4 RTL icon-mirroring rule.
 * Apply to icons that should mirror in RTL (arrows, chevrons,
 * paper-plane, etc.). Default is no mirror. */
[dir="rtl"] .icon-mirror {
  transform: scaleX(-1);
}


/* ============================================================
 * Dashboard shell — additional tokens used by /super-admin,
 * /admin, /my, /me. The auth surface (login/signup) does not use
 * these; they are scoped under .app and per-role classes.
 * ============================================================ */
:root {
  /* Dashboard-specific aliases — names match the reference HTMLs. */
  --brand-primary-hover: #186139;
  --brand-primary-pressed: #134a2c;
  --brand-light-2: #f4faf6;
  --accent-gold: #c9a227;
  --accent-gold-light: #fbf4de;

  /* The reference uses warmer surface tints than the auth shell;
   * align to those here so dashboards feel like the references. */
  --surface-warm: #faf9f6;
  --surface-warm-alt: #f5f4f1;
  --surface-warm-deep: #efede8;
  --border-warm-subtle: #eceae5;
  --border-warm-default: #d8d5ce;
  --border-warm-strong: #b8b4ab;

  /* Super-admin operator differentiator (purple). */
  --sadm-accent: #5c2d91;
  --sadm-accent-light: #f3edfa;
  --env-prod: #b91c1c;

  /* Geometry */
  --topbar-h: 64px;
  --sidebar-w: 248px;
}


/* ============================================================
 * App shell — sidebar + topbar + main grid.
 * Mobile (≤960px) collapses to a single column with a hamburger
 * trigger that toggles the off-canvas sidebar.
 * ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "side top" "side main";
  min-height: 100vh;
  background: var(--surface-warm);
  font-size: 14px;
  color: var(--color-text-primary);
}
.app .topbar {
  grid-area: top;
  background: var(--color-surface);
  border-block-end: 1px solid var(--border-warm-subtle);
  display: flex;
  align-items: center;
  padding-inline: 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
}
.app .sidebar {
  grid-area: side;
  background: var(--color-surface);
  border-inline-end: 1px solid var(--border-warm-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.app .main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100vh - var(--topbar-h));
}
.app .main-inner {
  flex: 1 0 auto;
  padding: 24px 32px 32px;
  min-width: 0;
}
@media (max-width: 768px) {
  .app .main-inner {
    padding: 16px 16px 24px;
  }
}
@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas: "top" "main";
  }
  .app .sidebar {
    position: fixed;
    inset-inline-start: 0;
    inset-block: 0;
    width: 280px;
    transform: translateX(calc((var(--rtl-flip, 1)) * -100%));
    z-index: 100;
    transition: transform 200ms ease-out;
    box-shadow: var(--shadow-lg);
  }
  [dir="rtl"] .app .sidebar {
    transform: translateX(100%);
    inset-inline-start: auto;
    inset-inline-end: 0;
    border-inline-end: 0;
    border-inline-start: 1px solid var(--border-warm-subtle);
  }
  .app[data-sidebar-open="true"] .sidebar {
    transform: translateX(0);
  }
  .app .sidebar-scrim {
    display: none;
  }
  .app[data-sidebar-open="true"] .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--color-surface-overlay);
    z-index: 90;
  }
  .topbar-hamburger {
    display: inline-grid !important;
  }
}

/* Brand mark (sidebar header) */
.app .brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  padding: 0 20px;
  height: var(--topbar-h);
  border-block-end: 1px solid var(--border-warm-subtle);
  color: var(--color-text-primary);
  text-decoration: none;
}
.app .brand-link strong {
  color: var(--color-brand);
  font-weight: 600;
}
.app .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--color-brand);
  color: var(--color-text-inverse);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.04em;
  font-family: var(--font-mono);
}
/* Super-admin "INTERNAL" tag on the brand */
.app[data-role="super_admin"] .brand-link::after {
  content: "INTERNAL";
  margin-inline-start: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--sadm-accent);
  background: var(--sadm-accent-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Sidebar nav */
.nav-group {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-group + .nav-group {
  border-block-start: 1px solid var(--border-warm-subtle);
}
.nav-group-label {
  padding: 12px 12px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
[lang="ar"] .nav-group-label {
  letter-spacing: 0;
  text-transform: none;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background 120ms, color 120ms;
  position: relative;
}
.nav-item:hover {
  background: var(--surface-warm-alt);
  color: var(--color-text-primary);
}
.nav-item.active {
  background: var(--color-brand-light);
  color: var(--color-brand);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  inset-inline-start: -3px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--color-brand);
  border-radius: 0 2px 2px 0;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.nav-badge {
  margin-inline-start: auto;
  padding: 2px 7px;
  background: var(--color-brand);
  color: var(--color-text-inverse);
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.nav-badge.muted {
  background: var(--surface-warm-alt);
  color: var(--color-text-tertiary);
}
.nav-badge.warning {
  background: var(--color-warning);
}
.nav-badge.danger {
  background: var(--color-error);
}

.sidebar-footer {
  margin-block-start: auto;
  padding: 12px;
  border-block-start: 1px solid var(--border-warm-subtle);
}

/* Sidebar footer — generic chip (tenant or tier) */
.sidebar-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-warm-alt);
  width: 100%;
  text-align: start;
  border: 0;
  cursor: default;
}
.sidebar-chip-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  background: linear-gradient(
    135deg,
    var(--color-brand),
    var(--brand-primary-pressed)
  );
  color: var(--color-text-inverse);
  font-family: var(--font-mono);
}
.sidebar-chip-mark svg {
  width: 16px;
  height: 16px;
}
.sidebar-chip-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-chip-meta .label {
  font-size: 11px;
  color: var(--color-text-tertiary);
  line-height: 1.2;
}
.sidebar-chip-meta .value {
  font-size: 13px;
  font-weight: 600;
  margin-block-start: 1px;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Production env chip (super-admin) */
.env-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
}
.env-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--env-prod);
  animation: livepulse 2s ease-in-out infinite;
}
@keyframes livepulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
.env-name {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--env-prod);
  letter-spacing: 0.04em;
}
.env-meta {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-inline-start: auto;
  font-family: var(--font-mono);
}

/* Topbar pieces */
.topbar-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  place-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--color-text-secondary);
}
.topbar-hamburger:hover {
  background: var(--surface-warm-alt);
  color: var(--color-text-primary);
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  min-width: 0;
}
.topbar-context-label {
  color: var(--color-text-tertiary);
}
.topbar-context-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-context-tier {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 1px;
}
.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-warm-subtle);
  margin-inline: 8px;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 480px;
  padding: 0 12px;
  height: 36px;
  background: var(--surface-warm-alt);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 120ms;
  min-width: 0;
}
.topbar-search:focus-within {
  background: var(--color-surface);
  border-color: var(--border-warm-default);
  box-shadow: 0 0 0 3px var(--color-brand-light);
}
.topbar-search svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}
.topbar-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 13px;
  color: var(--color-text-primary);
  min-width: 0;
}
.topbar-search input::-moz-placeholder {
  color: var(--color-text-tertiary);
}
.topbar-search input::placeholder {
  color: var(--color-text-tertiary);
}
.topbar-search kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--color-surface);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--color-text-tertiary);
  border: 1px solid var(--border-warm-subtle);
}
@media (max-width: 768px) {
  .topbar-search,
  .topbar-context-label,
  .topbar-context-name,
  .topbar-context-tier {
    display: none;
  }
}

.topbar-spacer {
  flex: 1;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 120ms;
  position: relative;
}
.icon-btn:hover {
  background: var(--surface-warm-alt);
  color: var(--color-text-primary);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}
.notif-dot {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 8px;
  height: 8px;
  background: var(--color-brand);
  border-radius: 9999px;
  border: 2px solid var(--color-surface);
}
.notif-dot.warn {
  background: var(--color-warning);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border-warm-subtle);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  cursor: pointer;
}
.user-chip:hover {
  background: var(--surface-warm-alt);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2d8b5c, var(--color-brand));
  color: var(--color-text-inverse);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.app[data-role="super_admin"] .user-avatar {
  background: linear-gradient(135deg, var(--sadm-accent), #3d1a6b);
}

/* User menu dropdown */
.user-menu {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  width: 260px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 60;
}
.user-menu-header {
  padding: 12px 12px 16px;
  border-block-end: 1px solid var(--border-warm-subtle);
  margin-block-end: 8px;
}
.user-menu-header .name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-primary);
}
.user-menu-header .email {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
  word-break: break-all;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--color-text-primary);
  text-align: start;
  width: 100%;
  text-decoration: none;
}
.user-menu-item:hover {
  background: var(--surface-warm-alt);
}
.user-menu-item.danger {
  color: var(--color-error);
}
.user-menu-item.danger:hover {
  background: var(--color-error-light);
}
.user-menu-item svg {
  width: 16px;
  height: 16px;
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-block-end: 24px;
  flex-wrap: wrap;
}
.page-title h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title p {
  margin-block-start: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Greeting */
.greeting {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-block-end: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.greeting h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.greeting h1 .wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 2.5s ease-in-out infinite;
}
@keyframes wave {
  0%,
  60%,
  100% {
    transform: rotate(0);
  }
  10%,
  30% {
    transform: rotate(14deg);
  }
  20%,
  40% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(10deg);
  }
}
.greeting p {
  margin-block-start: 4px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* Dashboard buttons (the .btn / .btn-* classes are already
 * defined for the auth shell; we add only what's missing). */
.btn-success {
  background: #16a34a;
  color: var(--color-text-inverse);
  border-color: #16a34a;
}
.btn-success:hover {
  background: #15803d;
  border-color: #15803d;
  color: var(--color-text-inverse);
}
.btn-danger-outline {
  background: var(--color-surface);
  color: var(--color-error);
  border-color: #fca5a5;
}
.btn-danger-outline:hover {
  background: var(--color-error-light);
}

/* Pills (override .pill from auth shell to use warmer surface tints
 * — auth uses different color shades). The dashboard pill uses
 * tabular-numerics for numeric pills. */
.app .pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.app .pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.app .pill.success {
  background: #dcfce7;
  color: #16a34a;
}
.app .pill.warning {
  background: #fef3c7;
  color: #b45309;
}
.app .pill.error {
  background: #fee2e2;
  color: #b91c1c;
}
.app .pill.info {
  background: #dbeafe;
  color: #1d4ed8;
}
.app .pill.gold {
  background: var(--accent-gold-light);
  color: #8a6d10;
}
.app .pill.neutral {
  background: var(--surface-warm-alt);
  color: var(--color-text-secondary);
}
.app .pill.purple {
  background: #ede9fe;
  color: #5b21b6;
}
.app .pill.purple .dot {
  background: #6d28d9;
}

/* KPI grid */
.kpi-row {
  display: grid;
  gap: 12px;
  margin-block-end: 24px;
}
.kpi-row.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.kpi-row.cols-6 {
  grid-template-columns: repeat(6, 1fr);
}
@media (max-width: 1280px) {
  .kpi-row.cols-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 800px) {
  .kpi-row.cols-3,
  .kpi-row.cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .kpi-row.cols-3,
  .kpi-row.cols-6 {
    grid-template-columns: 1fr;
  }
}
.kpi {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 120ms;
}
.kpi:hover {
  border-color: var(--border-warm-default);
}
.kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}
[lang="ar"] .kpi-label {
  letter-spacing: 0;
  text-transform: none;
}
.kpi-label svg {
  width: 14px;
  height: 14px;
}
.kpi-value {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi-value.lg {
  font-size: 30px;
}
.kpi-value .unit {
  font-size: 14px;
  color: var(--color-text-tertiary);
  font-weight: 400;
  margin-inline-start: 2px;
}
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.kpi-delta.up {
  color: #16a34a;
}
.kpi-delta.down {
  color: #b91c1c;
}
.kpi-delta.warn {
  color: var(--color-warning);
}
.kpi-delta.flat {
  color: var(--color-text-tertiary);
}

/* Quick actions */
.quick-actions {
  display: grid;
  gap: 12px;
  margin-block-end: 20px;
}
.quick-actions.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
.quick-actions.fluid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
@media (max-width: 1100px) {
  .quick-actions.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .quick-actions.cols-4 {
    grid-template-columns: 1fr;
  }
}
.quick-action {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
  cursor: pointer;
  font: inherit;
  color: var(--color-text-primary);
  transition: all 120ms;
  text-decoration: none;
}
.quick-action:hover {
  border-color: var(--color-brand);
  background: var(--brand-light-2);
}
.quick-action.disabled {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}
.quick-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--color-brand-light);
  color: var(--color-brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.quick-action-icon svg {
  width: 20px;
  height: 20px;
}
.quick-action-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quick-action-sub {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
}

/* Panels */
.panel-grid {
  display: grid;
  gap: 16px;
  margin-block-end: 16px;
}
.panel-grid.split {
  grid-template-columns: 2fr 1fr;
}
.panel-grid.two {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 1100px) {
  .panel-grid.split,
  .panel-grid.two {
    grid-template-columns: 1fr;
  }
}
.panel {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.panel-head {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-block-end: 1px solid var(--border-warm-subtle);
  gap: 12px;
}
.panel-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title .count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-tertiary);
  background: var(--surface-warm-alt);
  padding: 1px 8px;
  border-radius: 9999px;
  font-variant-numeric: tabular-nums;
}
.panel-title .count.warn {
  background: #fef3c7;
  color: #b45309;
}
.panel-action {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 500;
  text-decoration: none;
}
.panel-action:hover {
  color: var(--color-brand);
}
.panel-body.padded {
  padding: 16px 20px;
}
.panel-empty {
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-tertiary);
}

/* Approval row (super-admin tenant queue) */
.approval-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-block-start: 1px solid var(--border-warm-subtle);
  transition: background 120ms;
}
.approval-row:first-child {
  border-block-start: none;
}
.approval-row:hover {
  background: var(--surface-warm);
}
@media (max-width: 600px) {
  .approval-row {
    grid-template-columns: auto 1fr;
    grid-template-areas: "mark meta" "actions actions";
    gap: 8px 12px;
  }
  .approval-row > :nth-child(1) {
    grid-area: mark;
  }
  .approval-row > :nth-child(2) {
    grid-area: meta;
  }
  .approval-row > :nth-child(3) {
    display: none;
  }
  .approval-row > :nth-child(4) {
    grid-area: actions;
    justify-self: stretch;
  }
}

.tenant-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2d8b5c, var(--brand-primary-pressed));
  color: var(--color-text-inverse);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.tenant-mark.amber {
  background: linear-gradient(135deg, #d97706, #92400e);
}
.tenant-mark.blue {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
}
.tenant-mark.purple {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
}
.tenant-mark.rose {
  background: linear-gradient(135deg, #e11d48, #881337);
}
.tenant-mark.sm {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.row-meta {
  min-width: 0;
}
.row-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}
.row-sub {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.row-sub > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.row-sub .mono {
  font-family: var(--font-mono);
}
.row-time {
  font-size: 12px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Audit anomaly row */
.audit-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 12px 20px;
  align-items: center;
  border-block-start: 1px solid var(--border-warm-subtle);
  font-size: 13px;
}
.audit-row:first-child {
  border-block-start: none;
}
.audit-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-warm-alt);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}
.audit-icon svg {
  width: 14px;
  height: 14px;
}
.audit-icon.crit {
  background: #fee2e2;
  color: #b91c1c;
}
.audit-icon.warn {
  background: #fef3c7;
  color: #b45309;
}
.audit-icon.info {
  background: #dbeafe;
  color: #1d4ed8;
}
.audit-text {
  line-height: 1.4;
  min-width: 0;
}
.audit-text strong {
  font-weight: 600;
}
.audit-text .mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
}
.audit-time {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* System health stats grid */
.health-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}
@media (max-width: 480px) {
  .health-grid {
    grid-template-columns: 1fr;
  }
}
.health-stat {
  padding: 12px;
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  background: var(--surface-warm);
}
.health-stat-label {
  font-size: 11px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
[lang="ar"] .health-stat-label {
  letter-spacing: 0;
  text-transform: none;
}
.health-stat-value {
  font-size: 18px;
  font-weight: 600;
  margin-block-start: 4px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.health-stat-detail {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
}
.health-bar {
  height: 4px;
  background: var(--surface-warm-alt);
  border-radius: 2px;
  overflow: hidden;
  margin-block-start: 8px;
}
.health-bar-fill {
  height: 100%;
  background: #16a34a;
}

/* Tenant table */
.t-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.t-table thead th {
  text-align: start;
  padding: 12px 20px;
  background: var(--surface-warm);
  border-block-end: 1px solid var(--border-warm-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}
[lang="ar"] .t-table thead th {
  letter-spacing: 0;
  text-transform: none;
}
.t-table tbody td {
  padding: 12px 20px;
  border-block-start: 1px solid var(--border-warm-subtle);
  vertical-align: middle;
}
.t-table tbody tr:hover {
  background: var(--surface-warm);
}
.t-table .num {
  text-align: end;
}
.t-table .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.t-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.t-cell-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.t-cell-meta strong {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.t-cell-meta .sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tenant context banner (corp-employee) */
.tenant-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background:
    linear-gradient(135deg, var(--color-brand-light) 0%, var(--brand-light-2) 100%);
  border: 1px solid var(--color-brand-light);
  border-radius: 12px;
  margin-block-end: 20px;
}
.tenant-banner-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-brand), var(--brand-primary-pressed));
  color: var(--color-text-inverse);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.tenant-banner-info {
  flex: 1;
  min-width: 0;
}
.tenant-banner-info h3 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tenant-banner-info p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-block-start: 2px;
}

/* Profile hero (employee + individual) */
.profile-hero {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 16px;
  padding: 24px;
  margin-block-end: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.profile-hero.with-glow::before {
  content: "";
  position: absolute;
  inset-block-start: -50px;
  inset-inline-end: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    var(--color-brand-light) 0%,
    transparent 70%
  );
  pointer-events: none;
}
@media (max-width: 600px) {
  .profile-hero {
    grid-template-columns: auto 1fr;
    grid-template-areas: "photo info" "actions actions";
    gap: 16px;
  }
  .profile-hero > :nth-child(1) {
    grid-area: photo;
  }
  .profile-hero > :nth-child(2) {
    grid-area: info;
  }
  .profile-hero > :nth-child(3) {
    grid-area: actions;
    justify-self: stretch;
    flex-wrap: wrap;
  }
}
.profile-photo {
  width: 72px;
  height: 72px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #5bb789, var(--color-brand));
  color: var(--color-text-inverse);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}
.profile-info {
  min-width: 0;
  position: relative;
  z-index: 1;
}
.profile-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-title {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-block-start: 2px;
}
.profile-dept {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.profile-dept span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.profile-dept svg {
  width: 12px;
  height: 12px;
}
.profile-url {
  margin-block-start: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-warm-alt);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
  border: 1px solid transparent;
  transition: all 120ms;
  cursor: pointer;
  text-decoration: none;
  word-break: break-all;
}
.profile-url:hover {
  border-color: var(--border-warm-default);
  background: var(--color-surface);
}
.profile-url svg {
  width: 13px;
  height: 13px;
  color: var(--color-text-tertiary);
}
.profile-url .slug {
  color: var(--color-text-primary);
  font-weight: 500;
}
.profile-actions {
  display: flex;
  gap: 8px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

/* Locked-fields callout (employee) */
.locked-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-block-end: 20px;
  font-size: 13px;
  color: #1d4ed8;
}
.locked-info svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-block-start: 2px;
}
.locked-info strong {
  font-weight: 600;
  display: block;
}
.locked-info-detail {
  font-size: 12px;
  margin-block-start: 2px;
  color: var(--color-text-secondary);
}
.locked-info-detail .field-pill {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  margin: 0 2px;
  color: #1d4ed8;
}

/* Lead row */
.lead-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  padding: 12px 20px;
  align-items: center;
  border-block-start: 1px solid var(--border-warm-subtle);
}
.lead-row:first-child {
  border-block-start: none;
}
.lead-row:hover {
  background: var(--surface-warm);
}
@media (max-width: 600px) {
  .lead-row {
    grid-template-columns: auto 1fr;
    grid-template-areas: "av meta" "av detail";
    -moz-column-gap: 12px;
         column-gap: 12px;
  }
  .lead-row > :nth-child(3),
  .lead-row > :nth-child(4) {
    grid-area: detail;
    align-self: end;
    font-size: 11px;
  }
}
.lead-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: var(--color-text-inverse);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.lead-avatar.alt-1 {
  background: linear-gradient(135deg, #fb923c, #c2410c);
}
.lead-avatar.alt-2 {
  background: linear-gradient(135deg, #a78bfa, #6d28d9);
}
.lead-avatar.alt-3 {
  background: linear-gradient(135deg, #34d399, #047857);
}
.lead-avatar.alt-4 {
  background: linear-gradient(135deg, #f472b6, #be185d);
}
.lead-meta {
  min-width: 0;
}
.lead-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead-detail {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lead-source {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
}
[lang="ar"] .lead-source {
  letter-spacing: 0;
  text-transform: none;
}
.lead-time {
  font-size: 12px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Pro upsell + sustainability (individual) */
.upsell-pro {
  background:
    radial-gradient(circle at 80% 20%, rgba(201, 162, 39, 0.18) 0%, transparent 60%),
    linear-gradient(135deg, var(--accent-gold-light) 0%, #fdf8e5 100%);
  border: 1px solid #e8d597;
  border-radius: 16px;
  padding: 24px;
  margin-block-end: 24px;
}
.upsell-pro h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-end: 8px;
}
.upsell-pro p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-block-end: 16px;
  max-width: 580px;
}
.pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--accent-gold);
  color: var(--color-text-inverse);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 4px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.upsell-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-block-end: 16px;
}
@media (max-width: 800px) {
  .upsell-features {
    grid-template-columns: 1fr;
  }
}
.upsell-feature {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-primary);
}
.upsell-feature svg {
  width: 16px;
  height: 16px;
  color: var(--accent-gold);
  flex-shrink: 0;
  margin-block-start: 2px;
}
.btn-pro {
  background: var(--accent-gold);
  color: var(--color-text-inverse);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
}
.btn-pro:hover {
  background: #b08b1f;
}

.sustain {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--brand-light-2);
  border: 1px solid var(--color-brand-light);
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-brand);
  margin-block-start: 24px;
}
.sustain svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.sustain strong {
  font-weight: 600;
}

/* Coming-soon panel */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 32px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 16px;
  gap: 12px;
  min-height: 400px;
}
.coming-soon-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--color-brand-light);
  color: var(--color-brand);
  display: grid;
  place-items: center;
  margin-block-end: 12px;
}
.coming-soon-icon svg {
  width: 32px;
  height: 32px;
}
.coming-soon h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.coming-soon p {
  font-size: 14px;
  color: var(--color-text-secondary);
  max-width: 480px;
  line-height: 1.55;
}
.coming-soon .pill {
  margin-block-start: 8px;
}

/* Page loader (full-screen + inline variants) */
.page-loader {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--color-brand-light);
  z-index: 9999;
  overflow: hidden;
  pointer-events: none;
}
.page-loader::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: -40%;
  width: 40%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-brand) 50%,
    transparent
  );
  animation: page-loader-slide 1.1s ease-in-out infinite;
}
@keyframes page-loader-slide {
  0% {
    inset-inline-start: -40%;
  }
  100% {
    inset-inline-start: 100%;
  }
}
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-brand-light);
  border-block-start-color: var(--color-brand);
  border-radius: 50%;
  animation: spinner-rotate 800ms linear infinite;
}
.spinner.lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}
@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

/* Skeleton placeholder for loading states */
.skel {
  background: linear-gradient(
    90deg,
    var(--surface-warm-alt) 0%,
    var(--border-warm-subtle) 50%,
    var(--surface-warm-alt) 100%
  );
  background-size: 200% 100%;
  animation: skel-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skel-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
.skel-line {
  height: 14px;
}
.skel-line.lg {
  height: 22px;
}

/* ============================================================
 * Approvals workspace (super-admin) — queue + detail + form.
 * Reference: designs/screen-references/06-super-admin-approvals.html
 * ============================================================ */

/* Workspace header lives directly inside .main and replaces the
 * default .main padding; pad the workspace itself instead. */
.app[data-page="approvals"] .main {
  padding: 0;
  overflow: hidden;
}

.work-header {
  background: var(--color-surface);
  border-block-end: 1px solid var(--border-warm-subtle);
  padding: 20px 24px 0;
}
.work-header-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-block-end: 16px;
  flex-wrap: wrap;
}
.work-title h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.work-title h1 .count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-tertiary);
  background: var(--surface-warm-alt);
  padding: 2px 10px;
  border-radius: 9999px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.work-title p {
  margin-block-start: 4px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* Filter chip strip */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-block-start: 1px solid var(--border-warm-subtle);
  padding-block: 12px;
  margin-inline: -24px;
  padding-inline: 24px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--border-warm-subtle);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  transition: all 120ms;
}
.chip:hover {
  background: var(--surface-warm-alt);
  color: var(--color-text-primary);
}
.chip.active {
  background: var(--color-text-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-text-primary);
}
.chip .badge {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-warm-alt);
  color: var(--color-text-tertiary);
  padding: 1px 6px;
  border-radius: 4px;
  margin-inline-start: 2px;
  font-variant-numeric: tabular-nums;
}
.chip.active .badge {
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-text-inverse);
}

/* Two-pane workspace */
.workspace {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: calc(100vh - var(--topbar-h) - 156px);
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .workspace[data-pane="detail"] .queue {
    display: none;
  }
  .workspace[data-pane="queue"] .detail {
    display: none;
  }
}

.queue {
  border-inline-end: 1px solid var(--border-warm-subtle);
  background: var(--color-surface);
  overflow-y: auto;
  max-height: calc(100vh - var(--topbar-h) - 156px);
}
.queue-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 13px;
}
.queue-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 16px 20px;
  align-items: flex-start;
  border-block-end: 1px solid var(--border-warm-subtle);
  cursor: pointer;
  transition: background 120ms;
  position: relative;
  background: transparent;
  border-inline: 0;
  border-block-start: 0;
  text-align: start;
  font: inherit;
  width: 100%;
  color: inherit;
}
.queue-row:hover {
  background: var(--surface-warm);
}
.queue-row.active {
  background: var(--brand-light-2);
}
.queue-row.active::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 0;
  width: 3px;
  background: var(--color-brand);
}
.q-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2d8b5c, #134a2c);
  color: var(--color-text-inverse);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.q-mark.amber {
  background: linear-gradient(135deg, #d97706, #92400e);
}
.q-mark.blue {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
}
.q-mark.purple {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
}
.q-mark.rose {
  background: linear-gradient(135deg, #e11d48, #881337);
}
.q-mark.teal {
  background: linear-gradient(135deg, #0d9488, #115e59);
}
.q-mark.slate {
  background: linear-gradient(135deg, #475569, #1e293b);
}
.q-meta {
  min-width: 0;
}
.q-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.q-detail {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 4px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.q-detail .country {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-sans);
}
.q-detail .country svg {
  width: 10px;
  height: 10px;
}
.q-pills {
  display: flex;
  gap: 4px;
  margin-block-start: 6px;
  flex-wrap: wrap;
}
.q-time {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* Detail pane */
.detail {
  overflow-y: auto;
  background: var(--surface-warm);
  max-height: calc(100vh - var(--topbar-h) - 156px);
}
.detail-empty {
  padding: 80px 32px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 14px;
}
.detail-content {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}
.detail-back {
  display: none;
}
@media (max-width: 1100px) {
  .detail-back {
    display: inline-flex;
    margin-block-end: 12px;
  }
}

/* Tenant identity card */
.tenant-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 20px;
  margin-block-end: 16px;
}
.tenant-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: flex-start;
}
@media (max-width: 600px) {
  .tenant-head {
    grid-template-columns: auto 1fr;
    grid-template-areas: "mark info" "actions actions";
  }
  .tenant-head > :nth-child(1) {
    grid-area: mark;
  }
  .tenant-head > :nth-child(2) {
    grid-area: info;
  }
  .tenant-head > :nth-child(3) {
    grid-area: actions;
    justify-self: stretch;
  }
}
.tenant-mark-lg {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2d8b5c, #134a2c);
  color: var(--color-text-inverse);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.tenant-info {
  min-width: 0;
}
.tenant-info h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tenant-info .cr-ref {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-tertiary);
  background: var(--surface-warm-alt);
  padding: 2px 8px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.tenant-info .desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-block-start: 8px;
}
.tenant-info .desc-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-block-start: 12px;
}
.tenant-info .desc-row .sep {
  color: var(--border-warm-default);
}
.tenant-info .desc-row .mono {
  font-family: var(--font-mono);
}
.tenant-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.tenant-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-block-start: 20px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--border-warm-subtle);
}
@media (max-width: 700px) {
  .tenant-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.tenant-meta-item {
  font-size: 11px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
[lang="ar"] .tenant-meta-item {
  letter-spacing: 0;
  text-transform: none;
}
.tenant-meta-item .v {
  display: block;
  margin-block-start: 4px;
  font-size: 14px;
  color: var(--color-text-primary);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.tenant-meta-item .v.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Approval form */
.approval-form {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  margin-block-end: 16px;
  overflow: hidden;
}
.approval-form-head {
  padding: 16px 20px;
  border-block-end: 1px solid var(--border-warm-subtle);
  background: var(--surface-warm);
}
.approval-form-head h3 {
  font-size: 14px;
  font-weight: 600;
}
.approval-form-head p {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
}
.presets {
  padding: 16px 20px;
  border-block-end: 1px solid var(--border-warm-subtle);
}
.presets-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  margin-block-end: 8px;
}
[lang="ar"] .presets-label {
  letter-spacing: 0;
  text-transform: none;
}
.preset-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-warm-alt);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  transition: all 120ms;
}
.preset-chip:hover {
  background: var(--brand-light-2);
  border-color: var(--color-brand);
  color: var(--color-brand);
}

/* Mode toggle */
.mode-toggle-wrap {
  padding: 16px 20px;
  border-block-end: 1px solid var(--border-warm-subtle);
}
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .mode-toggle {
    grid-template-columns: 1fr;
  }
}
.mode-card {
  border: 2px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 120ms;
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-surface);
  font: inherit;
  color: inherit;
}
.mode-card:hover {
  border-color: var(--border-warm-default);
  background: var(--surface-warm);
}
.mode-card[aria-pressed="true"] {
  border-color: var(--color-brand);
  background: var(--brand-light-2);
}
.mode-card[aria-pressed="true"] .mode-radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-brand);
}
.mode-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.mode-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-warm-default);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mode-card[aria-pressed="true"] .mode-radio {
  border-color: var(--color-brand);
}
.mode-icon {
  color: var(--color-text-tertiary);
}
.mode-card[aria-pressed="true"] .mode-icon {
  color: var(--color-brand);
}
.mode-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}
.mode-tag {
  display: inline-flex;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}
[lang="ar"] .mode-tag {
  letter-spacing: 0;
  text-transform: none;
}
.mode-tag.trial {
  background: #dbeafe;
  color: #1d4ed8;
}
.mode-tag.paid {
  background: var(--accent-gold-light);
  color: #8a6d10;
}

/* Form body */
.form-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-section-label {
  font-size: 13px;
  font-weight: 600;
}
.form-section-help {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-block-start: -8px;
}

/* Segmented chip selectors */
.seg-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.seg-chip {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border-warm-subtle);
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all 120ms;
}
.seg-chip:hover {
  border-color: var(--border-warm-default);
  background: var(--surface-warm);
}
.seg-chip[aria-pressed="true"] {
  background: var(--color-brand);
  color: var(--color-text-inverse);
  border-color: var(--color-brand);
}

.custom-seg-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1.5px solid var(--border-warm-subtle);
  border-radius: 8px;
  background: var(--color-surface);
}
.custom-seg-input input {
  width: 70px;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-primary);
}
.custom-seg-input .unit {
  font-size: 12px;
  color: var(--color-text-tertiary);
}
.custom-seg-input:focus-within {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-light);
}

/* Computed-date readout */
.date-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block-start: 8px;
  padding: 12px 16px;
  background: var(--surface-warm-alt);
  border-radius: 8px;
  font-size: 13px;
  border: 1px dashed var(--border-warm-default);
  flex-wrap: wrap;
}
.date-display svg {
  width: 16px;
  height: 16px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}
.date-display .label {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
[lang="ar"] .date-display .label {
  letter-spacing: 0;
  text-transform: none;
}
.date-display .v {
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--color-text-primary);
}
.date-display .arrow {
  color: var(--color-text-tertiary);
}
.date-display .duration {
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
}

/* Tier card selector */
.tier-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .tier-cards {
    grid-template-columns: 1fr;
  }
}
.tier-card {
  border: 2px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 120ms;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: start;
  font: inherit;
  color: inherit;
}
.tier-card:hover {
  border-color: var(--border-warm-default);
  background: var(--surface-warm);
}
.tier-card[aria-pressed="true"] {
  border-color: var(--color-brand);
  background: var(--brand-light-2);
}
.tier-card.enterprise[aria-pressed="true"] {
  border-color: var(--accent-gold);
  background: var(--accent-gold-light);
}
.tier-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
}
.tier-card-detail {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

/* Internal notes (sticky-note) */
.internal-notes {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 16px 20px;
  margin-block-end: 16px;
}
.internal-notes-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
  margin-block-end: 12px;
}
[lang="ar"] .internal-notes-head {
  letter-spacing: 0;
  text-transform: none;
}
.internal-notes-head svg {
  width: 14px;
  height: 14px;
}
.internal-notes-head .visibility {
  margin-inline-start: auto;
  font-size: 10px;
  font-family: var(--font-mono);
  background: rgba(146, 64, 14, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: none;
  letter-spacing: 0;
}
.internal-notes textarea {
  width: 100%;
  border: 0;
  background: transparent;
  resize: vertical;
  min-height: 60px;
  font: inherit;
  font-size: 13px;
  outline: none;
  color: var(--color-text-primary);
}
.internal-notes textarea::-moz-placeholder {
  color: #b45309;
  opacity: 0.6;
}
.internal-notes textarea::placeholder {
  color: #b45309;
  opacity: 0.6;
}

/* Sticky action footer */
.action-footer {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  inset-block-end: 16px;
  box-shadow: var(--shadow-md);
}
.action-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.action-summary-line {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.action-summary-detail {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Generic input used inside the approval form */
.approval-form .input,
.approval-form input.input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-warm-subtle);
  border-radius: 8px;
  background: var(--color-surface);
  font-size: 13px;
  font: inherit;
  color: var(--color-text-primary);
  transition: all 120ms;
}
.approval-form .input:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-light);
}
.approval-form .input.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.approval-form .input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .approval-form .input-row {
    grid-template-columns: 1fr;
  }
}
.approval-form .field-label {
  font-size: 12px;
  font-weight: 600;
  margin-block-end: 6px;
  color: var(--color-text-primary);
  display: block;
}
.approval-form .field-label .required {
  color: var(--color-error);
}

/* Toast (used by approve/reject confirmations) */
.toast {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  background: var(--color-text-primary);
  color: var(--color-text-inverse);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  transform: translateY(20px);
  transition: all 200ms ease-out;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.toast.error {
  background: var(--color-error);
}


/* ============================================================
 * Tenants directory (super-admin) — KPI strip, toolbar, table.
 * Reference: designs/screen-references/12-sadm-tenants.html
 * ============================================================ */

.tenants-kpi {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, 1fr);
  margin-block-end: 20px;
}
@media (max-width: 800px) { .tenants-kpi { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tenants-kpi { grid-template-columns: 1fr; } }

/* Toolbar */
.tenants-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 12px;
  margin-block-end: 16px;
  flex-wrap: wrap;
}
.tenants-toolbar .chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tenants-toolbar .toolbar-group {
  display: flex;
  gap: 8px;
  margin-inline-start: auto;
  align-items: center;
}
@media (max-width: 768px) {
  .tenants-toolbar .toolbar-group {
    margin-inline-start: 0;
    width: 100%;
  }
}
.toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 32px;
  background: var(--surface-warm-alt);
  border-radius: 8px;
  border: 1px solid transparent;
  min-width: 220px;
  max-width: 320px;
  flex: 1;
  transition: all 120ms;
}
.toolbar-search:focus-within {
  background: var(--color-surface);
  border-color: var(--border-warm-default);
  box-shadow: 0 0 0 3px var(--color-brand-light);
}
.toolbar-search svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}
.toolbar-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 13px;
  color: var(--color-text-primary);
  min-width: 0;
}
.toolbar-search input::-moz-placeholder {
  color: var(--color-text-tertiary);
}
.toolbar-search input::placeholder {
  color: var(--color-text-tertiary);
}

/* Tenants card + table */
.tenants-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.tenants-card .scroll { overflow-x: auto; }
.tenants-card .t-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  min-width: 880px;
}
.tenants-card .t-table thead th {
  text-align: start;
  padding: 12px 16px;
  background: var(--surface-warm);
  border-block-end: 1px solid var(--border-warm-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
}
[lang="ar"] .tenants-card .t-table thead th {
  letter-spacing: 0;
  text-transform: none;
}
.tenants-card .t-table thead th.sortable {
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.tenants-card .t-table thead th.sortable:hover { color: var(--color-text-primary); }
.tenants-card .t-table thead th .sort {
  margin-inline-start: 4px;
  opacity: 0.5;
  font-size: 10px;
}
.tenants-card .t-table thead th.sorted .sort {
  opacity: 1;
  color: var(--color-brand);
}
.tenants-card .t-table tbody td {
  padding: 12px 16px;
  border-block-start: 1px solid var(--border-warm-subtle);
  vertical-align: middle;
}
.tenants-card .t-table tbody tr { transition: background 120ms; }
.tenants-card .t-table tbody tr:hover { background: var(--surface-warm); }
.tenants-card .t-table tbody tr.suspended { opacity: 0.6; }
.tenants-card .t-table tbody tr.archived { opacity: 0.45; }
.tenants-card .t-table .num { text-align: end; }
.tenants-card .t-table .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.t-cell-tenant {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.t-name-block { min-width: 0; }
.t-name {
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.t-slug {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.t-slug .sep { color: var(--border-warm-default); }

.tenant-mark.suspended {
  background: linear-gradient(135deg, #94a3b8, #475569) !important;
}
.tenant-mark.archived {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8) !important;
}

.owner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}
.owner-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sadm-accent), #3d1a6b);
  color: var(--color-text-inverse);
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 600;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.owner-avatar.alt-1 { background: linear-gradient(135deg, #fb923c, #c2410c); }
.owner-avatar.alt-2 { background: linear-gradient(135deg, #34d399, #047857); }

.row-menu {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--color-text-tertiary);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: all 120ms;
  position: relative;
}
.row-menu:hover {
  background: var(--surface-warm-alt);
  color: var(--color-text-primary);
}
.row-menu svg { width: 16px; height: 16px; }

.row-menu-popup {
  position: absolute;
  inset-block-start: calc(100% + 4px);
  inset-inline-end: 0;
  width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
}
.row-menu-popup button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--color-text-primary);
  text-align: start;
  width: 100%;
}
.row-menu-popup button:hover { background: var(--surface-warm-alt); }
.row-menu-popup button.danger { color: var(--color-error); }
.row-menu-popup button.danger:hover { background: var(--color-error-light); }
.row-menu-popup button:disabled { opacity: 0.5; cursor: not-allowed; }
.row-menu-popup button svg { width: 14px; height: 14px; }
.row-menu-popup .sep {
  height: 1px;
  background: var(--border-warm-subtle);
  margin: 4px 0;
}

/* Pagination */
.tenants-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-warm);
  border-block-start: 1px solid var(--border-warm-subtle);
  font-size: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.tenants-pagination .info {
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.tenants-pagination .actions { display: flex; gap: 4px; }
.pag-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}
.pag-btn:hover:not(:disabled) {
  background: var(--surface-warm-alt);
  color: var(--color-text-primary);
}
.pag-btn.active {
  background: var(--color-brand);
  color: var(--color-text-inverse);
}
.pag-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.pag-btn svg { width: 14px; height: 14px; }

/* Mobile: table → card list */
.tenants-card-list { display: none; }
@media (max-width: 768px) {
  .tenants-card .scroll { display: none; }
  .tenants-card-list {
    display: flex;
    flex-direction: column;
  }
  .tenants-card-list .row-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-block-end: 1px solid var(--border-warm-subtle);
  }
  .tenants-card-list .row-card:last-child { border-block-end: 0; }
  .tenants-card-list .row-card .head {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .tenants-card-list .row-card .meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--color-text-tertiary);
  }
  .tenants-card-list .row-card .meta-row strong {
    color: var(--color-text-primary);
    font-weight: 500;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
  }
  .tenants-card-list .row-card .pills-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
  }
}


/* ============================================================
 * Users directory (super-admin) — table-only specifics; the
 * KPI strip / toolbar / pagination chrome reuse .tenants-* +
 * .chip / .pag-* / .toolbar-search rules above.
 * Reference: designs/screen-references/14-sadm-users.html
 * ============================================================ */
.users-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.users-card .scroll { overflow-x: auto; }
.users-card .t-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  min-width: 920px;
}
.users-card .t-table thead th {
  text-align: start;
  padding: 12px 16px;
  background: var(--surface-warm);
  border-block-end: 1px solid var(--border-warm-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
}
[lang="ar"] .users-card .t-table thead th {
  letter-spacing: 0;
  text-transform: none;
}
.users-card .t-table tbody td {
  padding: 12px 16px;
  border-block-start: 1px solid var(--border-warm-subtle);
  vertical-align: middle;
}
.users-card .t-table tbody tr { transition: background 120ms; }
.users-card .t-table tbody tr:hover { background: var(--surface-warm); }
.users-card .t-table tbody tr.suspended { opacity: 0.55; }
.users-card .t-table tbody tr.deleted { opacity: 0.4; }
.users-card .t-table .num { text-align: end; }
.users-card .t-table .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* User cell */
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.uavatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d8b5c, var(--color-brand));
  color: var(--color-text-inverse);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.uavatar.alt-1 { background: linear-gradient(135deg, #fb923c, #c2410c); }
.uavatar.alt-2 { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.uavatar.alt-3 { background: linear-gradient(135deg, #34d399, #047857); }
.uavatar.alt-4 { background: linear-gradient(135deg, #f472b6, #be185d); }
.uavatar.alt-5 { background: linear-gradient(135deg, #60a5fa, #1e3a8a); }
.uavatar.alt-6 { background: linear-gradient(135deg, #fbbf24, #92400e); }
.uavatar.sadm {
  background: linear-gradient(135deg, var(--sadm-accent), #3d1a6b);
}
.uavatar.suspended {
  filter: grayscale(1);
  opacity: 0.5;
}
.u-name-block { min-width: 0; }
.u-name {
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.u-email {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

/* Mini tenant link inside the users table */
.tenant-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.tenant-link .tmark {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, #2d8b5c, #134a2c);
  color: var(--color-text-inverse);
  display: grid;
  place-items: center;
  font-size: 8px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.tenant-link .tmark.amber { background: linear-gradient(135deg, #d97706, #92400e); }
.tenant-link .tmark.blue { background: linear-gradient(135deg, #2563eb, #1e3a8a); }
.tenant-link .tmark.purple { background: linear-gradient(135deg, #7c3aed, #4c1d95); }
.tenant-link .tmark.rose { background: linear-gradient(135deg, #e11d48, #881337); }
.tenant-link .tmark.teal { background: linear-gradient(135deg, #0d9488, #115e59); }

/* MFA chip */
.mfa-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
}
.mfa-chip svg { width: 14px; height: 14px; }
.mfa-chip.on { color: #16a34a; }
.mfa-chip.off { color: var(--color-text-tertiary); }

/* Mobile card list — mirrors .tenants-card-list */
.users-card-list { display: none; }
@media (max-width: 768px) {
  .users-card .scroll { display: none; }
  .users-card-list {
    display: flex;
    flex-direction: column;
  }
  .users-card-list .row-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-block-end: 1px solid var(--border-warm-subtle);
  }
  .users-card-list .row-card:last-child { border-block-end: 0; }
  .users-card-list .row-card .head {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .users-card-list .row-card .meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--color-text-tertiary);
  }
  .users-card-list .row-card .meta-row strong {
    color: var(--color-text-primary);
    font-weight: 500;
  }
  .users-card-list .row-card .pills-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
  }
}


/* ============================================================
 * Audit log (super-admin) — two-column layout (sidebar filter
 * panel + event feed) collapsing to single column ≤1100 px.
 * ============================================================ */
.audit-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .audit-layout { grid-template-columns: 1fr; }
}

.app .audit-filters {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
}
@media (max-width: 1100px) {
  .app .audit-filters { position: static; }
}
.app .audit-filters h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  margin-block-end: 12px;
}
.app .audit-filters .filter-section { margin-block-end: 20px; }
.app .audit-filters .filter-section:last-child { margin-block-end: 0; }
.app .audit-filters .filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.app .audit-filters .filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 120ms;
}
.app .audit-filters .filter-row:hover {
  background: var(--surface-warm-alt);
  color: var(--color-text-primary);
}
.app .audit-filters .filter-row > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.app .audit-filters .filter-row input[type="checkbox"] {
  accent-color: var(--color-brand-primary);
  cursor: pointer;
}
.app .audit-filters .filter-row .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
  background: var(--surface-warm-alt);
  padding: 1px 6px;
  border-radius: 4px;
}
.app .audit-filters .date-range {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app .audit-filters .date-input {
  padding: 7px 10px;
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  width: 100%;
}
.app .audit-filters .date-input:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

/* Audit feed (events) */
.audit-feed {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.audit-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-block-end: 1px solid var(--border-warm-subtle);
  background: var(--surface-warm);
}
.audit-feed-head h3 { font-size: 13px; font-weight: 600; }
.audit-feed-head .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #16a34a;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.audit-feed-head .live::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #16a34a;
  border-radius: 50%;
  animation: livepulse 2s ease-in-out infinite;
}
@keyframes livepulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.audit-day-header {
  padding: 10px 20px;
  background: var(--surface-warm);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-block-end: 1px solid var(--border-warm-subtle);
}

.audit-event {
  display: grid;
  grid-template-columns: 76px 32px 1fr auto;
  gap: 12px;
  padding: 12px 20px;
  border-block-end: 1px solid var(--border-warm-subtle);
  align-items: flex-start;
  transition: background 120ms;
}
.audit-event:hover { background: var(--surface-warm); }
.audit-event:last-child { border-block-end: none; }

.audit-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
  padding-block-start: 6px;
  white-space: nowrap;
}

.audit-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-warm-alt);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}
.audit-icon svg { width: 16px; height: 16px; }
.audit-icon.crit { background: #fee2e2; color: #b91c1c; }
.audit-icon.warn { background: #fef3c7; color: #b45309; }
.audit-icon.info { background: #dbeafe; color: #1d4ed8; }
.audit-icon.ok { background: #dcfce7; color: #16a34a; }

.audit-text {
  font-size: 13px;
  line-height: 1.5;
  padding-block-start: 6px;
  word-break: break-word;
}
.audit-text strong { font-weight: 600; }
.audit-text .actor {
  color: var(--color-text-primary);
  font-weight: 500;
}
.audit-text .target { color: var(--color-text-secondary); }
.audit-text .target.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-warm-alt);
  padding: 0 6px;
  border-radius: 3px;
}
.audit-meta {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 4px;
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  flex-wrap: wrap;
}
.audit-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.audit-sev {
  padding-block-start: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.audit-actor-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-secondary);
}
.audit-actor-chip .av {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 8px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #5c2d91, #3d1a6b);
  flex-shrink: 0;
}
.audit-actor-chip .av.system { background: var(--color-text-tertiary); }
.audit-actor-chip .av.corp_admin {
  background: linear-gradient(135deg, #a78bfa, #6d28d9);
}
.audit-actor-chip .av.user {
  background: linear-gradient(135deg, #f472b6, #be185d);
}
.audit-actor-chip .av.tenant_admin {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
}

.audit-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface-warm);
  border-block-start: 1px solid var(--border-warm-subtle);
  font-size: 12px;
  flex-wrap: wrap;
  gap: 12px;
}
.audit-pagination .pag-info {
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
}

/* Tablet: stack layout earlier than 1100 to give the feed room */
@media (max-width: 768px) {
  .audit-event {
    grid-template-columns: 32px 1fr;
    grid-template-areas:
      "icon time"
      "icon body"
      "icon sev";
    -moz-column-gap: 12px;
         column-gap: 12px;
    row-gap: 4px;
    padding: 12px 16px;
  }
  .audit-event .audit-time { grid-area: time; padding-block-start: 0; }
  .audit-event .audit-icon { grid-area: icon; }
  .audit-event .audit-body { grid-area: body; }
  .audit-event .audit-sev {
    grid-area: sev;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    padding-block-start: 4px;
  }
  .audit-feed-head, .audit-day-header { padding-inline: 16px; }
  .audit-pagination { padding-inline: 16px; }
}


/* ============================================================
 * System health (super-admin) — overall status banner +
 * grouped service cards + recent incidents.
 * ============================================================ */
.status-banner {
  background: linear-gradient(135deg, #dcfce7 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-block-end: 20px;
}
.status-banner.warn {
  background: linear-gradient(135deg, #fef3c7 0%, #fef3c7 100%);
  border-color: #fde68a;
}
.status-banner.warn .status-icon { background: #b45309; }
.status-banner.warn .status-icon::before,
.status-banner.warn .status-icon::after { border-color: #b45309; }
.status-banner.warn .status-text h2 { color: #b45309; }
.status-banner.crit {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #fca5a5;
}
.status-banner.crit .status-icon { background: #b91c1c; }
.status-banner.crit .status-icon::before,
.status-banner.crit .status-icon::after { border-color: #b91c1c; }
.status-banner.crit .status-text h2 { color: #b91c1c; }
.status-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #16a34a;
  color: white;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}
.status-icon::before,
.status-icon::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid #16a34a;
  opacity: 0;
  animation: pulse-ring 2s ease-out infinite;
}
.status-icon::after { animation-delay: 1s; }
@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}
.status-icon svg { width: 28px; height: 28px; }
.status-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.status-text h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #16a34a;
}
.status-text p {
  font-size: 13px;
  color: var(--color-text-secondary);
}
.status-time {
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  text-align: end;
  flex-shrink: 0;
}
.status-time .v {
  font-size: 13px;
  color: var(--color-text-primary);
  font-weight: 600;
  display: block;
  margin-block-start: 2px;
}
@media (max-width: 700px) {
  .status-banner {
    flex-wrap: wrap;
    padding: 16px;
  }
  .status-time {
    margin-inline-start: 0;
    text-align: start;
    width: 100%;
  }
}

/* Section header */
.svc-section { margin-block-end: 20px; }
.svc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 12px;
  flex-wrap: wrap;
}
.svc-section-head h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}
.svc-section-head .meta {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
}

/* Service grid */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) { .svc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .svc-grid { grid-template-columns: 1fr; } }

.svc-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 120ms;
}
.svc-card:hover { border-color: var(--border-warm-default, #d8d5ce); }
.svc-card.warn { border-color: #fde68a; background: #fffbeb; }
.svc-card.crit { border-color: #fca5a5; background: #fef2f2; }

.svc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.svc-name {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.svc-name > span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.svc-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #16a34a;
  position: relative;
  flex-shrink: 0;
}
.svc-status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: #16a34a;
  opacity: 0.3;
  animation: livepulse 2s ease-in-out infinite;
}
.svc-status-dot.warn { background: #b45309; }
.svc-status-dot.warn::after { background: #b45309; }
.svc-status-dot.crit { background: #b91c1c; }
.svc-status-dot.crit::after { background: #b91c1c; }

.svc-status-text {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.svc-status-text.ok { color: #16a34a; }
.svc-status-text.warn { color: #b45309; }
.svc-status-text.crit { color: #b91c1c; }

.svc-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--border-warm-subtle);
}
.svc-metric-label {
  font-size: 10px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.svc-metric-value {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  margin-block-start: 2px;
  letter-spacing: -0.01em;
}
.svc-metric-value .unit {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-weight: 400;
  margin-inline-start: 2px;
}
.svc-metric-detail {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
}

.svc-bar {
  height: 4px;
  background: var(--surface-warm-alt);
  border-radius: 2px;
  overflow: hidden;
  margin-block-start: 8px;
}
.svc-bar-fill {
  height: 100%;
  background: #16a34a;
  transition: width 200ms;
}
.svc-bar-fill.warn { background: #b45309; }
.svc-bar-fill.crit { background: #b91c1c; }

.svc-spark {
  margin-block-start: 8px;
  height: 32px;
  width: 100%;
}

/* Synthetic-data tag for cards we haven't wired to real probes yet */
.svc-card .synthetic-tag {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  background: var(--surface-warm-alt);
  border-radius: 4px;
}

/* Recent incidents list */
.recent-incidents {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.ri-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
  border-block-start: 1px solid var(--border-warm-subtle);
  font-size: 13px;
}
.ri-row:first-of-type { border-block-start: none; }
.ri-row:hover { background: var(--surface-warm); }
.ri-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
}
@media (max-width: 600px) {
  .ri-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .ri-row .ri-time { justify-self: start; }
}


/* ============================================================
 * Templates gallery (super-admin)
 * ============================================================ */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tpl-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: all 120ms;
  display: flex;
  flex-direction: column;
}
.tpl-card:hover {
  border-color: var(--border-warm-default, #d8d5ce);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.tpl-card.draft { opacity: 0.85; border-style: dashed; }

/* Thumbnail wrapper */
.tpl-thumb {
  height: 200px;
  position: relative;
  overflow: hidden;
  background: var(--surface-warm-deep, #efede8);
  border-block-end: 1px solid var(--border-warm-subtle);
}
.tpl-thumb-tier {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  z-index: 2;
  backdrop-filter: blur(8px);
}
.tpl-thumb-tier.free {
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-text-secondary);
}
.tpl-thumb-tier.pro {
  background: rgba(31, 122, 77, 0.9);
  color: white;
}
.tpl-thumb-tier.business {
  background: rgba(29, 78, 216, 0.9);
  color: white;
}
.tpl-thumb-tier.enterprise {
  background: rgba(201, 162, 39, 0.9);
  color: white;
}
.tpl-thumb-tier.draft {
  background: rgba(180, 83, 9, 0.9);
  color: white;
}

/* CSS-art preview cards (mini business-card mockups) */
.preview {
  width: 70%;
  height: 80%;
  margin: 10% auto;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.12),
    0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Modern Mint (Free) */
.preview.mod-mint {
  background: linear-gradient(135deg, #ffffff 0%, #f4faf6 100%);
}
.preview.mod-mint::before {
  content: "";
  height: 32%;
  background: linear-gradient(135deg, #1f7a4d, #134a2c);
}
.preview.mod-mint::after {
  content: "";
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.preview.mod-mint .lines {
  margin: 24px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.preview.mod-mint .lines span {
  height: 4px;
  background: #d8d5ce;
  border-radius: 2px;
  display: block;
}
.preview.mod-mint .lines span:nth-child(1) {
  width: 60%;
  height: 6px;
  background: #1a1a1a;
}
.preview.mod-mint .lines span:nth-child(2) { width: 40%; }
.preview.mod-mint .lines span:nth-child(3) { width: 50%; }

/* Classic Gold (Free) */
.preview.classic-gold {
  background: #ffffff;
  border: 1px solid #eceae5;
  align-items: center;
  justify-content: center;
}
.preview.classic-gold::before {
  content: "";
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #c9a227, #8a6d10);
  border-radius: 50%;
  margin-block-end: 8px;
}
.preview.classic-gold .lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}
.preview.classic-gold .lines span {
  height: 3px;
  background: #d8d5ce;
  border-radius: 2px;
  display: block;
}
.preview.classic-gold .lines span:nth-child(1) {
  width: 70px;
  height: 5px;
  background: #1a1a1a;
}
.preview.classic-gold .lines span:nth-child(2) { width: 50px; }
.preview.classic-gold .lines span:nth-child(3) {
  width: 40px;
  background: #c9a227;
}

/* Bold Banner (Business) */
.preview.bold-banner { background: white; }
.preview.bold-banner::before {
  content: "";
  height: 50%;
  background: linear-gradient(135deg, #1f7a4d 0%, #186139 50%, #134a2c 100%);
}
.preview.bold-banner .lines {
  margin: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview.bold-banner .lines span {
  height: 4px;
  background: #d8d5ce;
  border-radius: 2px;
}
.preview.bold-banner .lines span:nth-child(1) {
  width: 65%;
  height: 6px;
  background: #1a1a1a;
}
.preview.bold-banner .lines span:nth-child(2) { width: 45%; }
.preview.bold-banner .lines span:nth-child(3) { width: 55%; }
.preview.bold-banner .lines span:nth-child(4) {
  width: 35%;
  background: #1f7a4d;
  height: 3px;
}

/* Pattern Arabic (Business) */
.preview.pattern-ar { background: white; position: relative; }
.preview.pattern-ar::before {
  content: "";
  height: 40%;
  background-color: #186139;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255, 255, 255, 0.1) 4px, rgba(255, 255, 255, 0.1) 8px),
    radial-gradient(circle at 20% 50%, rgba(201, 162, 39, 0.4) 0, transparent 30%),
    radial-gradient(circle at 80% 50%, rgba(201, 162, 39, 0.4) 0, transparent 30%);
}
.preview.pattern-ar .lines {
  margin: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.preview.pattern-ar .lines span {
  height: 4px;
  background: #d8d5ce;
  border-radius: 2px;
}
.preview.pattern-ar .lines span:nth-child(1) {
  width: 60%;
  height: 6px;
  background: #1a1a1a;
}
.preview.pattern-ar .lines span:nth-child(2) {
  width: 70%;
  background: #c9a227;
  height: 3px;
}
.preview.pattern-ar .lines span:nth-child(3) { width: 55%; }

/* Minimal Mono (Business) */
.preview.minimal-mono {
  background: #ffffff;
  padding: 16px 12px;
  justify-content: space-between;
}
.preview.minimal-mono .lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.preview.minimal-mono .lines span {
  height: 3px;
  background: #1a1a1a;
  border-radius: 1px;
  display: block;
}
.preview.minimal-mono .lines span:nth-child(1) { width: 70%; height: 6px; }
.preview.minimal-mono .lines span:nth-child(2) {
  width: 30%;
  background: #8c8c8c;
}
.preview.minimal-mono .lines span:nth-child(3) {
  width: 50%;
  background: #5c5c5c;
}
.preview.minimal-mono .footer {
  border-block-start: 1px solid #1a1a1a;
  height: 4px;
}

/* Government Crest (Enterprise) */
.preview.gov-crest { background: #ffffff; }
.preview.gov-crest::before {
  content: "";
  height: 18%;
  background: linear-gradient(180deg, #c9a227 0%, #8a6d10 100%);
}
.preview.gov-crest .crest {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  border: 3px solid #c9a227;
  border-radius: 50%;
  margin: -16px auto 0;
  position: relative;
  z-index: 1;
}
.preview.gov-crest::after {
  content: "";
  height: 8%;
  background: linear-gradient(180deg, #186139 0%, #134a2c 100%);
  margin-block-start: auto;
}
.preview.gov-crest .lines {
  margin: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.preview.gov-crest .lines span {
  height: 3px;
  background: #d8d5ce;
  border-radius: 2px;
}
.preview.gov-crest .lines span:nth-child(1) {
  width: 60%;
  height: 5px;
  background: #1a1a1a;
}
.preview.gov-crest .lines span:nth-child(2) { width: 50%; }

/* Healthcare Blue (Enterprise) */
.preview.health-blue { background: #f8fafc; }
.preview.health-blue::before {
  content: "";
  height: 35%;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  position: relative;
}
.preview.health-blue::after {
  content: "+";
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  background: white;
  border-radius: 50%;
  color: #2563eb;
  font-size: 22px;
  font-weight: 700;
  display: grid;
  place-items: center;
  z-index: 1;
}
.preview.health-blue .lines {
  margin: 22px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.preview.health-blue .lines span {
  height: 4px;
  background: #d8d5ce;
  border-radius: 2px;
}
.preview.health-blue .lines span:nth-child(1) {
  width: 60%;
  height: 6px;
  background: #1a1a1a;
}
.preview.health-blue .lines span:nth-child(2) { width: 45%; }

/* Realestate Stone (Business) */
.preview.real-stone { background: #fafaf9; }
.preview.real-stone::before {
  content: "";
  height: 45%;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.4), transparent),
    linear-gradient(180deg, #475569 0%, #1e293b 100%);
}
.preview.real-stone .lines {
  margin: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview.real-stone .lines span {
  height: 4px;
  background: #d8d5ce;
  border-radius: 2px;
}
.preview.real-stone .lines span:nth-child(1) {
  width: 65%;
  height: 6px;
  background: #1a1a1a;
}
.preview.real-stone .lines span:nth-child(2) {
  width: 50%;
  background: #c9a227;
  height: 3px;
}

/* Edu Friendly (Business) */
.preview.edu-friendly {
  background: linear-gradient(180deg, #fbf4de 0%, white 50%);
}
.preview.edu-friendly::before {
  content: "";
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #fb923c, #c2410c);
  border-radius: 50%;
  margin: 12px auto 8px;
  position: relative;
}
.preview.edu-friendly .lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  margin-block-start: 6px;
}
.preview.edu-friendly .lines span {
  height: 4px;
  background: #d8d5ce;
  border-radius: 2px;
}
.preview.edu-friendly .lines span:nth-child(1) {
  width: 55%;
  height: 6px;
  background: #1a1a1a;
}
.preview.edu-friendly .lines span:nth-child(2) { width: 40%; }
.preview.edu-friendly .lines span:nth-child(3) {
  width: 50%;
  background: #c2410c;
  height: 3px;
}

/* Tech Gradient (Enterprise) */
.preview.tech-grad {
  background:
    radial-gradient(circle at 0% 0%, #5c2d91 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, #1f7a4d 0%, transparent 50%),
    #1a1a1a;
}
.preview.tech-grad .lines {
  margin: auto 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview.tech-grad .lines span {
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}
.preview.tech-grad .lines span:nth-child(1) {
  width: 65%;
  height: 6px;
  background: white;
}
.preview.tech-grad .lines span:nth-child(2) { width: 45%; }
.preview.tech-grad .lines span:nth-child(3) {
  width: 55%;
  background: #c9a227;
  height: 3px;
}

/* Construction Hi-Vis (Business) */
.preview.construct { background: #ffffff; }
.preview.construct::before {
  content: "";
  height: 12%;
  background: repeating-linear-gradient(
    45deg,
    #c9a227 0,
    #c9a227 10px,
    #1a1a1a 10px,
    #1a1a1a 20px
  );
}
.preview.construct .lines {
  margin: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview.construct .lines span {
  height: 4px;
  background: #d8d5ce;
  border-radius: 2px;
}
.preview.construct .lines span:nth-child(1) {
  width: 70%;
  height: 6px;
  background: #1a1a1a;
}
.preview.construct .lines span:nth-child(2) { width: 50%; }
.preview.construct .lines span:nth-child(3) {
  width: 60%;
  background: #186139;
  height: 3px;
}

/* Maritime Navy (Enterprise) */
.preview.maritime {
  background: linear-gradient(180deg, #dbeafe 0%, white 50%);
}
.preview.maritime::before {
  content: "";
  height: 40%;
  background:
    linear-gradient(180deg, transparent 60%, rgba(255, 255, 255, 0.4) 60%, rgba(255, 255, 255, 0.4) 70%, transparent 70%),
    linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
}
.preview.maritime .lines {
  margin: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview.maritime .lines span {
  height: 4px;
  background: #d8d5ce;
  border-radius: 2px;
}
.preview.maritime .lines span:nth-child(1) {
  width: 65%;
  height: 6px;
  background: #1a1a1a;
}
.preview.maritime .lines span:nth-child(2) {
  width: 50%;
  background: #1e3a8a;
  height: 3px;
}

/* Card body */
.tpl-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.tpl-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tpl-name .row-menu {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.tpl-name .row-menu:hover {
  background: var(--surface-warm-alt);
  color: var(--color-text-primary);
}
.tpl-name .row-menu svg { width: 14px; height: 14px; }

.tpl-cat {
  font-size: 11px;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.tpl-cat::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--color-text-tertiary);
  border-radius: 50%;
}
.tpl-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block-start: 8px;
  border-block-start: 1px solid var(--border-warm-subtle);
  margin-block-start: auto;
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  flex-wrap: wrap;
}
.tpl-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tpl-stats svg { width: 11px; height: 11px; }

/* Category quick-jump bar */
.cat-bar {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  margin-block-end: 16px;
  overflow-x: auto;
}
.cat-pill {
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  border: 1px solid var(--border-warm-subtle);
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.cat-pill:hover {
  background: var(--surface-warm-alt);
  color: var(--color-text-primary);
}
.cat-pill.active {
  background: var(--brand-tint);
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}
.cat-pill .ct {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-warm-alt);
  color: var(--color-text-tertiary);
  padding: 1px 6px;
  border-radius: 4px;
}
.cat-pill.active .ct {
  background: var(--color-brand-primary);
  color: white;
}


/* ============================================================
 * Tier overrides (super-admin) — table with diff display
 * ============================================================ */
.info-banner {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 12px;
  padding: 12px 16px;
  margin-block-end: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-primary);
}
.info-banner svg {
  color: #1d4ed8;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-block-start: 2px;
}
.info-banner strong { color: #1d4ed8; }

/* Override-type badge */
.ov-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-warm-subtle);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.ov-type svg { width: 12px; height: 12px; flex-shrink: 0; }
.ov-type.tier {
  background: #fbf4de;
  color: #8a6d10;
  border-color: #fcd34d;
}
.ov-type.feature {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}
.ov-type.limit {
  background: var(--brand-tint);
  color: var(--color-brand-primary);
  border-color: #86efac;
}
.ov-type.pricing {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}

/* Diff display: from → to */
.diff {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  flex-wrap: wrap;
}
.diff-from {
  padding: 3px 8px;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 4px;
  text-decoration: line-through;
  text-decoration-color: rgba(185, 28, 28, 0.5);
  font-weight: 500;
}
.diff-arrow {
  color: var(--color-text-tertiary);
  font-size: 13px;
}
.diff-to {
  padding: 3px 8px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 4px;
  font-weight: 600;
}
.diff-to.gold { background: #fbf4de; color: #8a6d10; }
.diff-to.purple { background: #ede9fe; color: #5b21b6; }
.diff-to.blue { background: #dbeafe; color: #1d4ed8; }

/* Reason cell */
.reason-cell {
  font-size: 12px;
  color: var(--color-text-secondary);
  max-width: 240px;
  line-height: 1.4;
}

/* Date cell */
.dates-cell {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.dates-cell .effective {
  color: #16a34a;
  font-weight: 600;
}
.dates-cell .expires {
  color: #b45309;
  font-weight: 600;
}
.dates-cell .expires.near { color: #b91c1c; }
.dates-cell .perma {
  color: var(--color-text-tertiary);
  font-style: italic;
}

/* Approver chip */
.approver {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.approver-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5c2d91, #3d1a6b);
  color: white;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 600;
  flex-shrink: 0;
}
.approver-av.alt-1 {
  background: linear-gradient(135deg, #fb923c, #c2410c);
}
.approver-av.alt-2 {
  background: linear-gradient(135deg, #34d399, #047857);
}
.approver-av.alt-3 {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
}
.approver-av.alt-4 {
  background: linear-gradient(135deg, #e11d48, #881337);
}

/* Mobile card list for tier overrides */
.tier-overrides-card-list { display: none; }
@media (max-width: 768px) {
  .tier-overrides-card-list { display: flex; flex-direction: column; }
  .tier-overrides-card-list .row-card {
    padding: 14px 16px;
    border-block-end: 1px solid var(--border-warm-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .tier-overrides-card-list .row-card:last-child { border-block-end: 0; }
  .tier-overrides-card-list .row-card .head {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .tier-overrides-card-list .row-card .body-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .tier-overrides-card-list .row-card .reason-cell { max-width: none; }
}


/* ============================================================
 * Incidents (super-admin)
 * ============================================================ */
.inc-banner {
  background: linear-gradient(135deg, #dcfce7 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-block-end: 20px;
}
.inc-banner.warn {
  background: linear-gradient(135deg, #fef3c7 0%, #fef3c7 100%);
  border-color: #fde68a;
}
.inc-banner.warn .inc-banner-icon { background: #b45309; }
.inc-banner.warn .inc-banner-text h2 { color: #b45309; }
.inc-banner.crit {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #fca5a5;
}
.inc-banner.crit .inc-banner-icon { background: #b91c1c; }
.inc-banner.crit .inc-banner-text h2 { color: #b91c1c; }
.inc-banner-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #16a34a;
  color: white;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.inc-banner-icon svg { width: 28px; height: 28px; }
.inc-banner-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.inc-banner-text h2 {
  font-size: 20px;
  font-weight: 600;
  color: #16a34a;
}
.inc-banner-text p {
  font-size: 13px;
  color: var(--color-text-secondary);
}
.inc-banner-meta {
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  text-align: end;
  flex-shrink: 0;
}
.inc-banner-meta .v {
  font-size: 14px;
  color: var(--color-text-primary);
  font-weight: 600;
  display: block;
  margin-block-start: 2px;
}
@media (max-width: 700px) {
  .inc-banner { flex-wrap: wrap; padding: 16px; }
  .inc-banner-meta { margin-inline-start: 0; text-align: start; width: 100%; }
}

/* Severity legend */
.sev-legend {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  margin-block-end: 16px;
  flex-wrap: wrap;
  font-size: 11px;
}
.sev-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-secondary);
}
.sev-pill-mini {
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}
.sev-pill-mini.p0 { background: #7f1d1d; color: white; }
.sev-pill-mini.p1 { background: #fee2e2; color: #b91c1c; }
.sev-pill-mini.p2 { background: #fef3c7; color: #b45309; }
.sev-pill-mini.p3 { background: #dbeafe; color: #1d4ed8; }

/* Section header */
.inc-section { margin-block-end: 20px; }
.inc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 12px;
  flex-wrap: wrap;
}
.inc-section-head h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}

/* List + row */
.inc-list {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.inc-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 16px;
  padding: 16px 20px;
  border-block-start: 1px solid var(--border-warm-subtle);
  align-items: flex-start;
  transition: background 120ms;
}
.inc-row:first-child { border-block-start: none; }
.inc-row:hover { background: var(--surface-warm); }

.inc-sev {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.sev-pill {
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 100%;
  text-align: center;
}
.sev-pill.p0 { background: #7f1d1d; color: white; }
.sev-pill.p1 { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.sev-pill.p2 { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.sev-pill.p3 { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }

.inc-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}
.inc-status.resolved { color: #16a34a; }
.inc-status.ongoing { color: #b45309; }
.inc-status.investigating { color: #1d4ed8; }

.inc-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.inc-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.inc-summary {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.inc-meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  flex-wrap: wrap;
}
.inc-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.inc-meta .crit { color: #b91c1c; font-weight: 600; }
.inc-meta strong {
  color: var(--color-text-primary);
  font-weight: 500;
}

.inc-services {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-block-start: 4px;
}
.inc-service-chip {
  padding: 2px 8px;
  background: var(--surface-warm-alt);
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
}

.inc-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.inc-time {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.inc-action-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-brand-primary);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.inc-action-link:hover { background: var(--brand-tint); }
.inc-action-link.warn { color: #b45309; }
.inc-action-link.warn:hover { background: #fef3c7; }
.inc-action-link svg { width: 12px; height: 12px; }

@media (max-width: 700px) {
  .inc-row {
    grid-template-columns: 70px 1fr;
    grid-template-areas: "sev body" "sev actions";
    row-gap: 8px;
  }
  .inc-row .inc-sev { grid-area: sev; }
  .inc-row .inc-body { grid-area: body; }
  .inc-row .inc-actions {
    grid-area: actions;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
  }
  .inc-meta { gap: 8px; }
}

/* Empty state */
.inc-empty {
  background: var(--color-surface);
  border: 1px dashed var(--border-warm-subtle);
  border-radius: 12px;
  padding: 48px 32px;
  text-align: center;
}
.inc-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}
.inc-empty-icon svg { width: 32px; height: 32px; }
.inc-empty h3 {
  font-size: 16px;
  font-weight: 600;
  color: #16a34a;
  margin-block-end: 4px;
}
.inc-empty p {
  font-size: 13px;
  color: var(--color-text-secondary);
}


/* ============================================================
 * System settings (super-admin) — sticky tab rail + 7 panels
 * ============================================================ */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .settings-layout { grid-template-columns: 1fr; }
}

.settings-tabs {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 8px;
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
@media (max-width: 1100px) {
  .settings-tabs {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
}
.settings-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all 120ms;
  text-align: start;
  position: relative;
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.settings-tab:hover {
  background: var(--surface-warm-alt);
  color: var(--color-text-primary);
}
.settings-tab.active {
  background: var(--brand-tint);
  color: var(--color-brand-primary);
}
.settings-tab.active::before {
  content: "";
  position: absolute;
  inset-inline-start: -3px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--color-brand-primary);
  border-radius: 0 2px 2px 0;
}
.settings-tab svg { width: 16px; height: 16px; flex-shrink: 0; }
.settings-tab .tab-meta {
  margin-inline-start: auto;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  background: var(--surface-warm-alt);
  padding: 1px 6px;
  border-radius: 4px;
}
.settings-tab.active .tab-meta {
  background: var(--color-brand-primary);
  color: white;
}

/* Settings panel container */
.settings-panel {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.panel-head {
  padding: 20px 24px;
  border-block-end: 1px solid var(--border-warm-subtle);
  background: var(--surface-warm);
}
.panel-head h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-block-end: 4px;
}
.panel-head p {
  font-size: 13px;
  color: var(--color-text-secondary);
}
.panel-body { padding: 24px; }

/* Form section */
.form-section {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding-block: 20px;
  border-block-start: 1px solid var(--border-warm-subtle);
}
.form-section:first-child {
  padding-block-start: 0;
  border-block-start: none;
}
@media (max-width: 800px) {
  .form-section {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
.section-head h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-block-end: 4px;
}
.section-head p {
  font-size: 12px;
  color: var(--color-text-tertiary);
  line-height: 1.5;
}
.section-head .badge-info {
  display: inline-block;
  margin-block-start: 8px;
  padding: 2px 8px;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.section-head .badge-info.danger {
  background: #fee2e2;
  color: #b91c1c;
}
.section-head .badge-info.warn {
  background: #fef3c7;
  color: #b45309;
}
.section-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Form controls */
.s-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.s-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.s-field-label .required { color: #b91c1c; }
.s-field-label .lock-icon {
  color: var(--color-text-tertiary);
  width: 12px;
  height: 12px;
}
.s-field-hint {
  font-size: 11px;
  color: var(--color-text-tertiary);
  line-height: 1.4;
}

.s-input {
  padding: 9px 12px;
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  font-size: 13px;
  background: var(--color-surface);
  transition: all 120ms;
  width: 100%;
  color: var(--color-text-primary);
}
.s-input:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.s-input.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}
.s-input.locked {
  background: var(--surface-warm-alt);
  color: var(--color-text-secondary);
  cursor: not-allowed;
}
textarea.s-input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}
select.s-input {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238C8C8C' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-inline-end: 32px;
}
:root[dir="rtl"] select.s-input {
  background-position: left 10px center;
  padding-inline-end: 12px;
  padding-inline-start: 32px;
}

/* Toggle switch row */
.toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}
.toggle-row + .toggle-row {
  border-block-start: 1px solid var(--border-warm-subtle);
}
.toggle-row-text { flex: 1; min-width: 0; }
.toggle-row-text h4 {
  font-size: 13px;
  font-weight: 500;
  margin-block-end: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.toggle-row-text p {
  font-size: 11px;
  color: var(--color-text-tertiary);
  line-height: 1.4;
}
.toggle-row-text .pill {
  font-size: 10px;
  padding: 1px 6px;
}
.s-toggle {
  width: 36px;
  height: 20px;
  background: var(--border-warm-subtle);
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background 120ms;
  flex-shrink: 0;
  margin-block-start: 2px;
  border: 0;
  padding: 0;
}
.s-toggle::after {
  content: "";
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  transition: all 120ms;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.s-toggle.on { background: var(--color-brand-primary); }
.s-toggle.on::after { inset-inline-start: 18px; }
.s-toggle.locked { opacity: 0.5; cursor: not-allowed; }

.field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .field-grid-2,
  .field-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Sticky save bar */
.save-bar {
  position: sticky;
  bottom: 0;
  background: var(--color-surface);
  border-block-start: 1px solid var(--border-warm-subtle);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 -4px 6px -1px rgba(20, 30, 25, 0.05);
  z-index: 5;
}
.save-bar-msg {
  font-size: 12px;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
}
.save-bar-msg.dirty { color: #b45309; }
.save-bar-msg.dirty::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #b45309;
  border-radius: 50%;
}
.save-bar-actions { display: flex; gap: 8px; }

/* Danger zone block */
.danger-zone {
  margin-block-start: 24px;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  background: #fef2f2;
  padding: 16px 20px;
}
.danger-zone h3 {
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-end: 4px;
}
.danger-zone p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-block-end: 12px;
}

/* MFA matrix */
.mfa-matrix {
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.mfa-matrix-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-block-start: 1px solid var(--border-warm-subtle);
  align-items: center;
}
.mfa-matrix-row:first-child { border-block-start: none; }
.mfa-matrix-row .role-name {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mfa-radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mfa-radio {
  padding: 5px 12px;
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 120ms;
  background: transparent;
}
.mfa-radio:hover { background: var(--surface-warm-alt); }
.mfa-radio.selected {
  background: var(--brand-tint);
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
  font-weight: 600;
}
.mfa-radio.danger.selected {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
@media (max-width: 600px) {
  .mfa-matrix-row { grid-template-columns: 1fr; }
}

/* IP list */
.ip-list {
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.ip-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-block-start: 1px solid var(--border-warm-subtle);
  font-size: 12px;
  flex-wrap: wrap;
}
.ip-row:first-child { border-block-start: none; }
.ip-row .cidr {
  font-family: var(--font-mono);
  font-weight: 600;
}
.ip-row .label {
  color: var(--color-text-tertiary);
  flex: 1;
  min-width: 0;
}
.ip-row .remove {
  margin-inline-start: auto;
  color: var(--color-text-tertiary);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.ip-row .remove:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.ip-row .remove svg { width: 12px; height: 12px; }

/* Integrations list */
.integ-list {
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.integ-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 12px;
  padding: 12px 16px;
  border-block-start: 1px solid var(--border-warm-subtle);
  align-items: center;
}
.integ-row:first-child { border-block-start: none; }
.integ-row:hover { background: var(--surface-warm); }
.integ-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: white;
  font-size: 11px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1f7a4d, #134a2c);
}
.integ-logo.sg { background: linear-gradient(135deg, #1a82e2, #0a4a8a); }
.integ-logo.tw { background: linear-gradient(135deg, #f22f46, #b91c1c); }
.integ-logo.aw { background: linear-gradient(135deg, #ff9900, #c2410c); }
.integ-logo.cf { background: linear-gradient(135deg, #f38020, #c2410c); }
.integ-logo.st { background: linear-gradient(135deg, #635bff, #4c1d95); }
.integ-logo.mp { background: linear-gradient(135deg, #7856ff, #4c1d95); }
.integ-logo.sn { background: linear-gradient(135deg, #362d59, #1e1b4b); }
.integ-logo.gg { background: linear-gradient(135deg, #4285f4, #1a73e8); }
.integ-logo.ms { background: linear-gradient(135deg, #00a4ef, #0078d4); }
.integ-logo.ok { background: linear-gradient(135deg, #007dc1, #003f73); }
.integ-info { min-width: 0; }
.integ-name {
  font-size: 13px;
  font-weight: 600;
}
.integ-meta {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
}
.integ-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}
.integ-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.integ-status.on { background: #dcfce7; color: #16a34a; }
.integ-status.off { background: var(--surface-warm-alt); color: var(--color-text-tertiary); }
.integ-status.warn { background: #fef3c7; color: #b45309; }
@media (max-width: 700px) {
  .integ-row { grid-template-columns: 36px 1fr; row-gap: 6px; }
  .integ-row .integ-status { grid-column: 2 / 3; justify-self: start; }
  .integ-row .btn { grid-column: 2 / 3; justify-self: start; }
}

/* Tier card grid */
.tier-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 1000px) { .tier-card-grid { grid-template-columns: 1fr; } }
.tier-card {
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-surface);
}
.tier-card.business {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #dbeafe 0%, white 30%);
}
.tier-card.enterprise {
  border-color: #fcd34d;
  background: linear-gradient(180deg, #fbf4de 0%, white 30%);
}
.tier-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 4px;
}
.tier-card-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tier-card-price {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  margin-block: 2px;
}
.tier-card-price .unit {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-tertiary);
}
.tier-card-limits {
  font-size: 12px;
  color: var(--color-text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-block-start: 12px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--border-warm-subtle);
  list-style: none;
  padding-inline-start: 0;
}
.tier-card-limits li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.tier-card-limits li::before {
  content: "✓";
  color: #16a34a;
  flex-shrink: 0;
  font-weight: 700;
}
.tier-card-actions {
  margin-block-start: auto;
  padding-block-start: 12px;
  display: flex;
  gap: 8px;
}

/* Feature flag list rows */
.flag-list {
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.flag-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  padding: 12px 16px;
  border-block-start: 1px solid var(--border-warm-subtle);
  align-items: center;
}
.flag-row:first-child { border-block-start: none; }
.flag-row:hover { background: var(--surface-warm); }
.flag-info { min-width: 0; }
.flag-name {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.flag-name code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
  background: var(--surface-warm-alt);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
}
.flag-desc {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
  line-height: 1.4;
}
.flag-rollout {
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: end;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 4px;
}
.flag-rollout.full {
  background: #dcfce7;
  color: #16a34a;
  font-weight: 600;
}
.flag-rollout.partial {
  background: #fef3c7;
  color: #b45309;
  font-weight: 600;
}
.flag-rollout.tier {
  background: #fbf4de;
  color: #8a6d10;
  font-weight: 600;
}
.flag-rollout.beta {
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 600;
}
.flag-rollout.off {
  color: var(--color-text-tertiary);
}
.flag-overrides {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
}
.flag-overrides.has {
  color: #1d4ed8;
  font-weight: 600;
}
@media (max-width: 700px) {
  .flag-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "info toggle"
      "rollout overrides";
    row-gap: 6px;
  }
  .flag-row .flag-info { grid-area: info; }
  .flag-row .s-toggle { grid-area: toggle; }
  .flag-row .flag-rollout { grid-area: rollout; text-align: start; }
  .flag-row .flag-overrides { grid-area: overrides; text-align: end; }
}

/* Vendor + template list reuse */
.vendor-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (max-width: 700px) { .vendor-list { grid-template-columns: 1fr; } }
.vendor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  font-size: 12px;
}
.vendor-row .vendor-name { font-weight: 600; }
.vendor-row .vendor-role {
  color: var(--color-text-tertiary);
  font-size: 11px;
}
.vendor-row .vendor-dpa { margin-inline-start: auto; }


/* ============================================================
 * Corp-admin Employees (M06)
 * ============================================================ */
.seat-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 12px 16px;
  margin-block-end: 16px;
  font-size: 12px;
  flex-wrap: wrap;
}
.seat-bar-label { font-weight: 600; }
.seat-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface-warm-alt);
  border-radius: 9999px;
  overflow: hidden;
  max-width: 320px;
  min-width: 120px;
}
.seat-bar-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--color-brand-primary),
    #186139
  );
  border-radius: 9999px;
  transition: width 200ms;
}
.seat-bar-fill.warn { background: linear-gradient(90deg, #b45309, #92400e); }
.seat-bar-fill.crit { background: linear-gradient(90deg, #b91c1c, #7f1d1d); }
.seat-bar-meta {
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  font-size: 11px;
}

/* Department chips — use the same logical-property accents as
 * super-admin's tenant-mark family. */
.dept-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.dept-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.dept-chip.eng { background: rgba(124, 58, 237, 0.08); color: #6d28d9; }
.dept-chip.mkt { background: rgba(225, 29, 72, 0.08); color: #be185d; }
.dept-chip.sales { background: rgba(37, 99, 235, 0.08); color: #1e3a8a; }
.dept-chip.ops { background: rgba(31, 122, 77, 0.08); color: var(--color-brand-primary); }
.dept-chip.fin { background: rgba(217, 119, 6, 0.08); color: #92400e; }
.dept-chip.hr { background: rgba(13, 148, 136, 0.08); color: #115e59; }
.dept-chip.legal { background: rgba(71, 85, 105, 0.08); color: #1e293b; }
.dept-chip.cs { background: rgba(251, 146, 60, 0.08); color: #c2410c; }
.dept-chip.other {
  background: var(--surface-warm-alt);
  color: var(--color-text-secondary);
}

/* Employee avatar variants */
.emp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d8b5c, #1f7a4d);
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.emp-avatar.alt-1 { background: linear-gradient(135deg, #fb923c, #c2410c); }
.emp-avatar.alt-2 { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.emp-avatar.alt-3 { background: linear-gradient(135deg, #34d399, #047857); }
.emp-avatar.alt-4 { background: linear-gradient(135deg, #f472b6, #be185d); }
.emp-avatar.alt-5 { background: linear-gradient(135deg, #60a5fa, #1e3a8a); }
.emp-avatar.alt-6 { background: linear-gradient(135deg, #fbbf24, #92400e); }
.emp-avatar.alt-7 { background: linear-gradient(135deg, #2dd4bf, #115e59); }
.emp-avatar.alt-8 { background: linear-gradient(135deg, #f87171, #991b1b); }
.emp-avatar.pending {
  background: var(--surface-warm-alt);
  color: var(--color-text-tertiary);
  border: 1px dashed var(--border-warm-subtle);
}
.emp-avatar.suspended { filter: grayscale(1); opacity: 0.5; }

.emp-cell { display: flex; align-items: center; gap: 12px; }
.emp-name {
  font-weight: 600;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
}
.emp-name .you-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--brand-tint);
  color: var(--color-brand-primary);
  padding: 1px 6px;
  border-radius: 4px;
}
.emp-meta {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
  font-family: var(--font-mono);
}

/* Profile-status pills */
.profile-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.profile-status .ind {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.profile-status.complete { color: #16a34a; }
.profile-status.complete .ind { background: #16a34a; }
.profile-status.incomplete { color: #b45309; }
.profile-status.incomplete .ind { background: #b45309; }
.profile-status.pending { color: #1d4ed8; }
.profile-status.pending .ind { background: #1d4ed8; }
.profile-status.invited { color: var(--color-text-tertiary); }
.profile-status.invited .ind {
  background: var(--color-text-tertiary);
  border: 1px dashed var(--border-warm-subtle);
}
.profile-status-bar {
  width: 60px;
  height: 4px;
  background: var(--surface-warm-alt);
  border-radius: 9999px;
  overflow: hidden;
  margin-block-start: 3px;
}
.profile-status-bar > span {
  display: block;
  height: 100%;
  background: #16a34a;
  border-radius: 9999px;
}
.profile-status-bar > span.warn { background: #b45309; }

/* Role badge */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}
.role-badge.employee {
  background: var(--surface-warm-alt);
  color: var(--color-text-secondary);
}
.role-badge.admin {
  background: #fbf4de;
  color: #8a6d10;
}
.role-badge svg { width: 11px; height: 11px; }

/* Bulk action bar */
.bulk-bar {
  background: var(--color-text-primary);
  color: white;
  border-radius: 12px;
  padding: 12px 16px;
  margin-block-end: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}
.bulk-bar-count { font-size: 13px; font-weight: 600; }
.bulk-bar-count .num {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.15);
  padding: 1px 8px;
  border-radius: 4px;
  margin-inline-end: 4px;
}
.bulk-bar-actions {
  display: flex;
  gap: 8px;
  margin-inline-start: auto;
  flex-wrap: wrap;
}
.bulk-action-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bulk-action-btn:hover { background: rgba(255, 255, 255, 0.2); }
.bulk-action-btn svg { width: 12px; height: 12px; }
.bulk-action-btn.danger { color: #fca5a5; }
.bulk-action-btn.danger:hover { background: rgba(252, 165, 165, 0.15); }

/* Suspended row visual */
.app .t-table tbody tr.is-suspended { opacity: 0.55; }

/* ============================================================
 * Employee detail page
 * ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-block-end: 12px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--color-text-secondary);
}
.breadcrumb a:hover { color: var(--color-text-primary); }
.breadcrumb svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.breadcrumb .current {
  color: var(--color-text-primary);
  font-weight: 500;
}

.emp-header {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-block-end: 16px;
  flex-wrap: wrap;
}
.emp-h-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #be185d);
  color: white;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 600;
  flex-shrink: 0;
}
.emp-h-body { flex: 1; min-width: 0; }
.emp-h-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex-wrap: wrap;
}
.emp-h-name-ar {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-block-start: 4px;
}
.emp-h-title {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-block-start: 6px;
  line-height: 1.4;
}
.emp-h-meta {
  display: flex;
  gap: 16px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  margin-block-start: 12px;
  flex-wrap: wrap;
}
.emp-h-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.emp-h-meta svg { width: 12px; height: 12px; }
.emp-h-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pending-notice {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-block-end: 16px;
  flex-wrap: wrap;
}
.pending-notice-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1d4ed8;
  color: white;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.pending-notice-icon svg { width: 18px; height: 18px; }
.pending-notice-body { flex: 1; min-width: 0; font-size: 13px; }
.pending-notice-body .diff {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  margin-block-start: 4px;
  flex-wrap: wrap;
}
.pending-notice-body .diff code {
  background: var(--surface-warm-alt);
  padding: 1px 6px;
  border-radius: 4px;
}
.pending-notice-body .diff .from {
  background: #fee2e2;
  color: #b91c1c;
  padding: 2px 6px;
  border-radius: 4px;
  text-decoration: line-through;
}
.pending-notice-body .diff .to {
  background: #dcfce7;
  color: #16a34a;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.pending-notice-body .diff .arrow {
  color: var(--color-text-tertiary);
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .detail-layout { grid-template-columns: 1fr; }
}

.tabs-bar {
  display: flex;
  gap: 4px;
  border-block-end: 1px solid var(--border-warm-subtle);
  margin-block-end: 16px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: 0;
  border-block-end: 2px solid transparent;
  margin-block-end: -1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--color-text-primary); }
.tab-btn.active {
  color: var(--color-brand-primary);
  border-block-end-color: var(--color-brand-primary);
  font-weight: 600;
}
.tab-btn .count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-tertiary);
  background: var(--surface-warm-alt);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Activity timeline */
.timeline {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.timeline-day-head {
  padding: 10px 20px;
  background: var(--surface-warm);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-block-end: 1px solid var(--border-warm-subtle);
}
.timeline-event {
  display: grid;
  grid-template-columns: 60px 32px 1fr auto;
  gap: 12px;
  padding: 12px 20px;
  border-block-end: 1px solid var(--border-warm-subtle);
  align-items: flex-start;
}
.timeline-event:last-child { border-block-end: 0; }
.timeline-event:hover { background: var(--surface-warm); }
.timeline-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
  padding-block-start: 6px;
  white-space: nowrap;
}
.timeline-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-warm-alt);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}
.timeline-icon svg { width: 16px; height: 16px; }
.timeline-icon.crit { background: #fee2e2; color: #b91c1c; }
.timeline-icon.warn { background: #fef3c7; color: #b45309; }
.timeline-icon.info { background: #dbeafe; color: #1d4ed8; }
.timeline-icon.ok { background: #dcfce7; color: #16a34a; }
.timeline-icon.brand {
  background: var(--brand-tint);
  color: var(--color-brand-primary);
}
.timeline-body {
  font-size: 13px;
  line-height: 1.4;
  padding-block-start: 6px;
  word-break: break-word;
}
.timeline-body .detail {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 4px;
  font-family: var(--font-mono);
}
.timeline-pill {
  padding-block-start: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
@media (max-width: 700px) {
  .timeline-event {
    grid-template-columns: 32px 1fr;
    grid-template-areas: "icon time" "icon body" "icon pill";
    -moz-column-gap: 12px;
         column-gap: 12px;
    row-gap: 4px;
  }
  .timeline-event .timeline-time { grid-area: time; padding-block-start: 0; }
  .timeline-event .timeline-icon { grid-area: icon; }
  .timeline-event .timeline-body { grid-area: body; padding-block-start: 0; }
  .timeline-event .timeline-pill {
    grid-area: pill;
    justify-content: flex-start;
    padding-block-start: 0;
  }
}

/* Profile preview card */
.preview-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-block-end: 16px;
}
.preview-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.preview-mini-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f472b6, #be185d);
  color: white;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 600;
  margin-block-end: 8px;
}
.preview-mini-name {
  font-size: 15px;
  font-weight: 600;
}
.preview-mini-title {
  font-size: 12px;
  color: var(--color-text-secondary);
}
.preview-mini-co {
  font-size: 11px;
  color: var(--color-text-tertiary);
}
.preview-url {
  margin-block-start: 14px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--border-warm-subtle);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-brand-primary);
  font-family: var(--font-mono);
  word-break: break-all;
  justify-content: center;
}
.preview-url svg { width: 12px; height: 12px; flex-shrink: 0; }
.preview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-block-start: 14px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--border-warm-subtle);
}
.preview-stat-num {
  display: block;
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.preview-stat-label {
  font-size: 11px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Admin actions card */
.actions-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.actions-head {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  border-block-end: 1px solid var(--border-warm-subtle);
  background: var(--surface-warm);
}
.actions-section {
  padding: 12px;
  border-block-end: 1px solid var(--border-warm-subtle);
}
.actions-section:last-child { border-block-end: 0; }
.actions-section-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  padding-inline: 4px;
  margin-block-end: 6px;
}
.action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-text-primary);
  width: 100%;
  text-align: start;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.action-item:hover { background: var(--surface-warm-alt); }
.action-item svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}
.action-item.primary { color: var(--color-brand-primary); font-weight: 500; }
.action-item.primary svg { color: var(--color-brand-primary); }
.action-item.warn { color: #b45309; }
.action-item.warn svg { color: #b45309; }
.action-item.danger { color: #b91c1c; }
.action-item.danger svg { color: #b91c1c; }
.action-item.danger:hover { background: #fee2e2; }
.action-item:disabled { opacity: 0.5; cursor: not-allowed; }

.action-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}
.action-select-label {
  font-size: 11px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}
.action-select select {
  flex: 1;
  border: 1px solid var(--border-warm-subtle);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  background: var(--color-surface);
}


/* ============================================================
 * Corp-admin Departments & Groups (M05)
 * ============================================================ */
.view-tabs {
  display: flex;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
  margin-block-end: 16px;
  width: -moz-fit-content;
  width: fit-content;
}
.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.view-tab:hover { color: var(--color-text-primary); }
.view-tab.active {
  background: var(--color-text-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.view-tab svg { width: 14px; height: 14px; }
.view-tab .count {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-warm-alt);
  color: var(--color-text-tertiary);
  padding: 1px 6px;
  border-radius: 4px;
}
.view-tab.active .count {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* Department list */
.dept-list {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.dept-list-head {
  display: grid;
  grid-template-columns: 1fr 100px 120px 200px 100px 40px;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface-warm);
  border-block-end: 1px solid var(--border-warm-subtle);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}
.dept-list-head .num { text-align: end; }
@media (max-width: 900px) {
  .dept-list-head { grid-template-columns: 1fr 80px 40px; }
  .dept-list-head > :nth-child(n+3):not(:last-child) { display: none; }
}
.dept-row {
  display: grid;
  grid-template-columns: 1fr 100px 120px 200px 100px 40px;
  gap: 12px;
  padding: 12px 20px;
  border-block-end: 1px solid var(--border-warm-subtle);
  align-items: center;
  position: relative;
}
.dept-row:last-child { border-block-end: none; }
.dept-row:hover { background: var(--surface-warm); }
@media (max-width: 900px) {
  .dept-row { grid-template-columns: 1fr 80px 40px; }
  .dept-row > :nth-child(n+3):not(:last-child):not(:nth-child(2)) {
    display: none;
  }
}
.dept-row.has-accent { padding-inline-start: calc(20px + 4px); }
.dept-row.has-accent::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 2px 2px 0;
  background: var(--accent, var(--color-brand-primary));
}
.dept-row.depth-1 .dept-name-cell { padding-inline-start: 28px; }
.dept-row.depth-2 .dept-name-cell { padding-inline-start: 56px; }
.dept-row.depth-3 .dept-name-cell { padding-inline-start: 84px; }
.dept-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  min-width: 0;
}
.dept-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-tint);
  color: var(--color-brand-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.dept-icon svg { width: 16px; height: 16px; }
.dept-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dept-name-ar {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
  font-weight: 400;
}
.dept-tags { display: flex; gap: 4px; }
.dept-tag {
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface-warm-alt);
  color: var(--color-text-tertiary);
}
.dept-tag.brand { background: #fbf4de; color: #8a6d10; }
.dept-tag.root { background: #dbeafe; color: #1d4ed8; }
.dept-count {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: end;
  font-size: 13px;
}
.dept-count .label {
  font-size: 10px;
  color: var(--color-text-tertiary);
  display: block;
  margin-block-start: 2px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dept-manager {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  min-width: 0;
}
.dept-manager-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  background: linear-gradient(135deg, #a78bfa, #6d28d9);
}
.dept-manager-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dept-manager-empty {
  color: var(--color-text-tertiary);
  font-style: italic;
  font-size: 12px;
}

/* Org chart */
.org-chart-wrap {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 32px 24px;
  overflow-x: auto;
}
.org-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  min-width: 920px;
}
.org-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.org-node {
  background: var(--color-surface);
  border: 1.5px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 12px 16px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all 120ms;
}
.org-node:hover {
  border-color: var(--color-brand-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.org-node.root {
  border-color: var(--color-brand-primary);
  background: var(--brand-tint);
}
.org-node.has-accent {
  border-block-start-width: 4px;
  border-block-start-color: var(--accent, var(--color-brand-primary));
}
.org-node-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--brand-tint);
  color: var(--color-brand-primary);
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
}
.org-node-icon svg { width: 18px; height: 18px; }
.org-node-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.org-node-count {
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  margin-block-start: 4px;
  display: inline-block;
  padding: 2px 8px;
  background: var(--surface-warm-alt);
  border-radius: 9999px;
}
.org-children {
  margin-block-start: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  position: relative;
}
.org-children::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 50%;
  width: 2px;
  height: 16px;
  background: var(--border-warm-subtle);
}
.org-child-node {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.org-child-node:hover {
  border-color: var(--color-brand-primary);
  box-shadow: var(--shadow-sm);
}
.org-child-node .name { font-weight: 500; }
.org-child-node .count {
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  font-size: 11px;
}
.org-child-node.has-accent {
  border-inline-start: 3px solid var(--accent, var(--color-brand-primary));
}
.org-empty {
  font-size: 11px;
  color: var(--color-text-tertiary);
  text-align: center;
  font-style: italic;
  padding: 8px;
}

/* Groups grid */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.group-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.group-card:hover {
  border-color: var(--color-brand-primary);
  box-shadow: var(--shadow-md);
}
.group-card.archived { opacity: 0.7; border-style: dashed; }
.group-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.group-color-dot {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(99, 102, 241, 0.15);
}
.group-color-dot::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #6366f1;
}
.group-color-dot.indigo { background: rgba(99, 102, 241, 0.15); }
.group-color-dot.indigo::after { background: #6366f1; }
.group-color-dot.blue { background: rgba(37, 99, 235, 0.15); }
.group-color-dot.blue::after { background: #2563eb; }
.group-color-dot.green { background: rgba(22, 163, 74, 0.15); }
.group-color-dot.green::after { background: #16a34a; }
.group-color-dot.orange { background: rgba(251, 146, 60, 0.15); }
.group-color-dot.orange::after { background: #fb923c; }
.group-color-dot.gold { background: rgba(201, 162, 39, 0.15); }
.group-color-dot.gold::after { background: #c9a227; }
.group-color-dot.gray { background: rgba(100, 116, 139, 0.15); }
.group-color-dot.gray::after { background: #64748b; }
.group-color-dot.red { background: rgba(220, 38, 38, 0.15); }
.group-color-dot.red::after { background: #dc2626; }
.group-color-dot.teal { background: rgba(13, 148, 136, 0.15); }
.group-color-dot.teal::after { background: #0d9488; }
.group-card-body { flex: 1; min-width: 0; }
.group-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.group-name-ar {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
}
.group-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-block-start: 8px;
  line-height: 1.4;
}
.group-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--border-warm-subtle);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}

/* Color picker grid (used in new-dept + new-group modals) */
.color-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.color-option {
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 120ms;
  position: relative;
}
.color-option:hover { transform: scale(1.1); }
.color-option.selected { border-color: var(--color-text-primary); }
.color-option.selected::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / contain no-repeat;
}


/* Lang toggle (small, in topbar) */
.app .lang-toggle {
  display: flex;
  background: var(--surface-warm-alt);
  border-radius: 9999px;
  padding: 3px;
}
.app .lang-toggle button {
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: 9999px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.app .lang-toggle button[aria-pressed="true"] {
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
}


/* ============================================================
 * M01 Authentication — design system surface.
 *
 * Mirrors the reference HTML at
 * `designs/screen-references/TapRabt Auth _standalone_.html`
 * (decoded asset 109e0f09... + e27b83fc...).
 *
 * All values flow from the design tokens above so a token edit
 * propagates here automatically.
 * ============================================================ */

/* Brand — the "TR" pill + wordmark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--color-brand);
  text-decoration: none;
}
.brand-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-brand-light);
  color: var(--color-brand);
  border: 1px solid color-mix(in srgb, var(--color-brand) 18%, transparent);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

/* ---------- Split shell (form + brand aside) ---------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--color-surface-raised);
}
@media (min-width: 980px) {
  .auth-page { grid-template-columns: 5fr 7fr; }
  /* Brand aside is on the start edge in both directions, so the
   * `5fr` column comes first in document order. RTL flips the
   * visual layout automatically. */
}

.auth-aside {
  background:
    radial-gradient(1200px 600px at -10% 110%, rgba(201, 162, 39, 0.10), transparent 60%),
    radial-gradient(900px 500px at 110% -10%, rgba(31, 122, 77, 0.18), transparent 55%),
    linear-gradient(180deg, #16593a 0%, #1f7a4d 100%);
  color: var(--color-text-inverse);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
  overflow: hidden;
}
@media (min-width: 980px) {
  .auth-aside { padding: 48px 56px; min-height: 100vh; }
}
.auth-aside .brand { color: var(--color-text-inverse); }
.auth-aside .brand-glyph {
  background: rgba(255, 255, 255, 0.16);
  color: var(--color-text-inverse);
  border-color: rgba(255, 255, 255, 0.18);
}
.aside-headline {
  margin-top: auto;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: 24ch;
}
.aside-headline .accent { color: var(--color-accent-light); }
.aside-sub {
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  max-width: 38ch;
  margin-top: 12px;
  line-height: 1.55;
}
.aside-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 28px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}
.aside-meta span { display: inline-flex; align-items: center; gap: 8px; }
.aside-meta .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-accent-light);
}
.aside-decor {
  position: absolute;
  inset: auto -120px -180px auto;
  width: 480px;
  height: 480px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  pointer-events: none;
}
.aside-decor::after {
  content: "";
  position: absolute;
  inset: 60px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
[dir="rtl"] .aside-decor {
  inset: auto auto -180px -120px;
}

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 24px;
}
@media (min-width: 980px) { .auth-main { padding: 48px; } }

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 32px;
  font-size: 14px;
  color: var(--color-text-secondary);
}
.auth-topbar .muted-link { color: var(--color-text-secondary); }
.auth-topbar .muted-link:hover { color: var(--color-text-primary); }

.auth-card {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-card.wide { max-width: 600px; }

.auth-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand);
  font-weight: 500;
}
[lang="ar"] .auth-eyebrow { letter-spacing: 0; text-transform: none; }
.auth-h1 {
  margin: 6px 0 8px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--color-text-primary);
}
.auth-sub {
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 28px;
}
.auth-foot {
  margin-top: 28px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-secondary);
}
.auth-foot a { font-weight: 500; }
.legal-foot {
  margin-top: 36px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.legal-foot-made {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- Field row layout ---------- */
.field-row { display: grid; gap: 14px; }
.field-row.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .field-row.cols-2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.field-label .hint {
  font-weight: 400;
  color: var(--color-text-tertiary);
  font-size: 12px;
}

/* ---------- Inputs ---------- */
.input,
.select,
.textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::-moz-placeholder { color: var(--color-text-tertiary); }
.input::placeholder { color: var(--color-text-tertiary); }
.input:hover,
.select:hover { border-color: var(--color-text-tertiary); }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.15);
}
.textarea {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}
.input-group { position: relative; }
.input-group .input { padding-inline-end: 44px; }
.input-trail {
  position: absolute;
  inset-inline-end: 4px;
  inset-block: 4px;
  width: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: var(--color-text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.input-trail:hover {
  color: var(--color-text-secondary);
  background: var(--color-surface-alt);
}
.field-help { font-size: 12px; color: var(--color-text-tertiary); }
.field-error {
  font-size: 12px;
  color: var(--color-error);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-error::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--color-error);
}
.field.has-error .input { border-color: var(--color-error); }
.field.has-error .input:focus {
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.12);
}

/* ---------- Checkbox row ---------- */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text-secondary);
  cursor: pointer;
  line-height: 1.55;
}
.checkbox-row input[type="checkbox"] {
  accent-color: var(--color-brand);
  margin-top: 3px;
}
.checkbox-row a { color: var(--color-brand); }

/* ---------- Segmented (lang toggle) ---------- */
.seg {
  display: inline-flex;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  font-size: 13px;
  font-weight: 500;
}
.seg button {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}
.seg button[aria-pressed="true"] {
  background: var(--color-surface);
  color: var(--color-brand);
  box-shadow: var(--shadow-sm);
}

/* ---------- Strength meter ---------- */
.strength { display: grid; gap: 6px; margin-top: -2px; }
.strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.strength-bars span {
  height: 4px;
  border-radius: 999px;
  background: var(--color-border-subtle);
  transition: background 0.2s;
}
.strength[data-level="1"] .strength-bars span:nth-child(-n+1) { background: var(--color-error); }
.strength[data-level="2"] .strength-bars span:nth-child(-n+2) { background: var(--color-warning); }
.strength[data-level="3"] .strength-bars span:nth-child(-n+3) { background: #888c33; }
.strength[data-level="4"] .strength-bars span { background: var(--color-success); }
.strength-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-tertiary);
}
.strength-meta strong {
  color: var(--color-text-secondary);
  font-weight: 500;
}
.strength-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
  list-style: none;
  padding: 0;
}
.strength-rules li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.strength-rules li::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  flex: none;
}
.strength-rules li.ok { color: var(--color-success); }
.strength-rules li.ok::before {
  border-color: var(--color-success);
  background: var(--color-success);
  box-shadow:
    inset 0 0 0 2px var(--color-surface),
    inset 0 0 0 12px var(--color-success);
}
@media (max-width: 480px) {
  .strength-rules { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  border: 1.5px solid transparent;
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-primary {
  background: var(--color-brand);
  color: var(--color-text-inverse);
}
.btn-primary:hover {
  background: var(--color-brand-dark);
  color: var(--color-text-inverse);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  background: var(--color-text-disabled);
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-brand);
  border-color: var(--color-brand);
}
.btn-secondary:hover { background: var(--color-brand-light); }
.btn-secondary:disabled {
  color: var(--color-text-disabled);
  border-color: var(--color-border);
  cursor: not-allowed;
}
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.btn-ghost:hover {
  background: var(--color-surface-alt);
  color: var(--color-text-primary);
}
.btn-link {
  background: transparent;
  color: var(--color-brand);
  font-weight: 500;
  height: auto;
  padding: 0;
  border: 0;
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }
.btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.btn-row.center { justify-content: center; }

/* ---------- Divider ---------- */
.divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
  font-size: 12px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
[lang="ar"] .divider { letter-spacing: 0; text-transform: none; }
.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 28px);
  height: 1px;
  background: var(--color-border-subtle);
}
.divider::before { inset-inline-start: 0; }
.divider::after { inset-inline-end: 0; }

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  border: 1px solid transparent;
  margin-bottom: 18px;
  line-height: 1.45;
}
.alert .alert-ico {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.alert .alert-title { font-weight: 600; margin-bottom: 2px; }
.alert .alert-body { color: inherit; opacity: 0.9; }
.alert-info {
  background: var(--color-info-light);
  color: var(--color-info);
  border-color: rgba(26, 77, 128, 0.18);
}
.alert-success {
  background: var(--color-success-light);
  color: var(--color-success);
  border-color: rgba(19, 115, 51, 0.18);
}
.alert-warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
  border-color: rgba(184, 92, 0, 0.18);
}
.alert-error {
  background: var(--color-error-light);
  color: var(--color-error);
  border-color: rgba(179, 38, 30, 0.18);
}
.alert a { color: inherit; text-decoration: underline; font-weight: 500; }

/* ---------- Icon hero (verify, success, etc.) ---------- */
.icon-hero {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  display: grid;
  place-items: center;
  background: var(--color-brand-light);
  color: var(--color-brand);
  margin-bottom: 20px;
}
.icon-hero.warn {
  background: var(--color-warning-light);
  color: var(--color-warning);
}
.icon-hero.error {
  background: var(--color-error-light);
  color: var(--color-error);
}
.icon-hero.success {
  background: var(--color-success-light);
  color: var(--color-success);
}

/* ---------- OTP / TOTP code input ---------- */
.otp {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 12px 0 8px;
}
.otp input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  caret-color: var(--color-brand);
}
.otp input:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.15);
}
@media (max-width: 480px) {
  .otp { gap: 6px; }
  .otp input { width: 44px; height: 52px; font-size: 20px; }
}
.otp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Card (used inside auth shell) ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-h {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}
.card-sub {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}
.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border-subtle);
}
.card-row:first-child { border-top: 0; padding-top: 0; }
.card-row .grow { flex: 1; min-width: 0; }
.card-row .label { font-size: 13px; color: var(--color-text-tertiary); }
.card-row .value { font-size: 15px; color: var(--color-text-primary); }

/* ---------- Inline mono helper ---------- */
.mono { font-family: var(--font-mono); }

/* ---------- The brand-aside avoids touching mobile content height ---------- */
@media (max-width: 979px) {
  .auth-aside {
    min-height: auto;
    padding-block: 28px;
  }
  .aside-headline { font-size: 24px; margin-top: 16px; }
  .aside-decor { display: none; }
}

/* ============================================================
 * Site footer — Muscat Tech Solutions copyright
 * Mounted as the last child of every page's content area so it
 * sits at the bottom of the scroll, not below the viewport.
 * ============================================================ */
.site-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px;
  border-block-start: 1px solid var(--border-warm-subtle);
  background: var(--surface-warm-alt);
  color: var(--color-text-tertiary);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.site-footer .dot {
  color: var(--color-text-tertiary);
  opacity: 0.6;
}
.site-footer.compact {
  padding: 12px 16px;
  border-block-start: none;
  background: transparent;
  font-size: 11px;
}
@media (max-width: 480px) {
  .site-footer {
    padding: 12px 16px;
    font-size: 11px;
  }
}

/* ============================================================
 * /me/profile editor — Individual role (M02)
 * ============================================================ */
.me-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 1100px) {
  .me-profile-grid {
    grid-template-columns: 1fr;
  }
}
.completion-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  margin-block-end: 16px;
}
.completion-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.completion-ring .pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-brand-primary);
}
.completion-body h3 {
  font-size: 14px;
  font-weight: 600;
  margin-block-end: 2px;
}
.completion-body p {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.45;
}
.completion-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-block-start: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-brand-primary);
  background: rgba(31, 122, 77, 0.08);
  padding: 3px 10px;
  border-radius: 999px;
}
.form-section {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 20px;
  margin-block-end: 16px;
}
.form-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 16px;
}
.form-section-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}
.form-section-head .meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}
.section-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
}
.section-icon.tone-brand {
  background: rgba(31, 122, 77, 0.1);
  color: var(--color-brand-primary);
}
.section-icon.tone-info {
  background: #dbeafe;
  color: #1d4ed8;
}
.section-icon.tone-gold {
  background: #fbf4de;
  color: #8a6d10;
}
.section-icon.tone-purple {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}
.section-icon.tone-rose {
  background: rgba(225, 29, 72, 0.12);
  color: #be185d;
}
.form-section-body {
  display: grid;
  gap: 14px;
}
.form-field {
  display: block;
}
.form-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .form-field-row {
    grid-template-columns: 1fr;
  }
}
.field-tag {
  display: inline-block;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-inline-start: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-tag.locked {
  background: #f3f4f6;
  color: #6b7280;
}
.field-tag.approval {
  background: #fbf4de;
  color: #8a6d10;
}
.lang-tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-warm);
  padding: 2px;
  border-radius: 5px;
  margin-inline-start: 8px;
}
.lang-tabs button,
.lang-tabs span {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  background: transparent;
  border: 0;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  cursor: pointer;
}
.lang-tabs [data-active="true"] {
  background: var(--color-surface);
  color: var(--color-brand-primary);
}
.empty-pill {
  font-size: 10px;
  font-family: var(--font-mono);
  color: #8a6d10;
  font-weight: 600;
  background: #fbf4de;
  padding: 2px 7px;
  border-radius: 3px;
  margin-inline-start: 6px;
}
.char-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-tertiary);
}
.slug-url {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-warm);
  padding: 1px 5px;
  border-radius: 3px;
}
.social-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.social-remove {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border-warm-subtle);
  color: var(--color-text-tertiary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
}
.social-remove:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.media-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: flex-start;
}
@media (max-width: 640px) {
  .media-grid {
    grid-template-columns: 1fr;
  }
}
.photo-uploader {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d8b5c, #1f7a4d);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}
.photo-uploader-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}
.photo-uploader:hover .photo-uploader-overlay {
  opacity: 1;
}
.photo-meta {
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 8px;
}
.banner-uploader {
  width: 100%;
  height: 120px;
  border: 2px dashed var(--border-warm-subtle);
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-warm);
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: border-color 0.15s;
  overflow: hidden;
}
.banner-uploader:hover {
  border-color: var(--color-brand-primary);
  color: var(--color-brand-primary);
}
.profile-preview-pane {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.preview-head h3 {
  font-size: 13px;
  font-weight: 600;
}
.preview-lang-toggle {
  display: inline-flex;
  background: var(--surface-warm);
  padding: 2px;
  border-radius: 6px;
  gap: 2px;
}
.preview-lang-toggle button {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  background: transparent;
  border: 0;
  color: var(--color-text-tertiary);
  cursor: pointer;
}
.preview-lang-toggle button[data-active="true"] {
  background: var(--color-surface);
  color: var(--color-brand-primary);
}
.profile-preview-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 14px;
  overflow: hidden;
}
.preview-banner {
  height: 80px;
  background: linear-gradient(
    135deg,
    rgba(31, 122, 77, 0.2),
    rgba(201, 162, 39, 0.2)
  );
}
.preview-body {
  padding: 16px 16px 20px;
  margin-block-start: -32px;
  text-align: center;
}
.preview-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d8b5c, #1f7a4d);
  color: #fff;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 600;
  border: 3px solid var(--color-surface);
  overflow: hidden;
}
.preview-name {
  font-size: 16px;
  font-weight: 600;
}
.preview-job {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-block-start: 2px;
}
.preview-loc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-tertiary);
  margin-block-start: 6px;
}
.preview-bio {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-block-start: 10px;
  max-height: 4lh;
  overflow: hidden;
}
.preview-socials {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-block-start: 12px;
}
.preview-soc-chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-brand-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 600;
}
.preview-foot {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  margin-block-start: 16px;
}
.preview-meta {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}
.preview-meta > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.preview-meta code {
  font-size: 10px;
  color: var(--color-text-primary);
}
.me-profile-savebar {
  position: sticky;
  bottom: 16px;
  margin-block-start: 24px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 30;
}
.me-profile-savebar .summary {
  font-size: 13px;
  color: var(--color-text-secondary);
}
.me-profile-savebar .summary strong {
  color: var(--color-text-primary);
  margin-inline-end: 4px;
}

/* ============================================================
 * /me/settings — Individual role settings (M01 + M21)
 * ============================================================ */
.me-settings-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 900px) {
  .me-settings-grid {
    grid-template-columns: 1fr;
  }
}
.me-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  position: sticky;
  top: 16px;
}
@media (max-width: 900px) {
  .me-settings-nav {
    flex-direction: row;
    overflow-x: auto;
    position: static;
  }
}
.me-settings-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  text-align: start;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 120ms,
    color 120ms;
}
.me-settings-nav button:hover {
  background: var(--surface-warm);
  color: var(--color-text-primary);
}
.me-settings-nav button[data-active="true"] {
  background: rgba(31, 122, 77, 0.1);
  color: var(--color-brand-primary);
  font-weight: 600;
}
.me-settings-nav button[data-tone="danger"]:not([data-active="true"]):hover {
  background: #fef2f2;
  color: #b91c1c;
}
.me-settings-nav button[data-tone="danger"][data-active="true"] {
  background: #fee2e2;
  color: #b91c1c;
}

.me-settings-banner {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-block-end: 16px;
}
.me-settings-banner[data-kind="ok"] {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #065f46;
}
.me-settings-banner[data-kind="err"] {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.settings-panel {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 24px;
  margin-block-end: 16px;
}
.settings-panel[data-tone="danger"] {
  border-color: rgba(185, 28, 28, 0.4);
  background: linear-gradient(
    180deg,
    rgba(254, 226, 226, 0.35),
    var(--color-surface) 80%
  );
}
.settings-panel-head {
  margin-block-end: 20px;
}
.settings-panel-head h2 {
  font-size: 16px;
  font-weight: 600;
  margin-block-end: 2px;
}
.settings-panel-head p {
  font-size: 13px;
  color: var(--color-text-secondary);
}
.settings-panel-body {
  display: grid;
  gap: 14px;
}
.settings-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: flex-start;
  padding-block: 12px;
  border-block-start: 1px solid var(--border-warm-subtle);
}
.settings-row:first-child {
  border-block-start: 0;
  padding-block-start: 0;
}
@media (max-width: 700px) {
  .settings-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
.settings-row-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-row-label strong {
  font-size: 13px;
  font-weight: 600;
}
.settings-row-label span {
  font-size: 12px;
  color: var(--color-text-tertiary);
  line-height: 1.5;
}
.settings-row-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.row-hint {
  font-size: 11px;
  color: var(--color-text-tertiary);
}
.row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.row-meta-text {
  font-size: 12px;
  color: var(--color-text-secondary);
}
.row-error {
  font-size: 12px;
  color: #b91c1c;
}
.row-loading,
.row-empty {
  padding: 32px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 13px;
}
.me-settings-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-warm);
  padding: 4px 10px;
  border-radius: 4px;
  align-self: flex-start;
}

.locale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.locale-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  background: var(--color-surface);
  border: 2px solid var(--border-warm-subtle);
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 120ms,
    border-color 120ms;
}
.locale-card:hover {
  background: var(--surface-warm);
}
.locale-card[data-selected="true"] {
  border-color: var(--color-brand-primary);
  background: rgba(31, 122, 77, 0.06);
}
.locale-card:disabled {
  opacity: 0.6;
  cursor: wait;
}
.locale-flag {
  font-size: 24px;
  line-height: 1;
}
.locale-name {
  font-size: 13px;
  font-weight: 500;
}
.locale-code {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}

.mfa-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: var(--surface-warm);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 10px;
}
.mfa-status-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-block-end: 4px;
}
.mfa-meta {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-block-start: 8px;
}
.mfa-secret {
  background: var(--surface-warm);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  padding: 14px;
  margin-block: 12px;
}
.mfa-secret-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-block-end: 6px;
}
.mfa-secret code {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  word-break: break-all;
}
.mfa-secret-uri {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-block-start: 8px;
  word-break: break-all;
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-warm-subtle);
  border-radius: 10px;
}
.session-row-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.session-row-info strong {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.session-row-info span {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}

.notif-grid {
  display: grid;
  gap: 0;
}
.notif-head {
  display: grid;
  grid-template-columns: 1fr repeat(3, 90px);
  gap: 8px;
  align-items: center;
  padding-block-end: 10px;
  border-block-end: 1px solid var(--border-warm-subtle);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.notif-head > span {
  text-align: center;
}
.notif-head > span:first-child {
  text-align: start;
}
.notif-row {
  display: grid;
  grid-template-columns: 1fr repeat(3, 90px);
  gap: 8px;
  align-items: center;
  padding-block: 14px;
  border-block-end: 1px solid var(--border-warm-subtle);
}
.notif-row:last-child {
  border-block-end: 0;
}
.notif-row-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.notif-row-label strong {
  font-size: 13px;
}
.notif-row-label span {
  font-size: 11px;
  color: var(--color-text-tertiary);
}
.notif-switch {
  position: relative;
  width: 38px;
  height: 22px;
  margin: 0 auto;
  cursor: pointer;
}
.notif-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.notif-switch span {
  position: absolute;
  inset: 0;
  background: var(--border-warm-subtle);
  border-radius: 11px;
  transition: background 120ms;
}
.notif-switch span::after {
  content: "";
  position: absolute;
  insetBlockStart: 2px;
  insetInlineStart: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 160ms;
}
.notif-switch input:checked + span {
  background: var(--color-brand-primary);
}
.notif-switch input:checked + span::after {
  transform: translateX(16px);
}
:dir(rtl) .notif-switch input:checked + span::after {
  transform: translateX(-16px);
}

.backup-codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 16px;
  background: var(--surface-warm);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 10px;
  margin-block: 12px;
}
.backup-codes code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 6px;
  padding: 6px 10px;
  text-align: center;
  letter-spacing: 0.1em;
}

.modal-sub {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-block-end: 14px;
}
.modal-err {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  margin-block-end: 12px;
}

/* ============================================================
 * /me/leads + /me/analytics — Individual role (Phase 2)
 * ============================================================ */
.me-leads-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-block-end: 16px;
}
@media (max-width: 900px) {
  .me-leads-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .me-leads-kpis {
    grid-template-columns: 1fr;
  }
}
.me-leads-kpis .kpi {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.me-leads-kpis .kpi[data-tone="brand"] {
  border-color: rgba(31, 122, 77, 0.3);
  background: rgba(31, 122, 77, 0.04);
}
.me-leads-kpis .kpi[data-mute="true"] {
  opacity: 0.7;
}
.me-leads-kpis .kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}
.me-leads-kpis .kpi-value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-text-primary);
}
.me-leads-kpis .kpi-delta {
  font-size: 11px;
  font-family: var(--font-mono);
}
.me-leads-kpis .kpi-delta.up {
  color: #16a34a;
}
.me-leads-kpis .kpi-delta.down {
  color: #b91c1c;
}
.me-leads-kpis .kpi-delta.flat {
  color: var(--color-text-tertiary);
}

.me-leads-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-block-end: 16px;
}
.me-leads-chips button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-warm-subtle);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.me-leads-chips button:hover {
  background: var(--surface-warm);
}
.me-leads-chips button[data-active="true"] {
  background: rgba(31, 122, 77, 0.1);
  border-color: rgba(31, 122, 77, 0.4);
  color: var(--color-brand-primary);
  font-weight: 600;
}
.me-leads-chips .chip-count {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-warm);
  border-radius: 999px;
  padding: 1px 7px;
}
.me-leads-chips button[data-active="true"] .chip-count {
  background: var(--color-brand-primary);
  color: #fff;
}
.me-leads-search {
  margin-inline-start: auto;
  width: 240px;
  padding: 6px 12px;
  border: 1px solid var(--border-warm-subtle);
  border-radius: 999px;
  font-size: 13px;
  background: var(--color-surface);
}

.me-leads-grid {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
}
@media (max-width: 1100px) {
  .me-leads-grid {
    grid-template-columns: 1fr;
  }
}
.me-leads-list {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  overflow-y: auto;
}
.lead-row {
  width: 100%;
  text-align: start;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  border-block-end: 1px solid var(--border-warm-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}
.lead-row:hover {
  background: var(--surface-warm);
}
.lead-row[data-active="true"] {
  background: rgba(31, 122, 77, 0.06);
  box-shadow: inset 3px 0 0 var(--color-brand-primary);
}
:dir(rtl) .lead-row[data-active="true"] {
  box-shadow: inset -3px 0 0 var(--color-brand-primary);
}
.lead-row[data-unread="true"] strong::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-brand-primary);
  border-radius: 50%;
  margin-inline-end: 6px;
}
.lead-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.lead-row-head strong {
  font-size: 13px;
  font-weight: 600;
}
.lead-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}
.lead-row-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lead-row-snippet {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.me-leads-detail {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 20px;
  min-height: 320px;
}
.lead-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lead-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-block-end: 14px;
  border-block-end: 1px solid var(--border-warm-subtle);
}
.lead-detail-head strong {
  font-size: 16px;
  font-weight: 600;
  display: block;
}
.lead-detail-head span {
  font-size: 12px;
  color: var(--color-text-secondary);
}
.lead-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.lead-detail-actions .s-input {
  max-width: 200px;
}
.lead-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding-block: 12px;
  border-block-start: 1px solid var(--border-warm-subtle);
  border-block-end: 1px solid var(--border-warm-subtle);
}
.lead-detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lead-detail-row dt {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}
.lead-detail-row dd {
  font-size: 13px;
}
.lead-detail-message,
.lead-detail-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lead-detail-message .label,
.lead-detail-note .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}
.lead-detail-message p {
  background: var(--surface-warm);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  white-space: pre-wrap;
}
.lead-detail-history {
  font-size: 12px;
}
.lead-detail-history summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-secondary);
}
.lead-detail-history ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lead-detail-history li {
  display: flex;
  gap: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}
.lead-detail-history li strong {
  color: var(--color-text-primary);
}
.lead-detail-history .hist-note {
  color: var(--color-text-secondary);
}

/* analytics */
.me-analytics-window {
  display: inline-flex;
  background: var(--surface-warm);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 999px;
  padding: 2px;
}
.me-analytics-window button {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--color-text-tertiary);
  cursor: pointer;
}
.me-analytics-window button[data-active="true"] {
  background: var(--color-surface);
  color: var(--color-brand-primary);
  box-shadow: var(--shadow-sm);
}

.me-analytics-pro-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(
    90deg,
    rgba(201, 162, 39, 0.12),
    rgba(201, 162, 39, 0.04)
  );
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 12px;
  margin-block-end: 16px;
}
.me-analytics-pro-banner svg {
  color: #8a6d10;
  flex-shrink: 0;
}
.me-analytics-pro-banner div {
  flex: 1;
}
.me-analytics-pro-banner strong {
  font-size: 13px;
  display: block;
}
.me-analytics-pro-banner p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-block-start: 2px;
}

.me-analytics-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-block-end: 16px;
}
@media (max-width: 1100px) {
  .me-analytics-charts {
    grid-template-columns: 1fr;
  }
}
.me-analytics-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
}
.me-analytics-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: 12px;
}
.me-analytics-card header h3 {
  font-size: 13px;
  font-weight: 600;
}
.me-analytics-card header span {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}
.me-analytics-chart {
  width: 100%;
}
.me-analytics-chart svg {
  width: 100%;
  height: 180px;
}
.me-analytics-chart .chart-x {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  margin-block-start: 4px;
}

.me-analytics-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.me-analytics-bars li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.me-analytics-bars .bar-label {
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-analytics-bars .bar-fill {
  height: 8px;
  background: var(--color-brand-primary);
  border-radius: 4px;
  min-width: 4px;
}
.me-analytics-bars .bar-count {
  font-family: var(--font-mono);
  text-align: end;
  color: var(--color-text-primary);
}

.quick-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-stats > div {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-family: var(--font-mono);
}
.quick-stats dt {
  color: var(--color-text-tertiary);
}
.quick-stats dd {
  color: var(--color-text-primary);
}

/* ============================================================
 * /me/qr + /me/nfc — Individual role (Phase 3)
 * ============================================================ */
.me-section-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  margin: 24px 0 12px;
}

/* QR */
.me-qr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 1024px) {
  .me-qr-grid {
    grid-template-columns: 1fr;
  }
}
.me-qr-preview {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 24px;
}
.me-qr-preview-frame {
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--surface-warm);
  border-radius: 12px;
  min-height: 400px;
}
.me-qr-preview-frame img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  background: #fff;
}
.me-qr-disabled {
  text-align: center;
  color: var(--color-text-tertiary);
  padding: 32px;
}
.me-qr-disabled strong {
  display: block;
  margin-block: 12px 6px;
  font-size: 15px;
  color: var(--color-text-primary);
}
.me-qr-disabled p {
  font-size: 13px;
}
.me-qr-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-block-start: 20px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--border-warm-subtle);
}
@media (max-width: 700px) {
  .me-qr-meta {
    grid-template-columns: 1fr;
  }
}
.me-qr-meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.me-qr-meta-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}
.me-qr-meta code {
  font-size: 12px;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-qr-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: 16px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--border-warm-subtle);
}
.me-qr-downloads a[data-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.me-qr-controls {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: 16px;
}
.me-qr-controls .control-section {
  padding-block: 12px;
  border-block-end: 1px solid var(--border-warm-subtle);
}
.me-qr-controls .control-section:first-child {
  padding-block-start: 0;
}
.me-qr-controls .control-section:last-child {
  border-block-end: 0;
  padding-block-end: 0;
}
.me-qr-controls h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  margin-block-end: 10px;
}
.control-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.control-chips button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-warm-subtle);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.control-chips button[data-active="true"] {
  background: rgba(31, 122, 77, 0.1);
  border-color: rgba(31, 122, 77, 0.4);
  color: var(--color-brand-primary);
}
.control-colours {
  display: grid;
  gap: 10px;
}
.control-colours label {
  display: block;
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-block-end: 6px;
}
.colour-pair {
  display: flex;
  gap: 6px;
}
.colour-pair input[type="color"] {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-warm-subtle);
  border-radius: 6px;
  padding: 2px;
  background: var(--color-surface);
  cursor: pointer;
}
.colour-pair input[type="text"] {
  flex: 1;
  font-family: var(--font-mono);
}
.control-size {
  display: flex;
  align-items: center;
  gap: 10px;
}
.control-size input[type="range"] {
  flex: 1;
}
.control-size code {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  min-width: 60px;
  text-align: end;
}

/* NFC catalog + orders */
.me-nfc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.me-nfc-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.me-nfc-card-preview {
  aspect-ratio: 16/10;
  background: var(--surface-warm);
  display: grid;
  place-items: center;
  position: relative;
  color: var(--color-text-tertiary);
}
.me-nfc-card-tier {
  position: absolute;
  insetBlockStart: 8px;
  insetInlineEnd: 8px;
}
.me-nfc-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.me-nfc-card-body strong {
  font-size: 14px;
  font-weight: 600;
}
.me-nfc-card-material {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  text-transform: capitalize;
}
.me-nfc-card-body p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-block: 6px;
  flex: 1;
}
.me-nfc-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-start: 8px;
}
.me-nfc-card-price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
}
.me-nfc-card-price small {
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-inline-start: 2px;
}

.me-nfc-orders {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.me-nfc-order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 10px;
}
.me-nfc-order-id {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 4px;
}
.me-nfc-order-id code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-warm);
  padding: 2px 8px;
  border-radius: 4px;
}
.me-nfc-order-meta {
  display: flex;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}
.me-nfc-order-total {
  display: flex;
  align-items: center;
  gap: 12px;
}
.me-nfc-order-total strong {
  font-family: var(--font-mono);
  font-size: 15px;
}
.me-nfc-order-total small {
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-inline-start: 2px;
}

.me-nfc-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface-warm);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  font-size: 13px;
}
.me-nfc-total strong {
  font-family: var(--font-mono);
  font-size: 18px;
}

.me-nfc-review {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.me-nfc-review > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.me-nfc-review strong {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}
.me-nfc-review span {
  font-size: 13px;
  color: var(--color-text-primary);
}

/* ============================================================
 * /me/id-card + /me/wallet — Individual role (Phase 4)
 * ============================================================ */

/* Digital ID card */
.me-idcard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 1100px) {
  .me-idcard-grid {
    grid-template-columns: 1fr;
  }
}
.me-idcard-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-block-end: 12px;
}
.me-idcard-filter button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-warm-subtle);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.me-idcard-filter button[data-active="true"] {
  background: rgba(31, 122, 77, 0.1);
  border-color: rgba(31, 122, 77, 0.4);
  color: var(--color-brand-primary);
  font-weight: 600;
}
.me-idcard-tier-chip {
  margin-inline-start: auto;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
}

.me-idcard-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.me-idcard-design {
  display: flex;
  flex-direction: column;
  text-align: start;
  background: var(--color-surface);
  border: 2px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 120ms, transform 120ms;
}
.me-idcard-design:hover {
  border-color: rgba(31, 122, 77, 0.4);
}
.me-idcard-design[data-selected="true"] {
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.15);
}
.me-idcard-design[data-locked="true"] {
  opacity: 0.65;
  cursor: not-allowed;
}
.me-idcard-design-preview {
  aspect-ratio: 4/5;
  background: var(--surface-warm);
  display: grid;
  place-items: center;
  position: relative;
  color: var(--color-text-tertiary);
}
.me-idcard-design-preview img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}
.me-idcard-design-lock {
  position: absolute;
  insetBlockStart: 8px;
  insetInlineEnd: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.me-idcard-design-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.me-idcard-design-body strong {
  font-size: 13px;
  font-weight: 600;
}
.me-idcard-design-body span {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  text-transform: capitalize;
}

.me-idcard-preview {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.me-idcard-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.me-idcard-preview-head h3 {
  font-size: 13px;
  font-weight: 600;
}
.me-idcard-preview-stage {
  display: grid;
  place-items: center;
  padding: 16px;
  background: linear-gradient(
    180deg,
    var(--surface-warm) 0%,
    rgba(31, 122, 77, 0.05) 100%
  );
  border-radius: 12px;
  min-height: 320px;
}
.me-idcard-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--border-warm-subtle);
}

/* Wallet */
.me-wallet-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 900px) {
  .me-wallet-grid {
    grid-template-columns: 1fr;
  }
  .me-wallet-phone {
    display: flex;
    justify-content: center;
  }
}

.me-wallet-phone {
  position: sticky;
  top: 16px;
}
.phone-frame {
  width: 240px;
  height: 480px;
  background: #111;
  border-radius: 36px;
  padding: 12px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}
.phone-notch {
  position: absolute;
  insetBlockStart: 8px;
  insetInlineStart: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 18px;
  background: #111;
  border-radius: 12px;
  z-index: 2;
}
.phone-screen {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #2f4d3c 0%, #1a2a22 100%);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  padding: 30px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.phone-status {
  display: flex;
  justify-content: space-between;
  color: #fff;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
}
.phone-lock-title {
  font-size: 28px;
  font-weight: 300;
  color: #fff;
  text-align: center;
  margin-block-start: 6px;
}
.phone-card {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  background: #fff;
}
.phone-card-meta {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.phone-card-meta strong {
  font-size: 13px;
}
.phone-card-meta span {
  font-size: 10px;
  opacity: 0.75;
}
.phone-hint {
  margin-block-start: auto;
  text-align: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
}

.me-wallet-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.me-wallet-action-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
}
.me-wallet-action-card[data-coming-soon="true"] {
  background: linear-gradient(
    180deg,
    var(--surface-warm) 0%,
    var(--color-surface) 100%
  );
}
.me-wallet-action-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-block-end: 12px;
}
.me-wallet-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.me-wallet-action-icon.apple {
  background: #000;
  color: #fff;
}
.me-wallet-action-icon.google {
  background: linear-gradient(135deg, #4285f4, #34a853);
  color: #fff;
}
.me-wallet-action-icon.brand {
  background: rgba(31, 122, 77, 0.12);
  color: var(--color-brand-primary);
}
.me-wallet-action-icon.info {
  background: #dbeafe;
  color: #1d4ed8;
}
.me-wallet-action-head strong {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.me-wallet-action-head p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-block-start: 4px;
  line-height: 1.5;
}
.me-wallet-soon {
  font-size: 10px;
  font-weight: 600;
  background: #fbf4de;
  color: #8a6d10;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.me-wallet-action-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--border-warm-subtle);
}

/* ============================================================
 * /admin/templates — Corp-admin template policy (M10 §FR-TPL)
 * ============================================================ */
.tpl-deprecation-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(
    90deg,
    rgba(180, 83, 9, 0.08),
    rgba(180, 83, 9, 0.02)
  );
  border: 1px solid rgba(180, 83, 9, 0.35);
  border-radius: 10px;
  margin-block-end: 16px;
}
.tpl-deprecation-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tpl-deprecation-body {
  flex: 1;
  min-width: 0;
}
.tpl-deprecation-body strong {
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  display: block;
}
.tpl-deprecation-body p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-block-start: 4px;
  line-height: 1.5;
}

.tpl-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 1100px) {
  .tpl-layout {
    grid-template-columns: 1fr;
  }
}

/* Lock-card */
.tpl-lock-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--color-surface);
  border: 1.5px solid var(--border-warm-subtle);
  border-radius: 12px;
  margin-block-end: 20px;
  transition: border-color 160ms, background 160ms;
}
.tpl-lock-card[data-on="true"] {
  border-color: rgba(201, 162, 39, 0.55);
  background: linear-gradient(
    180deg,
    rgba(201, 162, 39, 0.06),
    var(--color-surface) 80%
  );
}
.tpl-lock-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-warm);
  color: var(--color-text-secondary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tpl-lock-card[data-on="true"] .tpl-lock-icon {
  background: rgba(201, 162, 39, 0.15);
  color: #8a6d10;
}
.tpl-lock-body {
  flex: 1;
  min-width: 0;
}
.tpl-lock-body strong {
  font-size: 14px;
  font-weight: 600;
  display: block;
}
.tpl-lock-body p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-block-start: 4px;
  line-height: 1.5;
}
.tpl-toggle {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: var(--border-warm-subtle);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 160ms;
}
.tpl-toggle[data-on="true"] {
  background: var(--color-brand-primary);
}
.tpl-toggle-thumb {
  position: absolute;
  insetBlockStart: 3px;
  insetInlineStart: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 180ms ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.tpl-toggle[data-on="true"] .tpl-toggle-thumb {
  transform: translateX(20px);
}
:dir(rtl) .tpl-toggle[data-on="true"] .tpl-toggle-thumb {
  transform: translateX(-20px);
}

.tpl-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-block: 20px 12px;
}
.tpl-section-head h2 {
  font-size: 15px;
  font-weight: 600;
}
.tpl-section-head p {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
}
.tpl-meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}

/* Template gallery */
.tpl-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.tpl-card {
  background: var(--color-surface);
  border: 1.5px solid var(--border-warm-subtle);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 160ms, box-shadow 160ms;
}
.tpl-card[data-allowed="true"] {
  border-color: var(--color-brand-primary);
  background: rgba(31, 122, 77, 0.03);
}
.tpl-card[data-default="true"] {
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.18);
}
.tpl-card[data-locked="true"] {
  opacity: 0.55;
}
.tpl-card[data-deprecated="true"] {
  background: #fffbeb;
  border-color: #fcd34d;
}
.tpl-card-toggle {
  text-align: start;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  display: block;
}
.tpl-card-toggle:disabled {
  cursor: not-allowed;
}
.tpl-card-check {
  position: absolute;
  insetBlockStart: 8px;
  insetInlineEnd: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid var(--border-warm-subtle);
  display: grid;
  place-items: center;
  color: var(--color-text-tertiary);
  z-index: 2;
}
.tpl-card[data-allowed="true"] .tpl-card-check {
  background: var(--color-brand-primary);
  color: #fff;
  border-color: var(--color-brand-primary);
}
.tpl-card-preview {
  aspect-ratio: 4/5;
  position: relative;
  display: grid;
  place-items: center;
  padding: 20px 16px;
  color: #fff;
  overflow: hidden;
}
.tpl-card-preview img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}
.tpl-preview-1 { background: linear-gradient(135deg, #1F7A4D, #2D8B5C); }
.tpl-preview-2 { background: linear-gradient(135deg, #1A1A1A, #2D2D2D); }
.tpl-preview-3 { background: linear-gradient(135deg, #C9A227, #B5891B); }
.tpl-preview-4 { background: linear-gradient(135deg, #6D28D9, #8B5CF6); }
.tpl-preview-5 { background: linear-gradient(135deg, #2563EB, #60A5FA); }
.tpl-preview-6 { background: linear-gradient(135deg, #BE185D, #F472B6); }
.tpl-preview-7 { background: linear-gradient(135deg, #FAFAF9, #ECEAE5); color: #1a1a1a; }
.tpl-preview-8 { background: linear-gradient(135deg, #0D9488, #2DD4BF); }
.tpl-card-mock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  width: 100%;
}
.tpl-card-mock .mock-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
}
.tpl-preview-7 .mock-avatar {
  background: rgba(0, 0, 0, 0.08);
}
.tpl-card-mock .mock-name {
  font-size: 10px;
  font-weight: 600;
  margin-block-start: 4px;
}
.tpl-card-mock .mock-role {
  font-size: 8px;
  opacity: 0.85;
}
.tpl-card-mock .mock-bar {
  height: 3px;
  width: 70%;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  margin-block-start: 6px;
}
.tpl-preview-7 .mock-bar {
  background: rgba(0, 0, 0, 0.15);
}
.tpl-card-mock .mock-bar.short {
  width: 50%;
}
.tpl-card-deprecated {
  position: absolute;
  insetBlockEnd: 10px;
  insetInlineStart: 50%;
  transform: translateX(-50%);
  background: rgba(180, 83, 9, 0.95);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}
:dir(rtl) .tpl-card-deprecated {
  transform: translateX(50%);
}
.tpl-card-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.tpl-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.tpl-card-name {
  font-size: 13px;
  font-weight: 600;
}
.tpl-card-desc {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tpl-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-block-start: 4px;
}
.tpl-card-meta {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}
.tpl-card-default-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-brand-primary);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 2px 0;
}
.tpl-card-default-btn:hover {
  text-decoration: underline;
}
.tpl-card-default-pill {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-brand-primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Default-template summary */
.tpl-default-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.tpl-default-thumb {
  width: 48px;
  height: 64px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1f7a4d, #2d8b5c);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 14px;
}
.tpl-default-info {
  flex: 1;
  min-width: 0;
}
.tpl-default-info strong {
  font-size: 14px;
  font-weight: 600;
  display: block;
}
.tpl-default-info span {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
  display: block;
}

/* Side rail */
.tpl-side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
}
.tpl-side-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
}
.tpl-side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: 12px;
}
.tpl-side-head h3 {
  font-size: 13px;
  font-weight: 600;
}
.tpl-side-head .meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
}

/* Donut */
.tpl-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.tpl-donut {
  position: relative;
  width: 140px;
  height: 140px;
}
.tpl-donut-inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}
.tpl-donut-inner .num {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.tpl-donut-inner .label {
  font-size: 10px;
  color: var(--color-text-tertiary);
}
.tpl-donut-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tpl-donut-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.tpl-donut-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.tpl-donut-name {
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-donut-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Recent changes feed */
.tpl-changes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tpl-changes-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.tpl-changes-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-brand-primary);
  margin-block-start: 7px;
  flex-shrink: 0;
}
.tpl-changes-dot.warn {
  background: #b45309;
}
.tpl-changes-line {
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-text-primary);
}
.tpl-changes-line code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-warm);
  padding: 1px 5px;
  border-radius: 3px;
}
.tpl-changes-meta {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-text-tertiary);
  margin-block-start: 2px;
}

/* /admin/employees/[id] — QR card in the right rail */
.emp-qr-card {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 16px;
  margin-block-start: 12px;
}
.emp-qr-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: 12px;
}
.emp-qr-card-head strong {
  font-size: 13px;
  font-weight: 600;
}
.emp-qr-card-head code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-warm);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.emp-qr-card-img {
  display: grid;
  place-items: center;
  padding: 14px;
  background: var(--surface-warm);
  border-radius: 10px;
  margin-block-end: 12px;
}
.emp-qr-card-img img {
  width: 100%;
  max-width: 180px;
  height: auto;
  background: #fff;
  border-radius: 6px;
}
.emp-qr-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* /admin/employees Invite modal — credentials surface */
.invite-credentials {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.invite-credentials-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.invite-credentials-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(31, 122, 77, 0.15);
  color: var(--color-brand-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.invite-credentials-head strong {
  font-size: 16px;
  font-weight: 600;
  display: block;
}
.invite-credentials-head p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-block-start: 2px;
}
.invite-credentials-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invite-credential-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-warm);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 10px;
}
.invite-credential-row .lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  display: block;
  margin-block-end: 4px;
}
.invite-credential-row code {
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-all;
}
.invite-credentials-qr {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border-warm-subtle);
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    rgba(31, 122, 77, 0.04),
    var(--color-surface) 80%
  );
}
.invite-credentials-qr > div {
  flex: 1;
}
.invite-credentials-qr strong {
  font-size: 13px;
  font-weight: 600;
  display: block;
}
.invite-credentials-qr p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-block-start: 4px;
}
.invite-credentials-qr img {
  background: #fff;
  border-radius: 6px;
  padding: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.invite-credentials-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--border-warm-subtle);
}
.invite-credentials-warn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0;
}

/* /admin/employees/[id] — tab panels */
.emp-tab-panel {
  background: var(--color-surface);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 20px;
}
.emp-tab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.emp-tab-kv {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface-warm);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 8px;
  min-width: 0;
}
.emp-tab-kv-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
}
.emp-tab-kv-value {
  font-size: 13px;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}
.empty-card {
  padding: 28px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 13px;
  background: var(--color-surface);
  border: 1px dashed var(--border-warm-subtle);
  border-radius: 12px;
}

/* QR tab — large preview + meta + downloads */
.emp-qr-tab-grid {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 720px) {
  .emp-qr-tab-grid {
    grid-template-columns: 1fr;
  }
}
.emp-qr-tab-preview {
  display: grid;
  place-items: center;
  background: var(--surface-warm);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  padding: 24px;
}
.emp-qr-tab-preview img {
  width: 100%;
  max-width: 260px;
  height: auto;
  background: #fff;
  border-radius: 8px;
}
.emp-qr-tab-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ID Card tab */
.emp-id-tab-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: 14px;
}
.emp-id-tab-head h3 {
  font-size: 14px;
  font-weight: 600;
}
.emp-id-tab-stage {
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(
    180deg,
    var(--surface-warm),
    rgba(31, 122, 77, 0.05)
  );
  border: 1px solid var(--border-warm-subtle);
  border-radius: 12px;
  min-height: 240px;
}
.emp-id-tab-stage img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}
.emp-id-tab-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-block-start: 14px;
}

/* Settings tab */
.emp-settings-section {
  padding-block-end: 16px;
  margin-block-end: 16px;
  border-block-end: 1px solid var(--border-warm-subtle);
}
.emp-settings-section:last-child {
  padding-block-end: 0;
  margin-block-end: 0;
  border-block-end: 0;
}
.emp-settings-section h3 {
  font-size: 13px;
  font-weight: 600;
  margin-block-end: 12px;
}

/* /admin/employees/[id] Settings tab — interactive controls */
.emp-settings-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.emp-settings-row > div:first-child {
  flex: 1;
  min-width: 200px;
}
.emp-settings-row h3 {
  font-size: 13px;
  font-weight: 600;
  margin-block-end: 4px;
}
.emp-settings-row p {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.emp-segmented {
  display: inline-flex;
  background: var(--surface-warm);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.emp-segmented button {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 120ms;
}
.emp-segmented button:hover:not([data-active="true"]):not(:disabled) {
  color: var(--color-text-primary);
}
.emp-segmented button[data-active="true"] {
  background: var(--color-surface);
  color: var(--color-brand-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.emp-segmented button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.emp-settings-switches {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-block-start: 12px;
}
.emp-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface-warm);
  border: 1px solid var(--border-warm-subtle);
  border-radius: 10px;
  cursor: pointer;
}
.emp-toggle-row > div {
  flex: 1;
  min-width: 0;
}
.emp-toggle-row strong {
  font-size: 13px;
  font-weight: 600;
  display: block;
}
.emp-toggle-row span {
  font-size: 11px;
  color: var(--color-text-tertiary);
}
.emp-toggle {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: var(--border-warm-subtle);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 160ms;
}
.emp-toggle[data-on="true"] {
  background: var(--color-brand-primary);
}
.emp-toggle:disabled {
  cursor: wait;
  opacity: 0.7;
}
.emp-toggle-thumb {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 180ms ease;
}
.emp-toggle[data-on="true"] .emp-toggle-thumb {
  transform: translateX(18px);
}
:dir(rtl) .emp-toggle[data-on="true"] .emp-toggle-thumb {
  transform: translateX(-18px);
}

/* Reusable modal tab strip — pill-style tabs with brand-tinted
 * active state. Used by any modal with multi-mode entry. */
.modal-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  background: var(--surface-warm);
  border-block-end: 1px solid var(--border-warm-subtle);
}
.modal-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 120ms,
    color 120ms,
    border-color 120ms;
}
.modal-tab:hover {
  background: rgba(31, 122, 77, 0.06);
  color: var(--color-text-primary);
}
.modal-tab[data-active="true"] {
  background: rgba(31, 122, 77, 0.1);
  border-color: rgba(31, 122, 77, 0.28);
  color: var(--color-brand-primary);
  font-weight: 600;
}
.modal-tab:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
}

