:root {
    --ink: #2a265e;
    --ink-soft: #544d91;
    --sand: #f4f2ff;
    --clay: #d7d2f2;
    --moss: #7c74c7;
    --pine: #5545b6;
    --amber: #f39a3b;
    --mist: #eeeafd;
    --border: #e2ddf6;
    --white: #ffffff;

    /* React-equivalent aliases */
    --background: var(--sand);
    --surface: var(--white);
    --text: var(--ink);
    --text-muted: var(--ink-soft);
    --primary: var(--pine);
    --primary-soft: #6d5ed6;
    --secondary: var(--moss);
    --accent: var(--amber);

    /* from React tailwind theme */
    --danger: #ef4444;
    --success: #16a34a;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --shadow-card: 0 12px 30px rgba(42, 38, 94, 0.14);
    --font-ui: "Cairo", "Cairo Fallback", "Noto Kufi Arabic", "Noto Sans Arabic", sans-serif;
    --btn-font-size: 14px;
    --btn-font-weight: 700;
    --btn-letter-spacing: 0;
    --btn-line-height: 1.2;
    --field-height: 42px;
    --field-padding-y: 10px;
    --field-padding-x: 12px;
    --field-radius: var(--radius-sm);
    --field-border-width: 1px;
    --field-border-color: var(--border);
    --field-border-color-focus: var(--primary-soft);
    --field-bg: var(--surface);
    --field-fg: var(--text);
    --field-placeholder: color-mix(in srgb, var(--text-muted) 70%, transparent);
    --field-shadow-focus: 0 0 0 3px color-mix(in srgb, var(--primary-soft) 22%, transparent);
    --field-text-size: 14px;
    --field-textarea-min-height: 92px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at 20% 0, #faf7ff 0%, var(--background) 45%, #f1ecff 100%);
    color: var(--text);
    font-family: var(--font-ui);
}

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

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

.se-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px;
}

.se-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.se-gap-2 {
    gap: 8px;
}

.se-gap-3 {
    gap: 12px;
}

.se-gap-4 {
    gap: 16px;
}

.se-mt-2 {
    margin-top: 8px;
}

.se-mt-3 {
    margin-top: 12px;
}

.se-mt-4 {
    margin-top: 16px;
}

.se-mt-6 {
    margin-top: 24px;
}

.se-text-muted {
    color: var(--text-muted);
}

.se-text-sm {
    font-size: 14px;
}

.se-text-xs {
    font-size: 12px;
}

.se-title {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
}

.se-subtitle {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.se-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.se-card-header {
    padding: 18px 20px 0;
}

.se-card-body {
    padding: 0 20px 20px;
}

.se-card-title {
    margin: 0;
    font-size: 19px;
    color: var(--primary);
}

.se-card-desc {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.se-btn {
    --btn-bg: var(--primary);
    --btn-fg: #ffffff;
    --btn-border: transparent;
    --btn-shadow: none;
    border: 1px solid var(--btn-border);
    border-radius: var(--radius-pill);
    background: var(--btn-bg);
    color: var(--btn-fg);
    box-shadow: var(--btn-shadow);
    padding: 10px 14px;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    text-decoration: none;
    border-radius: 12px;
    padding: 10px 18px;
    border: 1px solid var(--btn-border);
    cursor: pointer;
    background-color: var(--btn-bg);
    color: var(--btn-fg);
    font-size:16px;
    font-weight: 600;
    transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
    letter-spacing: var(--btn-letter-spacing);
    line-height: 1;
    font-style: normal;
    text-transform: none;
    white-space: nowrap;
    align-items: center;
    justify-content: center;



}

.se-btn:hover {
    opacity: .95;
}

.se-btn:active {
    transform: translateY(1px);
}

.se-btn:disabled {
    opacity: .58;
    cursor: not-allowed;
    transform: none;
}

.se-btn-primary {
    --btn-bg: var(--primary);
    --btn-fg: #ffffff;
}

.se-btn-secondary {
    --btn-bg: #e9e5ff;
    --btn-fg: #43388f;
    --btn-border: #d9d0ff;
}

.se-btn-ghost {
    --btn-bg: #ffffff;
    --btn-fg: var(--primary);
    --btn-border: var(--border);
}

.se-btn-danger {
    --btn-bg: var(--danger);
    --btn-fg: #ffffff;
}

.se-btn-success {
    --btn-bg: var(--success);
    --btn-fg: #ffffff;
}

.se-btn-accent {
    --btn-bg: var(--accent);
    --btn-fg: #ffffff;
    --btn-shadow: 0 10px 24px rgba(245, 158, 11, 0.28);
}

.se-btn-link {
    --btn-bg: transparent;
    --btn-fg: var(--primary);
    --btn-border: transparent;
    padding-inline: 0;
    border-radius: 0;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.se-btn-sm {
    padding: 7px 11px;
    font-size: 12px;
}

.se-btn-lg {
    padding: 11px 18px;
    font-size: 15px;
}

.se-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

.se-btn-square {
    border-radius: 12px;
}

.se-input-wrap {
    display: grid;
    gap: 6px;
}

.se-label {
    font-size: 13px;
    color: var(--text-muted);
}

.se-field,
.se-input {
    width: 100%;
    background-color: var(--mist);
    border-radius: 16px;
    border: 1px solid rgb(226, 221, 246);
    padding: 10px 16px;
    color: rgb(42, 38, 94);
    font-size: 12px;
}

.se-field::placeholder,
.se-input::placeholder {
    color: var(--field-placeholder);
}

.se-field:focus,
.se-field:focus-visible,
.se-input:focus,
.se-input:focus-visible {
    border-color: var(--field-border-color-focus);
    box-shadow: var(--field-shadow-focus);
}

.se-field:disabled,
.se-input:disabled {
    opacity: .7;
    cursor: not-allowed;
    background: color-mix(in srgb, var(--field-bg) 92%, #e5e7eb);
}

.se-field--input,
input.se-input {
    min-height: var(--field-height);
}

.se-field--select,
.se-field--trigger,
select.se-input {
    min-height: var(--field-height);
}

.se-field--textarea,
textarea.se-input {
    min-height: var(--field-textarea-min-height);
    resize: vertical;
    line-height: 1.5;
}

.se-error {
    font-size: 12px;
    color: var(--danger);
}

.se-searchable-select {
    position: relative;
}

.se-searchable-select__native {
    position: absolute !important;
    inset: 0;
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
    pointer-events: none;
}

.se-searchable-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    text-align: start;
}

.se-searchable-select__value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.se-searchable-select__caret {
    flex: 0 0 auto;
    opacity: .7;
}

.se-searchable-select__panel {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 6px);
    z-index: 80;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 14px 30px rgba(30, 27, 75, .12);
    padding: 8px;
}

.se-searchable-select__search {
    margin-bottom: 8px;
}

.se-searchable-select__options {
    max-height: 220px;
    overflow: auto;
    display: grid;
    gap: 4px;
}

.se-searchable-select__option {
    border: 0;
    border-radius: 9px;
    background: transparent;
    padding: 8px 10px;
    text-align: start;
    cursor: pointer;
    color: var(--text);
}

.se-searchable-select__option:hover,
.se-searchable-select__option.is-selected {
    background: #f1ecff;
}

.se-searchable-select__option.is-empty {
    color: var(--text-muted);
}

.se-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;

    height: 100vh;


    /* .se-sidebar { height: auto; position: relative; overflow: visible; } */

}

.se-sidebar {
    min-height: 100vh;
    padding-bottom: 1vh;
    background: linear-gradient(180deg, #0b1731 0%, #0e1e3f 50%, #0b1731 100%);
    color: #ffffff;
    padding: 24px 16px;
    position: fixed;
    top: 0;
    overflow-y: auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    width: fit-content;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    z-index: 2;
}

.se-brand-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}

.se-brand-actions {
    display: inline-flex;
    gap: 8px;
}

.se-brand-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.se-brand-btn-accent {
    background: #f59e0b;
    color: #1f2937;
    border-color: transparent;
}

.se-notifications {
    position: relative;
}

.se-notifications-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border: 2px solid #0b1731;
}

.se-notifications-count.is-hidden {
    display: none;
}

.se-notifications-panel {
    position: fixed;
    top: 12px;
    left: 12px;
    width: 360px;
    max-width: 86vw;
    max-height: 420px;
    background: #fff;
    color: #111827;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.2);
    overflow: hidden;
    z-index: 10000;
    display: grid;
    grid-template-rows: auto 1fr;
}

.se-notifications-panel[hidden] {
    display: none;
}

.se-notification-popup {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: min(340px, calc(100vw - 24px));
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.24);
    padding: 12px 14px 12px 12px;
    z-index: 10010;
    cursor: pointer;
}

.se-notification-popup-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #1e293b;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.se-notification-popup-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    padding-right: 20px;
}

.se-notification-popup-message {
    margin-top: 4px;
    color: #475569;
    font-size: 12px;
    line-height: 1.35;
}

.se-notifications-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 700;
}

.se-notifications-read-all {
    border: 0;
    background: transparent;
    color: #4f46e5;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.se-notifications-list {
    max-height: 330px;
    overflow-y: auto;
}

.se-notification-item {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: #eef2ff;
}

.se-notification-item.is-read {
    background: #fff;
}

.se-notification-item:hover {
    background: #e0e7ff;
}

.se-notification-title {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
}

.se-notification-message {
    margin-top: 4px;
    color: #475569;
    font-size: 12px;
    line-height: 1.35;
}

.se-notification-time {
    margin-top: 6px;
    color: #64748b;
    font-size: 11px;
}

.se-notifications-empty {
    padding: 14px 12px;
    color: #64748b;
    font-size: 12px;
}

.se-brand {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.se-brand-sub {
    color: rgba(255, 255, 255, .7);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.3;
}

.se-brand-logo {
    display: none;
    max-width: 100px;
    max-height: 36px;
    object-fit: contain;
    margin-bottom: 4px;
}

.se-brand-logo.is-visible {
    display: block;
}

.se-brand-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(10, 16, 30, 0.5);
    place-items: center;
    padding: 14px;
}

.se-brand-modal.is-open {
    display: grid;
}

.se-brand-modal-card {
    width: min(460px, 100%);
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
    padding: 14px;
    display: grid;
    gap: 10px;
    position: relative;
}

.se-brand-modal-close {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.se-brand-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.se-brand-field {
    display: grid;
    gap: 5px;
}

.se-brand-field>span,
.se-brand-upload-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 700;
}

.se-brand-field>input {
    min-height: var(--field-height);
    border: var(--field-border-width) solid var(--field-border-color);
    border-radius: var(--field-radius);
    padding: var(--field-padding-y) var(--field-padding-x);
    font-size: var(--field-text-size);
    font-family: inherit;
}

.se-brand-upload-wrap {
    display: grid;
    gap: 6px;
}

.se-brand-upload-box {
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    padding: 10px;
    display: grid;
    place-items: center;
    gap: 8px;
    background: rgba(248, 250, 252, 0.6);
}

.se-brand-upload-box img {
    display: none;
    max-height: 96px;
    max-width: 100%;
    object-fit: contain;
}

.se-brand-upload-box img.is-visible {
    display: block;
}

.se-brand-file-input {
    display: none;
}

.se-brand-upload-btn {
    min-height: 36px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    padding: 0 12px;
    cursor: pointer;
}

.se-brand-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.se-brand-save-btn {
    min-height: 38px;
    border-radius: 10px;
    border: 0;
    background: #f59e0b;
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.se-company-profile-card .se-card-body {
    padding-top: 16px;
}

.se-company-profile-form {
    display: grid;
    gap: 12px;
}

.se-company-profile-assets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.se-company-upload {
    border: 1px solid var(--border);
    border-radius: 16px;
    min-height: 220px;
    display: grid;
    place-items: center;
    background: var(--surface);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.se-company-upload:hover {
    border-color: var(--primary-soft);
    background: color-mix(in srgb, var(--surface) 90%, #eef2ff);
}

.se-company-upload:focus-within {
    border-color: var(--primary-soft);
    box-shadow: var(--field-shadow-focus);
}

.se-company-upload-preview {
    display: none;
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}

.se-company-upload-preview.is-visible {
    display: block;
}

.se-company-upload-empty {
    display: grid;
    gap: 8px;
    justify-items: center;
    align-content: center;
    color: var(--text-muted);
    text-align: center;
    padding: 12px;
}

.se-company-upload-empty.is-hidden {
    display: none;
}

.se-company-upload-icon {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    color: var(--primary);
    background: #ece8ff;
    border: 1px solid #ddd5ff;
}

.se-company-upload-text {
    font-size: 13px;
    font-weight: 700;
}

.se-company-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.se-company-profile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.se-nav {
    margin-top: 8px;
    display: grid;
    gap: 16px;
    flex: 1 1 auto;
    align-content: start;
    min-height: 0;
    padding-right: 4px;
    padding-bottom: 16px;
}

.se-nav-group {
    display: grid;
    gap: 8px;
}

.se-nav-group-title {
    color: rgba(222, 230, 237, 0.6);
    font-size: 14px;
    font-weight: 400;
    padding: 0 4px;
}

.se-nav-group-items {
    display: grid;
    gap: 8px;
}

.se-nav-group-language {
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.se-nav-lang-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.se-nav-lang-item {
    justify-content: center;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.02em;
}

[dir="rtl"] .se-nav-lang-item,
[dir="ltr"] .se-nav-lang-item {
    text-align: center;
}

.se-nav-item {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 400;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(222, 230, 237, 0.6);
    border: 0;
    width: 100%;
    text-align: right;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background .15s ease, color .15s ease;
}

.se-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.se-nav-icon svg {
    margin-right: 5px;
}

.se-nav-item-back {
    justify-content: center;
    min-height: 42px;
    width: 20%;
}

.se-nav-item-back .se-nav-icon-back {
    width: 18px;
    height: 18px;
}

[dir="rtl"] .se-nav-item-back .se-nav-icon-back {
    transform: scaleX(-1);
}

.se-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

[dir="ltr"] .se-nav-item {
    text-align: left;
}

[dir="ltr"] .se-nav-group-title {
    text-align: left;
}

[dir="ltr"] .se-sidebar {
    direction: ltr;
}

[dir="rtl"] .se-nav-item {
    text-align: right;
}

.se-nav-dot {
    width: 4px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.5);
    flex: 0 0 4px;
}

.se-nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.se-nav-item.is-active {
    background: #f59e0b;
    color: #ffffff;
    font-weight: 600;
}

.se-nav-item.is-active .se-nav-dot {
    background: #ffffff;
}

.se-sidebar-footer {
    margin-top: 0;
    display: grid;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    flex: 0 0 auto;
    background: transparent;
}

.se-nav-item-logout {
    background: rgba(226, 70, 92, .24);
    color: #ffe1e6;
}

.se-main {
    padding: 24px;
    background: #f3f4fb;
    min-height: 100vh;
}

.se-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.se-page-title {
    margin: 0;
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
}

.se-page-desc {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.se-guest-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.se-guest-card {
    width: 100%;
    max-width: 560px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    padding: 24px;
}

/* Auth pages: match React shell colors */
.se-auth-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #0b1731 0%, #0e1e3f 50%, #0b1731 100%);
    padding: 16px;
}

.se-auth-shell {
    width: min(560px, 100%);
    margin: 0 auto;
    min-height: calc(100vh - 32px);
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(11, 23, 49, 0.85);
    box-shadow: 0 24px 50px rgba(3, 8, 22, 0.35);
}

.se-auth-main {
    padding: 28px;
    display: grid;
    align-content: center;
    background: linear-gradient(180deg, rgba(12, 28, 59, 0.62), rgba(8, 18, 40, 0.78));
}

.se-auth-main .se-title {
    color: #ffffff;
    font-size: 36px;
}

.se-auth-main .se-subtitle {
    color: rgba(222, 230, 237, 0.78);
    font-size: 16px;
}

.se-auth-main .se-label,
.se-auth-main .se-text-muted {
    color: rgba(222, 230, 237, 0.78);
}

.se-auth-main .se-input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.se-auth-main .se-input::placeholder {
    color: rgba(222, 230, 237, 0.55);
}

/* Customer profile (tenant) */
.cp-card {
    padding: 18px;
    background: linear-gradient(145deg, #f8fafc 0%, #f4f5ff 100%);
    border: 1px solid #e4e7ec;
    border-radius: 14px;
}

.cp-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cp-head .cp-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cp-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cp-status {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
}

.cp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.cp-tile {
    padding: 10px 12px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
    display: grid;
    gap: 4px;
}

.cp-tile-label {
    color: #6b7280;
    font-weight: 700;
    font-size: 12px;
}

.cp-tile-value {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.cp-notes {
    grid-column: 1 / -1;
}

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

.cp-metric {
    border-radius: 14px;
    padding: 12px;
    display: grid;
    gap: 10px;
    justify-items: center;
    text-align: center;
}

.cp-metric .label {
    font-weight: 800;
    font-size: 15px;
}

.cp-metric .value {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.cp-metric.ac {
    border: 1px solid rgba(22, 163, 74, 0.25);
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
}

.cp-metric.dc {
    border: 1px solid rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

/* Shared CRM page layer (used across tenant screens) */
.crm-layout {
    direction: rtl;
    display: grid;
    gap: 24px;
    background: rgb(249, 250, 251);
    border-radius: 22px;
    padding: 24px;
    font-family: inherit;
}

html[dir="ltr"] .crm-layout {
    direction: ltr;
}

.crm-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.crm-title h2 {
    margin: 0;
    color: #2a265e;
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 600;
    line-height: 1.3;
}

.crm-title p {
    margin: 4px 0 0;
    color: #544d91;
    font-size: clamp(12px, 1.6vw, 14px);
    font-weight: 400;
}

.crm-tools {
    display: flex;
}

.crm-search-wrap {
    position: relative;
    width: min(100%, 420px);
}

.crm-search {
    width: 100%;
    border: 1px solid #e2ddf6;
    border-radius: 999px;
    background: #fff;
    color: #2a265e;
    padding: 10px 38px 10px 12px;
    font-size: clamp(12px, 1.5vw, 13px);
    outline: none;
    font-family: inherit;
}

.crm-search::placeholder {
    color: #7c74c7;
    font-size: clamp(11px, 1.3vw, 12px);
}

.crm-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #544d91;
    display: inline-flex;
    align-items: center;
}

.crm-table-card {
    background: #fff;
    border: 1px solid #e2ddf6;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 6px 14px rgba(42, 38, 94, 0.08);
}

.crm-table-title {
    padding: 12px 14px;
    border-bottom: 1px solid #e2ddf6;
    font-weight: 700;
    color: #2a265e;
    background: #fff;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(12px, 1.6vw, 14px);
}

.crm-table th {
    padding: 12px 16px;
    color: #544d91;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid #e2ddf6;
    text-align: right;
    background: rgba(234, 237, 240, 0.5);
}

.crm-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2ddf6;
    color: #2a265e;
    font-size: 14px;
    text-align: right;
    vertical-align: middle;
    background: #fff;
}

html[dir="ltr"] .crm-table-card .crm-table th,
html[dir="ltr"] .crm-table-card .crm-table td {
    text-align: left;
}

.crm-table tr:last-child td {
    border-bottom: 0;
}

/* Unified table system */
.se-table-wrap {
    overflow: auto;
}

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

.se-table th,
.tbl th {
    padding: 12px 16px;
    color: #544d91;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid #e2ddf6;
    text-align: right;
    background: rgba(234, 237, 240, 0.5);
}

.se-table td,
.tbl td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2ddf6;
    color: #2a265e;
    font-size: 14px;
    text-align: right;
    vertical-align: middle;
    background: #fff;
}

.se-table tr:last-child td,
.tbl tr:last-child td {
    border-bottom: 0;
}

.se-table .is-strong {
    font-weight: 700;
}

.se-table .is-muted {
    color: #6b7280;
    font-size: 12px;
}

.se-table .is-empty {
    color: #544d91;
}

.se-table .is-center {
    text-align: center !important;
}

.se-table .is-positive {
    color: #16a34a;
}

.se-table .is-negative {
    color: #dc2626;
}

/* Generic cell helpers for crm-table and custom table rows */
.cell-strong {
    font-weight: 700;
}

.cell-muted {
    color: #544d91;
    font-size: 12px;
}

.cell-success {
    color: #159947;
}

html[dir="ltr"] .se-table th,
html[dir="ltr"] .se-table td,
html[dir="ltr"] .tbl th,
html[dir="ltr"] .tbl td {
    text-align: left;
}

.crm-card {
    border: 1px solid #e2ddf6;
    border-radius: 22px !important;
    overflow: hidden;
    box-shadow: 0 6px 14px rgba(42, 38, 94, 0.08);
}

.crm-card .se-card-header {
    background: #fff;
    border-bottom: 1px solid #e2ddf6;
}

.crm-card .se-card-title {
    color: #2a265e;
    font-size: 16px;
    font-weight: 600;
}

.crm-card .se-card-body {
    background: #fff;
}

.crm-icon-actions,
.customer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-icon-btn,
.customer-icon-btn {
    border: 0;
    background: transparent;
    padding: 2px;
    cursor: pointer;
    line-height: 0;
    color: #3a67ff;
}

.crm-icon-btn.is-view,
.customer-icon-btn.is-view {
    color: #f39a3b;
}

.crm-icon-btn.is-delete,
.customer-icon-btn.is-delete {
    color: #ff3b30;
}

.crm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.crm-badge.active {
    background: rgba(76, 210, 153, 0.18);
    color: #1f8e5a;
}

.crm-badge.inactive {
    background: rgba(240, 82, 82, 0.16);
    color: #d14343;
}

.crm-badge.pending {
    background: rgba(246, 173, 85, 0.2);
    color: #b45309;
}

.crm-empty {
    padding: 24px !important;
    text-align: center !important;
    color: #544d91 !important;
    font-size: 14px !important;
}

.crm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1100;
}

.crm-modal[hidden] {
    display: none !important;
}

.crm-modal.is-open {
    display: flex;
}

.crm-modal-card {
    background: #fff;
    width: min(100%, var(--crm-modal-width, 920px));
    border: 1px solid #e2ddf6;
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(42, 38, 94, 0.08);
    max-height: 90vh;
    overflow: auto;
}

.crm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e2ddf6;
}

.crm-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2a265e;
}

.crm-modal-body {
    padding: 16px;
}

.crm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 16px 16px;
}

.crm-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.crm-form-grid .se-input-wrap:last-child {
    grid-column: 1 / -1;
}

.crm-form-grid .se-label {
    font-size: 13px;
    padding-top: 10px;
}

.crm-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 12px;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-card);
}

.pill {
    border-radius: var(--radius-pill);
}


@media (max-width: 992px) {
    .se-shell {
        grid-template-columns: 1fr;
    }

    .se-nav {
        overflow: visible;
        max-height: none;
    }

    .se-sidebar-footer {
        position: static;
        background: transparent;
        backdrop-filter: none;
    }

    .se-main {
        padding: 16px;
    }

    .se-title {
        font-size: 24px;
    }

    .se-page-title {
        font-size: 22px;
    }

    .se-auth-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .se-auth-main .se-title {
        font-size: 28px;
    }

    .se-company-profile-assets {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .se-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}
