/* Jopi modern admin UI */

:root {
    --ui-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ui-bg: #f4f7fb;
    --ui-bg-elevated: #ffffff;
    --ui-bg-muted: #f8fafc;
    --ui-bg-soft: #eef3f8;
    --ui-text: #202939;
    --ui-heading: #111827;
    --ui-muted: #697586;
    --ui-faint: #98a2b3;
    --ui-border: #d9e2ec;
    --ui-border-strong: #c4d0dd;
    --ui-primary: #2563eb;
    --ui-primary-dark: #1d4ed8;
    --ui-primary-soft: #eff6ff;
    --ui-cyan: #0891b2;
    --ui-cyan-soft: #ecfeff;
    --ui-emerald: #059669;
    --ui-emerald-soft: #ecfdf5;
    --ui-amber: #b7791f;
    --ui-amber-soft: #fffbeb;
    --ui-red: #dc2626;
    --ui-red-soft: #fef2f2;
    --ui-radius: 8px;
    --ui-radius-sm: 6px;
    --ui-radius-round: 999px;
    --ui-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --ui-shadow-sm: 0 8px 20px rgba(16, 24, 40, 0.07);
    --ui-shadow-md: 0 18px 45px rgba(16, 24, 40, 0.12);
    --ui-focus: 0 0 0 4px rgba(37, 99, 235, 0.16);
    --ui-page-max: 1440px;
    --ui-page-pad: clamp(0.875rem, 1.7vw, 2rem);
    --ui-control-h: 2.75rem;
    --bs-body-font-family: var(--ui-font);
    --bs-body-font-size: 0.9375rem;
    --bs-body-color: var(--ui-text);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--ui-bg);
}

body {
    min-height: 100vh;
    margin: 0;
    padding-bottom: 5rem;
    color: var(--ui-text);
    font-family: var(--ui-font);
    font-size: 0.9375rem;
    line-height: 1.5;
    letter-spacing: 0;
    background:
        radial-gradient(circle at top left, rgba(8, 145, 178, 0.12), transparent 28rem),
        linear-gradient(180deg, #f8fbff 0, var(--ui-bg) 22rem);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
    font-family: var(--ui-font);
    letter-spacing: 0;
}

::selection {
    color: #fff;
    background: var(--ui-primary);
}

a {
    color: var(--ui-primary);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

a:hover {
    color: var(--ui-primary-dark);
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    color: var(--ui-heading);
    font-weight: 750;
    line-height: 1.18;
    letter-spacing: 0;
}

h1,
.h1 {
    font-size: clamp(1.45rem, 1.15rem + 0.8vw, 2rem);
}

h2,
.h2 {
    font-size: clamp(1.35rem, 1.12rem + 0.55vw, 1.75rem);
}

h3,
.h3,
h4,
.h4,
h5,
.h5 {
    font-size: 1.125rem;
}

h6,
.h6 {
    font-size: 0.9375rem;
}

small,
.small {
    font-size: 0.8125rem !important;
}

code {
    color: #475467;
    font-size: 0.8125rem;
    word-break: break-word;
}

svg {
    flex-shrink: 0;
}

.container {
    width: 100%;
    max-width: var(--ui-page-max);
    padding-left: var(--ui-page-pad);
    padding-right: var(--ui-page-pad);
}

.text-muted {
    color: var(--ui-muted) !important;
}

.text-dark {
    color: var(--ui-heading) !important;
}

.text-success {
    color: var(--ui-emerald) !important;
}

.text-danger {
    color: var(--ui-red) !important;
}

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

/* Navigation */
.glass-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    margin-bottom: 0 !important;
    padding: 0.75rem 0;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(217, 226, 236, 0.84);
    box-shadow: 0 6px 22px rgba(16, 24, 40, 0.05);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.glass-nav .navbar-brand {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    color: var(--ui-heading);
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: 0;
}

.glass-nav .navbar-brand::before {
    content: "";
    width: 0.75rem;
    height: 0.75rem;
    margin-right: 0.55rem;
    background: linear-gradient(135deg, var(--ui-cyan), var(--ui-primary));
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(8, 145, 178, 0.11);
}

.glass-nav .navbar-toggler {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-color: var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: none;
}

.glass-nav .navbar-toggler:focus {
    box-shadow: var(--ui-focus);
}

.glass-nav .nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.45rem 0.8rem;
    color: var(--ui-muted);
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: var(--ui-radius-round);
    transition: color 0.16s ease, background-color 0.16s ease;
}

.glass-nav .nav-link:hover,
.glass-nav .nav-link.active {
    color: var(--ui-primary-dark);
    background: var(--ui-primary-soft);
}

.navbar-user-name {
    max-width: 18rem;
    overflow: hidden;
    color: var(--ui-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Page layout */
.main-container {
    max-width: var(--ui-page-max);
    padding-top: clamp(1rem, 1.5vw, 2rem);
}

.page-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 2.75rem;
    margin-bottom: 1.1rem;
}

.page-header h1,
.page-header h2 {
    margin: 0;
}

.page-header h2::after {
    content: "";
    display: block;
    width: 2.4rem;
    height: 0.18rem;
    margin-top: 0.45rem;
    background: linear-gradient(90deg, var(--ui-cyan), var(--ui-primary));
    border-radius: var(--ui-radius-round);
}

.glass-card {
    margin-bottom: 1.1rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(217, 226, 236, 0.9);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-xs);
}

.glass-card:hover {
    border-color: rgba(196, 208, 221, 0.95);
}

.glass-card.p-0 {
    overflow: hidden;
}

.form-page,
#addExpenseForm {
    width: 100%;
    max-width: var(--ui-page-max);
    margin-left: auto;
    margin-right: auto;
}

.form-header {
    padding: 1.25rem 1.5rem;
    background: var(--ui-bg-muted);
    border-bottom: 1px solid var(--ui-border);
}

.form-header h1 {
    margin: 0;
}

.form-body {
    padding: clamp(1rem, 1.4vw, 1.5rem);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    color: var(--ui-muted);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-xs);
    transition: transform 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn-back:hover,
.btn-back:focus {
    color: var(--ui-primary);
    border-color: #b7c9ee;
    box-shadow: var(--ui-shadow-sm);
    transform: translateY(-1px);
}

.auth-page,
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(74vh, 52rem);
    padding: 2rem 0;
}

.login-card {
    max-width: 28rem;
}

.login-icon,
.error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.85rem;
    color: var(--ui-primary);
    background: linear-gradient(135deg, var(--ui-primary-soft), #fff);
    border: 1px solid #c8dafc;
    border-radius: var(--ui-radius);
}

.error-icon {
    color: var(--ui-red);
    background: var(--ui-red-soft);
    border-color: #fecaca;
}

.request-id-box {
    max-width: 100%;
    padding: 0.85rem 1rem;
    overflow-wrap: anywhere;
    background: var(--ui-bg-muted);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
}

.inline-icon {
    margin-top: -0.125rem;
}

/* Forms */
.form-label {
    margin-bottom: 0.45rem;
    color: #344054;
    font-size: 0.875rem;
    font-weight: 700;
}

.form-control,
.form-select,
.ts-control {
    min-height: var(--ui-control-h);
    color: var(--ui-heading);
    font-size: 0.9375rem;
    background-color: #fff;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.form-control,
.form-select {
    padding: 0.625rem 0.85rem;
}

.form-control.bg-light,
textarea.form-control.bg-light {
    background: var(--ui-bg-muted) !important;
}

.form-control.border-0 {
    border: 1px solid transparent !important;
}

.form-control:focus,
.form-select:focus,
.ts-control.focus {
    color: var(--ui-heading);
    background-color: #fff;
    border-color: #8fb4ff;
    box-shadow: var(--ui-focus);
    outline: 0;
}

.form-control::placeholder {
    color: var(--ui-faint);
}

textarea.form-control {
    min-height: 7.5rem;
    resize: vertical;
}

.form-check-input {
    border-color: var(--ui-border-strong);
}

.form-check-input:checked {
    background-color: var(--ui-primary);
    border-color: var(--ui-primary);
}

.form-check-input:focus {
    border-color: #8fb4ff;
    box-shadow: var(--ui-focus);
}

.form-switch .form-check-input {
    width: 2.8rem;
    height: 1.45rem;
}

.invalid-feedback,
[data-valmsg-for],
.field-validation-error {
    font-size: 0.8125rem;
}

select.tom-select-pending {
    height: var(--ui-control-h);
    min-height: var(--ui-control-h);
    overflow: hidden;
    visibility: hidden;
}

.ts-wrapper {
    min-height: var(--ui-control-h);
}

.ts-control {
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
}

.ts-wrapper.multi .ts-control > div {
    display: inline-flex;
    align-items: center;
    min-height: 1.8rem;
    color: var(--ui-primary-dark);
    font-size: 0.8125rem;
    font-weight: 700;
    background: var(--ui-primary-soft);
    border: 1px solid #c8dafc;
    border-radius: var(--ui-radius-round);
}

.ts-wrapper.plugin-remove_button:not(.rtl) .item .remove {
    border-left-color: #c8dafc;
}

.ts-dropdown {
    margin-top: 0.35rem;
    color: var(--ui-text);
    font-size: 0.9375rem;
    border-color: var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-md);
}

.ts-dropdown .active {
    color: var(--ui-primary-dark);
    background: var(--ui-primary-soft);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    min-height: 2.45rem;
    padding: 0.52rem 1rem;
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: 0;
    border-radius: var(--ui-radius);
    border-width: 1px;
    box-shadow: none;
    transition: transform 0.16s ease, color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

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

.btn:focus-visible {
    box-shadow: var(--ui-focus);
}

.btn:disabled,
.btn.disabled {
    transform: none;
    cursor: not-allowed;
    opacity: 0.58;
}

.btn-sm {
    min-height: 2.1rem;
    padding: 0.38rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    min-height: 2.9rem;
    padding: 0.72rem 1.15rem;
    font-size: 0.95rem;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, #2d72f3, var(--ui-primary));
    border-color: var(--ui-primary);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background: linear-gradient(180deg, var(--ui-primary), var(--ui-primary-dark));
    border-color: var(--ui-primary-dark);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.btn-light {
    color: var(--ui-heading);
    background: #fff;
    border-color: var(--ui-border);
    box-shadow: var(--ui-shadow-xs);
}

.btn-light:hover,
.btn-light:focus {
    color: var(--ui-heading);
    background: var(--ui-bg-muted);
    border-color: var(--ui-border-strong);
}

.btn-outline-primary,
.btn-outline-info,
.btn-outline-secondary,
.btn-outline-success {
    background: #fff;
}

.btn-outline-primary {
    color: var(--ui-primary);
    border-color: #b7c9ee;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-check:checked + .btn-outline-primary {
    color: #fff;
    background: var(--ui-primary);
    border-color: var(--ui-primary);
}

.btn-outline-info {
    color: var(--ui-cyan);
    border-color: #a5e7f2;
}

.btn-outline-info:hover,
.btn-outline-info:focus {
    color: #fff;
    background: var(--ui-cyan);
    border-color: var(--ui-cyan);
}

.btn-outline-secondary {
    color: #475467;
    border-color: var(--ui-border);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-check:checked + .btn-outline-secondary {
    color: var(--ui-heading);
    background: var(--ui-bg-soft);
    border-color: var(--ui-border-strong);
}

.btn-outline-success {
    color: var(--ui-emerald);
    border-color: #a7f3d0;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    color: #fff;
    background: var(--ui-emerald);
    border-color: var(--ui-emerald);
}

.btn-success {
    color: #fff;
    background: var(--ui-emerald);
    border-color: var(--ui-emerald);
}

.btn-success:hover,
.btn-success:focus {
    color: #fff;
    background: #047857;
    border-color: #047857;
}

.btn-edit-action {
    color: var(--ui-primary-dark);
    background: var(--ui-primary-soft);
    border-color: #c8dafc;
}

.btn-edit-action:hover,
.btn-edit-action:focus {
    color: #fff;
    background: var(--ui-primary);
    border-color: var(--ui-primary);
}

.btn-icon-action {
    width: 2.125rem;
    min-width: 2.125rem;
    height: 2.125rem;
    min-height: 2.125rem;
    padding: 0;
    border-radius: 50% !important;
}

.btn-icon-dismiss {
    width: 1.9rem;
    min-width: 1.9rem;
    height: 1.9rem;
    min-height: 1.9rem;
    padding: 0;
    color: var(--ui-red);
    background: transparent;
    border-color: transparent;
    border-radius: 50% !important;
}

.btn-icon-dismiss:hover,
.btn-icon-dismiss:focus {
    color: #fff;
    background: var(--ui-red);
    border-color: var(--ui-red);
}

.btn-group {
    border-radius: var(--ui-radius);
}

.btn-group .btn {
    transform: none;
}

.dropdown-menu {
    padding: 0.35rem;
    font-size: 0.9rem;
    border-color: var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-md);
}

.dropdown-item {
    border-radius: var(--ui-radius-sm);
}

.dropdown-item:active {
    background: var(--ui-primary);
}

/* Feedback and badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.65rem;
    padding: 0.34rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    border-radius: var(--ui-radius-round);
}

.bg-success {
    color: #047857 !important;
    background: var(--ui-emerald-soft) !important;
    border: 1px solid #a7f3d0;
}

.bg-warning {
    color: var(--ui-amber) !important;
    background: var(--ui-amber-soft) !important;
    border: 1px solid #fde68a;
}

.bg-secondary {
    color: #667085 !important;
    background: var(--ui-bg-soft) !important;
    border: 1px solid var(--ui-border);
}

.bg-primary {
    color: var(--ui-primary-dark) !important;
    background: var(--ui-primary-soft) !important;
    border: 1px solid #c8dafc;
}

.bg-info {
    color: var(--ui-cyan) !important;
    background: var(--ui-cyan-soft) !important;
    border: 1px solid #a5e7f2;
}

.alert {
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    border-radius: var(--ui-radius);
}

.alert-success {
    color: #05603a;
    background: var(--ui-emerald-soft);
    border-color: #a7f3d0;
}

.alert-danger {
    color: #b42318;
    background: var(--ui-red-soft);
    border-color: #fecaca;
}

/* Tables */
.table-responsive {
    scrollbar-color: #b8c4d2 transparent;
}

.glass-card .table {
    margin-bottom: 0;
    color: var(--ui-text);
}

.glass-card .table thead th {
    position: relative;
    padding: 0.95rem 1rem;
    color: #667085;
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0;
    white-space: nowrap;
    background: #f8fafc;
    border-bottom: 1px solid var(--ui-border);
}

.glass-card .table tbody td {
    padding: 0.92rem 1rem;
    color: var(--ui-text);
    font-size: 0.9rem;
    vertical-align: middle;
    border-bottom: 1px solid #e8eef5;
}

.glass-card .table tbody tr:last-child td {
    border-bottom: none;
}

.glass-card .table tbody tr {
    transition: background-color 0.14s ease;
}

.glass-card .table tbody tr:hover {
    background: #fbfdff;
}

.table-secondary {
    --bs-table-bg: #f5f7fa;
    --bs-table-striped-bg: #eef2f6;
    --bs-table-hover-bg: #eef2f6;
}

.expenses-table {
    min-width: 940px;
}

.expenses-table-operator {
    min-width: 980px;
}

.expenses-table-coordinator {
    min-width: 1120px;
}

.expenses-table-card {
    background: #fff;
}

.expenses-table-select {
    width: 3rem;
    text-align: center;
}

.expenses-table-actions {
    width: 7rem;
    text-align: center;
}

.expenses-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    white-space: nowrap;
}

.expenses-table-date {
    white-space: nowrap;
}

.expenses-table-projects {
    min-width: 13rem;
}

.expense-table-project + .expense-table-project {
    margin-top: 0.58rem;
}

.expenses-table-comment {
    max-width: 18rem;
    color: var(--ui-muted) !important;
    overflow-wrap: anywhere;
    white-space: normal;
}

/* Detail and list surfaces */
.expense-list,
.project-list,
.user-list {
    display: grid;
    gap: 0.9rem;
}

.expense-card,
.project-list .glass-card,
.user-list .glass-card {
    margin-bottom: 0;
    padding: 1rem;
}

.expense-card-main {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.expense-card-title {
    min-width: 0;
    color: var(--ui-heading);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.expense-card-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.48rem 0.8rem;
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    color: var(--ui-muted);
    font-size: 0.8125rem;
    border-top: 1px solid var(--ui-border);
}

.expense-card-meta span,
.expense-card-comment {
    min-width: 0;
    overflow-wrap: anywhere;
}

.expense-card-projects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--ui-border);
}

.expense-card-comment {
    margin-top: 0.85rem;
    color: var(--ui-muted);
    font-size: 0.9rem;
}

.expense-card-clickable {
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.expense-card-clickable:hover,
.expense-card-clickable:focus {
    border-color: #b7c9ee;
    box-shadow: var(--ui-shadow-sm);
    transform: translateY(-1px);
}

.expense-project-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 1.8rem;
    padding: 0.35rem 0.65rem;
    color: var(--ui-primary-dark);
    font-size: 0.8125rem;
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
    background: var(--ui-primary-soft);
    border: 1px solid #c8dafc;
    border-radius: var(--ui-radius-round);
}

.expenses-table-projects .expense-project-chip {
    margin: 0.12rem 0.18rem 0.12rem 0;
}

.expense-project-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.expense-detail-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.expense-technical-id {
    min-width: 0;
}

.expense-technical-id code {
    display: block;
    max-width: 100%;
    margin-top: 0.2rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.expense-detail-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

dl.detail-list {
    margin-bottom: 0;
}

dl.detail-list dt,
dl.detail-list dd {
    min-width: 0;
    padding: 0.78rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--ui-border);
}

dl.detail-list dt {
    color: var(--ui-muted);
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0;
}

dl.detail-list dd {
    color: var(--ui-heading);
    font-size: 0.9375rem;
    font-weight: 650;
}

dl.detail-list dt:last-of-type,
dl.detail-list dd:last-of-type {
    border-bottom: none;
}

.expense-detail-section {
    padding-top: 1.05rem;
    border-top: 1px solid var(--ui-border);
}

.section-title {
    color: #344054;
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0;
}

.expense-project-list {
    display: grid;
    gap: 0.8rem;
}

.expense-project-card {
    padding: 1rem;
    background: var(--ui-bg-muted);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
}

.expense-project-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.expense-project-card-name {
    min-width: 0;
    color: var(--ui-heading);
    font-size: 0.95rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.expense-project-card-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.78rem 1.25rem;
    margin: 0;
}

.expense-project-card-details dt {
    color: var(--ui-muted);
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: uppercase;
}

.expense-project-card-details dd {
    margin: 0.18rem 0 0;
    color: var(--ui-heading);
    font-size: 0.9rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.expense-attachments-list {
    display: grid;
    gap: 0.6rem;
}

.expense-attachment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.7rem;
    color: var(--ui-text);
    background: var(--ui-bg-muted);
    border: 1px solid transparent;
    border-radius: var(--ui-radius);
    transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.expense-attachment-item:hover,
.expense-attachment-item:focus {
    color: var(--ui-text);
    background: var(--ui-primary-soft);
    border-color: #c8dafc;
    transform: translateY(-1px);
}

.expense-attachment-icon,
.attachment-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.55rem;
    height: 2.55rem;
    overflow: hidden;
    color: var(--ui-primary);
    background: #edf5ff;
    border-radius: var(--ui-radius);
}

.attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Add expense */
.attachment-choice {
    min-height: 5.8rem;
    padding: 0.75rem;
    border-radius: var(--ui-radius);
}

.attachment-choice svg {
    flex: 0 0 auto;
}

.qr-badge-inner,
.attachment-list-item {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.7rem;
    padding: 0.62rem 0.7rem;
    background: var(--ui-bg-muted);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
}

.qr-badge-inner {
    color: var(--ui-emerald);
    background: var(--ui-emerald-soft);
    border-color: #a7f3d0;
}

.attachment-list-item + .attachment-list-item {
    margin-top: 0.45rem;
}

.attachment-file-name {
    max-width: min(22rem, 64vw);
}

.loading-overlay-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(17, 24, 39, 0.56);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.loading-overlay-content {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 2001;
    width: min(90vw, 24rem);
    transform: translate(-50%, -50%);
    animation: overlayIn 0.22s ease;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
}

@keyframes overlayIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* QR scanner */
.qr-scanner-modal .modal-content {
    color: #fff;
    background: #101828;
}

.qr-scanner-modal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.qr-scanner-modal .modal-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 850;
}

.qr-scanner-modal .modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
}

.qr-scanner-reader {
    width: min(100%, 44rem);
    overflow: hidden;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--ui-radius);
}

.qr-scanner-reader video,
.qr-scanner-reader canvas {
    max-height: calc(100vh - 11rem);
    object-fit: cover;
}

.qr-scanner-hint {
    width: min(100%, 44rem);
    color: #d0d5dd;
    font-size: 0.9rem;
    text-align: center;
}

/* Empty state and floating action */
.empty-state {
    padding: clamp(2.2rem, 4vw, 4rem) 1.25rem;
    color: var(--ui-muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.78);
    border: 1px dashed var(--ui-border-strong);
}

.empty-state p {
    margin-bottom: 0;
}

.empty-state svg {
    margin-bottom: 1rem;
    color: #8da1b5;
}

.fab {
    position: fixed;
    right: clamp(1rem, 2vw, 2rem);
    bottom: clamp(1rem, 2vw, 2rem);
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    color: #fff;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--ui-cyan), var(--ui-primary));
    border: 0;
    border-radius: 50%;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.28);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.fab:hover,
.fab:focus {
    color: #fff;
    filter: saturate(1.08);
    box-shadow: 0 20px 42px rgba(37, 99, 235, 0.34);
    transform: translateY(-2px);
}

/* Responsive */
@media (min-width: 1600px) {
    :root {
        --ui-page-max: 1560px;
    }

    .glass-card .table tbody td,
    .glass-card .table thead th {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }
}

@media (max-width: 991.98px) {
    :root {
        --ui-page-pad: 1rem;
    }

    .glass-nav .navbar-collapse {
        padding-top: 0.75rem;
    }

    .glass-nav .navbar-nav {
        gap: 0.2rem;
    }

    .glass-nav .nav-link {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: 5.75rem;
        font-size: 0.9rem;
    }

    :root {
        --ui-page-pad: 0.85rem;
        --ui-control-h: 2.7rem;
    }

    .main-container {
        padding-top: 1rem;
    }

    .page-header {
        gap: 0.7rem;
        margin-bottom: 0.9rem;
    }

    .page-header h2::after {
        width: 1.9rem;
        margin-top: 0.35rem;
    }

    .glass-card {
        margin-bottom: 0.9rem;
    }

    .form-body {
        padding: 1rem;
    }

    .auth-page,
    .error-page {
        min-height: calc(100vh - 8rem);
        padding: 1rem 0;
    }

    .expense-list-mobile-first .expense-card-meta {
        grid-template-columns: 1fr;
    }

    .expense-card-main {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .expense-card-main .expense-card-title {
        flex: 1 1 9rem;
    }

    .expense-card-main .badge {
        margin-left: auto;
    }

    .expense-card-meta {
        grid-template-columns: 1fr;
    }

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

    .expense-detail-actions {
        justify-content: stretch;
    }

    .expense-detail-actions .btn {
        flex: 1 1 auto;
    }

    dl.detail-list dt {
        padding-bottom: 0.2rem;
        border-bottom: 0;
    }

    dl.detail-list dd {
        padding-top: 0;
    }

    .expense-project-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .project-list .glass-card > .d-flex,
    .user-list .glass-card > .d-flex {
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .project-list .glass-card > .d-flex > .d-flex:first-child,
    .user-list .glass-card > .d-flex > .d-flex:first-child {
        min-width: 0;
    }

    .project-list .glass-card > .d-flex > .d-flex:last-child,
    .user-list .glass-card > .d-flex > .d-flex:last-child {
        flex: 0 0 auto;
    }

    .fab {
        width: 3.2rem;
        height: 3.2rem;
        font-size: 1.4rem;
    }
}

@media (max-width: 575.98px) {
    .btn {
        min-width: 0;
    }

    .d-grid.gap-2.d-md-flex .btn {
        width: 100%;
    }

    .row.g-2 > .col-6 {
        width: 50%;
    }

    .attachment-choice {
        min-height: 5.25rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .attachment-choice .small {
        font-size: 0.75rem !important;
        line-height: 1.15;
    }

    .navbar-user-name {
        max-width: 100%;
    }
}
