:root {
    --fa-bg: #f6f8fc;
    --fa-card: #ffffff;
    --fa-card-soft: #fbfcff;
    --fa-border: #e7ebf2;
    --fa-border-strong: #d9e0eb;
    --fa-text: #152238;
    --fa-muted: #667085;
    --fa-primary: #062246;
    --fa-primary-2: #0b3474;
    --fa-primary-soft: #edf3ff;
    --fa-orange: #ff6500;
    --fa-orange-2: #ff7b00;
    --fa-orange-soft: #fff2e8;
    --fa-success: #169c62;
    --fa-danger: #d92d20;
    --fa-shadow: 0 18px 55px rgba(6, 34, 70, .07);
    --fa-shadow-soft: 0 10px 32px rgba(6, 34, 70, .045);
    --fa-radius-xl: 28px;
    --fa-radius-lg: 22px;
    --fa-radius-md: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--fa-bg);
    color: var(--fa-text);
    font-family: Tahoma, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--fa-primary-2);
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}

a:hover { color: var(--fa-orange); }

.min-w-0 { min-width: 0; }

.brand-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.auth-logo {
    width: 86px;
    height: 86px;
    object-fit: contain;
}

.settings-logo {
    width: 128px;
    height: 128px;
    object-fit: contain;
}

/* App shell */

.app-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 8%, rgba(255, 101, 0, .055), transparent 22%),
        radial-gradient(circle at 95% 3%, rgba(6, 34, 70, .055), transparent 24%),
        var(--fa-bg);
}

.app-shell {
    display: flex;
    gap: 22px;
    min-height: 100vh;
    padding: 18px;
}

.sidebar {
    width: 284px;
    flex: 0 0 284px;
    position: sticky;
    top: 18px;
    height: calc(100vh - 36px);
    overflow: hidden;
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--fa-border);
    border-radius: var(--fa-radius-xl);
    box-shadow: var(--fa-shadow-soft);
    backdrop-filter: blur(14px);
}

.sidebar-brand {
    padding: 1.2rem 1.25rem;
    color: var(--fa-text);
    border-bottom: 1px solid var(--fa-border);
}

.sidebar-brand:hover { color: var(--fa-text); }

.sidebar-brand strong {
    font-size: 1rem;
    color: var(--fa-primary);
}

.sidebar-brand small {
    display: block;
    margin-top: 2px;
    color: var(--fa-muted);
    font-size: .72rem;
    letter-spacing: .04em;
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff, #f3f6fb);
    border: 1px solid var(--fa-border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.sidebar-scroll {
    overflow-y: auto;
    scrollbar-width: thin;
}

.sidebar-nav { padding: 1rem !important; }

.sidebar-nav .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 46px;
    padding: .72rem .9rem;
    margin-bottom: .35rem;
    border: 1px solid transparent;
    border-radius: 14px;
    color: #4c596d;
    font-weight: 600;
}

.sidebar-nav .nav-link:hover {
    color: var(--fa-primary);
    background: #f8faff;
    border-color: #edf0f5;
    transform: translateX(-2px);
}

.sidebar-nav .nav-link.active {
    color: var(--fa-primary);
    background: linear-gradient(135deg, #f1f5ff 0%, #fff6ef 100%);
    border-color: #e8e8ef;
}

.sidebar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    right: 7px;
    top: 50%;
    width: 4px;
    height: 22px;
    border-radius: 999px;
    background: var(--fa-orange);
    transform: translateY(-50%);
}

.sidebar-nav .nav-link i {
    width: 22px;
    text-align: center;
    color: var(--fa-primary-2);
}

.sidebar-nav hr {
    border-color: var(--fa-border);
    opacity: 1;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1rem 1.15rem;
    margin: .75rem;
    background: linear-gradient(135deg, #f7f9fd 0%, #fff7f1 100%);
    border: 1px solid var(--fa-border);
    border-radius: 18px;
}

.sidebar-user strong { font-size: .88rem; }
.sidebar-user small { color: var(--fa-muted); font-size: .75rem; }

.user-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, var(--fa-primary), var(--fa-primary-2));
    box-shadow: 0 8px 18px rgba(6, 34, 70, .15);
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 11px;
    font-size: .8rem;
}

.content-area {
    min-width: 0;
    width: 100%;
}

.app-content {
    max-width: 1680px;
    margin-inline: auto;
}

.app-topbar {
    min-height: 64px;
    padding: .7rem .85rem .7rem 1rem;
    background: rgba(255, 255, 255, .82);
    border: 1px solid var(--fa-border);
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(6, 34, 70, .035);
    backdrop-filter: blur(14px);
}

.topbar-status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .72rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--fa-border);
    color: var(--fa-primary);
    font-size: .78rem;
    font-weight: 700;
}

.topbar-status > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fa-success);
    box-shadow: 0 0 0 4px rgba(22, 156, 98, .08);
}

.topbar-user {
    min-height: 42px;
    padding: .3rem .5rem .3rem .8rem;
    border: 1px solid var(--fa-border);
    border-radius: 14px;
    background: #fff;
    font-size: .86rem;
    font-weight: 600;
}

.btn-logout {
    min-height: 42px;
    color: #7a3440;
    background: #fff7f7;
    border: 1px solid #f4dddd;
}

.btn-logout:hover {
    color: #fff;
    background: var(--fa-danger);
    border-color: var(--fa-danger);
}

.mobile-header {
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--fa-border);
    backdrop-filter: blur(14px);
}

.mobile-brand { color: var(--fa-primary); }
.mobile-brand small { color: var(--fa-muted); font-size: .7rem; }

.bento-menu-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--fa-primary);
    background: #f8fafc;
    border: 1px solid var(--fa-border);
}

.mobile-nav-canvas {
    border: 0;
    border-radius: 24px 0 0 24px;
}

/* Bento system */

.page-heading { padding: .25rem .15rem; }

.eyebrow,
.bento-kicker {
    display: inline-block;
    margin-bottom: .35rem;
    color: var(--fa-orange);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .11em;
    direction: ltr;
}

.page-title {
    margin-bottom: .35rem;
    color: var(--fa-primary);
    font-weight: 900;
    letter-spacing: -.025em;
}

.bento-chip {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    align-self: flex-start;
    padding: .62rem .85rem;
    color: var(--fa-primary);
    background: #fff;
    border: 1px solid var(--fa-border);
    border-radius: 14px;
    box-shadow: var(--fa-shadow-soft);
    font-size: .82rem;
    font-weight: 700;
}

.bento-chip i { color: var(--fa-orange); }

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.bento-span-12 { grid-column: span 12; }
.bento-span-8 { grid-column: span 8; }
.bento-span-7 { grid-column: span 7; }
.bento-span-6 { grid-column: span 6; }
.bento-span-5 { grid-column: span 5; }
.bento-span-4 { grid-column: span 4; }
.bento-span-3 { grid-column: span 3; }

.bento-card,
.panel-card,
.stat-card {
    position: relative;
    min-width: 0;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--fa-border);
    border-radius: var(--fa-radius-lg);
    box-shadow: var(--fa-shadow-soft);
    overflow: hidden;
}

.bento-card {
    padding: 1.35rem;
}

.bento-card::before {
    content: '';
    position: absolute;
    inset-inline-start: 18px;
    top: 0;
    width: 54px;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, var(--fa-primary-2), var(--fa-orange));
    opacity: .92;
}

.bento-accent-card {
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 101, 0, .11), transparent 42%),
        #fff;
}

.bento-info-card {
    background:
        linear-gradient(135deg, rgba(237, 243, 255, .86), rgba(255, 247, 241, .82)),
        #fff;
}

.bento-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.bento-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    font-size: 1rem;
}

.bento-icon-navy {
    color: #fff;
    background: linear-gradient(145deg, var(--fa-primary), var(--fa-primary-2));
}

.bento-icon-orange {
    color: #fff;
    background: linear-gradient(145deg, var(--fa-orange), var(--fa-orange-2));
}

.bento-meta {
    padding: .75rem .9rem;
    color: var(--fa-muted);
    background: #f8fafc;
    border: 1px dashed var(--fa-border-strong);
    border-radius: 13px;
    font-size: .78rem;
    overflow-wrap: anywhere;
}

.section-divider {
    height: 1px;
    margin: 1.5rem 0;
    background: linear-gradient(90deg, transparent, var(--fa-border), transparent);
}

.brand-preview {
    min-height: 190px;
    display: grid;
    place-items: center;
    padding: 1rem;
    background:
        linear-gradient(45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f8fafc 75%),
        linear-gradient(-45deg, transparent 75%, #f8fafc 75%),
        #fff;
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
    border: 1px solid var(--fa-border);
    border-radius: 18px;
}

.flow-dots {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: .8rem 1rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--fa-border);
}

.flow-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--fa-primary-2);
}

.flow-dots span:nth-child(2) { background: #ff9a35; }
.flow-dots span:nth-child(3) { background: var(--fa-orange); }

/* Existing panels inherit Bento visuals */

.panel-card {
    border-radius: var(--fa-radius-lg);
}

.panel-card .card-header {
    padding: 1rem 1.2rem;
    color: var(--fa-primary);
    background: #fff !important;
    border-bottom: 1px solid var(--fa-border);
}

.stat-card {
    height: 100%;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: #d9dfeb;
    box-shadow: var(--fa-shadow);
}

.stat-card > span {
    color: var(--fa-muted);
    font-size: .86rem;
}

.stat-card > strong {
    color: var(--fa-primary);
    font-size: 1.75rem;
    line-height: 1.4;
    font-weight: 900;
}

.stat-card > small { color: var(--fa-muted); }

.stat-card.stat-orange {
    background: linear-gradient(145deg, #fff 25%, var(--fa-orange-soft) 100%);
}

.stat-card.stat-navy {
    color: #fff;
    background: linear-gradient(145deg, #062246 0%, #0c3679 100%);
    border-color: transparent;
}

.stat-card.stat-navy > span,
.stat-card.stat-navy > small { color: rgba(255,255,255,.72); }
.stat-card.stat-navy > strong { color: #fff; }

.project-tile {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-height: 110px;
    padding: 1rem;
    color: var(--fa-text);
    text-decoration: none;
    background: linear-gradient(145deg, #fff, #fbfcff);
    border: 1px solid var(--fa-border);
    border-radius: 16px;
}

.project-tile:hover,
.project-card:hover {
    color: var(--fa-primary);
    background: #fff;
    border-color: #d2d9e5;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(6, 34, 70, .06);
}

.project-tile i { color: var(--fa-orange); }

.empty-state {
    text-align: center;
    color: var(--fa-muted);
    padding: 2rem 1rem;
    background: #fbfcfe;
    border: 1px dashed var(--fa-border-strong);
    border-radius: 16px;
}

.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ticket-message {
    max-width: 86%;
    padding: 1rem;
    border-radius: 18px;
    line-height: 1.9;
}

.customer-message {
    align-self: flex-start;
    background: #f5f7fb;
    border: 1px solid var(--fa-border);
}

.staff-message {
    align-self: flex-end;
    background: #fff4eb;
    border: 1px solid #ffe1c9;
}

.tiny { font-size: .75rem; }

/* Forms and Bootstrap overrides */

.form-label {
    color: #344054;
    font-size: .86rem;
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 46px;
    color: var(--fa-text);
    background-color: #fff;
    border-color: #dce2eb;
    border-radius: 13px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(255, 101, 0, .52);
    box-shadow: 0 0 0 .22rem rgba(255, 101, 0, .075);
}

.form-text { color: #87909f; }

.btn {
    min-height: 42px;
    border-radius: 12px;
    font-weight: 700;
}

.btn-sm { min-height: 34px; border-radius: 10px; }

.btn-primary {
    --bs-btn-bg: #062246;
    --bs-btn-border-color: #062246;
    --bs-btn-hover-bg: #0b3474;
    --bs-btn-hover-border-color: #0b3474;
    --bs-btn-active-bg: #031936;
    --bs-btn-active-border-color: #031936;
    box-shadow: 0 9px 20px rgba(6, 34, 70, .12);
}

.btn-outline-primary {
    --bs-btn-color: #062246;
    --bs-btn-border-color: #c9d2df;
    --bs-btn-hover-bg: #062246;
    --bs-btn-hover-border-color: #062246;
}

.badge { border-radius: 999px; padding: .48em .72em; }

.table {
    --bs-table-bg: transparent;
    color: var(--fa-text);
}

.table > :not(caption) > * > * {
    padding: .9rem .7rem;
    vertical-align: middle;
    border-bottom-color: #edf0f4;
}

.table thead th {
    color: #667085;
    font-size: .78rem;
    font-weight: 800;
    background: #fafbfc;
}

.table-responsive { border-radius: 16px; }

.alert {
    border-radius: 16px;
    border-width: 1px;
}

code {
    direction: ltr;
    unicode-bidi: embed;
    color: #9a3412;
    background: #fff5ed;
    border-radius: 6px;
    padding: .1rem .32rem;
}

/* Authentication Bento */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, rgba(255,255,255,.76), rgba(246,248,252,.96)),
        var(--fa-bg);
}

.auth-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
}

.auth-orb-one {
    width: 420px;
    height: 420px;
    top: -210px;
    right: -120px;
    background: radial-gradient(circle, rgba(6,34,70,.12), rgba(6,34,70,0));
}

.auth-orb-two {
    width: 360px;
    height: 360px;
    bottom: -190px;
    left: -90px;
    background: radial-gradient(circle, rgba(255,101,0,.16), rgba(255,101,0,0));
}

.auth-bento {
    max-width: 1010px;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
    gap: 18px;
    padding: 10px;
    background: rgba(255,255,255,.42);
    border: 1px solid rgba(231,235,242,.95);
    border-radius: 32px;
    box-shadow: 0 32px 80px rgba(6,34,70,.09);
    backdrop-filter: blur(18px);
}

.auth-brand-panel {
    min-height: 590px;
    padding: 2.2rem;
    color: #fff;
    background:
        radial-gradient(circle at 95% 5%, rgba(255,101,0,.28), transparent 30%),
        linear-gradient(145deg, #041a36, #0a326d);
    border-radius: 25px;
    overflow: hidden;
}

.auth-brand-panel h1 {
    font-size: clamp(2rem, 3.4vw, 3.05rem);
    line-height: 1.45;
    font-weight: 900;
    letter-spacing: -.045em;
}

.auth-brand-panel p {
    max-width: 420px;
    color: rgba(255,255,255,.72);
    line-height: 2;
}

.auth-brand-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .48rem .72rem;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    color: rgba(255,255,255,.86);
    background: rgba(255,255,255,.06);
    font-size: .74rem;
    direction: ltr;
}

.auth-brand-pill span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fa-orange);
    box-shadow: 0 0 0 5px rgba(255,101,0,.12);
}

.auth-brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
}

.auth-brand-logo-wrap img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    padding: 5px;
    background: #fff;
    border-radius: 18px;
}

.auth-brand-logo-wrap strong { display: block; }
.auth-brand-logo-wrap small { display: block; margin-top: 4px; color: rgba(255,255,255,.6); direction: ltr; }

.auth-card {
    width: 100%;
    max-width: 560px;
    border-radius: 25px;
    background: #fff;
}

.auth-bento .auth-card {
    max-width: none;
    min-height: 590px;
    display: flex;
    justify-content: center;
    box-shadow: none;
}

.auth-bento .auth-card .card-body {
    width: 100%;
    max-width: 520px;
    align-self: center;
}

.auth-heading h4 { color: var(--fa-primary); font-weight: 900; }

.auth-icon {
    width: 58px;
    height: 58px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, var(--fa-primary), var(--fa-primary-2));
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(6,34,70,.15);
}

.auth-icon-orange {
    background: linear-gradient(145deg, var(--fa-orange), var(--fa-orange-2));
    box-shadow: 0 12px 28px rgba(255,101,0,.16);
}

.auth-note {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .8rem .9rem;
    color: #667085;
    background: #fafbfc;
    border: 1px solid var(--fa-border);
    border-radius: 14px;
    font-size: .8rem;
    line-height: 1.8;
}

.auth-note i {
    margin-top: .35rem;
    color: var(--fa-orange);
}

.input-icon-wrap { position: relative; }

.input-icon-wrap > i {
    position: absolute;
    right: 14px;
    top: 50%;
    z-index: 3;
    color: #98a2b3;
    transform: translateY(-50%);
}

.input-icon-wrap .form-control { padding-right: 42px; }

.otp-input {
    min-height: 58px;
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: .35em;
    padding-left: .5rem;
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem .2rem 0;
}

.auth-back-link { color: var(--fa-muted); }

/* Landing page compatibility */

.hero-section {
    background:
        radial-gradient(circle at 85% 15%, rgba(255,101,0,.08), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
}

.py-lg-6 {
    padding-top: 6rem !important;
    padding-bottom: 6rem !important;
}

.hero-logo-card {
    background: #fff;
    border: 1px solid var(--fa-border);
    border-radius: 32px;
    padding: 3.5rem;
    box-shadow: var(--fa-shadow-soft);
}

.hero-logo {
    width: min(260px, 70%);
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.feature-card {
    height: 100%;
    background: #fff;
    border: 1px solid var(--fa-border);
    border-radius: 22px;
    padding: 1.5rem;
    box-shadow: var(--fa-shadow-soft);
}

.feature-card i {
    font-size: 1.8rem;
    color: var(--fa-orange);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--fa-muted);
    margin-bottom: 0;
    line-height: 1.9;
}

@media (max-width: 1199.98px) {
    .bento-span-8,
    .bento-span-7,
    .bento-span-5 { grid-column: span 12; }

    .bento-span-4,
    .bento-span-3 { grid-column: span 6; }
}

@media (max-width: 991.98px) {
    .app-shell { display: block; padding: 0; }
    .content-area { width: 100%; }

    .app-topbar {
        margin-top: .15rem;
        border-radius: 17px;
    }

    .auth-bento {
        display: block;
        max-width: 610px;
        padding: 7px;
        border-radius: 27px;
    }

    .auth-card { min-height: auto; }

    .py-lg-6 {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }
}

@media (max-width: 767.98px) {
    .bento-span-8,
    .bento-span-7,
    .bento-span-6,
    .bento-span-5,
    .bento-span-4,
    .bento-span-3 { grid-column: span 12; }

    .bento-grid { gap: 14px; }
    .bento-card { padding: 1.1rem; border-radius: 18px; }

    .page-heading { align-items: flex-start !important; }
}

@media (max-width: 575.98px) {
    .app-content {
        padding-left: .85rem !important;
        padding-right: .85rem !important;
    }

    .app-topbar { min-height: 58px; padding: .55rem .65rem; }

    .panel-card,
    .stat-card,
    .bento-card { border-radius: 17px; }

    .ticket-message { max-width: 96%; }

    .hero-logo-card { padding: 2rem; }

    .display-5 { font-size: 2rem; }

    .auth-page { align-items: flex-start; }
    .auth-bento { margin-top: .5rem; }
    .auth-card { border-radius: 21px; }
    .auth-card .card-body { padding: 1.35rem !important; }
    .auth-actions { flex-direction: column; }
}

.fw-black { font-weight: 900; }
.text-brand { color: var(--fa-primary); }
.text-orange { color: #ffad76 !important; }

.dashboard-number,
.dashboard-payment,
.dashboard-revenue {
    color: var(--fa-primary);
    font-weight: 900;
    letter-spacing: -.025em;
}

.dashboard-number { font-size: 2.35rem; }
.dashboard-payment { font-size: 1.45rem; }
.dashboard-revenue { font-size: clamp(1.65rem, 3vw, 2.4rem); }

.subscription-state {
    width: fit-content;
    padding: .48rem .72rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 900;
}

.subscription-state.is-active {
    color: #087443;
    background: #eaf9f1;
    border: 1px solid #c9efdc;
}

.subscription-state.is-expired {
    color: #b54708;
    background: #fff4e8;
    border: 1px solid #ffdfbf;
}

.mini-metric {
    height: 100%;
    padding: 1rem;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(217,224,235,.9);
    border-radius: 16px;
}

.mini-metric span {
    display: block;
    margin-bottom: .35rem;
    color: var(--fa-muted);
    font-size: .78rem;
}

.mini-metric strong { color: var(--fa-primary); }

.bento-dark-card {
    color: #fff;
    background:
        radial-gradient(circle at 100% 0%, rgba(255,101,0,.26), transparent 40%),
        linear-gradient(145deg, #041a36 0%, #0b3474 100%);
    border-color: transparent;
}

.bento-dark-card::before { background: var(--fa-orange); }
.bento-dark-card h5 { color: #fff; }
.bento-dark-card p { color: rgba(255,255,255,.68); }

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.quick-links-grid a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .8rem;
    color: rgba(255,255,255,.88);
    text-decoration: none;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px;
}

.quick-links-grid a:hover {
    color: #fff;
    background: rgba(255,255,255,.13);
    transform: translateY(-1px);
}

.quick-links-grid i { color: #ff9c5c; }

.notification-stack {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .8rem 0;
    border-bottom: 1px solid rgba(217,224,235,.8);
}

.notification-item:last-child { border-bottom: 0; padding-bottom: 0; }

.notification-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    margin-top: .55rem;
    border-radius: 50%;
    background: var(--fa-orange);
    box-shadow: 0 0 0 5px rgba(255,101,0,.08);
}

/* License and usage guide components */
.license-price {
    color: var(--fa-primary);
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 900;
    letter-spacing: -.02em;
}

.guide-tabs .nav-link {
    color: var(--fa-muted);
    font-weight: 800;
    border-radius: 12px 12px 0 0;
}

.guide-tabs .nav-link.active {
    color: var(--fa-primary);
}

.guide-step-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guide-step-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid rgba(217, 224, 235, .9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(6, 34, 70, .05);
}

.guide-step-number {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: #fff;
    background: linear-gradient(145deg, var(--fa-primary), var(--fa-primary-2));
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 900;
}

.guide-step-content h6 {
    margin-bottom: .55rem;
    color: var(--fa-primary);
    font-weight: 900;
}

.guide-step-description {
    color: #4a5870;
    line-height: 2;
}

.guide-image-link {
    display: block;
    margin-top: 1rem;
}

.guide-step-image {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: #f7f9fc;
    border: 1px solid rgba(217, 224, 235, .9);
    border-radius: 16px;
}

.guide-video-shell,
.guide-admin-box {
    padding: 1rem;
    background: #f8faff;
    border: 1px solid rgba(217, 224, 235, .9);
    border-radius: 18px;
}

.guide-video-shell video {
    max-height: 620px;
    background: #061a36;
    border-radius: 16px;
}

.persian-date-input {
    direction: ltr;
    text-align: left;
}

@media (max-width: 575.98px) {
    .guide-step-card {
        grid-template-columns: 1fr;
    }

    .guide-step-number {
        width: 42px;
        height: 42px;
    }
}

/* Patch 04: license safety and OTP experience */
.license-guide-callout,
.license-critical-warning,
.license-one-time-note {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    border: 1px solid rgba(255, 101, 0, .18);
    background: rgba(255, 101, 0, .07);
    color: var(--fa-primary);
    border-radius: 16px;
    padding: 1rem 1.05rem;
}

.license-guide-callout > i,
.license-critical-warning > i,
.license-one-time-note > i {
    color: var(--fa-orange);
    margin-top: .15rem;
}

.license-guide-callout span,
.license-critical-warning span {
    display: block;
    color: var(--fa-muted);
    font-size: .88rem;
    margin-top: .2rem;
}

.license-one-time-note {
    font-size: .84rem;
    padding: .8rem .9rem;
}

.license-guide-steps {
    display: grid;
    gap: 1rem;
}

.license-guide-step {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.license-guide-step > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(145deg, var(--fa-primary), var(--fa-primary-2));
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(6, 34, 70, .16);
}

.license-guide-step p {
    color: var(--fa-muted);
    font-size: .9rem;
    margin: .3rem 0 0;
}

.license-reveal-shell {
    max-width: 860px;
    padding: 1rem 0 3rem;
}

.license-reveal-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--fa-border);
    background: rgba(255,255,255,.96);
    border-radius: 28px;
    padding: clamp(1.4rem, 4vw, 2.5rem);
    box-shadow: 0 24px 70px rgba(6,34,70,.11);
}

.license-reveal-card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255,101,0,.16), transparent 70%);
    pointer-events: none;
}

.license-reveal-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(145deg, var(--fa-orange), #ff8a2a);
    box-shadow: 0 14px 28px rgba(255,101,0,.22);
    margin-bottom: 1.1rem;
}

.license-secret-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    background: #f7f9fc;
    border: 1px dashed rgba(6,34,70,.24);
    border-radius: 16px;
    padding: .85rem;
}

.license-secret-box code {
    direction: ltr;
    unicode-bidi: isolate;
    color: var(--fa-primary);
    word-break: break-all;
    font-size: .92rem;
    padding-inline: .4rem;
}

.license-reveal-checks {
    display: grid;
    gap: .65rem;
}

.license-reveal-checks > div {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    color: var(--fa-muted);
    font-size: .88rem;
}

.license-reveal-checks i {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    border-radius: 50%;
    color: #0e7b52;
    background: rgba(14,123,82,.09);
}

.license-replace-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 1rem 1.5rem;
    align-items: end;
    padding: .4rem 0;
}

.otp-verification-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(6,34,70,.09);
    background: linear-gradient(165deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 24px;
    padding: 1.3rem;
    box-shadow: 0 18px 44px rgba(6,34,70,.08);
    animation: otpCardEnter .55s cubic-bezier(.2,.8,.2,1) both;
}

.otp-verification-card::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    right: -90px;
    top: -100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,101,0,.18), transparent 67%);
    pointer-events: none;
}

.otp-signal {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: .85rem;
}

.otp-signal span {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,101,0,.28);
    animation: otpSignal 1.25s ease-in-out infinite;
}
.otp-signal span:nth-child(2) { animation-delay: .15s; }
.otp-signal span:nth-child(3) { animation-delay: .3s; }

.otp-boxes {
    display: grid;
    grid-template-columns: repeat(6, minmax(38px, 1fr));
    gap: .55rem;
    max-width: 430px;
    margin: 0 auto;
}

.otp-digit {
    width: 100%;
    aspect-ratio: 1 / 1.08;
    min-width: 0;
    border: 1px solid rgba(6,34,70,.12);
    border-radius: 14px;
    background: #f5f8fc;
    color: var(--fa-primary);
    font-size: clamp(1.1rem, 4vw, 1.45rem);
    font-weight: 900;
    text-align: center;
    outline: none;
    caret-color: var(--fa-orange);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
    animation: otpDigitEnter .42s cubic-bezier(.2,.8,.2,1) both;
}

.otp-digit:nth-child(2) { animation-delay: .05s; }
.otp-digit:nth-child(3) { animation-delay: .10s; }
.otp-digit:nth-child(4) { animation-delay: .15s; }
.otp-digit:nth-child(5) { animation-delay: .20s; }
.otp-digit:nth-child(6) { animation-delay: .25s; }

.otp-digit:focus {
    background: #fff;
    border-color: var(--fa-orange);
    box-shadow: 0 0 0 4px rgba(255,101,0,.10), 0 12px 24px rgba(6,34,70,.08);
    transform: translateY(-3px) scale(1.025);
}

.otp-digit.has-value {
    background: #fff;
    border-color: rgba(11,52,116,.32);
    animation: otpValuePop .22s ease both;
}

.otp-live-status {
    min-height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .55rem;
    color: var(--fa-muted);
    font-size: .84rem;
    transition: color .2s ease;
}

.otp-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fa-orange);
    box-shadow: 0 0 0 0 rgba(255,101,0,.35);
    animation: otpPulse 1.6s infinite;
}

.otp-complete .otp-live-status {
    color: #0e7b52;
    font-weight: 700;
}

.otp-complete .otp-status-dot {
    background: #0e7b52;
    animation: none;
    box-shadow: 0 0 0 5px rgba(14,123,82,.09);
}

.otp-complete .otp-shield,
.otp-complete ~ .otp-auth-heading .otp-shield {
    animation: otpSuccess .5s ease both;
}

.otp-submit:not(:disabled) {
    animation: otpReady 1.8s ease-in-out infinite;
}

@keyframes otpCardEnter {
    from { opacity: 0; transform: translateY(18px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes otpDigitEnter {
    from { opacity: 0; transform: translateY(12px) scale(.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes otpValuePop {
    0% { transform: scale(.92); }
    60% { transform: scale(1.07); }
    100% { transform: scale(1); }
}

@keyframes otpSignal {
    0%, 100% { transform: translateY(0); opacity: .35; }
    50% { transform: translateY(-3px); opacity: 1; }
}

@keyframes otpPulse {
    0% { box-shadow: 0 0 0 0 rgba(255,101,0,.28); }
    70% { box-shadow: 0 0 0 7px rgba(255,101,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,101,0,0); }
}

@keyframes otpReady {
    0%, 100% { box-shadow: 0 8px 20px rgba(11,52,116,.12); }
    50% { box-shadow: 0 10px 28px rgba(255,101,0,.18); }
}

@keyframes otpSuccess {
    0% { transform: scale(1); }
    55% { transform: scale(1.13) rotate(-5deg); }
    100% { transform: scale(1); }
}

@media (max-width: 767.98px) {
    .license-replace-inline { grid-template-columns: 1fr; }
    .license-secret-box { grid-template-columns: 1fr; }
    .license-secret-box .btn { width: 100%; }
    .otp-verification-card { padding: 1rem .8rem; border-radius: 20px; }
    .otp-boxes { gap: .35rem; }
    .otp-digit { border-radius: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    .otp-verification-card,
    .otp-digit,
    .otp-signal span,
    .otp-status-dot,
    .otp-submit:not(:disabled) {
        animation: none !important;
    }
}


/* Error log center */
.error-icon-fatal,
.error-icon-error,
.error-icon-warning {
    color: #fff;
}
.error-icon-fatal { background: linear-gradient(145deg, #7f1d1d, #b91c1c); }
.error-icon-error { background: linear-gradient(145deg, #b42318, #ef4444); }
.error-icon-warning { background: linear-gradient(145deg, #c2410c, var(--fa-orange)); }

.error-log-table th {
    white-space: nowrap;
    font-size: .78rem;
    color: var(--fa-muted);
    background: #f8fafc;
}
.error-log-table td { vertical-align: middle; }
.error-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    border-radius: 999px;
    padding: .34rem .65rem;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .02em;
}
.error-level-fatal { color: #991b1b; background: #fee2e2; }
.error-level-error { color: #b42318; background: #ffebe8; }
.error-level-warning { color: #9a3412; background: #fff1e7; }
.error-level-info { color: var(--fa-primary-2); background: #eaf2ff; }
.error-source,
.error-id {
    display: inline-block;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--fa-primary-2);
    background: #f4f7fb;
    border-radius: 8px;
    padding: .28rem .45rem;
}
.error-message-cell { min-width: 260px; max-width: 470px; }
.error-message-cell strong { display: block; font-size: .86rem; line-height: 1.75; }
.error-message-cell small { display: block; color: var(--fa-muted); margin-top: .2rem; direction: ltr; text-align: right; }
.error-detail-row { background: transparent; }
.error-detail-panel {
    background: #f8fafc;
    border-top: 1px dashed var(--fa-border);
    border-bottom: 1px solid var(--fa-border);
    padding: 1.15rem;
}
.error-detail-panel h6 { color: var(--fa-primary); font-weight: 900; }
.error-detail-panel pre {
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 360px;
    overflow: auto;
    border-radius: 14px;
    padding: .9rem;
    margin: 0;
    color: #dbeafe;
    background: #071a33;
    font-size: .76rem;
    line-height: 1.65;
}
@media (max-width: 991.98px) {
    .error-log-stats .bento-span-3 { grid-column: span 6; }
}
@media (max-width: 575.98px) {
    .error-log-stats .bento-span-3 { grid-column: span 12; }
}

/* Customer welcome header */
.customer-topbar {
    padding: .85rem 1rem;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, .96), rgba(248, 251, 255, .94)),
        #fff;
    overflow: hidden;
    position: relative;
}

.customer-topbar::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--fa-orange), var(--fa-orange-2));
}

.customer-welcome {
    position: relative;
    z-index: 1;
}

.welcome-mark {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(145deg, var(--fa-primary), var(--fa-primary-2));
    box-shadow: 0 10px 24px rgba(6, 34, 70, .14);
}

.welcome-mark i {
    color: #fff;
    font-size: 1.05rem;
}

.welcome-kicker {
    display: block;
    margin-bottom: 2px;
    color: var(--fa-orange);
    font-size: .65rem;
    font-weight: 900;
    letter-spacing: .11em;
    direction: ltr;
    text-align: right;
}

.welcome-title {
    color: var(--fa-primary);
    font-size: 1rem;
    font-weight: 900;
}

.welcome-subtitle {
    margin-top: 2px;
    color: var(--fa-muted);
    font-size: .76rem;
}

.customer-logout {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .customer-topbar {
        align-items: stretch !important;
        padding: .8rem;
    }

    .customer-welcome {
        width: 100%;
    }

    .welcome-mark {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 13px;
    }

    .welcome-subtitle {
        line-height: 1.7;
    }

    .customer-logout {
        width: 100%;
        justify-content: center;
    }
}
