:root {
    --background: #f8fafc;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-soft: #f8fafc;
    --foreground: #0f172a;
    --muted-foreground: #64748b;
    --border: #dbe2ea;
    --border-strong: #c7d2de;
    --primary: #0f172a;
    --primary-foreground: #ffffff;
    --accent: #cc1f1f;
    --accent-soft: rgba(204, 31, 31, 0.08);
    --success: #166534;
    --success-soft: #ecfdf5;
    --warning: #9a3412;
    --warning-soft: #fff7ed;
    --danger: #b91c1c;
    --danger-soft: #fef2f2;
    --info: #1d4ed8;
    --info-soft: #eff6ff;
    --color-primary: var(--primary);
    --color-danger: var(--danger);
    --color-success: var(--success);
    --color-bg: var(--background);
    --color-surface: #ffffff;
    --color-border: var(--border);
    --color-text: var(--foreground);
    --color-muted: var(--muted-foreground);
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --space-2: 0.5rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
    --radius-sm: 8px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --container: 1360px;
    --topbar-height: 92px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--foreground);
    background:
        radial-gradient(circle at 12% 18%, rgba(219, 234, 254, 0.78), transparent 28%),
        radial-gradient(circle at 88% 24%, rgba(224, 242, 254, 0.7), transparent 24%),
        radial-gradient(circle at 80% 84%, rgba(241, 245, 249, 0.92), transparent 28%),
        linear-gradient(180deg, #f8fafc 0%, #eef3f8 46%, #f8fafc 100%);
    line-height: 1.6;
}

a {
    color: inherit;
}

.bg-orb {
    position: fixed;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(78px);
    opacity: 0.55;
    z-index: 0;
}

.bg-orb-1 {
    width: 360px;
    height: 360px;
    top: 110px;
    left: -60px;
    background: rgba(191, 219, 254, 0.9);
}

.bg-orb-2 {
    width: 320px;
    height: 320px;
    right: -40px;
    bottom: 80px;
    background: rgba(226, 232, 240, 0.92);
}

.bg-orb-3 {
    width: 280px;
    height: 280px;
    top: 42%;
    right: 24%;
    background: rgba(254, 226, 226, 0.32);
}

.container {
    width: min(var(--container), calc(100vw - 40px));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.84);
    border-bottom: 1px solid rgba(203, 213, 225, 0.72);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 8px 24px rgba(15, 23, 42, 0.03);
}

.topbar-inner {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
}

.brand-shell,
.topbar-right,
.brand-suite,
.nav,
.topbar-user,
.actions,
.inline-select,
.line-item-header,
.card-header,
.field-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand-shell,
.topbar-right {
    min-width: 0;
}

.brand-suite {
    text-decoration: none;
    gap: 0.9rem;
}

.brand-byndbits {
    font-family: "Montserrat", "Segoe UI", sans-serif;
    font-size: 1.125rem;
    font-weight: 300;
    letter-spacing: 0.24em;
    color: #1a2a5e;
    white-space: nowrap;
}

.brand-byndbits-dot {
    color: var(--accent);
    font-weight: 600;
}

.brand-divider {
    width: 1px;
    height: 48px;
    background: linear-gradient(180deg, transparent, var(--accent), transparent);
    flex-shrink: 0;
}

.brand-tts-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
}

.brand-bespoke-logo {
    height: 60px;
    width: auto;
    display: block;
}

.brand-app,
.topbar-user-meta {
    display: flex;
    flex-direction: column;
}

.brand-kicker,
.topbar-user-role,
.summary-bar span,
.table-wrap thead th {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.brand-kicker {
    font-size: 0.68rem;
    color: var(--muted-foreground);
    font-weight: 700;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav a {
    text-decoration: none;
    color: var(--muted-foreground);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.6rem 0.82rem;
    border-radius: 999px;
    transition: color 0.16s ease, background 0.16s ease;
}

.nav a:hover,
.nav a:focus-visible {
    color: var(--foreground);
    background: rgba(255, 255, 255, 0.8);
    outline: none;
}

.topbar-user {
    padding: 0.45rem 0.55rem 0.45rem 0.85rem;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-sm);
}

.topbar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.topbar-user-role {
    margin-top: 0.15rem;
    font-size: 0.66rem;
    color: var(--muted-foreground);
    font-weight: 700;
}

.layout {
    padding: 2rem 0 3.75rem;
}

.card {
    background: var(--surface);
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.6rem;
    margin-bottom: 1.25rem;
    backdrop-filter: blur(12px);
}

.card-header,
.line-item-header {
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.page-title-stack {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 0;
}

.page-title-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
}

.page-title-copy .muted {
    margin: 0;
}

.card-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.back-button {
    min-width: 104px;
    box-shadow: var(--shadow-sm);
}

h1,
h2 {
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

h1 {
    font-size: clamp(1.45rem, 1.15rem + 1vw, 2rem);
    font-weight: 700;
}

h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.muted {
    color: var(--muted-foreground);
    font-size: 0.92rem;
}

.flash-list {
    display: grid;
    gap: 0.7rem;
    margin-bottom: 1.1rem;
}

.flash {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.flash-success {
    background: var(--success-soft);
    border-color: #bbf7d0;
    color: var(--success);
}

.flash-error {
    background: var(--danger-soft);
    border-color: #fecaca;
    color: var(--danger);
}

.flash-info {
    background: var(--info-soft);
    border-color: #bfdbfe;
    color: var(--info);
}

.form-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

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

.filter-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
}

label,
.field-label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.86rem;
    font-weight: 600;
}

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

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.92);
    color: var(--foreground);
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
    border-color: rgba(15, 23, 42, 0.34);
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.07);
    background: #ffffff;
}

input:not([type="checkbox"]):not([type="radio"]):invalid,
textarea:invalid,
select:invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
    background: #fff5f5;
}

input:not([type="checkbox"]):not([type="radio"]):invalid:focus,
textarea:invalid:focus,
select:invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.25), 0 0 0 8px rgba(185, 28, 28, 0.08);
    background: #ffffff;
}

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

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 1rem;
    padding-right: 2.7rem;
}

button,
.button-link,
.btn-primary,
.action-link,
.notification-link,
.table-wrap td > a,
.simple-list li > a,
.card-header > a:not(.brand-suite),
.card-header-actions > a,
.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.72rem 1.02rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: var(--primary);
    color: var(--primary-foreground);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.12);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

button:hover,
.button-link:hover,
.action-link:hover,
.notification-link:hover,
.table-wrap td > a:hover,
.simple-list li > a:hover,
.card-header > a:not(.brand-suite):hover,
.card-header-actions > a:hover,
.link-button:hover,
button:focus-visible,
.button-link:focus-visible,
.action-link:focus-visible,
.notification-link:focus-visible,
.table-wrap td > a:focus-visible,
.simple-list li > a:focus-visible,
.card-header > a:not(.brand-suite):focus-visible,
.card-header-actions > a:focus-visible,
.link-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 28px rgba(15, 23, 42, 0.16);
    outline: none;
}

button.secondary,
.button-link,
.notification-link,
.simple-list li > a,
.card-header > a:not(.brand-suite),
.link-button {
    background: rgba(255, 255, 255, 0.92);
    color: var(--foreground);
    border-color: rgba(203, 213, 225, 0.88);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--color-primary);
    color: var(--primary-foreground);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.72rem 1.02rem;
    border-radius: var(--radius-md);
    border: 1px solid #fecaca;
    background: var(--danger-soft);
    color: var(--color-danger);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
}

.input-field {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.92);
    color: var(--foreground);
}

.page-title {
    margin: 0;
    font-size: clamp(1.55rem, 1.24rem + 1.2vw, 2.35rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.section-title {
    margin: 0;
    font-size: var(--text-xl);
    line-height: 1.2;
    letter-spacing: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

button.compact,
.table-wrap td > a,
.notification-link {
    min-height: 36px;
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

button.danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #fecaca;
    box-shadow: none;
}

button:disabled,
button.disabled-approval {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    background: var(--muted-foreground) !important;
    color: white !important;
}

button.disabled-approval:hover {
    transform: none !important;
    box-shadow: none !important;
}

.inline-select {
    align-items: stretch;
    width: 100%;
}

.inline-role-form,
.inline-check {
    display: flex;
    align-items: center;
}

.inline-role-form {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.assignment-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 0.65rem;
    align-items: end;
}

.admin-workspace,
.admin-create-panel,
.admin-users-panel {
    position: relative;
    z-index: 1;
}

.admin-page-head,
.section-heading-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
}

.admin-page-head {
    align-items: flex-start;
    padding: 0.4rem 0 0.7rem;
    border-bottom: 1px solid rgba(203, 213, 225, 0.7);
}

.admin-head-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-page-head h1,
.section-heading-row h2 {
    margin: 0;
}

.admin-count {
    display: grid;
    justify-items: end;
    min-width: 120px;
}

.admin-count strong {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    line-height: 1;
}

.admin-count span,
.mini-form-title {
    color: var(--muted-foreground);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-create-panel,
.admin-users-panel {
    margin-top: 1.1rem;
    padding-top: 1rem;
}

.admin-create-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
    align-items: end;
}

.admin-create-grid .field-label,
.admin-create-grid label {
    min-width: 0;
}

.form-action-row {
    display: flex;
    justify-content: flex-end;
}

.admin-search {
    min-width: min(100%, 320px);
    color: var(--muted-foreground);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.multi-select-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    align-items: end;
}

.modal-form-grid .span-2 {
    grid-column: 1 / -1;
}

.modal-section-grid {
    display: grid;
    grid-template-columns: minmax(240px, 0.85fr) minmax(220px, 0.68fr) minmax(300px, 1fr);
    gap: 0.9rem;
    align-items: start;
}

.modal-section {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.74);
}

.admin-mini-form button[type="submit"] {
    align-self: flex-start;
    margin-top: auto;
    min-width: 136px;
}

.magic-selection-panel {
    align-self: stretch;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.86));
}

.magic-selection-panel > span {
    display: block;
    margin-bottom: 0.45rem;
}

.segmented-choice {
    gap: 0.35rem;
}

.choice-grid {
    display: flex;
    flex-wrap: wrap;
}

.segmented-choice .inline-check {
    min-height: 36px;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--foreground);
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.segmented-choice .inline-check:has(input:checked) {
    border-color: rgba(204, 31, 31, 0.45);
    background: var(--accent-soft);
}

.segmented-choice .inline-check:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

.admin-users-table {
    min-width: 1120px;
}

.admin-users-table th:nth-child(1) {
    width: 20%;
}

.admin-users-table th:nth-child(2) {
    width: 18%;
}

.admin-users-table th:nth-child(3) {
    width: 34%;
}

.admin-users-table th:nth-child(4) {
    width: 12%;
}

.admin-users-table th:nth-child(5) {
    width: 16%;
}

.admin-users-table th:last-child,
.admin-users-table td:last-child {
    text-align: right;
}

.admin-users-table td:last-child button {
    min-width: 92px;
}

.user-identity,
.assignment-summary,
.role-chip-list,
.user-edit-grid,
.admin-mini-form {
    display: grid;
    gap: 0.4rem;
}

.user-identity strong {
    font-size: 0.95rem;
    line-height: 1.2;
}

.user-identity span,
.user-identity small,
.assignment-summary span {
    color: var(--muted-foreground);
    font-size: 0.78rem;
}

.user-identity small {
    font-size: 0.74rem;
}

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

.assignment-summary b {
    display: block;
    color: var(--foreground);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.role-chip-list {
    display: flex;
    flex-wrap: wrap;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--foreground);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: capitalize;
}

.user-edit-panel {
    min-width: 180px;
}

.user-edit-panel summary {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    font-weight: 800;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.user-edit-panel summary:hover {
    background: var(--surface-soft);
    border-color: var(--border-strong);
}

.user-edit-panel[open] summary {
    margin-bottom: 0.75rem;
}

.user-edit-grid {
    min-width: min(70vw, 760px);
    grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr);
    gap: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.96);
    box-shadow: var(--shadow-sm);
}

.admin-mini-form {
    align-content: start;
}

.admin-mini-form .compact-choice {
    display: flex;
    flex-wrap: wrap;
}

.admin-mini-form button {
    justify-self: start;
}

.select-help {
    display: block;
    margin-top: 0.32rem;
    color: var(--muted-foreground);
    font-size: 0.74rem;
}

.approval-workspace,
.approval-review-workspace {
    position: relative;
    z-index: 1;
}

.approval-page-head,
.approval-review-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(203, 213, 225, 0.72);
}

.approval-page-head h1,
.approval-review-head h1,
.approval-queue-item h2,
.approval-line-card h2 {
    margin: 0;
}

.approval-count {
    display: grid;
    justify-items: end;
    min-width: 96px;
}

.approval-count strong {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1;
}

.approval-count span {
    color: var(--muted-foreground);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.approval-queue-list,
.approval-line-list {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.approval-queue-item,
.approval-line-card,
.approval-empty-state,
.approval-guidance {
    border: 1px solid rgba(203, 213, 225, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
}

.approval-queue-item {
    display: grid;
    grid-template-columns: minmax(82px, 0.3fr) minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.approval-queue-item:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    background: rgba(248, 250, 252, 0.95);
}

.queue-report-id,
.approval-line-total {
    display: grid;
    gap: 0.15rem;
}

.queue-report-id span,
.approval-line-total span,
.approval-review-summary span {
    color: var(--muted-foreground);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.queue-report-id strong,
.approval-line-total strong {
    font-size: 1.2rem;
}

.queue-report-main {
    min-width: 0;
}

.queue-report-main p {
    margin: 0.15rem 0 0.55rem;
    color: var(--muted-foreground);
}

.queue-meta,
.approval-line-meta,
.approval-review-summary {
    display: grid;
    gap: 0.65rem;
}

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

.queue-meta span,
.approval-line-meta span {
    color: var(--muted-foreground);
    font-size: 0.8rem;
}

.queue-meta b,
.approval-line-meta b {
    display: block;
    color: var(--foreground);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.queue-review-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: 800;
    text-decoration: none;
}

.approval-empty-state {
    margin-top: 1rem;
    padding: 1.2rem;
}

.approval-empty-state h2 {
    margin: 0 0 0.25rem;
}

.approval-review-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 1rem;
}

.approval-review-summary div {
    padding: 0.8rem;
    border: 1px solid rgba(203, 213, 225, 0.75);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
}

.approval-review-summary strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.05rem;
}

.approval-guidance {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    align-items: center;
    margin-top: 0.9rem;
    padding: 0.75rem 0.85rem;
    background: var(--warning-soft);
    color: var(--warning);
}

.approval-guidance span {
    font-size: 0.88rem;
}

.approval-line-card {
    display: grid;
    gap: 0.85rem;
    padding: 0.95rem;
}

.approval-line-main {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.approval-line-main p {
    margin: 0.15rem 0 0;
}

.approval-line-meta {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.approval-line-meta a {
    color: var(--info);
    font-weight: 800;
}

.approval-card-form {
    display: grid;
    grid-template-columns: minmax(140px, 0.4fr) minmax(220px, 1fr) auto;
    gap: 0.65rem;
    align-items: end;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.inline-check {
    gap: 0.3rem;
    flex-direction: row;
    font-size: 0.82rem;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.inline-select select {
    flex: 1;
    min-width: 0;
}

.inline-select button {
    min-width: 72px;
    padding-left: 0.82rem;
    padding-right: 0.82rem;
    white-space: nowrap;
}

.stack-field,
.brand-app,
.topbar-user-meta,
.approval-form {
    display: flex;
    flex-direction: column;
}

.stack-field,
.approval-form {
    gap: 0.65rem;
}

.field-row {
    justify-content: space-between;
    min-height: 36px;
}

.expense-form {
    display: grid;
    gap: 1.05rem;
    width: 100%;
}

.expense-section {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.58);
    width: 100%;
}

.expense-section.line-items-section {
    width: 100%;
    padding: 1.25rem;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.58);
    display: flex;
    flex-direction: column;
}

.expense-section-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.92);
}

.expense-section-header h2 {
    font-size: 1rem;
}

.expense-section-grid {
    gap: 0.8rem;
    margin-bottom: 0;
}

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

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

.people-grid .stack-field {
    min-height: 0;
}

.people-grid .stack-field:has(.checkbox-list.hidden) {
    display: contents;
}

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

.expense-section textarea {
    min-height: 104px;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 0.25rem;
    color: var(--muted-foreground);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
}

/* ============================================================================
   LINE ITEMS SECTION - shadcn-inspired
   ============================================================================ */

.line-items-section {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.line-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
}

.line-items-title {
    flex: 1;
}

.line-items-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--foreground);
}

.line-items-subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 0.8rem;
    color: var(--muted-foreground);
    font-weight: 400;
}

.line-items-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    border: 1.5px dashed rgba(203, 213, 225, 0.6);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.5);
    text-align: center;
    min-height: 200px;
}

.line-items-empty[hidden] {
    display: none;
}

.line-items-empty-icon {
    width: 56px;
    height: 56px;
    color: var(--muted-foreground);
    margin-bottom: 1.25rem;
    opacity: 0.6;
}

.line-items-empty p {
    margin: 0;
    color: var(--foreground);
    font-weight: 500;
}

.line-items-empty-hint {
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.line-items-list {
    display: grid;
    gap: 1rem;
}

.line-item-card {
    padding: 1.25rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0.1), 0 1px 2px rgba(0, 0, 0.06);
    transition: all 0.2s ease;
}

.line-item-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0.08);
}

.line-item-card-draft {
    box-shadow: none;
}

.line-item-card-draft .remove-line {
    display: none;
}

.line-item-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.line-item-card-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.line-item-card-head .remove-line {
    min-height: 36px;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.line-item-grid {
    display: grid;
    grid-template-columns:
        1.8fr
        1.4fr
        1.2fr
        1.2fr
        1.2fr;
    gap: 1rem;
    align-items: end;
}

@media (min-width: 1024px) {
    .line-item-grid {
        grid-template-columns:
            2fr
            1.6fr
            1.4fr
            1.4fr
            1.4fr;
        gap: 1.1rem;
    }
}

.line-item-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.line-item-field > *,
.line-item-field .inline-select {
    min-height: 44px;
}

.line-item-field input[type="number"],
.line-item-field input[readonly] {
    text-align: right;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-variant-numeric: tabular-nums;
}

.line-item-receipt select {
    min-height: 44px;
}

.line-item-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--foreground);
}

.line-item-field input[type="number"] {
    text-align: right;
}

.line-item-field input[type="file"] {
    min-height: 42px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.line-item-field small {
    font-weight: 400;
    color: var(--muted-foreground);
}

.line-item-vendor {
    grid-column: auto;
}

.line-item-vendor .inline-select {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.line-item-vendor select {
    flex: 1;
    min-width: 0;
}

.line-item-vendor .add-master {
    flex-shrink: 0;
    align-self: flex-end;
    min-height: 44px;
}

.line-item-receipt-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(203, 213, 225, 0.7);
}

.line-item-receipt-section .receipt-drop-zone {
    min-height: 120px;
    padding: 1.5rem;
    border: 2px dashed rgba(15, 23, 42, 0.15);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.line-item-receipt-section .receipt-drop-zone:hover {
    border-color: rgba(15, 23, 42, 0.3);
    background: rgba(248, 250, 252, 0.7);
}

.line-item-receipt-section .receipt-drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.08);
}

.line-item-receipt-section .receipt-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.line-item-receipt-section .receipt-drop-icon {
    width: 48px;
    height: 48px;
    color: rgba(15, 23, 42, 0.3);
}

.line-item-receipt-section .receipt-drop-hint {
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.line-item-receipt-section .existing-receipt-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 80px;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.submit-report-btn {
    width: min(100%, 340px);
    justify-self: end;
    background: linear-gradient(135deg, var(--primary) 0%, #1e293b 100%);
    border: 1px solid rgba(15, 23, 42, 0.2);
}

.form-error {
    margin: 0;
    padding: 1rem 1.2rem;
    border: 2px solid var(--danger);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(254, 226, 226, 0.98), rgba(254, 242, 242, 0.95));
    color: #b91c1c;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(185, 28, 28, 0.25), 0 0 0 4px rgba(185, 28, 28, 0.1);
    animation: errorPulse 0.3s ease-out;
}

@keyframes errorPulse {
    0% { transform: scale(0.98); opacity: 0.8; }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}

.form-error[hidden] {
    display: none;
}

body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.36);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-card {
    width: min(100%, 520px);
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
    margin: 1rem auto;
    flex-shrink: 0;
}

.modal-card-wide {
    width: min(100%, 980px);
    max-height: calc(100vh - 2rem);
}

.admin-modal {
    width: min(1040px, calc(100vw - 2rem));
    max-height: calc(100dvh - 1rem);
    margin: 0 auto;
    border-radius: 8px;
}

.admin-modal-overlay {
    align-items: center;
    padding: clamp(0.5rem, 2vh, 1rem);
    overflow: hidden;
}

.admin-modal .modal-close {
    min-height: 36px;
    border-radius: 8px;
}

.modal-header {
    flex-shrink: 0;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
}

.modal-card-wide .modal-header {
    border-radius: 23px 23px 0 0;
}

.admin-modal .modal-header {
    padding: 1rem;
    border-radius: 7px 7px 0 0;
}

.modal-header,
.modal-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
}

.modal-header {
    margin-bottom: 0;
}

.modal-header h2 {
    margin: 0;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    -webkit-overflow-scrolling: touch;
}

.modal-card-wide .modal-body {
    padding: 1.25rem;
}

.admin-modal .modal-body {
    min-height: 0;
    padding: 1rem;
}

.admin-modal .multi-select-table-wrapper {
    max-height: clamp(140px, 24dvh, 220px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.admin-modal .multi-select-list {
    max-height: none;
    overflow: visible;
}

.modal-actions {
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(248, 250, 252, 0.8);
}

.modal-card-wide .modal-actions {
    padding: 1rem 1.25rem;
}

.admin-modal .modal-actions {
    padding: 0.85rem 1rem;
    border-radius: 0 0 7px 7px;
}

.checkbox-list {
    display: grid;
    gap: 0.32rem;
    max-height: 154px;
    overflow: auto;
    padding: 0.55rem;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
}

.checkbox-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    padding: 0.58rem 0.7rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.checkbox-item:hover {
    background: rgba(248, 250, 252, 0.92);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #0f172a;
}

.checkbox-options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(203, 213, 225, 0.88);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    transition: all 0.16s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.checkbox-option:hover {
    border-color: rgba(15, 23, 42, 0.2);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.checkbox-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #0f172a;
}

.checkbox-option span {
    user-select: none;
}

.project-name-field {
    margin-top: 1rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.line-item-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    width: 100%;
}

.line-item-header button {
    min-width: 180px;
    font-size: 0.95rem;
    padding: 0.85rem 1.5rem;
    margin: 0;
}

.drop-zone {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 1.5rem 2rem;
    border: 2px dashed rgba(203, 213, 225, 0.8);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.8), rgba(241, 245, 249, 0.6));
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.9));
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.drop-zone.drag-over {
    border-color: #3b82f6;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.04));
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.15);
    transform: scale(1.02);
}

.drop-zone.has-file {
    border-color: #166534;
    background: linear-gradient(180deg, rgba(22, 101, 52, 0.06), rgba(22, 101, 52, 0.02));
}

.drop-zone-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 0 auto 1rem auto;
    flex-wrap: wrap;
    width: 100%;
    text-align: center;
}

.drop-zone-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--foreground);
}

.drop-zone-content p {
    margin: 0;
    font-size: 0.9rem;
}

.drop-zone-hint {
    font-size: 0.8rem !important;
    color: var(--muted-foreground) !important;
    font-weight: 500;
}

.drop-zone-button {
    max-width: 280px;
    padding: 0.9rem 1.5rem !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    margin: 0 auto;
}

.drop-zone-icon {
    width: 48px;
    height: 48px;
    color: var(--muted-foreground);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.drop-zone:hover .drop-zone-icon {
    color: var(--primary);
    transform: scale(1.1);
}

.drop-zone.drag-over .drop-zone-icon {
    color: #3b82f6;
    transform: scale(1.15);
}

.drop-zone.has-file .drop-zone-icon {
    color: #166534;
}

.drop-zone-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--foreground);
}

.drop-zone-content p {
    margin: 0;
    font-size: 0.9rem;
}

.drop-zone-hint {
    font-size: 0.8rem !important;
    color: var(--muted-foreground) !important;
    font-weight: 500;
}

.drop-zone-actions .secondary {
    flex: 1;
    max-width: 140px;
}

.drop-zone-actions .danger {
    flex: 1;
    max-width: 140px;
}

.drop-zone .file-info {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    text-align: center;
}

.drop-zone.has-file .drop-zone-content {
    opacity: 0.3;
}

.drop-zone.has-file .file-info {
    display: block;
}

.file-info-icon {
    width: 48px;
    height: 48px;
    color: #166534;
    margin-bottom: 0.8rem;
}

.file-info-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--foreground);
    margin-bottom: 0.3rem;
    word-break: break-word;
}

.file-info-size {
    font-size: 0.85rem;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

.drop-zone-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.drop-zone-actions .secondary {
    flex: 1;
    max-width: 140px;
}

.drop-zone-actions .danger {
    flex: 1;
    max-width: 140px;
}

.checkbox-list.hidden {
    display: none;
}

.no-attendees-message {
    padding: 1.5rem;
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.9rem;
    font-style: italic;
    border: 1px dashed rgba(203, 213, 225, 0.6);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.5);
}

.people-grid .stack-field:empty {
    display: none;
}

.table-wrap {
    overflow: auto;
    border: 1px solid rgba(203, 213, 225, 0.86);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
}

table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    text-align: left;
    font-size: 0.88rem;
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.86);
}

.table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.97), rgba(241, 245, 249, 0.94));
    color: var(--muted-foreground);
    font-size: 0.72rem;
    font-weight: 700;
}

tbody tr:hover td {
    background: rgba(248, 250, 252, 0.94);
}

tbody tr:last-child td,
.simple-list li:last-child {
    border-bottom: none;
}

.summary-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.1rem;
}

.summary-bar div,
.detail-grid p,
.note-box {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(203, 213, 225, 0.86);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.96));
    box-shadow: var(--shadow-sm);
}

.summary-bar span {
    display: block;
    margin-bottom: 0.28rem;
    font-size: 0.76rem;
    color: var(--muted-foreground);
    font-weight: 700;
}

.summary-bar strong {
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.status-pending_supervisor {
    color: var(--warning);
    background: var(--warning-soft);
}

.status-returned_for_correction {
    color: var(--danger);
    background: var(--danger-soft);
}

.status-approved {
    color: var(--success);
    background: var(--success-soft);
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    padding: 0.08rem 0.45rem;
    margin-left: 0.3rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--foreground);
    font-size: 0.73rem;
    font-weight: 700;
}

.simple-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.simple-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.simple-list li p {
    margin: 0;
}

.notification-list {
    display: grid;
    gap: 0.75rem;
}

.notification-list li {
    padding: 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-sm);
}

.notification-list li:last-child {
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.simple-list.compact li {
    padding: 0.75rem 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem 1.4rem;
    margin-bottom: 1rem;
}

.detail-grid p {
    margin: 0;
}

.auth-card {
    width: min(520px, calc(100vw - 28px));
    margin: max(24px, calc(8vh - 12px)) auto 0;
    padding: 0;
    overflow: hidden;
}

.login-card {
    padding: 1.4rem;
}

.login-branding {
    padding: 0.35rem 0.2rem 0.3rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.82);
}

.login-wordmark {
    text-align: center;
    font-family: "Montserrat", "Segoe UI", sans-serif;
    font-size: clamp(1.65rem, 1.25rem + 1vw, 2rem);
    font-weight: 300;
    letter-spacing: 0.22em;
    color: #1a2a5e;
}

.login-divider {
    height: 2px;
    margin: 0.9rem 0 1rem;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.login-brand-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: center;
    justify-items: center;
}

.login-tts-logo {
    width: 98px;
    height: auto;
    display: block;
}

.login-bespoke-logo {
    width: auto;
    max-width: min(100%, 240px);
    height: 108px;
    object-fit: contain;
    display: block;
}

.login-copy {
    padding: 1.1rem 0.3rem 0.9rem;
    text-align: center;
}

.login-copy p {
    margin: 0.45rem auto 0;
    max-width: 28rem;
}

.login-form {
    padding: 0 0.35rem 0.35rem;
}

.login-field {
    display: grid;
    gap: 0.45rem;
}

.login-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--foreground);
}

.login-input-shell {
    display: grid;
    grid-template-columns: 1.05rem minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0 0.9rem 0 1rem;
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.login-input-shell svg {
    width: 1.05rem;
    height: 1.05rem;
    color: #94a3b8;
    flex-shrink: 0;
    pointer-events: none;
    transition: color 0.16s ease;
}

.login-input-shell input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 46px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    line-height: 1.2;
}

.login-input-shell input:not([type="checkbox"]):not([type="radio"]):focus {
    border-color: transparent;
    box-shadow: none;
    background: transparent;
}

.login-input-shell:focus-within {
    border-color: rgba(15, 23, 42, 0.34);
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.07);
    background: #ffffff;
}

.login-input-shell:focus-within svg {
    color: var(--foreground);
}

/* ============================================================================
   EXISTING RECEIPTS - Edit mode
   ============================================================================ */

.existing-receipt-display {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem;
    border: 1px solid rgba(203, 213, 225, 0.7);
    border-radius: 10px;
    background: rgba(241, 245, 249, 0.5);
    transition: all 0.2s ease;
}

.existing-receipt-display.drag-over {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.existing-receipt-display .receipt-thumbnail {
    background: rgba(226, 232, 240, 0.7);
}

.existing-receipt-icon {
    width: 20px;
    height: 20px;
    color: var(--muted-foreground);
}

.existing-receipt-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.existing-receipt-actions {
    display: flex;
    gap: 0.35rem;
}

.view-receipt-btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    min-height: 24px;
    text-decoration: none;
}

/* ============================================================================
   RECEIPT COMBO SELECTOR - Simplified UX
   ============================================================================ */

.receipt-preview-container {
    margin-top: 0.75rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   LINE ITEM RECEIPT AREAS
   ============================================================================ */

.receipt-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    padding: 1rem 0.85rem;
    border: 2px dashed rgba(203, 213, 225, 0.75);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.8), rgba(241, 245, 249, 0.6));
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.receipt-drop-zone:hover,
.receipt-drop-zone.drag-over {
    border-color: #3b82f6;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.04));
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.receipt-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    color: var(--muted-foreground);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
}

.receipt-drop-icon {
    width: 24px;
    height: 24px;
    color: var(--muted-foreground);
    flex-shrink: 0;
}

.receipt-drop-hint {
    font-size: 0.72rem;
    color: var(--muted-foreground);
    opacity: 0.8;
}

.receipt-drop-zone.drag-over .receipt-drop-icon {
    color: #3b82f6;
}

.receipt-preview-assigned {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.receipt-thumbnail {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.8);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.receipt-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.receipt-thumbnail .pdf-icon {
    width: 20px;
    height: 20px;
    color: var(--muted-foreground);
}

.receipt-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.receipt-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.change-receipt-btn {
    align-self: flex-start;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    min-height: 24px;
}

.line-item-card.highlight-error {
    animation: highlightError 0.5s ease;
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15) !important;
}

@keyframes highlightError {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ============================================================================
   RECEIPT PREVIEW MODAL - Phase 3 (Lightbox)
   ============================================================================ */

.receipt-preview-overlay {
    z-index: 100;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    padding: 2rem;
}

.receipt-preview-card {
    position: relative;
    max-width: min(1200px, calc(100vw - 4rem));
    max-height: min(90vh, calc(100dvh - 4rem));
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.receipt-preview-close {
    position: absolute;
    top: -3rem;
    right: 0;
    width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.receipt-preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.receipt-preview-close svg {
    width: 24px;
    height: 24px;
}

.receipt-preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    min-height: 300px;
}

.receipt-preview-content img {
    max-width: 100%;
    max-height: min(75vh, 600px);
    object-fit: contain;
}

.receipt-preview-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    text-align: center;
}

.receipt-preview-fallback svg {
    width: 64px;
    height: 64px;
    color: var(--muted-foreground);
}

.receipt-preview-fallback p {
    margin: 0;
}

.receipt-preview-fallback .muted {
    font-size: 0.88rem;
    color: var(--muted-foreground);
}

.receipt-preview-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
}

.receipt-preview-info span {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-preview-info.hidden {
    display: none;
}

/* Make thumbnails clickable */
.receipt-thumbnail {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.receipt-thumbnail:hover {
    transform: scale(1.05);
}

.receipt-thumbnail img {
    pointer-events: none;
}

/* Line items header styling */
.line-items-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.line-items-header-row h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--foreground);
}

.hidden {
    display: none !important;
}

@media (max-width: 1140px) {
    .topbar-inner,
    .topbar-right,
    .brand-shell {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-right {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .two-col,
    .detail-grid,
    .summary-bar,
    .filter-grid,
    .login-brand-grid {
        grid-template-columns: 1fr;
    }

    .inline-select,
    .simple-list li {
        align-items: flex-start;
        flex-direction: column;
    }

    .inline-select select,
    .inline-select button {
        width: 100%;
    }

    .card {
        padding: 1.15rem;
    }

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

    .basics-grid,
    .company-grid,
    .people-grid {
        grid-template-columns: 1fr;
    }

    /* Expense form mobile optimization */
    .expense-section {
        gap: 0.7rem;
    }

    .form-grid {
        gap: 0.8rem;
    }

    .checkbox-options-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .checkbox-option {
        padding: 0.7rem 0.85rem;
        font-size: 0.85rem;
    }

    .field-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .stack-field {
        gap: 0.5rem;
    }

    .checkbox-list {
        max-height: 160px;
    }

    .line-item-vendor,
    .line-item-receipt {
        grid-column: 1 / -1;
    }

    .receipt-drop-zone {
        min-height: 100px;
        padding: 1rem;
    }

    /* Drop zone tablet optimization */
    .drop-zone {
        max-width: 100%;
        padding: 1.8rem 2rem;
        min-height: 160px;
        margin: auto;
    }

    .drop-zone-content {
        flex-direction: row;
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .drop-zone-icon {
        width: 52px;
        height: 52px;
    }

    .drop-zone-content h3 {
        font-size: 1.1rem;
    }

    .drop-zone-button {
        max-width: 260px;
        margin: 0 auto;
    }

    .admin-page-head,
    .section-heading-row {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-head-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-count {
        justify-items: start;
    }

    .admin-create-grid,
    .modal-form-grid,
    .modal-section-grid,
    .assignment-form,
    .user-edit-grid,
    .assignment-summary,
    .approval-queue-item,
    .approval-review-summary,
    .approval-line-meta,
    .approval-card-form {
        grid-template-columns: 1fr;
    }

    .admin-search {
        min-width: 0;
    }

    .user-edit-grid {
        min-width: 0;
    }

    .approval-page-head,
    .approval-review-head,
    .approval-line-main {
        align-items: stretch;
        flex-direction: column;
    }

    .approval-count {
        justify-items: start;
    }
}

@media (max-width: 760px) {
    .container {
        width: min(var(--container), calc(100vw - 24px));
    }

    .topbar {
        position: sticky;
    }

    .topbar-inner {
        gap: 0.85rem;
        min-height: auto;
        padding: 0.75rem 0;
    }

    .brand-shell {
        gap: 0.65rem;
    }

    .brand-suite {
        flex-wrap: wrap;
        gap: 0.55rem;
    }

    .brand-divider {
        display: none;
    }

    .brand-byndbits {
        font-size: 0.95rem;
        letter-spacing: 0.2em;
    }

    .brand-tts-logo {
        width: 42px;
        height: 42px;
    }

    .brand-bespoke-logo {
        height: 46px;
    }

    .brand-app {
        display: none;
    }

    .nav {
        justify-content: flex-start;
        gap: 0.45rem;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.15rem;
        scrollbar-width: thin;
    }

    .nav a {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 0.55rem 0.72rem;
        background: rgba(255, 255, 255, 0.7);
    }

    .topbar-user {
        width: 100%;
        justify-content: space-between;
        border-radius: 18px;
    }

    .card-header,
    .line-item-header,
    .expense-section-header,
    .field-row {
        align-items: stretch;
        flex-direction: column;
        gap: 0.75rem;
    }

    .expense-section-header {
        gap: 0.35rem;
    }

    .card-header > a:not(.brand-suite),
    .card-header-actions,
    .card-header-actions > a,
    .action-link,
    .back-button,
    .notification-link,
    .line-item-header button,
    .submit-report-btn {
        width: 100%;
    }

    .card-header-actions {
        align-items: stretch;
        flex-direction: column;
    }

    table {
        min-width: 0;
    }

    .table-wrap table thead,
    #line-items-table thead {
        display: none;
    }

    .table-wrap table,
    .table-wrap table tbody,
    .table-wrap table tr,
    .table-wrap table td,
    #line-items-table,
    #line-items-table tbody,
    #line-items-table tr,
    #line-items-table td {
        display: block;
        width: 100%;
    }

    .table-wrap table tr {
        margin-bottom: 0.8rem;
        padding: 0.85rem;
        border-radius: 18px;
        border: 1px solid rgba(226, 232, 240, 0.95);
        background: rgba(255, 255, 255, 0.94);
        box-shadow: var(--shadow-sm);
    }

    .table-wrap table td {
        border: none;
        padding: 0.45rem 0;
        background: transparent;
    }

    .table-wrap table td::before,
    #line-items-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.3rem;
        color: var(--muted-foreground);
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-weight: 700;
    }

    .table-wrap td > a,
    .actions a,
    .table-wrap button {
        width: 100%;
    }

    .table-wrap {
        border: 0;
        background: transparent;
        overflow: visible;
    }
}

@media (max-width: 560px) {
    .layout {
        padding: 1rem 0 2.2rem;
    }

    .auth-card {
        width: min(100vw - 18px, 520px);
        margin-top: 0.8rem;
    }

    .container {
        width: min(var(--container), calc(100vw - 18px));
    }

    .card {
        padding: 0.95rem;
        border-radius: 20px;
        box-shadow: var(--shadow-sm);
    }

    .expense-section {
        padding: 0.85rem;
        border-radius: 18px;
    }

    h1 {
        font-size: 1.35rem;
    }

    .muted {
        font-size: 0.86rem;
    }

    input:not([type="checkbox"]):not([type="radio"]),
    textarea,
    select {
        min-height: 46px;
        font-size: 0.92rem;
    }

    button,
    .button-link,
    .action-link,
    .notification-link,
    .table-wrap td > a,
    .simple-list li > a,
    .card-header > a:not(.brand-suite),
    .card-header-actions > a,
    .link-button {
        width: 100%;
        min-height: 44px;
        padding: 0.68rem 0.85rem;
    }

    .line-item-card {
        padding: 0.85rem;
        border-radius: 18px;
    }

    .line-item-card-head {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .line-items-section {
        padding: 0.85rem;
    }

    .line-item-header {
        width: 100% !important;
    }

    .line-item-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .summary-bar {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .summary-bar div {
        padding: 0.7rem 0.85rem;
    }

    .summary-bar strong {
        font-size: 1rem;
    }

    /* Drop zone mobile optimization */
    .drop-zone {
        max-width: 100%;
        padding: 1.2rem 1rem;
        min-height: 140px;
        margin: auto;
    }

    .drop-zone-button {
        max-width: 240px;
        margin: 0 auto;
    }

    .drop-zone-content {
        flex-direction: column;
        gap: 0.6rem;
        text-align: center;
        align-items: center;
        justify-content: center;
    }

    .drop-zone-icon {
        width: 40px;
        height: 40px;
    }

    .drop-zone-content h3 {
        font-size: 1rem;
    }

    .drop-zone-content p {
        font-size: 0.85rem;
    }

    .drop-zone-hint {
        font-size: 0.75rem !important;
    }

    .drop-zone-button {
        max-width: 100%;
        padding: 0.8rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .file-info {
        padding: 1rem !important;
    }

    .file-info-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 0.6rem;
    }

    .file-info-name {
        font-size: 0.9rem;
    }

    .file-info-size {
        font-size: 0.75rem;
        margin-bottom: 0.8rem;
    }

    .drop-zone-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .drop-zone-actions button {
        max-width: 100%;
    }

    .drop-zone-content {
        flex-direction: column;
        gap: 0.8rem;
    }

    .line-item-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .line-item-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .summary-bar div {
        padding: 0.85rem;
    }

    .summary-bar strong {
        font-size: 1.02rem;
    }

    .checkbox-list {
        max-height: 190px;
        padding: 0.55rem;
    }

    .checkbox-item {
        padding: 0.62rem 0.68rem;
    }

    .login-card {
        padding: 1rem;
    }

    .login-bespoke-logo {
        height: 88px;
    }

    .modal-overlay {
        align-items: end;
        padding: 0.6rem;
    }

    .modal-card {
        width: 100%;
        max-height: calc(100dvh - 1.2rem);
        border-radius: 22px;
        padding: 0.95rem;
    }

    .modal-header,
    .modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .modal-actions button,
    .modal-close {
        width: 100%;
    }

    .admin-modal-overlay {
        align-items: center;
        padding: 0.45rem;
    }

    .admin-modal {
        padding: 0;
        max-height: calc(100dvh - 0.9rem);
        border-radius: 8px;
    }

    .admin-modal .modal-header,
    .admin-modal .modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-mini-form button[type="submit"] {
        width: 100%;
    }
}

/* ============================================================================
   MODAL HEIGHT OPTIMIZATION
   ============================================================================ */

@media (max-height: 700px) {
    .modal-overlay {
        padding: 0.5rem;
    }

    .modal-card {
        margin: 0.5rem auto;
        max-height: calc(100vh - 1rem);
    }

    .modal-card-wide {
        margin: 0.5rem auto;
        max-height: calc(100vh - 1rem);
    }

    .modal-header {
        padding: 0.85rem 1rem 0.75rem;
    }

    .admin-modal .modal-header {
        padding: 0.75rem 0.85rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .admin-modal .modal-body {
        padding: 0.85rem;
    }

    .modal-actions {
        padding: 0.75rem 1rem;
    }

    .admin-modal .modal-actions {
        padding: 0.65rem 0.85rem;
    }

    .admin-modal {
        max-height: calc(100dvh - 1rem);
    }

}

@media (max-height: 500px) {
    .modal-overlay {
        padding: 0.25rem;
    }

    .modal-card {
        margin: 0.25rem auto;
        max-height: calc(100vh - 0.5rem);
        border-radius: 16px;
    }

    .modal-card-wide {
        margin: 0.25rem auto;
        border-radius: 16px;
    }

    .modal-header {
        padding: 0.65rem 0.85rem 0.55rem;
    }

    .modal-header h2 {
        font-size: 1rem;
    }

    .modal-header .muted {
        font-size: 0.8rem;
    }

    .modal-body {
        padding: 0.75rem 0.85rem;
    }

    .modal-actions {
        padding: 0.6rem 0.85rem;
    }

    .admin-modal-overlay {
        padding: 0.25rem;
    }

    .admin-modal {
        max-height: calc(100dvh - 0.5rem);
        border-radius: 8px;
    }

    .admin-modal .modal-header .muted {
        display: none;
    }

    .multi-select-header {
        margin-bottom: 0.35rem;
    }

    .multi-select-search {
        margin-bottom: 0.35rem;
    }

    .multi-select-item {
        padding: 0.45rem 0.6rem;
        grid-template-columns: 20px minmax(0, 1fr);
        gap: 0.45rem;
    }

    .multi-select-label {
        font-size: 0.82rem;
    }

}

/* ============================================================================
   MULTI-SELECT TABLE COMPONENT - Admin Brutalism Refinado
   ============================================================================ */

.multi-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.multi-select-header.compact {
    margin-bottom: 0.35rem;
}

.multi-select-header > span:first-child {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--foreground);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.select-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.multi-select-search {
    margin-bottom: 0.5rem;
}

.multi-select-search.compact {
    margin-bottom: 0.35rem;
}

.multi-select-search input {
    font-size: 0.82rem;
    padding: 0.5rem 0.7rem;
    min-height: 38px;
    border: 1.5px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.2s ease;
}

.multi-select-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(204, 31, 31, 0.1);
    background: #ffffff;
}

.multi-select-table-wrapper {
    position: relative;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    max-height: none;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.multi-select-table-wrapper.compact {
    border-radius: 12px;
}

.multi-select-list {
    display: flex;
    flex-direction: column;
}

.multi-select-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    background: transparent;
}

.multi-select-item:last-child {
    border-bottom: none;
}

.multi-select-item:hover {
    background: rgba(248, 250, 252, 0.8);
}

.multi-select-item.compact {
    padding: 0.5rem 0.65rem;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 0.5rem;
}

.multi-select-item input[type="checkbox"] {
    appearance: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 2px solid var(--border-strong);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    justify-self: start;
}

.multi-select-item.compact input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border-radius: 5px;
}

.multi-select-item input[type="checkbox"]:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(204, 31, 31, 0.08);
}

.multi-select-item input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.multi-select-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    opacity: 0;
    animation: checkIn 0.2s ease forwards 0.1s;
}

.multi-select-item.compact input[type="checkbox"]:checked::after {
    width: 5px;
    height: 8px;
}

@keyframes checkIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(45deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(45deg) scale(1);
    }
}

.multi-select-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--foreground);
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-select-item.compact .multi-select-label {
    font-size: 0.82rem;
}

.multi-select-item:has(input:checked) {
    background: rgba(204, 31, 31, 0.04);
}

.multi-select-item:has(input:checked).compact {
    background: rgba(204, 31, 31, 0.03);
}

.multi-select-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    min-height: 120px;
}

.multi-select-empty span {
    color: var(--muted-foreground);
    font-size: 0.85rem;
    font-style: italic;
}

/* Search highlight */
.multi-select-label mark {
    background: rgba(204, 31, 31, 0.15);
    color: var(--accent);
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: 600;
}

/* Mobile responsiveness */
@media (max-width: 760px) {
    .multi-select-item {
        grid-template-columns: 22px minmax(0, 1fr);
        padding: 0.6rem 0.7rem;
    }

    .multi-select-label {
        font-size: 0.85rem;
    }

}

/* Animation for search results */
.multi-select-item {
    animation: slideIn 0.2s ease;
}

/* ============================================================================
   RESPONSIVE - ADMIN USER FORM
   ============================================================================ */

@media (max-width: 760px) and (max-height: 600px) {
    .modal-overlay {
        padding: 0.25rem;
    }

    .modal-card {
        margin: 0.25rem auto;
        max-height: calc(100vh - 0.5rem);
        border-radius: 12px;
    }

    .modal-card-wide {
        margin: 0.25rem auto;
        max-height: calc(100vh - 0.5rem);
        border-radius: 12px;
    }

    .modal-header {
        padding: 0.6rem 0.75rem;
    }

    .modal-header h2 {
        font-size: 0.95rem;
    }

    .modal-header .muted {
        font-size: 0.75rem;
    }

    .modal-body {
        padding: 0.6rem 0.75rem;
    }

    .modal-actions {
        padding: 0.5rem 0.75rem;
    }

}

@media (max-width: 560px) {
    .multi-select-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .multi-select-search input {
        font-size: 0.8rem;
        padding: 0.45rem 0.6rem;
        min-height: 36px;
    }

    .multi-select-item {
        grid-template-columns: 20px minmax(0, 1fr);
        padding: 0.55rem 0.65rem;
        gap: 0.5rem;
    }

    .multi-select-label {
        font-size: 0.82rem;
    }

    .multi-select-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 760px) and (max-height: 600px) {
    .admin-modal-overlay {
        align-items: center;
        padding: 0.25rem;
    }

    .admin-modal {
        padding: 0;
        max-height: calc(100dvh - 0.5rem);
        border-radius: 8px;
    }

    .admin-modal .modal-header {
        padding: 0.6rem 0.75rem;
    }

    .admin-modal .modal-body {
        padding: 0.6rem 0.75rem;
    }

    .admin-modal .multi-select-table-wrapper {
        max-height: clamp(96px, 25dvh, 140px);
    }

    .admin-modal .modal-header .muted {
        display: none;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   PRINT ATTACHMENTS
   ============================================================================ */

.print-page {
    margin: 0;
    padding: 24px;
    color: var(--foreground);
    background: var(--background);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

.print-shell {
    max-width: 1120px;
    margin: 0 auto;
}

.print-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-md);
}

.print-toolbar h1 {
    margin: 0;
    font-size: clamp(1.35rem, 1.1rem + 1vw, 2rem);
    letter-spacing: 0;
}

.print-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.print-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.72rem 1.02rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: var(--primary);
    color: var(--primary-foreground);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.12);
}

.print-button.secondary {
    background: #ffffff;
    color: var(--foreground);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.page-break {
    page-break-after: always;
    margin-bottom: 20px;
    padding: 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.receipt {
    margin: 12px 0 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.print-page img {
    max-width: 100%;
    max-height: 680px;
    display: block;
}

@media (max-width: 720px) {
    .print-page {
        padding: 12px;
    }

    .print-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .print-actions,
    .print-button {
        width: 100%;
    }
}

@media print {
    .noprint {
        display: none !important;
    }

    .print-page {
        margin: 0;
        padding: 0;
        background: #ffffff;
    }

    .print-shell {
        max-width: none;
    }

    .page-break {
        border: 0;
        border-radius: 0;
        padding: 0;
    }

    .print-page a {
        color: #000000;
        text-decoration: none;
    }
}
