@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --ui-bg: #f4efe7;
    --ui-bg-strong: #e9decf;
    --ui-surface: rgba(255, 255, 255, 0.86);
    --ui-surface-strong: #fffdfa;
    --ui-surface-muted: #f7f2ea;
    --ui-border: rgba(63, 48, 35, 0.1);
    --ui-border-strong: rgba(16, 24, 40, 0.14);
    --ui-text: #1e2939;
    --ui-text-soft: #5f6c7b;
    --ui-heading: #201a13;
    --ui-accent: var(--theme-primary, #2563eb);
    --ui-accent-strong: var(--theme-secondary, #0ea5e9);
    --ui-accent-soft: color-mix(in srgb, var(--theme-primary, #2563eb) 12%, transparent);
    --ui-warm: var(--theme-accent, #f59e0b);
    --ui-danger: #b42318;
    --ui-success: var(--theme-primary, #2563eb);
    --ui-shadow: 0 24px 60px rgba(38, 27, 17, 0.12);
    --ui-shadow-soft: 0 14px 34px rgba(31, 22, 14, 0.08);
    --ui-radius-xl: 30px;
    --ui-radius-lg: 22px;
    --ui-radius-md: 16px;
    --ui-radius-sm: 12px;
    --ui-max: 1180px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.ui-body {
    margin: 0;
    min-height: 100vh;
    color: var(--ui-text);
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--theme-primary, #2563eb) 18%, transparent), transparent 28%),
        radial-gradient(circle at bottom right, color-mix(in srgb, var(--theme-accent, #f59e0b) 16%, transparent), transparent 24%),
        linear-gradient(135deg, #f8f4ee 0%, #efe5d8 48%, #f7f2ea 100%);
}
.mobile-sidebar-close,.mobile-menu-toggle{
    display: none;
}

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

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

.ui-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ui-shell--bare {
    display: block;
}

.ui-container {
    width: min(calc(100% - 32px), var(--ui-max));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: #fffaf5;
    background: rgba(255, 251, 245, 0.96);
    border-bottom: 1px solid rgba(63, 48, 35, 0.08);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--theme-primary, #2563eb) 10%, transparent);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .site-header {
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
    }
}

.site-header__inner,
.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 10px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.brand__mark {
    width: auto;
    min-width: 48px;
    height: 48px;
    max-width: 180px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--ui-accent) 0%, var(--ui-warm) 100%);
    box-shadow: 0 14px 28px color-mix(in srgb, var(--theme-primary, #2563eb) 22%, transparent);
}

.brand__mark--image {
    padding: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.brand__logo {
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand__copy {
    display: grid;
    gap: 0;
}

.brand__name {
    margin: 0;
    color: var(--ui-heading);
    display: block;
    font: 700 1.15rem/1.1 'Fraunces', serif;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(63, 48, 35, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--ui-text);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.mobile-menu-toggle:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--theme-primary, #2563eb) 26%, white);
    background: rgba(255, 255, 255, 0.9);
}

.profile-menu {
    position: relative;
}

.profile-menu summary {
    list-style: none;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.profile-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 12px 8px 8px;
    border-radius: 999px;
    border: 1px solid rgba(63, 48, 35, 0.1);
    background: rgba(255, 255, 255, 0.66);
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.profile-menu__trigger:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--theme-primary, #2563eb) 22%, white);
    background: rgba(255, 255, 255, 0.92);
}

.profile-menu__avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--ui-accent) 0%, var(--ui-warm) 100%);
}

.profile-menu__avatar--image {
    background: rgba(255, 255, 255, 0.9);
}

.profile-menu__avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-menu__identity {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.profile-menu__name {
    color: var(--ui-heading);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
}

.profile-menu__meta {
    color: var(--ui-text-soft);
    font-size: 0.78rem;
    line-height: 1;
}

.profile-menu__caret {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    color: var(--ui-text-soft);
    transform: rotate(45deg) translateY(-2px);
    flex: 0 0 auto;
}

.profile-menu[open] .profile-menu__caret {
    transform: rotate(225deg) translateY(-1px);
}

.profile-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid rgba(63, 48, 35, 0.08);
    background: rgba(255, 253, 250, 0.96);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(16px);
}

.profile-menu__item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 14px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--ui-text);
    text-align: left;
    cursor: pointer;
}

.profile-menu__item:hover {
    background: rgba(255, 255, 255, 0.9);
}

.profile-menu__item svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.profile-menu__item--danger {
    color: var(--ui-danger);
}

.site-nav__link,
.ui-button--ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.site-nav__link svg,
.ui-button svg,
.ui-button--ghost svg,
.site-footer__links svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.site-nav__link,
.ui-button--ghost {
    color: var(--ui-text);
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(63, 48, 35, 0.1);
}

.ui-button {
    color: #fff;
    background: linear-gradient(135deg, var(--ui-accent) 0%, var(--ui-accent-strong) 100%);
    box-shadow: 0 16px 28px color-mix(in srgb, var(--theme-primary, #2563eb) 20%, transparent);
    cursor: pointer;
}

.ui-button--danger {
    color: var(--ui-danger);
    border-color: color-mix(in srgb, var(--ui-danger) 24%, white);
    background: color-mix(in srgb, var(--ui-danger) 8%, white);
}

.site-nav__link:hover,
.ui-button:hover,
.ui-button--ghost:hover {
    transform: translateY(-1px);
}

.site-nav__link:hover,
.ui-button--ghost:hover {
    border-color: color-mix(in srgb, var(--theme-primary, #2563eb) 26%, white);
    background: rgba(255, 255, 255, 0.9);
}

.page-main {
    flex: 1;
    padding: 42px 0 56px;
}

.page-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    align-items: stretch;
}

.hero-panel,
.content-panel,
.info-card,
.status-card,
.form-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-xl);
    box-shadow: var(--ui-shadow-soft);
    backdrop-filter: blur(16px);
}

.hero-panel,
.content-panel {
    padding: 34px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--ui-accent-soft);
    color: var(--ui-accent-strong);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.display-title,
.section-title {
    margin: 18px 0 12px;
    color: var(--ui-heading);
    font-family: 'Fraunces', serif;
    letter-spacing: -0.04em;
}

.display-title {
    font-size: clamp(2.5rem, 4vw, 4.4rem);
    line-height: 0.94;
}

.section-title {
    font-size: clamp(1.85rem, 2.2vw, 2.4rem);
    line-height: 1;
}

.section-title--flush {
    margin: 0;
}

.lead,
.muted {
    color: var(--ui-text-soft);
    line-height: 1.7;
}

.stack {
    display: grid;
    gap: 16px;
}

.cards-grid,
.stats-grid {
    display: grid;
    gap: 16px;
}

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

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card,
.status-card,
.form-card {
    padding: 22px;
}

.info-card h3,
.status-card h3,
.form-card h3 {
    margin: 0 0 10px;
    color: var(--ui-heading);
    font-size: 1rem;
}

.kpi {
    margin: 0;
    color: var(--ui-heading);
    font-family: 'Fraunces', serif;
    font-size: 2rem;
    line-height: 1;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(63, 48, 35, 0.08);
    color: var(--ui-text);
    font-size: 0.88rem;
}

.field {
    display: grid;
    gap: 10px;
}

.field--align-end {
    align-self: end;
}

.field label {
    font-weight: 700;
    font-size: 0.92rem;
}

.input,
.textarea,
.select {
    width: 100%;
    border: 1px solid rgba(16, 24, 40, 0.12);
    background: var(--ui-surface-strong);
    color: var(--ui-text);
    border-radius: var(--ui-radius-md);
    padding: 14px 16px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

select.input,
select.select,
.settings-select,
.dataTables_wrapper .dataTables_length select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 19px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 44px;
}

.textarea {
    min-height: 116px;
    resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: color-mix(in srgb, var(--theme-primary, #2563eb) 52%, white);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-primary, #2563eb) 14%, transparent);
}

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

.invoice-customer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field--full {
    grid-column: 1 / -1;
}

.inline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.inline-row--tight {
    gap: 0.75rem;
}

.input--min-md {
    min-width: 180px;
}

.invoice-view-actions {
    align-items: stretch;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.invoice-view-actions form,
.invoice-view-actions .inline-row--tight {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ui-text-soft);
    font-size: 0.92rem;
}

.check input {
    accent-color: var(--ui-accent);
}

.banner {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: var(--ui-radius-md);
    font-size: 0.94rem;
    line-height: 1.6;
}

.banner--success {
    background: rgba(15, 118, 110, 0.08);
    color: var(--ui-success);
}

.banner--error {
    background: rgba(180, 35, 24, 0.08);
    color: var(--ui-danger);
}

.sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sidebar-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(63, 48, 35, 0.08);
    color: var(--ui-text);
    font-size: 0.9rem;
}

.sidebar-nav__link.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--ui-accent) 0%, var(--ui-warm) 100%);
    border-color: transparent;
}

.detail-list {
    display: grid;
    gap: 14px;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(63, 48, 35, 0.08);
}

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

.detail-item strong {
    display: block;
    color: var(--ui-heading);
}

.detail-item span {
    color: var(--ui-text-soft);
    text-align: right;
}

.site-footer {
    border-top: 1px solid rgba(63, 48, 35, 0.08);
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--theme-primary, #2563eb) 7%, rgba(255, 253, 250, 0.92)),
            color-mix(in srgb, var(--theme-accent, #f59e0b) 8%, rgba(246, 238, 228, 0.94))
        );
    backdrop-filter: blur(14px);
}

.site-footer__brand {
    display: grid;
    gap: 10px;
    max-width: 40rem;
}

.site-footer__title {
    margin: 0;
    color: var(--ui-heading);
    font: 700 1.05rem/1.1 'Fraunces', serif;
}

.site-footer__copy,
.site-footer__links {
    color: var(--ui-text-soft);
    font-size: 0.92rem;
    line-height: 1.6;
}

.site-footer__links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.site-footer__links a,
.site-footer__links span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(63, 48, 35, 0.08);
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.site-footer__links a:hover {
    color: var(--ui-heading);
    border-color: color-mix(in srgb, var(--theme-primary, #2563eb) 22%, white);
    background: rgba(255, 255, 255, 0.7);
}

.theme-dark .site-header {
    background: rgba(11, 18, 32, 0.84);
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

.theme-dark .brand__name,
.theme-dark .site-footer__title {
    color: #f8fafc;
}

.theme-dark .site-footer__copy,
.theme-dark .site-footer__links {
    color: #94a3b8;
}

.theme-dark .site-nav__link,
.theme-dark .ui-button--ghost,
.theme-dark .profile-menu__trigger,
.theme-dark .site-footer__links a,
.theme-dark .site-footer__links span {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.16);
    color: #e2e8f0;
}

.theme-dark .profile-menu__name {
    color: #f8fafc;
}

.theme-dark .profile-menu__meta,
.theme-dark .profile-menu__caret {
    color: #94a3b8;
}

.theme-dark .profile-menu__panel {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(148, 163, 184, 0.12);
}

.theme-dark .profile-menu__item {
    color: #fff;
}

.theme-dark .profile-menu__item svg {
    color: #fff;
}

.theme-dark .profile-menu__item:hover {
    background: rgba(30, 41, 59, 0.9);
}

.theme-dark .site-footer {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(11, 18, 32, 0.88));
    border-top-color: rgba(148, 163, 184, 0.12);
}

@media (max-width: 920px) {
    .page-grid,
    .cards-grid,
    .stats-grid,
    .field-row {
        grid-template-columns: 1fr;
    }

    .invoice-customer-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel,
    .content-panel {
        padding: 26px;
    }
}

@media (max-width: 720px) {
    .site-header__inner,
    .site-footer__inner,
    .inline-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .site-nav__link,
    .ui-button,
    .ui-button--ghost,
    .profile-menu,
    .profile-menu__trigger,
    .site-footer__links a,
    .site-footer__links span {
        width: 100%;
        justify-content: center;
    }

    .profile-menu__panel {
        position: static;
        margin-top: 10px;
        width: 100%;
    }

    .profile-menu__identity {
        flex: 1;
    }

    .brand {
        align-items: flex-start;
    }

.site-footer__links {
        width: 100%;
        justify-content: flex-start;
    }
}

.auth-screen {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 32px;
    background:
        radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--theme-primary, #2563eb) 24%, transparent), transparent 30%),
        radial-gradient(circle at 85% 18%, color-mix(in srgb, var(--theme-accent, #f59e0b) 18%, transparent), transparent 28%),
        linear-gradient(135deg, #f5efe6 0%, #f7f9fc 48%, #eef4fb 100%);
}

.auth-screen__backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.28), transparent 42%),
        radial-gradient(circle at center, rgba(255, 255, 255, 0.3), transparent 56%);
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    margin: 0 auto;
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 38px;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 253, 250, 0.82);
    backdrop-filter: blur(20px);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.auth-brand--stacked {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    margin-bottom: 30px;
}

.auth-brand__mark {
    width: auto;
    height: 120px;
    border-radius: 22px;
    display: flex;
    place-items: center;
    overflow: hidden;
    color: #fff;
    font: 800 1.35rem/1 'Manrope', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-brand__mark--image {
    background: rgba(255, 255, 255, 0.92);
}

.auth-brand__logo {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.auth-brand__copy {
    display: none;
    gap: 0;
}

.auth-brand__name {
    margin: 0;
    color: var(--ui-heading);
    font: 700 clamp(2rem, 3vw, 2.7rem)/0.95 'Fraunces', serif;
    letter-spacing: -0.04em;
}

.auth-panel__header {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
    text-align: center;
}

.auth-panel__title {
    margin: 0;
    color: var(--ui-heading);
    font: 700 clamp(2rem, 3vw, 2.8rem)/0.98 'Fraunces', serif;
    letter-spacing: -0.05em;
}

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

.auth-input {
    min-height: 56px;
    background: rgba(255, 255, 255, 0.92);
}

.auth-form__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-submit {
    min-height: 54px;
    font-size: 0.98rem;
}

.theme-dark .auth-screen {
    background:
        radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--theme-primary, #2563eb) 18%, transparent), transparent 30%),
        radial-gradient(circle at 85% 18%, color-mix(in srgb, var(--theme-accent, #f59e0b) 14%, transparent), transparent 28%),
        linear-gradient(135deg, #08111f 0%, #101c32 48%, #0b1320 100%);
}

.theme-dark .auth-card {
    background: rgba(11, 18, 32, 0.82);
    border-color: rgba(148, 163, 184, 0.12);
}

.theme-dark .auth-brand__name,
.theme-dark .auth-panel__title {
    color: #f8fafc;
}

.theme-dark .auth-input {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.14);
    color: #e2e8f0;
}

@media (max-width: 980px) {
    .auth-screen {
        padding: 20px;
    }

    .auth-card {
        min-height: auto;
        padding: 28px;
    }
}

@media (max-width: 640px) {
    .auth-form__meta {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-screen {
        padding: 14px;
    }

    .auth-card {
        padding: 24px 20px;
    }
}


.settings-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 320px minmax(0, 1fr);
    background: #f8fafc;
    color: #0f172a
}

@media (max-width: 920px) {
    .settings-app {
        grid-template-columns: 1fr;
    }

    .settings-app__primary {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: 1px solid #e2e8f0;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    }

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

    .mobile-sidebar-close {
        display: flex;
    }

    .settings-app__secondary {
        display: none;
    }

    .settings-app__main--wide {
        grid-column: span 1;
    }

    .settings-content {
        padding: 20px 16px;
    }

    .settings-topbar {
        display: flex;
    }
}

.settings-app__primary,
.settings-app__secondary {
    background: #fff;
    border-right: 1px solid #e2e8f0
}

.settings-app__primary {
    padding: 18px 10px 24px;
    position: sticky;
    top: 76px;
    align-self: start;
    height: 100vh;
    height: 100dvh;
    overflow: auto;
}

.mobile-sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.16s ease;
}

.mobile-sidebar-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.mobile-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-sidebar-backdrop.mobile-sidebar-backdrop-open {
    display: block;
}

.settings-app__secondary {
    padding: 22px 18px
}

.settings-app__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f8fafc
}

.settings-app__main--wide {
    grid-column: span 2
}

.settings-brand {
    padding: 0 10px 18px;
    font-size: 14px;
    color: #64748b
}

.settings-main-nav,
.settings-side-nav,
.settings-stack {
    display: grid
}

.settings-stack--compact {
    gap: 14px
}

.settings-main-nav {
    gap: 6px
}

.settings-inline-submenu {
    display: grid;
    gap: 10px;
    margin: 6px 0 14px;
    padding: 0 0 0 18px
}

.settings-side-nav {
    gap: 8px
}

.settings-form-grid--spaced {
    margin-top: 20px;
}

.settings-main-nav__item,
.settings-side-nav__item {
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: 14px;
    color: #0f172a;
    text-decoration: none;
    transition: background-color .16s ease, color .16s ease
}

.settings-main-nav__toggle {
    justify-content: center;
    margin-top: 10px;
    padding: 0 !important;
    width: 42px;
    height: 42px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 14px;
    background: transparent;
    border-color: transparent;
    color: #475569;
    box-shadow: none;
}

.settings-main-nav__divider {
    height: 1px;
    margin: 14px 10px 4px;
    background: rgba(226, 232, 240, 0.9);
}

.theme-dark .settings-main-nav__divider {
    background: rgba(148, 163, 184, 0.18);
}

.settings-main-nav__toggle:hover {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--theme-primary);
    transform: none;
}

.settings-main-nav__toggle svg {
    width: 18px;
    height: 18px;
}

.theme-dark .settings-main-nav__toggle:hover {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.22);
}

.settings-main-nav__item {
    padding: 11px 12px;
    font-size: 15px
}

.settings-main-nav__item.is-active {
    background: #f3f4f6
}

.settings-side-nav__item {
    padding: 12px 14px;
    font-size: 14px;
    color: #475569
}

.settings-side-nav__item.is-active {
    color: var(--theme-primary);
    background: color-mix(in srgb, var(--theme-primary) 12%, white)
}

.settings-main-nav__item svg,
.settings-side-nav__item svg,
.settings-topbar__icon svg,
.settings-card__title svg {
    width: 21px;
    height: 21px;
    color: currentColor;
    flex: 0 0 auto
}

.settings-side-label {
    font-size: 13px;
    letter-spacing: .08em;
    color: #64748b;
    margin-bottom: 18px
}

.settings-topbar {
    height: 56px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 30px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-size: 15px;
    font-weight: 600
}

.settings-topbar {
    display: none;
}

.settings-content {
    padding: 28px 30px 40px
}

.settings-content__heading {
    margin: 0;
    font-size: 29px;
    line-height: 1.15;
    font-weight: 700
}

.settings-content__subheading {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 14px
}

.settings-banner {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    border: 1px solid transparent
}

.settings-banner--success {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0
}

.settings-banner--error {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca
}

.settings-card {
    margin-top: 28px;
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    padding: 30px;
    max-width: 1060px
}

.settings-card+.settings-card {
    margin-top: 20px
}

.settings-card__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 20px;
    font-weight: 700
}

.settings-card__title svg {
    color: var(--theme-primary)
}

.settings-card__description {
    margin: 10px 0 28px;
    color: #64748b;
    font-size: 14px
}

.settings-logo-row {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    margin-bottom: 28px
}

.settings-logo-drop {
    width: 100px;
    height: 100px;
    border: 2px dashed #d8dee9;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #64748b;
    background: #fbfdff
}

.settings-logo-drop svg {
    width: 34px;
    height: 34px
}

.settings-logo-drop--preview {
    overflow: hidden;
    position: relative
}

.settings-logo-drop--preview.has-image {
    border-style: solid;
    border-color: #dbe4f0;
    background: #fff
}

.settings-logo-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.settings-logo-preview-icon {
    width: 34px;
    height: 34px
}

.settings-logo-meta h4,
.settings-list__title {
    margin: 2px 0;
    font-size: 16px;
    font-weight: 500
}

.settings-logo-meta p,
.settings-muted {
    margin: 0;
    color: #64748b;
    font-size: 14px
}

.settings-upload-btn,
.settings-link-btn,
.settings-save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer
}

.settings-upload-btn,
.settings-link-btn {
    border: 1px solid #d8dee9;
    background: #fff;
    color: #0f172a
}

.settings-save-btn {
    border: 0;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
    color: #fff;
    font-weight: 600
}

.settings-form-grid,
.settings-grid-two,
.settings-grid-three,
.settings-feature-grid,
.settings-backup-grid {
    display: grid;
    gap: 20px
}

.settings-form-grid,
.settings-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr))
}

.settings-grid-three,
.settings-feature-grid,
.settings-backup-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr))
}

.settings-field {
    display: grid;
    gap: 10px
}

.settings-field--full {
    grid-column: 1 / -1
}

.settings-field label {
    font-size: 14px;
    font-weight: 500
}

.settings-input,
.settings-select,
.settings-textarea {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 15px;
    border: 1px solid #dbe4f0;
    background: #f8fafc;
    color: #0f172a;
    font-size: 15px;
    outline: none
}

.settings-readonly {
    min-height: 50px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-radius: 15px;
    border: 1px solid #dbe4f0;
    background: #f8fafc;
    color: #475569;
    font-size: 15px
}

.settings-textarea {
    min-height: 120px;
    padding: 14px 16px;
    resize: vertical
}

.settings-input:focus,
.settings-select:focus,
.settings-textarea:focus {
    border-color: color-mix(in srgb, var(--theme-primary) 45%, white);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 14%, transparent)
}

.settings-actions {
    margin-top: 26px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap
}

.settings-file-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px
}

.settings-file-picker {
    display: grid;
    gap: 12px
}

.settings-file-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 54px;
    padding: 0 18px;
    border: 1px dashed #bfd0e6;
    border-radius: 16px;
    background: #f8fbff;
    color: #0f172a;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease
}

.settings-file-trigger:hover {
    border-color: color-mix(in srgb, var(--theme-primary) 45%, white);
    background: color-mix(in srgb, var(--theme-primary) 6%, white)
}

.settings-file-trigger svg {
    width: 20px;
    height: 20px;
    color: var(--theme-primary)
}

.settings-file-name {
    font-size: 13px;
    color: #64748b;
    min-height: 18px;
    word-break: break-word
}

.settings-preset,
.settings-toggle,
.settings-role-card,
.settings-module-card,
.settings-backup-card {
    border: 1px solid #dbe4f0;
    border-radius: 18px;
    padding: 18px;
    background: #fff
}

.settings-preset input {
    margin-right: 10px
}

.settings-preset__swatches {
    display: flex;
    gap: 10px;
    margin-top: 14px
}

.settings-preset__swatch {
    width: 28px;
    height: 28px;
    border-radius: 999px
}

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px
}

.settings-toggle__copy strong {
    display: block;
    margin-bottom: 4px
}

.settings-switch,
.settings-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #334155
}

.settings-switch input,
.settings-check input {
    accent-color: var(--theme-primary)
}

.settings-permission-grid,
.settings-custom-list {
    display: grid;
    gap: 18px
}

.settings-toggle-grid {
    display: grid;
    gap: 18px;
}

.settings-switch--toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.settings-switch--toggle {
    position: relative;
    gap: 10px;
}

.settings-switch__ui {
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-primary) 14%, #94a3b8);
    border: 1px solid rgba(148, 163, 184, 0.65);
    display: inline-flex;
    align-items: center;
    padding: 2px;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.settings-switch__ui::after {
    content: "";
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.15);
    transform: translateX(0);
    transition: transform .16s ease;
}

.settings-switch--toggle input:checked + .settings-switch__ui {
    background: color-mix(in srgb, var(--theme-primary) 75%, #22c55e);
    border-color: color-mix(in srgb, var(--theme-primary) 60%, white);
    box-shadow: 0 10px 22px color-mix(in srgb, var(--theme-primary) 25%, transparent);
}

.settings-switch--toggle input:checked + .settings-switch__ui::after {
    transform: translateX(20px);
}

.settings-permission-row {
    display: grid;
    grid-template-columns: 110px repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
    font-size: 14px
}

.settings-permission-row strong {
    text-transform: capitalize
}

.settings-custom-module {
    border-top: 1px solid #e2e8f0;
    padding-top: 18px
}

.settings-custom-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #eff4fa
}

.settings-custom-item:last-child {
    border-bottom: 0
}

.settings-inline-form {
    display: inline
}

.invoice-table-card {
    overflow: hidden;
    padding: 0
}

.invoice-table-wrap {
    width: 100%;
    overflow-x: auto
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px
}

.invoice-table th,
.invoice-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 14px;
    vertical-align: middle
}

.invoice-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase
}

.invoice-table tbody tr:last-child td {
    border-bottom: 0
}

.invoice-table .is-right {
    text-align: right
}

.invoice-table__customer {
    display: grid;
    gap: 4px
}

.invoice-table__customer span {
    color: #64748b;
    font-size: 13px
}

.invoice-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-primary) 12%, white);
    color: var(--theme-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em
}

.invoice-table__link {
    color: var(--theme-primary);
    font-weight: 700;
    text-decoration: none
}

.invoice-items-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    background: #fff;
}

.invoice-items-table {
    width: 100%;
    min-width: 1040px;
    border-collapse: collapse;
}

.invoice-items-table th,
.invoice-items-table td {
    padding: 10px;
    border-bottom: 1px solid #e5edf6;
    vertical-align: top;
}

.invoice-items-table th {
    color: #475569;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
}

.invoice-items-table tbody tr:last-child td {
    border-bottom: 0;
}

.invoice-items-table .input {
    min-height: 42px;
    border-radius: 10px;
    padding-top: 9px;
    padding-bottom: 9px;
}

.invoice-items-table__product {
    width: 22%;
}

.invoice-product-search {
    position: relative;
    width: min(320px, 42vw);
}

.invoice-product-search .input {
    min-height: 42px;
    border-radius: 12px;
    padding-top: 9px;
    padding-bottom: 9px;
}

.invoice-product-search__results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 15;
    width: min(420px, 86vw);
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
}

.invoice-product-search__option {
    width: 100%;
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.invoice-product-search__option:hover,
.invoice-product-search__option:focus {
    background: #f1f5f9;
    outline: none;
}

.invoice-product-search__option small {
    color: #64748b;
}

.invoice-items-table__description {
    width: 25%;
}

.invoice-items-table__number {
    width: 10%;
}

.invoice-items-table__action {
    width: 110px;
    text-align: right;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #fff;
    color: var(--ui-text);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.icon-button:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--theme-primary, #2563eb) 28%, white);
    background: #f8fafc;
}

.icon-button svg {
    width: 18px;
    height: 18px;
}

.icon-button--primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--ui-accent) 0%, var(--ui-accent-strong) 100%);
}

.icon-button--danger {
    color: var(--ui-danger);
    border-color: color-mix(in srgb, var(--ui-danger) 24%, white);
    background: color-mix(in srgb, var(--ui-danger) 8%, white);
}

.icon-button:disabled {
    cursor: not-allowed;
    opacity: .45;
    transform: none;
}

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

/* DataTables Wrapper */
.dataTables_wrapper {
    padding: 24px;
    background: var(--ui-surface-strong);
    border-radius: var(--ui-radius-lg);
    border: 1px solid var(--ui-border);
    overflow-x: auto;
}

/* DataTables Controls (Filter & Length) */
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dataTables_wrapper .dataTables_length {
    justify-content: flex-start;
}

.dataTables_wrapper .dataTables_filter {
    justify-content: flex-end;
}

@media (max-width: 920px) {
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        width: 100%;
        justify-content: space-between;
    }

    .dataTables_wrapper .dataTables_filter {
        order: 2;
        margin-top: 10px;
    }

    .dataTables_wrapper .dataTables_length {
        order: 1;
    }

    .dataTables_wrapper table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        min-width: 100%;
    }

    .dataTables_wrapper table th,
    .dataTables_wrapper table td {
        white-space: nowrap;
        padding: 12px 8px;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }

    .dataTables_wrapper .dataTables_paginate {
        flex-wrap: wrap;
        gap: 5px;
    }
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--ui-text-soft);
    font-weight: 500;
    margin: 0;
}

/* DataTables Select */
.dataTables_wrapper .dataTables_length select {
    min-height: 42px;
    padding: 0 36px 0 14px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface-strong);
    color: var(--ui-text);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.dataTables_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: var(--ui-accent);
    box-shadow: 0 0 0 3px var(--ui-accent-soft);
}

/* DataTables Search Input */
.dataTables_wrapper .dataTables_filter input {
    min-height: 42px;
    min-width: 240px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface-strong);
    color: var(--ui-text);
    font-size: 0.88rem;
    transition: border-color 160ms ease, box-shadow 160ms ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--ui-accent);
    box-shadow: 0 0 0 3px var(--ui-accent-soft);
}

.dataTables_wrapper .dataTables_filter input::placeholder {
    color: var(--ui-text-soft);
    opacity: 0.7;
}

/* DataTables Info & Pagination */
.dataTables_wrapper .fg-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.85rem;
    color: var(--ui-text-soft);
    padding: 0;
    margin: 0;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin: 0;
    flex-wrap: wrap;
    padding: 8px;
}

.dataTables_wrapper .dataTables_paginate > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Pagination Buttons */
.dataTables_wrapper .dataTables_paginate > a,
.dataTables_wrapper .dataTables_paginate > span > a,
.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .fg-button,
.dataTables_wrapper .dataTables_paginate .ui-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0 14px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    border: 1px solid var(--ui-border) !important;
    background: var(--ui-surface-strong) !important;
    color: var(--ui-text) !important;
    font-size: 13px !important;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.dataTables_wrapper .dataTables_paginate > a:hover,
.dataTables_wrapper .dataTables_paginate > span > a:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dataTables_wrapper .dataTables_paginate .fg-button:hover,
.dataTables_wrapper .dataTables_paginate .ui-button:hover {
    background: var(--ui-accent-soft) !important;
    border-color: var(--ui-accent) !important;
    color: var(--ui-accent) !important;
    box-shadow: 0 10px 20px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.dataTables_wrapper .dataTables_paginate > a.previous,
.dataTables_wrapper .dataTables_paginate > a.next,
.dataTables_wrapper .dataTables_paginate > span > a.previous,
.dataTables_wrapper .dataTables_paginate > span > a.next,
.dataTables_wrapper .dataTables_paginate .paginate_button.previous,
.dataTables_wrapper .dataTables_paginate .paginate_button.next,
.dataTables_wrapper .dataTables_paginate .fg-button.ui-button.previous,
.dataTables_wrapper .dataTables_paginate .fg-button.ui-button.next {
    min-width: 40px;
    padding: 0 4px !important;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50% !important;
}

/* Disabled Pagination */
.dataTables_wrapper .dataTables_paginate > a.ui-state-disabled,
.dataTables_wrapper .dataTables_paginate > span > a.ui-state-disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .fg-button.ui-button.ui-state-disabled,
.dataTables_wrapper .dataTables_paginate .ui-state-disabled {
    background: var(--ui-surface-muted) !important;
    border-color: var(--ui-border) !important;
    color: var(--ui-text-soft) !important;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
    opacity: 0.6;
    border-radius: 50% !important;
}

/* Current/Active Pagination */
.dataTables_wrapper .dataTables_paginate > a.current,
.dataTables_wrapper .dataTables_paginate > span > a.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, var(--ui-accent), var(--ui-accent-strong)) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--ui-accent) 30%, transparent);
    transform: none;
}

/* Processing Indicator */
.dataTables_wrapper .dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--ui-surface-strong);
    padding: 16px 24px;
    border-radius: var(--ui-radius-md);
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow-soft);
    font-size: 0.9rem;
    color: var(--ui-text-soft);
    z-index: 10;
}

.invoice-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
    gap: 20px
}

.invoice-summary-card {
    display: grid;
    gap: 10px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #f8fafc
}

.invoice-summary-card span {
    color: #64748b
}

.invoice-summary-card__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase
}

.invoice-totals {
    display: grid;
    gap: 12px
}

.invoice-totals__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px
}

.invoice-totals__row--total {
    padding-top: 12px;
    border-top: 1px solid #dbe4f0;
    font-size: 16px
}

.theme-dark .settings-app {
    background: #0f172a;
    color: #e5edf7
}

.theme-dark .settings-app__primary,
.theme-dark .settings-app__secondary,
.theme-dark .settings-topbar,
.theme-dark .settings-card,
.theme-dark .settings-preset,
.theme-dark .settings-toggle,
.theme-dark .settings-backup-card {
    background: #111827;
    border-color: #243041
}

.theme-dark .settings-app__main {
    background: #0f172a
}

.theme-dark .settings-main-nav__item,
.theme-dark .settings-side-nav__item,
.theme-dark .settings-content__heading,
.theme-dark .settings-card__title,
.theme-dark .settings-field label {
    color: #e5edf7
}

.theme-dark .settings-main-nav__item.is-active {
    background: #1f2937
}

.theme-dark .settings-side-nav__item {
    color: #9fb0c7
}

.theme-dark .settings-side-nav__item.is-active {
    background: color-mix(in srgb, var(--theme-primary) 20%, #111827)
}

.theme-dark .settings-brand,
.theme-dark .settings-side-label,
.theme-dark .settings-content__subheading,
.theme-dark .settings-card__description,
.theme-dark .settings-muted,
.theme-dark .settings-file-name,
.theme-dark .settings-logo-meta p {
    color: #94a3b8
}


.theme-dark .settings-input,
.theme-dark .settings-select,
.theme-dark .settings-textarea,
.theme-dark .settings-file-trigger,
.theme-dark .settings-link-btn,
.theme-dark .settings-readonly {
    background: #0b1220;
    color: #e5edf7;
    border-color: #243041
}

.theme-dark .settings-logo-drop {
    background: #0b1220;
    border-color: #243041;
    color: #94a3b8
}

.theme-dark .settings-logo-drop--preview.has-image {
    background: #111827;
    border-color: #243041
}

.theme-dark .settings-custom-module {
    border-color: #243041
}

.theme-dark .settings-custom-item {
    border-color: #1f2937
}

.theme-dark .invoice-table th,
.theme-dark .invoice-table td {
    border-color: #243041
}

.theme-dark .invoice-items-table-wrap {
    background: #0f172a;
    border-color: #243041;
}

.theme-dark .invoice-items-table th {
    background: #111827;
    color: #cbd5e1;
}

.theme-dark .invoice-items-table td {
    border-color: #243041;
}

.theme-dark .icon-button {
    background: #111827;
    border-color: #243041;
    color: #e5edf7;
}

.theme-dark .icon-button--primary {
    color: #fff;
    border-color: transparent;
}

.theme-dark .icon-button--danger {
    color: #fca5a5;
    border-color: rgba(252, 165, 165, .28);
    background: rgba(180, 35, 24, .12);
}

.theme-dark .invoice-product-search__results {
    background: #0f172a;
    border-color: #243041;
}

.theme-dark .invoice-product-search__option {
    color: #e5edf7;
}

.theme-dark .invoice-product-search__option:hover,
.theme-dark .invoice-product-search__option:focus {
    background: #111827;
}

.theme-dark .invoice-product-search__option small {
    color: #94a3b8;
}

.theme-dark .invoice-table th {
    background: #0f172a;
    color: #9fb0c7
}

.theme-dark .invoice-table__customer span {
    color: #94a3b8
}

.theme-dark .invoice-status-pill {
    background: color-mix(in srgb, var(--theme-primary) 18%, #111827)
}

.theme-dark .dataTables_wrapper .dataTables_filter input,
.theme-dark .dataTables_wrapper .dataTables_length select {
    background: #0b1220;
    color: #e5edf7;
    border-color: #243041
}

.theme-dark .dataTables_wrapper .dataTables_info,
.theme-dark .dataTables_wrapper .dataTables_length,
.theme-dark .dataTables_wrapper .dataTables_filter,
.theme-dark .dataTables_wrapper .dataTables_paginate {
    color: #94a3b8 !important
}

.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button {
    background: #111827 !important;
    border-color: #243041 !important;
    color: #e5edf7 !important;
    box-shadow: none
}

.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #162033 !important;
    border-color: color-mix(in srgb, var(--theme-primary) 32%, #243041) !important;
    color: #fff !important
}

.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background: #0f172a !important;
    border-color: #1f2937 !important;
    color: #64748b !important
}

.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.theme-dark .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary)) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--theme-primary) 25%, transparent)
}

.theme-dark .invoice-summary-card {
    background: #0f172a;
    border-color: #243041
}

.theme-dark .invoice-summary-card span {
    color: #94a3b8
}

.theme-dark .invoice-totals__row--total {
    border-color: #243041
}

@media (max-width:1320px) {
    .settings-app {
        grid-template-columns: 250px 280px minmax(0, 1fr)
    }

    .settings-grid-three,
    .settings-feature-grid,
    .settings-backup-grid {
        grid-template-columns: 1fr
    }

    .invoice-summary-grid {
        grid-template-columns: 1fr
    }
}

@media (max-width:980px) {
    .settings-app {
        grid-template-columns: 1fr
    }

    .settings-app__primary,
    .settings-app__secondary {
        border-right: 0;
        border-bottom: 1px solid #e2e8f0
    }

    .settings-form-grid,
    .settings-grid-two,
    .settings-permission-row {
        grid-template-columns: 1fr
    }
}

@media (max-width:640px) {
    .invoice-table {
        min-width: 0
    }

    .invoice-table thead {
        display: none
    }

    .invoice-table,
    .invoice-table tbody,
    .invoice-table tr,
    .invoice-table td {
        display: block;
        width: 100%
    }

    .invoice-table tr {
        padding: 16px 18px;
        border-bottom: 1px solid #e2e8f0
    }

    .invoice-table tbody tr:last-child {
        border-bottom: 0
    }

    .invoice-table td {
        padding: 8px 0;
        border-bottom: 0;
        text-align: left
    }

    .invoice-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: #64748b;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .08em;
        text-transform: uppercase
    }

    .invoice-table .is-right {
        text-align: left
    }

    .settings-content,
    .settings-card {
        padding: 20px
    }

    .settings-logo-row,
    .settings-toggle,
    .settings-custom-item {
        flex-direction: column;
        align-items: flex-start
    }

    .theme-dark .invoice-table tr {
        border-color: #243041
    }

    .theme-dark .invoice-table td::before {
        color: #94a3b8
    }
}


.dashboard-stack {
    display: grid;
    gap: 22px;
}

.dashboard-hero-card,
.dashboard-metric-card,
.dashboard-panel-card {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 26px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .06);
}

.dashboard-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
    gap: 24px;
    padding: 30px;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--theme-primary) 14%, transparent), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 45%, #f7fafc 100%);
}

.dashboard-hero-card__title {
    margin: 16px 0 10px;
    color: #0f172a;
    font-family: 'Fraunces', serif;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1;
}

.dashboard-hero-card__text,
.dashboard-panel-card__text,
.dashboard-metric-card__meta,
.dashboard-progress-item__head span,
.dashboard-mini-stat span,
.dashboard-activity-item__main span,
.dashboard-empty-card,
.dashboard-hero-card__highlight span {
    color: #64748b;
}

.dashboard-hero-card__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.dashboard-hero-card__chart {
    display: grid;
    gap: 18px;
    align-content: stretch;
}

.dashboard-mini-chart {
    height: 220px;
    display: flex;
    align-items: end;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,.66), rgba(248,250,252,.96));
    border: 1px solid rgba(148, 163, 184, .18);
}

.dashboard-mini-chart__bar {
    flex: 1;
    min-height: 42px;
    border-radius: 18px 18px 10px 10px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--theme-primary) 55%, white), var(--theme-primary));
    display: flex;
    align-items: end;
    justify-content: center;
    padding-bottom: 10px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}

.dashboard-mini-chart__bar.is-accent {
    background: linear-gradient(180deg, color-mix(in srgb, var(--theme-accent) 45%, white), var(--theme-accent));
}

.dashboard-hero-card__highlight {
    display: grid;
    gap: 6px;
    padding: 18px 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dashboard-hero-card__highlight strong {
    font-family: 'Fraunces', serif;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dashboard-metric-grid,
.dashboard-showcase-grid,
.dashboard-lists-grid {
    display: grid;
    gap: 18px;
}

.dashboard-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-showcase-grid {
    grid-template-columns: 1.2fr .8fr;
}

.dashboard-lists-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-metric-card,
.dashboard-panel-card {
    padding: 24px;
}

.dashboard-metric-card {
    display: grid;
    gap: 10px;
}

.dashboard-metric-card--revenue {
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 10%, white), #ffffff 58%, color-mix(in srgb, var(--theme-accent) 12%, white));
}

.dashboard-metric-card__icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: color-mix(in srgb, var(--theme-primary) 12%, white);
    color: var(--theme-primary);
}

.dashboard-metric-card__icon svg {
    width: 22px;
    height: 22px;
}

.dashboard-metric-card__label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.dashboard-metric-card__value {
    color: #0f172a;
    font-family: 'Fraunces', serif;
    font-size: 2rem;
    line-height: 1;
}

.dashboard-panel-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-panel-card__title {
    margin: 0 0 6px;
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 800;
}

.dashboard-progress-list,
.dashboard-mini-stat-list,
.dashboard-activity-list {
    display: grid;
    gap: 14px;
}

.dashboard-progress-item__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.dashboard-progress-item__head strong,
.dashboard-mini-stat strong,
.dashboard-activity-item strong {
    color: #0f172a;
}

.dashboard-progress {
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef6;
}

.dashboard-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
}

.dashboard-mini-stat-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-mini-stat {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.dashboard-activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.dashboard-activity-item__main,
.dashboard-activity-item__side {
    display: grid;
    gap: 6px;
}

.dashboard-activity-item__side {
    justify-items: end;
    text-align: right;
}

.dashboard-empty-card {
    padding: 24px;
    border-radius: 20px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
}

.theme-dark .dashboard-hero-card,
.theme-dark .dashboard-metric-card,
.theme-dark .dashboard-panel-card {
    background: #111827;
    border-color: #243041;
    box-shadow: none;
}

.theme-dark .dashboard-hero-card {
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--theme-primary) 16%, transparent), transparent 30%),
        linear-gradient(135deg, #111827 0%, #0f172a 45%, #111827 100%);
}

.theme-dark .dashboard-mini-chart,
.theme-dark .dashboard-mini-stat,
.theme-dark .dashboard-activity-item,
.theme-dark .dashboard-empty-card {
    background: #0f172a;
    border-color: #243041;
}

.theme-dark .dashboard-hero-card__title,
.theme-dark .dashboard-metric-card__value,
.theme-dark .dashboard-panel-card__title,
.theme-dark .dashboard-progress-item__head strong,
.theme-dark .dashboard-mini-stat strong,
.theme-dark .dashboard-activity-item strong {
    color: #e5edf7;
}

.theme-dark .dashboard-hero-card__text,
.theme-dark .dashboard-panel-card__text,
.theme-dark .dashboard-metric-card__meta,
.theme-dark .dashboard-progress-item__head span,
.theme-dark .dashboard-mini-stat span,
.theme-dark .dashboard-activity-item__main span,
.theme-dark .dashboard-empty-card,
.theme-dark .dashboard-hero-card__highlight span,
.theme-dark .dashboard-metric-card__label {
    color: #94a3b8;
}

@media (max-width: 1320px) {
    .dashboard-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-showcase-grid,
    .dashboard-lists-grid,
    .dashboard-hero-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .dashboard-mini-stat-list {
        grid-template-columns: 1fr;
    }

    .dashboard-hero-card__actions,
    .dashboard-panel-card__head,
    .dashboard-activity-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-activity-item__side {
        justify-items: start;
        text-align: left;
    }

    .dashboard-metric-grid {
        grid-template-columns: 1fr;
    }
}





.table-action-menu {
    position: relative;
    display: inline-block
}

.table-action-menu summary {
    list-style: none
}

.table-action-menu summary::-webkit-details-marker {
    display: none
}

.table-action-menu__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, box-shadow .2s ease
}

.table-action-menu__trigger:hover,
.table-action-menu[open] .table-action-menu__trigger {
    border-color: color-mix(in srgb, var(--theme-primary) 45%, #dbe4f0);
    color: var(--theme-primary);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08)
}

.table-action-menu__icon {
    width: 18px;
    height: 18px
}

.table-action-menu__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    min-width: 160px;
    max-width: 200px;
    padding: 8px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 30px rgba(15, 23, 42, .12)
}

.table-action-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #0f172a;
    font: inherit;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer
}

.table-action-menu__item:hover {
    background: #f8fafc;
    color: var(--theme-primary)
}

.table-action-menu__item-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto
}

.table-action-menu__item--danger {
    color: #b91c1c
}

.table-action-menu__item--danger:hover {
    background: #fef2f2;
    color: #b91c1c
}
.settings-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 6px;
}

.settings-sidebar__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.settings-sidebar__toggle:hover {
    background: #f8fafc;
    border-color: color-mix(in srgb, var(--theme-primary) 28%, white);
    color: var(--theme-primary);
    transform: translateY(-1px);
}

.settings-sidebar__toggle svg {
    width: 18px;
    height: 18px;
}

body.has-collapsed-sidebar .settings-app {
    grid-template-columns: 72px 320px minmax(0, 1fr);
}

body.has-collapsed-sidebar .settings-brand,
body.has-collapsed-sidebar .settings-main-nav__item span,
body.has-collapsed-sidebar .settings-inline-submenu span {
    display: none;
}

body.has-collapsed-sidebar .settings-sidebar__head {
    justify-content: center;
}

body.has-collapsed-sidebar .settings-main-nav__item,
body.has-collapsed-sidebar .settings-inline-submenu .settings-side-nav__item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.has-collapsed-sidebar .settings-inline-submenu {
    padding-left: 0;
    margin-top: 4px;
}

body.has-collapsed-sidebar .settings-inline-submenu .settings-side-nav__item {
    min-height: 44px;
}

.theme-dark .settings-sidebar__toggle {
    background: #111827;
    border-color: #243041;
    color: #e5edf7;
}

.theme-dark .settings-sidebar__toggle:hover {
    background: #162033;
    border-color: color-mix(in srgb, var(--theme-primary) 32%, #243041);
    color: #fff;
}

@media (max-width: 980px) {
    body.has-collapsed-sidebar .settings-app {
        grid-template-columns: 1fr;
    }
}
.settings-app {
    transition: grid-template-columns .24s ease;
}

.settings-app__primary {
    transition: padding .24s ease;
}

.settings-main-nav__item,
.settings-side-nav__item {
    transition: background-color .16s ease, color .16s ease, padding .24s ease, transform .18s ease, opacity .2s ease;
}

.settings-main-nav__item svg,
.settings-side-nav__item svg,
.settings-topbar__icon svg,
.settings-card__title svg {
    transition: transform .24s ease;
}

.settings-sidebar__head {
    transition: justify-content .24s ease;
}

.settings-sidebar__toggle svg {
    transition: transform .24s ease;
}

.settings-brand,
.settings-main-nav__item span,
.settings-inline-submenu span {
    transition: opacity .18s ease, width .22s ease;
}

body.has-collapsed-sidebar .settings-brand,
body.has-collapsed-sidebar .settings-main-nav__item span,
body.has-collapsed-sidebar .settings-inline-submenu span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

body.has-collapsed-sidebar .settings-sidebar__toggle svg {
    transform: rotate(180deg);
}

body.has-collapsed-sidebar .settings-main-nav__item svg,
body.has-collapsed-sidebar .settings-inline-submenu .settings-side-nav__item svg {
    transform: scale(1.04);
}
body:not(.has-collapsed-sidebar) .settings-brand,
body:not(.has-collapsed-sidebar) .settings-main-nav__item span,
body:not(.has-collapsed-sidebar) .settings-inline-submenu span {
    display: block;
    opacity: 1;
    width: auto;
    overflow: visible;
}

body:not(.has-collapsed-sidebar) .settings-inline-submenu {
    display: grid;
    opacity: 1;
    max-height: 640px;
}

body.has-collapsed-sidebar .settings-inline-submenu {
    max-height: none;
}

.super-admin-stack {
    gap: 24px;
}

.super-admin-hero {
    align-items: start;
}

.super-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
    gap: 18px;
}

.super-admin-grid--secondary {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
}

.super-admin-toolbar {
    margin-bottom: 18px;
}

.super-admin-module-form {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid #e2e8f0;
}

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

.super-admin-module-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    padding: 18px;
    border: 1px solid #dbe4f0;
    border-radius: 20px;
    background: #f8fafc;
}

.super-admin-module-card input {
    margin-top: 2px;
    accent-color: var(--theme-primary);
}

.super-admin-module-card strong,
.super-admin-user-card label {
    color: #0f172a;
}

.super-admin-module-card span,
.super-admin-module-card small {
    color: #64748b;
}

.super-admin-module-card small {
    grid-column: 2;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.super-admin-module-card.is-locked {
    opacity: .72;
    background: #f1f5f9;
}

.super-admin-user-list,
.super-admin-analytics-list {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.super-admin-user-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
}

.theme-dark .super-admin-module-form {
    border-top-color: #243041;
}

.theme-dark .super-admin-module-card,
.theme-dark .super-admin-user-card {
    background: #0f172a;
    border-color: #243041;
}

.theme-dark .super-admin-module-card strong,
.theme-dark .super-admin-user-card label {
    color: #e5edf7;
}

.theme-dark .super-admin-module-card span,
.theme-dark .super-admin-module-card small {
    color: #94a3b8;
}

@media (max-width: 1320px) {
    .super-admin-grid,
    .super-admin-grid--secondary,
    .super-admin-module-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 1024px) {
    .settings-app {
        grid-template-columns: 200px 1fr;
    }
    
    .settings-app__main--wide {
        grid-column: span 1;
    }
    
    .invoice-product-search {
        width: min(280px, 50vw);
    }
    
    .invoice-product-search__results {
        width: min(380px, 90vw);
    }
}

@media (max-width: 920px) {
    .page-grid,
    .cards-grid,
    .stats-grid,
    .field-row {
        grid-template-columns: 1fr;
    }

    .invoice-customer-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel,
    .content-panel {
        padding: 26px;
    }
    
    .settings-app {
        grid-template-columns: 1fr;
    }
    
    .settings-app__primary {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        background: #fff;
        border-right: 1px solid #e2e8f0;
        box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
        padding: 16px 12px 24px;
    }
    
    .settings-app__primary.mobile-sidebar-open {
        display: block;
    }
    
    .mobile-sidebar-close {
        display: flex;
    }
    
    .settings-sidebar__head {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 16px;
    }
    
    .settings-topbar {
        display: flex;
    }
    
    .settings-content {
        padding: 20px 16px 32px;
    }
    
    .dataTables_wrapper {
        padding: 16px;
    }
    
    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        font-size: 14px;
    }
    
    .dataTables_wrapper .dataTables_info {
        font-size: 13px;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        font-size: 13px;
    }
    
    .dataTables_wrapper table th,
    .dataTables_wrapper table td {
        padding: 12px 10px;
        font-size: 13px;
    }
    
    .table-action-menu__panel {
        right: auto;
        left: 0;
        max-width: 180px;
    }
    
    .table-action-menu__item {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .settings-card {
        padding: 20px;
        border-radius: 16px;
    }
    
    .settings-form-grid,
    .settings-grid-two,
    .settings-grid-three,
    .settings-feature-grid,
    .settings-backup-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-permission-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .invoice-items-table {
        min-width: 100%;
    }
    
    .invoice-items-table th,
    .invoice-items-table td {
        padding: 8px 6px;
        font-size: 13px;
    }
    
    .invoice-items-table .input {
        min-height: 38px;
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .invoice-items-table__product,
    .invoice-items-table__description {
        width: auto;
        min-width: 120px;
    }
    
    .invoice-items-table__number {
        width: 80px;
    }
    
    .invoice-items-table__action {
        width: 50px;
    }
}

@media (max-width: 720px) {
    .site-footer__inner,
    .inline-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-header__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 8px 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .site-nav {
        width: auto;
        justify-content: flex-end;
        gap: 6px;
        position: relative;
    }

    .site-nav.mobile-menu-open {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px;
        background: #fff;
        border: 1px solid rgba(63, 48, 35, 0.1);
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
        z-index: 100;
        min-width: 200px;
    }

    .site-nav.mobile-menu-open .site-nav__link,
    .site-nav.mobile-menu-open .profile-menu__trigger {
        width: 100%;
        justify-content: flex-start;
    }

    .site-nav.mobile-menu-open .site-nav__link span,
    .site-nav.mobile-menu-open .profile-menu__identity {
        display: block;
    }

    .site-nav.mobile-menu-open .profile-menu__caret {
        display: block;
    }

    .site-nav__link {
        padding: 0 10px;
        min-height: 40px;
    }

    .site-nav__link span {
        display: none;
    }

    .ui-button--ghost,
    .profile-menu,
    .profile-menu__trigger {
        width: auto;
        justify-content: center;
        min-height: 40px;
        padding: 0 10px;
    }

    .ui-button {
        width: auto;
        justify-content: center;
    }

    .profile-menu__trigger {
        padding: 6px 8px 6px 6px;
        min-height: 40px;
    }

    .profile-menu__identity {
        display: none;
    }

    .profile-menu__caret {
        display: none;
    }

    .profile-menu__panel {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        margin-top: 0;
        width: min(280px, 90vw);
    }

    .brand {
        align-items: center;
    }

    .brand__mark {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 0.7rem;
    }

    .site-footer__links {
        width: 100%;
        justify-content: flex-start;
    }
    
    .page-main {
        padding: 24px 0 32px;
    }
    
    .ui-container {
        width: calc(100% - 24px);
    }
    
    .hero-panel,
    .content-panel {
        padding: 20px;
        border-radius: 20px;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .display-title {
        font-size: 1.8rem;
    }
    
    .field-row {
        gap: 12px;
    }
    
    .input,
    .textarea,
    .select {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .invoice-product-search {
        width: 100%;
    }
    
    .invoice-product-search__results {
        width: 100%;
        right: 0;
        left: 0;
    }
    
    .inline-row--tight {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .pill {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    .icon-button {
        width: 38px;
        height: 38px;
    }
    
    .icon-button svg {
        width: 16px;
        height: 16px;
    }
    
    .dataTables_wrapper {
        padding: 12px;
    }
    
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        flex-direction: column;
        gap: 10px;
    }
    
    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        width: 100%;
        font-size: 13px;
    }
    
    .dataTables_wrapper .dataTables_info {
        font-size: 12px;
    }
    
    .dataTables_wrapper .dataTables_paginate {
        justify-content: center;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .dataTables_wrapper table {
        font-size: 12px;
    }
    
    .dataTables_wrapper table th,
    .dataTables_wrapper table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .table-action-menu__panel {
        right: auto;
        left: 0;
        max-width: 160px;
    }
    
    .table-action-menu__item {
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .site-header__inner,
    .site-footer__inner {
        padding: 8px 0;
    }
    
    .brand__mark {
        width: 40px;
        height: 40px;
        font-size: 0.65rem;
    }
    
    .brand__name {
        font-size: 0.9rem;
    }
    
    .site-nav__link,
    .ui-button--ghost {
        min-height: 40px;
        font-size: 0.85rem;
        padding: 0 12px;
    }

    .ui-button {
        font-size: 0.85rem;
    }
    
    .profile-menu__trigger {
        min-height: 44px;
        padding: 6px 8px 6px 6px;
    }
    
    .profile-menu__avatar {
        width: 34px;
        height: 34px;
        font-size: 0.7rem;
    }
    
    .hero-panel,
    .content-panel {
        padding: 16px;
        border-radius: 16px;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .display-title {
        font-size: 1.5rem;
    }
    
    .eyebrow {
        font-size: 0.65rem;
        padding: 6px 10px;
    }
    
    .input,
    .textarea,
    .select {
        padding: 10px 12px;
        border-radius: 12px;
        font-size: 13px;
    }
    
    .invoice-items-table th,
    .invoice-items-table td {
        padding: 6px 4px;
        font-size: 11px;
    }
    
    .invoice-items-table .input {
        min-height: 34px;
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .icon-button {
        width: 36px;
        height: 36px;
    }
    
    .icon-button svg {
        width: 14px;
        height: 14px;
    }
    
    .settings-content {
        padding: 16px 12px 24px;
    }
    
    .settings-card {
        padding: 16px;
        border-radius: 14px;
    }
    
    .settings-card__title {
        font-size: 1rem;
    }
    
    .settings-input,
    .settings-select,
    .settings-textarea {
        min-height: 44px;
        font-size: 14px;
    }
    
    .settings-upload-btn,
    .settings-link-btn,
    .settings-save-btn {
        min-height: 38px;
        font-size: 12px;
    }
    
    .muted,
    .lead {
        font-size: 0.85rem;
    }
    
    .field label {
        font-size: 0.85rem;
    }
    
    .dataTables_wrapper {
        padding: 10px;
    }
    
    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .dataTables_wrapper .dataTables_info {
        font-size: 11px;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .dataTables_wrapper table th,
    .dataTables_wrapper table td {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    .table-action-menu__panel {
        right: auto;
        left: 0;
        max-width: 150px;
    }
    
    .table-action-menu__item {
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .input,
    .textarea,
    .select,
    .settings-input,
    .settings-select,
    .settings-textarea {
        font-size: 16px;
    }
    
    .site-nav__link,
    .ui-button--ghost,
    .icon-button {
        min-height: 48px;
        min-width: 48px;
    }

    .ui-button {
        min-width: 48px;
    }
    
    .settings-main-nav__item,
    .settings-side-nav__item {
        min-height: 48px;
        padding: 12px;
    }
}

/* Landscape mobile optimizations */
@media (max-height: 500px) and (orientation: landscape) {
    .settings-app__primary {
        height: auto;
        max-height: calc(100vh - 60px);
    }
    
    .hero-panel,
    .content-panel {
        padding: 16px;
    }
    
    .section-title {
        font-size: 1.3rem;
        margin: 12px 0 8px;
    }
}

select.input,
select.select,
.settings-select,
.dataTables_wrapper .dataTables_length select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 19px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 44px;
}
