body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-width: 320px;
    overflow-x: hidden;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.form-input {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 0.75rem 0.875rem;
    font-size: 0.95rem;
    color: #0f172a;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-error {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: #be123c;
}

.form-checkbox {
    height: 1.05rem;
    width: 1.05rem;
    border-radius: 0.3rem;
    border: 1px solid #cbd5e1;
    accent-color: #2563eb;
    cursor: pointer;
}

.color-swatch {
    display: inline-block;
    height: 0.6rem;
    width: 0.6rem;
    border-radius: 9999px;
    flex: 0 0 auto;
}

.btn-primary {
    align-items: center;
    border-radius: 0.5rem;
    background: #2563eb;
    color: #ffffff;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    padding: 0.75rem 1rem;
    transition: background 150ms ease, transform 150ms ease;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary,
.nav-link {
    border-radius: 0.5rem;
    color: #475569;
    font-weight: 600;
    padding: 0.55rem 0.75rem;
}

.btn-secondary {
    border: 1px solid #cbd5e1;
    background: #ffffff;
}

.btn-secondary:hover,
.nav-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.payment-invoice-row {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(11rem, 1.8fr) repeat(5, minmax(6.5rem, 1fr));
}

.payment-invoice-device,
.payment-invoice-field {
    min-width: 0;
}

.payment-invoice-device p,
.payment-invoice-field p {
    overflow-wrap: anywhere;
}

.sidebar-shell {
    background: #ffffff;
    border: 1px solid #e7ebf2;
    border-left: 0;
    border-radius: 0;
    bottom: 0;
    box-shadow: 8px 0 35px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    left: 0;
    overflow: hidden;
    padding: 0;
    position: fixed;
    top: 0;
    width: 19rem;
    z-index: 30;
    transition: width 180ms ease;
}

.sidebar-brand {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    padding: 1.45rem 1.35rem 1.15rem;
    transition: padding 180ms ease;
}

.sidebar-brand-logo {
    align-items: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 0.65rem;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.35rem;
    justify-content: center;
    width: 2.35rem;
}

.sidebar-brand-logo svg {
    height: 1.25rem;
    stroke-width: 1.9;
    width: 1.25rem;
}

.sidebar-brand-logo img {
    border-radius: 0.65rem;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.sidebar-brand-name {
    color: #0f172a;
    flex: 1;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    transition: opacity 150ms ease, visibility 150ms ease;
}

.sidebar-menu-button,
.sidebar-user-more {
    align-items: center;
    background: #f3f5f9;
    border: 0;
    border-radius: 0.55rem;
    color: #64748b;
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.65rem;
    justify-content: center;
    transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
    width: 2.65rem;
}

.sidebar-menu-button svg,
.sidebar-user-more svg {
    height: 1.22rem;
    stroke-width: 2;
    width: 1.22rem;
}

.sidebar-menu-button:hover,
.sidebar-user-more:hover {
    background: #eaf1ff;
    color: #2563eb;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem 1.1rem 0;
    transition: padding 180ms ease;
}

.sidebar-nav::-webkit-scrollbar {
    width: 0;
}

.sidebar-section {
    border-bottom: 1px solid #edf0f5;
    margin-bottom: 1.15rem;
    padding-bottom: 1.15rem;
}

.sidebar-section-title {
    color: #68758a;
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
    margin: 0 0 0.65rem;
    padding: 0 0.4rem;
    text-transform: uppercase;
    transition: opacity 150ms ease, visibility 150ms ease;
}

.sidebar-link {
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 0.45rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 0.98rem;
    font-weight: 500;
    justify-content: flex-start;
    letter-spacing: 0;
    line-height: 1;
    margin: 0;
    min-height: 3.2rem;
    padding: 0 0.85rem;
    position: relative;
    text-align: left;
    width: 100%;
    transition: background 150ms ease, color 150ms ease, justify-content 180ms ease, padding 180ms ease;
}

.sidebar-link svg {
    color: #69758a;
    flex: 0 0 auto;
    height: 1.22rem;
    stroke-width: 1.9;
    width: 1.22rem;
}

.sidebar-submenu {
    display: none;
    gap: 0.45rem;
    margin: 0.35rem 0 0.55rem;
    padding-left: 2.15rem;
    padding-right: 0.2rem;
}

.sidebar-submenu-open {
    display: grid;
}

[data-submenu-toggle][aria-expanded="true"] .sidebar-chevron {
    transform: rotate(90deg);
}

.sidebar-sub-link {
    align-items: center;
    border-radius: 0.45rem;
    color: #0f172a;
    display: flex;
    font-size: 0.92rem;
    font-weight: 600;
    gap: 0.75rem;
    line-height: 1;
    min-height: 2.45rem;
    padding: 0 0.75rem;
    position: relative;
    transition: background 150ms ease, color 150ms ease;
}

.sidebar-sub-link i,
.sidebar-sub-link svg {
    color: #69758a;
    flex: 0 0 auto;
    height: 1.12rem;
    stroke-width: 1.9;
    width: 1.12rem;
}

.sidebar-sub-link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.sidebar-sub-link.sidebar-link-active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.sidebar-sub-link.sidebar-link-active i,
.sidebar-sub-link.sidebar-link-active svg {
    color: #2563eb;
}

.sidebar-link span:not(.sidebar-badge) {
    flex: 1;
    min-width: 0;
    transition: opacity 150ms ease, visibility 150ms ease;
}

.sidebar-link:hover {
    background: #eff6ff;
    color: #2563eb;
}

.sidebar-link-active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0.035) 100%);
    color: #2563eb;
    font-weight: 600;
}

.sidebar-link-active:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0.035) 100%);
    color: #2563eb;
}

.sidebar-link.sidebar-link-active::before {
    background: #2563eb;
    border-radius: 999px;
    bottom: 0;
    content: "";
    left: -1px;
    position: absolute;
    top: 0;
    width: 0.22rem;
}

.sidebar-link-active svg {
    color: #2563eb;
}

.sidebar-chevron {
    color: #6b778c;
    height: 1rem !important;
    margin-left: auto;
    width: 1rem !important;
    transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
}

.sidebar-badge {
    align-items: center;
    background: #e9efff;
    border-radius: 999px;
    color: #2563eb;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 700;
    height: 1.8rem;
    justify-content: center;
    min-width: 2.4rem;
    padding: 0 0.5rem;
    transition: opacity 150ms ease, visibility 150ms ease;
}

/* Queue count on a submenu entry — deposits, returns and travel claims waiting
   on an office decision. Smaller than .sidebar-badge and amber, because it is a
   nag rather than a neutral count. */
.sidebar-sub-badge {
    align-items: center;
    background: #fef3c7;
    border-radius: 999px;
    color: #92400e;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 700;
    height: 1.35rem;
    justify-content: center;
    margin-left: auto;
    min-width: 1.6rem;
    padding: 0 0.4rem;
}

.sidebar-logout-form {
    border-bottom: 1px solid #edf0f5;
    margin-bottom: 0;
    padding-bottom: 1.15rem;
}

.sidebar-link-danger {
    color: #ef4444;
}

.sidebar-link-danger svg {
    color: #ef4444;
}

.sidebar-link-danger:hover {
    background: #fff1f2;
    color: #ef4444;
}

.sidebar-user {
    align-items: center;
    border-top: 1px solid #edf0f5;
    display: flex;
    gap: 1rem;
    min-height: 5.8rem;
    padding: 1.25rem 1.25rem;
    transition: padding 180ms ease;
}

.sidebar-user-avatar {
    align-items: center;
    background: #dfe7ff;
    border: 0;
    border-radius: 999px;
    color: #2563eb;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1rem;
    font-weight: 600;
    height: 2.8rem;
    justify-content: center;
    width: 2.8rem;
}

.sidebar-user-meta {
    display: block;
    flex: 1;
    min-width: 0;
    transition: opacity 150ms ease, visibility 150ms ease;
}

.sidebar-user-meta span,
.sidebar-user-meta small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-meta span {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
}

.sidebar-user-meta small {
    color: #64748b;
    font-size: 0.92rem;
    margin-top: 0.25rem;
}

.app-main {
    margin-left: 19rem;
    max-width: none;
    padding: 0 2rem 2rem;
    transition: margin-left 180ms ease;
    width: calc(100% - 19rem);
}

.app-topbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e7ebf2;
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.055);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    min-height: 4.5rem;
    padding: 0.85rem 1rem 0.85rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-topbar-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.app-topbar-title span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    text-transform: uppercase;
}

.app-topbar-title strong {
    color: #0f172a;
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 0.65rem;
}

.app-topbar-icon {
    align-items: center;
    background: #f3f5f9;
    border: 0;
    border-radius: 0.55rem;
    color: #64748b;
    display: inline-flex;
    height: 2.65rem;
    justify-content: center;
    position: relative;
    transition: background 150ms ease, color 150ms ease;
    width: 2.65rem;
}

.app-topbar-icon:hover {
    background: #eaf1ff;
    color: #2563eb;
}

.app-topbar-icon svg {
    height: 1.15rem;
    stroke-width: 2;
    width: 1.15rem;
}

.app-topbar-icon span {
    background: #2563eb;
    border: 2px solid #ffffff;
    border-radius: 999px;
    height: 0.62rem;
    position: absolute;
    right: 0.72rem;
    top: 0.7rem;
    width: 0.62rem;
}

.app-topbar-dot {
    align-items: center;
    background: #e11d48 !important;
    border: 2px solid #ffffff;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex !important;
    font-size: 0.6rem;
    font-weight: 700;
    height: 1.05rem !important;
    justify-content: center;
    line-height: 1;
    min-width: 1.05rem;
    padding: 0 0.2rem;
    position: absolute;
    right: 0.3rem;
    top: 0.28rem;
    width: auto !important;
}

.app-topbar-search {
    align-items: center;
    background: #f3f5f9;
    border-radius: 0.55rem;
    display: inline-flex;
    overflow: hidden;
    transition: background 150ms ease;
}

.app-topbar-search .app-topbar-icon {
    background: transparent;
}

.app-topbar-search input {
    background: transparent;
    border: 0;
    color: #0f172a;
    font-size: 0.85rem;
    outline: none;
    padding: 0 0.6rem 0 0;
    width: 0;
    transition: width 180ms ease;
}

.app-topbar-search:focus-within,
.app-topbar-search.is-open {
    background: #eaf1ff;
}

.app-topbar-search:focus-within input,
.app-topbar-search.is-open input {
    width: 14rem;
}

@media (max-width: 640px) {
    .app-topbar-search:focus-within input,
    .app-topbar-search.is-open input {
        width: 9rem;
    }
}

.app-topbar-user {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #edf0f5;
    border-radius: 0.65rem;
    color: #0f172a;
    display: inline-flex;
    gap: 0.65rem;
    min-height: 2.65rem;
    padding: 0.35rem 0.85rem 0.35rem 0.4rem;
}

.app-topbar-user span {
    align-items: center;
    background: #dfe7ff;
    border-radius: 999px;
    color: #2563eb;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.85rem;
    font-weight: 700;
    height: 1.95rem;
    justify-content: center;
    width: 1.95rem;
}

.app-topbar-user small {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar-user-wrap {
    position: relative;
}

button.app-topbar-user {
    cursor: pointer;
    font-family: inherit;
    transition: background 160ms ease, border-color 160ms ease;
}

button.app-topbar-user:hover,
.app-topbar-user-wrap.is-open button.app-topbar-user {
    background: #eaf1ff;
    border-color: #dfe7ff;
}

.app-topbar-user-caret {
    color: #94a3b8;
    height: 1rem;
    transition: transform 160ms ease;
    width: 1rem;
}

.app-topbar-user-wrap.is-open .app-topbar-user-caret {
    transform: rotate(180deg);
}

.app-topbar-user-menu {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.25);
    display: none;
    min-width: 14rem;
    padding: 0.4rem;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 60;
}

.app-topbar-user-wrap.is-open .app-topbar-user-menu {
    display: block;
}

.app-topbar-user-menu-head {
    border-bottom: 1px solid #edf0f5;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-bottom: 0.35rem;
    padding: 0.5rem 0.75rem 0.65rem;
}

.app-topbar-user-menu-head strong {
    color: #0f172a;
    font-size: 0.88rem;
}

.app-topbar-user-menu-head small {
    color: #64748b;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar-user-menu form {
    margin: 0;
}

.app-topbar-user-menu-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0.55rem;
    color: #334155;
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    text-decoration: none;
    width: 100%;
}

.app-topbar-user-menu-item svg {
    height: 1rem;
    stroke-width: 2;
    width: 1rem;
}

.app-topbar-user-menu-item:hover {
    background: #eaf1ff;
    color: #2563eb;
}

.app-topbar-user-menu-danger {
    color: #e11d48;
}

.app-topbar-user-menu-danger:hover {
    background: #fff1f2;
    color: #e11d48;
}

a.sidebar-user {
    color: inherit;
    text-decoration: none;
    transition: background 160ms ease;
}

a.sidebar-user:hover {
    background: #f8fafc;
}

body.is-sidebar-collapsed .sidebar-shell,
.sidebar-shell.sidebar-collapsed {
    width: 5.4rem;
}

body.is-sidebar-collapsed .sidebar-brand,
.sidebar-shell.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 1.35rem 0.8rem 1.05rem;
}

body.is-sidebar-collapsed .sidebar-brand-name,
body.is-sidebar-collapsed .sidebar-section-title,
body.is-sidebar-collapsed .sidebar-link span:not(.sidebar-badge),
body.is-sidebar-collapsed .sidebar-chevron,
body.is-sidebar-collapsed .sidebar-badge,
body.is-sidebar-collapsed .sidebar-user-meta,
body.is-sidebar-collapsed .sidebar-user-more,
.sidebar-shell.sidebar-collapsed .sidebar-brand-name,
.sidebar-shell.sidebar-collapsed .sidebar-section-title,
.sidebar-shell.sidebar-collapsed .sidebar-link span:not(.sidebar-badge),
.sidebar-shell.sidebar-collapsed .sidebar-chevron,
.sidebar-shell.sidebar-collapsed .sidebar-badge,
.sidebar-shell.sidebar-collapsed .sidebar-user-meta,
.sidebar-shell.sidebar-collapsed .sidebar-user-more {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

body.is-sidebar-collapsed .sidebar-brand-logo,
.sidebar-shell.sidebar-collapsed .sidebar-brand-logo {
    display: none;
}

body.is-sidebar-collapsed .sidebar-brand-name,
body.is-sidebar-collapsed .sidebar-section-title,
body.is-sidebar-collapsed .sidebar-link span,
body.is-sidebar-collapsed .sidebar-chevron,
body.is-sidebar-collapsed .sidebar-badge,
body.is-sidebar-collapsed .sidebar-user-meta,
body.is-sidebar-collapsed .sidebar-user-more,
.sidebar-shell.sidebar-collapsed .sidebar-brand-name,
.sidebar-shell.sidebar-collapsed .sidebar-section-title,
.sidebar-shell.sidebar-collapsed .sidebar-link span,
.sidebar-shell.sidebar-collapsed .sidebar-chevron,
.sidebar-shell.sidebar-collapsed .sidebar-badge,
.sidebar-shell.sidebar-collapsed .sidebar-user-meta,
.sidebar-shell.sidebar-collapsed .sidebar-user-more {
    display: none;
}

body.is-sidebar-collapsed .sidebar-menu-button,
.sidebar-shell.sidebar-collapsed .sidebar-menu-button {
    background: #eaf1ff;
    color: #2563eb;
}

body.is-sidebar-collapsed .sidebar-nav,
.sidebar-shell.sidebar-collapsed .sidebar-nav {
    padding: 0.35rem 0.8rem 0;
}

body.is-sidebar-collapsed .sidebar-section,
.sidebar-shell.sidebar-collapsed .sidebar-section {
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
}

body.is-sidebar-collapsed .sidebar-link,
.sidebar-shell.sidebar-collapsed .sidebar-link {
    justify-content: center;
    min-height: 3.15rem;
    padding: 0;
}

body.is-sidebar-collapsed .sidebar-link svg:not(.sidebar-chevron),
.sidebar-shell.sidebar-collapsed .sidebar-link svg:not(.sidebar-chevron) {
    margin: 0;
}

body.is-sidebar-collapsed .sidebar-link.sidebar-link-active::before,
.sidebar-shell.sidebar-collapsed .sidebar-link.sidebar-link-active::before {
    left: 0;
    width: 0.2rem;
}

body.is-sidebar-collapsed .sidebar-submenu,
.sidebar-shell.sidebar-collapsed .sidebar-submenu {
    display: none;
}

body.is-sidebar-collapsed .sidebar-logout-form,
.sidebar-shell.sidebar-collapsed .sidebar-logout-form {
    padding-bottom: 0.85rem;
}

body.is-sidebar-collapsed .sidebar-user,
.sidebar-shell.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding: 1rem 0.8rem;
}

body.is-sidebar-collapsed .sidebar-user-avatar,
.sidebar-shell.sidebar-collapsed .sidebar-user-avatar {
    height: 2.45rem;
    width: 2.45rem;
}

body.is-sidebar-collapsed .app-main,
.app-main.sidebar-collapsed {
    margin-left: 5.4rem;
    width: calc(100% - 5.4rem);
}

html.is-sidebar-collapsed .sidebar-shell {
    width: 5.4rem;
}

html.is-sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 1.35rem 0.8rem 1.05rem;
}

html.is-sidebar-collapsed .sidebar-brand-name,
html.is-sidebar-collapsed .sidebar-section-title,
html.is-sidebar-collapsed .sidebar-link span,
html.is-sidebar-collapsed .sidebar-chevron,
html.is-sidebar-collapsed .sidebar-badge,
html.is-sidebar-collapsed .sidebar-user-meta,
html.is-sidebar-collapsed .sidebar-user-more,
html.is-sidebar-collapsed .sidebar-brand-logo {
    display: none;
}

html.is-sidebar-collapsed .sidebar-menu-button {
    background: #eaf1ff;
    color: #2563eb;
}

html.is-sidebar-collapsed .sidebar-nav {
    padding: 0.35rem 0.8rem 0;
}

html.is-sidebar-collapsed .sidebar-section {
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
}

html.is-sidebar-collapsed .sidebar-link {
    justify-content: center;
    min-height: 3.15rem;
    padding: 0;
}

html.is-sidebar-collapsed .sidebar-link.sidebar-link-active::before {
    left: 0;
    width: 0.2rem;
}

html.is-sidebar-collapsed .sidebar-submenu {
    display: none;
}

html.is-sidebar-collapsed .sidebar-logout-form {
    padding-bottom: 0.85rem;
}

html.is-sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding: 1rem 0.8rem;
}

html.is-sidebar-collapsed .sidebar-user-avatar {
    height: 2.45rem;
    width: 2.45rem;
}

html.is-sidebar-collapsed .app-main {
    margin-left: 5.4rem;
    width: calc(100% - 5.4rem);
}

.mobile-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: none;
}

@media (max-width: 1280px) {
    .sidebar-shell {
        width: 16.5rem;
    }

    .sidebar-brand {
        padding: 1.25rem 1rem 1rem;
    }

    .sidebar-brand-name {
        font-size: 1.12rem;
    }

    .sidebar-menu-button,
    .sidebar-user-more {
        height: 2.4rem;
        width: 2.4rem;
    }

    .sidebar-nav {
        padding: 0.25rem 0.85rem 0;
    }

    .sidebar-link {
        gap: 0.75rem;
        font-size: 0.92rem;
        min-height: 3rem;
        padding: 0 0.7rem;
    }

    .sidebar-user {
        gap: 0.75rem;
        padding: 1rem;
    }

    .app-main {
        margin-left: 16.5rem;
        padding: 0 1.5rem 1.5rem;
        width: calc(100% - 16.5rem);
    }

    .app-topbar {
        top: 0;
    }
}

@media (max-width: 1100px) {
    .sidebar-shell {
        width: 14.75rem;
    }

    .sidebar-brand-logo {
        height: 2.1rem;
        width: 2.1rem;
    }

    .sidebar-brand-name {
        font-size: 1rem;
    }

    .sidebar-link {
        font-size: 0.88rem;
        min-height: 2.85rem;
    }

    .sidebar-user-avatar {
        height: 2.35rem;
        width: 2.35rem;
    }

    .sidebar-user-meta span {
        font-size: 0.9rem;
    }

    .sidebar-user-meta small {
        font-size: 0.78rem;
    }

    .app-main {
        margin-left: 14.75rem;
        padding: 0 1.25rem 1.25rem;
        width: calc(100% - 14.75rem);
    }

    .app-topbar {
        margin-bottom: 1.25rem;
        min-height: 4.2rem;
        padding: 0.75rem 0.85rem 0.75rem 1rem;
    }

    .app-topbar-title strong {
        font-size: 1rem;
    }

    .app-topbar-user small {
        max-width: 7rem;
    }
}

@media (max-width: 900px) {
    .sidebar-shell {
        display: none;
    }

    .mobile-header {
        display: block;
    }

    .app-main {
        margin-left: 0;
        padding: 0 1rem 1rem;
        width: 100%;
    }

    .app-topbar {
        top: 0;
        margin-bottom: 1rem;
    }

    html.is-sidebar-collapsed .app-main,
    body.is-sidebar-collapsed .app-main,
    .app-main.sidebar-collapsed {
        margin-left: 0;
        width: 100%;
    }

    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 40;
    }

    .mobile-header nav {
        scrollbar-width: none;
    }

    .mobile-header nav::-webkit-scrollbar {
        display: none;
    }

    .app-main section,
    .app-main form,
    .app-main .rounded-lg {
        max-width: 100%;
    }

    .app-main .p-8 {
        padding: 1.25rem;
    }

    .app-main .p-6 {
        padding: 1rem;
    }

    .app-main h1 {
        font-size: 1.75rem;
        line-height: 1.18;
    }

    .btn-primary,
    .btn-secondary {
        min-height: 2.75rem;
    }

    table {
        min-width: 42rem;
    }

    .payment-invoice-row {
        gap: 0.75rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payment-invoice-device {
        grid-column: 1 / -1;
    }

    .payment-invoice-field {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        padding: 0.75rem;
    }
}

@media (max-width: 640px) {
    .app-main {
        padding: 0 0.75rem 0.75rem;
    }

    .app-topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.9rem;
        position: static;
    }

    .app-topbar-title strong {
        white-space: normal;
    }

    .app-topbar-actions {
        justify-content: space-between;
        width: 100%;
    }

    .app-topbar-user {
        flex: 1;
        justify-content: flex-start;
        min-width: 0;
    }

    .app-topbar-user small {
        max-width: none;
    }

    .mobile-header > div {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .mobile-header nav {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .app-main .rounded-lg {
        border-radius: 0.5rem;
    }

    .app-main .p-8,
    .app-main .p-6 {
        padding: 1rem;
    }

    .app-main h1 {
        font-size: 1.5rem;
    }

    .app-main h2 {
        font-size: 1.35rem;
    }

    .app-main .flex.gap-3 {
        flex-wrap: wrap;
    }

    .app-main .btn-primary,
    .app-main .btn-secondary {
        width: 100%;
    }

    .form-input {
        font-size: 1rem;
        min-height: 2.85rem;
    }

    th.px-6,
    td.px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    th.py-3 {
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    td.py-4 {
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }

    .payment-due-summary {
        align-items: flex-start;
    }

    .payment-due-summary span {
        align-self: flex-start;
    }

    .payment-invoice-list {
        border: 0;
        border-radius: 0;
    }

    .payment-invoice-row {
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        grid-template-columns: 1fr;
        margin-bottom: 0.75rem;
    }

    .payment-invoice-list > .payment-invoice-row:last-child {
        margin-bottom: 0;
    }

    .payment-invoice-field {
        align-items: center;
        display: flex;
        justify-content: space-between;
        gap: 1rem;
    }

    .payment-invoice-field p:first-child {
        margin: 0;
    }

    .payment-invoice-field p:last-child {
        margin-top: 0;
        text-align: right;
    }
}

@media (max-width: 420px) {
    .app-main {
        padding: 0 0.6rem 0.6rem;
    }

    .app-topbar {
        border-radius: 0.55rem;
        gap: 0.7rem;
        padding: 0.8rem;
    }

    .app-topbar-icon {
        height: 2.45rem;
        width: 2.45rem;
    }

    .app-topbar-user {
        padding-right: 0.65rem;
    }

    .mobile-header a.text-base {
        font-size: 0.95rem;
    }

    .nav-link {
        padding: 0.5rem 0.65rem;
        white-space: nowrap;
    }

    .app-main .p-8,
    .app-main .p-6 {
        padding: 0.85rem;
    }

    .app-main h1 {
        font-size: 1.35rem;
    }

    .app-main p,
    .app-main dt,
    .app-main dd,
    .form-label {
        overflow-wrap: anywhere;
    }
}

/* Login page */
body:has(.login-card) {
    background-color: #f1f5f9;
}

.login-card {
    background: #ffffff;
    border: 1px solid #e7ebf2;
    border-radius: 1rem;
    box-shadow: 0 8px 35px rgba(15, 23, 42, 0.06);
}

.login-card-logo {
    align-items: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 0.65rem;
    color: #ffffff;
    display: inline-flex;
    height: 3.25rem;
    justify-content: center;
    overflow: hidden;
    width: 3.25rem;
}

.login-card-logo img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.login-card .form-input {
    border-radius: 0.55rem;
    border-color: #e7ebf2;
    background: #ffffff;
    padding: 0.8rem 1rem;
}

.login-card .form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-card .form-label {
    font-size: 0.8rem;
    color: #475569;
}

.login-card .btn-primary {
    border-radius: 0.55rem;
    padding: 0.85rem 1rem;
}

.login-password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    color: #94a3b8;
    transition: color 150ms ease;
}

.login-password-toggle:hover {
    color: #0f172a;
}

.login-password-toggle i {
    width: 1.1rem;
    height: 1.1rem;
}

/* Direct payment (renew subscription) page */
.renewal-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #2563eb;
    flex-shrink: 0;
}

/* Inline table filter controls — .form-input is 100% wide, these sit in a row */
.filter-control {
    width: auto;
    min-width: 8.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.filter-control[type="search"] {
    min-width: 15rem;
}

@media (max-width: 640px) {
    .filter-control,
    .filter-control[type="search"] {
        width: 100%;
        min-width: 0;
    }
}

/* Square icon-only action buttons (table rows) */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    width: 2.25rem;
    flex: 0 0 auto;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.icon-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.icon-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.icon-btn i,
.icon-btn svg {
    height: 1.05rem;
    width: 1.05rem;
}

.icon-btn-blue:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

/* Notification bell dropdown */
.notification-wrap {
    position: relative;
}

.notification-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.25);
    max-height: 26rem;
    overflow: hidden;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: 22rem;
    z-index: 60;
}

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

.notification-panel-head {
    align-items: center;
    border-bottom: 1px solid #edf0f5;
    display: flex;
    justify-content: space-between;
    padding: 0.7rem 0.9rem;
}

.notification-panel-head strong {
    color: #0f172a;
    font-size: 0.88rem;
}

.notification-panel-head button {
    background: transparent;
    border: 0;
    color: #2563eb;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
}

.notification-list {
    max-height: 19rem;
    overflow-y: auto;
}

.notification-item {
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.9rem;
    text-decoration: none;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item strong {
    color: #0f172a;
    font-size: 0.83rem;
}

.notification-item span {
    color: #475569;
    font-size: 0.78rem;
}

.notification-item small {
    color: #94a3b8;
    font-size: 0.7rem;
}

.notification-item-unread {
    background: #eff6ff;
}

.notification-item-unread strong::before {
    background: #2563eb;
    border-radius: 9999px;
    content: "";
    display: inline-block;
    height: 0.4rem;
    margin-right: 0.4rem;
    width: 0.4rem;
}

.notification-empty {
    color: #94a3b8;
    font-size: 0.8rem;
    padding: 1.5rem 0.9rem;
    text-align: center;
}

.notification-panel-foot {
    border-top: 1px solid #edf0f5;
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
}

.notification-panel-foot a,
.notification-panel-foot button {
    background: transparent;
    border: 0;
    color: #2563eb;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}

/* Compose notice — audience cards and role toggles */
.compose-option {
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    transition: background 0.15s, border-color 0.15s;
}

.compose-option:hover {
    background: #f8fafc;
}

.compose-option:has(input:checked) {
    background: #eff6ff;
    border-color: #2563eb;
}

.compose-option-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.compose-option-body strong {
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 600;
}

.compose-option-body small {
    color: #64748b;
    font-size: 0.72rem;
}

.compose-option-check {
    color: #2563eb;
    opacity: 0;
    flex-shrink: 0;
}

.compose-option:has(input:checked) .compose-option-check {
    opacity: 1;
}

.compose-role {
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    cursor: pointer;
    display: flex;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    transition: background 0.15s, border-color 0.15s;
}

.compose-role:hover {
    background: #f8fafc;
}

.compose-role:has(input:checked) {
    background: #eff6ff;
    border-color: #2563eb;
}

.compose-role-check {
    align-items: center;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.35rem;
    color: transparent;
    display: flex;
    flex-shrink: 0;
    height: 1.1rem;
    justify-content: center;
    width: 1.1rem;
}

.compose-role:has(input:checked) .compose-role-check {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.compose-role-name {
    color: #334155;
    flex: 1;
    font-size: 0.83rem;
    font-weight: 600;
}

.compose-role-count {
    background: #f1f5f9;
    border-radius: 9999px;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
}

/* A role nobody holds still sends nothing — make that obvious before clicking. */
.compose-role-empty .compose-role-name,
.compose-role-empty .compose-role-count {
    color: #94a3b8;
}

/* Print icon while its hidden print frame is loading. */
.icon-btn.is-printing {
    opacity: 0.5;
    pointer-events: none;
}
