@font-face {
    font-family: 'DB Heavent';
    src: url("../fonts/DB Heavent v3.2.2.ttf") format("truetype");
    font-weight: 400;
}

@font-face {
    font-family: 'DB Heavent';
    src: url("../fonts/DB Heavent Med v3.2.2.ttf") format("truetype");
    font-weight: 500;
}

@font-face {
    font-family: 'DB Heavent';
    src: url("../fonts/DB Heavent Bd v3.2.2.ttf") format("truetype");
    font-weight: 700;
}

:root {
    --bg: #f7f7f7;
    --surface: #ffffff;
    --surface-soft: #f3f4f6;
    --text: #141414;
    --text-soft: #667085;
    --line: #e5e7eb;
    --primary: #c1121f;
    --primary-dark: #7f0812;
    --primary-soft: rgba(193, 18, 31, 0.12);
    --success: #15803d;
    --warning: #b45309;
    --danger: #b91c1c;
    --black: #0f0f10;
    --shadow: 0 24px 56px rgba(15, 15, 16, 0.12);
    --radius: 24px;
    --radius-sm: 16px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'DB Heavent', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(193, 18, 31, 0.08), transparent 25%),
        linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
    color: var(--text);
    overflow-x: hidden;
}

body.has-open-modal {
    overflow: hidden;
}

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

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

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

form {
    min-width: 0;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

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

.app-body {
    padding-top: 92px;
}

.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    background: rgba(15, 15, 16, 0.97);
    border-bottom: 4px solid var(--primary);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.topbar__inner {
    max-width: 1480px;
    margin: 0 auto;
    padding: 14px 24px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand__logo {
    height: 42px;
    object-fit: contain;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: visible;
}

.main-nav__link {
    color: rgba(255, 255, 255, 0.74);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
    white-space: nowrap;
}

.main-nav__link:hover,
.main-nav__link.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(193, 18, 31, 0.2), rgba(193, 18, 31, 0.34));
    transform: translateY(-2px);
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

.nav-toggle {
    display: none;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    padding: 0;
    place-items: center;
    justify-content: center;
    align-items: center;
}

.dropdown {
    position: relative;
}

.dropdown__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    min-width: 290px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 22px;
    padding: 10px;
    box-shadow: var(--shadow);
    display: none;
}

.dropdown.is-open .dropdown__menu {
    display: block;
}

.dropdown__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px 14px;
    color: var(--text-soft);
}

.notification-item,
.dropdown__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    transition: transform 0.18s ease, background 0.18s ease;
}

.notification-item:hover,
.dropdown__item:hover {
    transform: translateX(4px);
    background: #f9fafb;
}

.notification-item__icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
}

.notification-item--danger .notification-item__icon {
    background: rgba(185, 28, 28, 0.12);
    color: var(--danger);
}

.notification-item--warning .notification-item__icon {
    background: rgba(180, 83, 9, 0.12);
    color: var(--warning);
}

.notification-item--success .notification-item__icon,
.notification-item--info .notification-item__icon {
    background: rgba(21, 128, 61, 0.12);
    color: var(--success);
}

.notification-item p {
    margin: 3px 0 0;
    color: var(--text-soft);
}

.icon-button,
.profile-chip {
    border: 0;
    cursor: pointer;
}

.icon-button {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    position: relative;
    transition: transform 0.18s ease, background 0.18s ease;
}

.icon-button:hover,
.profile-chip:hover {
    transform: translateY(-2px);
}

.icon-button.is-alerting {
    animation: bell-swing 1.8s ease-in-out infinite;
}

.icon-button__badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
}

.icon-button__badge[hidden],
[data-notification-count-label][hidden] {
    display: none !important;
}

.profile-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
    color: #fff;
    padding: 8px 14px 8px 8px;
    border-radius: 999px;
}

.profile-chip__info {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1;
}

.profile-chip__info strong {
    font-size: 20px;
    font-weight: 700;
}

.profile-chip__info small {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.68);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    overflow: hidden;
}

.avatar--image {
    object-fit: cover;
    background: #fff;
}

.page-shell {
    flex: 1;
    max-width: 1480px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 24px 96px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 28px;
}

.page-header > *,
.content-grid > *,
.dashboard-grid > *,
.stat-grid > * {
    min-width: 0;
}

.page-header h1,
.section-heading h2,
.panel__head h2,
.auth-panel__headline h1 {
    margin: 0;
    font-size: clamp(32px, 4vw, 46px);
    line-height: 0.98;
    font-weight: 700;
}

.page-header p,
.section-heading p,
.panel__head p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 21px;
}

.eyebrow {
    margin: 0 0 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
}

.page-header__actions,
.action-row,
.modal__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-grid,
.dashboard-grid,
.content-grid {
    display: grid;
    gap: 22px;
}

.stat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 24px;
}

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

.dashboard-grid {
    grid-template-columns: 1.7fr 1fr;
    margin-bottom: 24px;
}

.content-grid--sidebar {
    grid-template-columns: 390px minmax(0, 1fr);
}

.content-grid--wide {
    grid-template-columns: 1.1fr 1fr;
}

.content-grid--stack {
    grid-template-columns: 1fr;
}

.panel,
.stat-card,
.auth-card,
.auth-panel {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    min-width: 0;
}

.panel {
    padding: 24px;
}

.panel__head {
    margin-bottom: 20px;
}

.panel__head.panel__head--space {
    margin-bottom: 16px;
}

.panel__head--space {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    flex-wrap: wrap;
}

.panel__head--space > * {
    min-width: 0;
}

.stat-card {
    padding: 22px;
    display: flex;
    gap: 18px;
    align-items: center;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 44px;
    line-height: 0.9;
}

.stat-card span,
.stat-card small {
    display: block;
}

.stat-card small {
    color: var(--text-soft);
    font-size: 18px;
}

.stat-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: rgba(15, 15, 16, 0.06);
    color: var(--black);
}

.stat-card--primary {
    background: linear-gradient(135deg, #1b1b1d, #232326);
    color: #fff;
}

.stat-card--primary small {
    color: rgba(255, 255, 255, 0.7);
}

.stat-card--primary .stat-card__icon {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.field--grow {
    flex: 1;
    min-width: 0;
}

.field__label {
    font-size: 21px;
    font-weight: 700;
}

.input,
.browse-button {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 54px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 0 18px;
    font-size: 22px;
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.input:focus,
.browse-button:focus-within {
    outline: none;
    border-color: rgba(193, 18, 31, 0.48);
    box-shadow: 0 0 0 4px rgba(193, 18, 31, 0.12);
    transform: translateY(-1px);
}

.input--textarea {
    padding: 16px 18px;
    min-height: 130px;
    resize: vertical;
}

.input-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    width: 100%;
    min-width: 0;
}

.input-wrap .icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    z-index: 2;
}

.input-wrap .input {
    padding-left: 48px;
    padding-right: 60px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #6b7280;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    cursor: pointer;
    border-radius: 12px;
    z-index: 3;
}

.password-toggle__icon--hide {
    display: none;
}

.password-toggle.is-visible .password-toggle__icon--show {
    display: none;
}

.password-toggle.is-visible .password-toggle__icon--hide {
    display: block;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-size: 20px;
}

.btn {
    border: 0;
    border-radius: 18px;
    min-height: 52px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    font-size: 21px;
    font-weight: 700;
    max-width: 100%;
    min-width: 0;
    text-align: center;
    line-height: 1.1;
}

.btn span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 18px 30px rgba(15, 15, 16, 0.16);
}

.btn:disabled {
    cursor: wait;
    opacity: 0.85;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #e5383b);
}

.btn-secondary {
    color: var(--text);
    background: #f3f4f6;
}

.btn-danger,
.btn-danger-soft {
    color: #fff;
    background: linear-gradient(135deg, #b91c1c, #ef4444);
}

.btn-danger-soft {
    background: rgba(185, 28, 28, 0.12);
    color: #991b1b;
}

.btn-icon {
    width: 52px;
    padding: 0;
}

.btn-sm {
    min-height: 42px;
    padding: 0 14px;
    font-size: 18px;
    border-radius: 14px;
}

.btn-block {
    width: 100%;
}

.btn__progress {
    display: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

.btn.is-loading .btn__label {
    opacity: 0.8;
}

.btn.is-loading .btn__progress {
    display: inline-block;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 22px;
    border: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
}

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

.table thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    font-size: 18px;
    text-align: left;
    padding: 14px 16px;
    color: var(--text-soft);
    border-bottom: 1px solid var(--line);
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 20px;
    vertical-align: middle;
    background: #fff;
}

.table tbody tr:hover td {
    background: rgba(193, 18, 31, 0.03);
}

.table--clickable tbody tr {
    cursor: pointer;
}

.table__placeholder td {
    height: 74px;
    color: transparent;
}

.table-media {
    display: flex;
    align-items: center;
    gap: 14px;
}

.table-media > div,
.profile-hero > div {
    min-width: 0;
}

.table-media strong,
.profile-hero strong {
    font-size: 22px;
    overflow-wrap: anywhere;
}

.table-media small,
.profile-hero p {
    display: block;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 18px;
    overflow-wrap: anywhere;
}

.table-media__placeholder,
.thumb-button {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    background: #f3f4f6;
    border: 0;
    overflow: hidden;
}

.thumb-button {
    cursor: pointer;
}

.thumb-button img,
.profile-hero__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-form {
    flex: 0 1 320px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.panel__head--space .search-form {
    margin-left: auto;
    max-width: 360px;
}

.pagination {
    display: flex;
    gap: 10px;
    justify-content: end;
    margin-top: 18px;
    flex-wrap: wrap;
}

.pagination__link {
    min-width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #f3f4f6;
    font-weight: 700;
    transition: transform 0.18s ease, background 0.18s ease;
}

.pagination__link.is-active,
.pagination__link:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

.movement-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.movement-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) 160px minmax(0, 1fr) 52px;
    gap: 12px;
    align-items: end;
    padding: 16px;
    background: #fafafa;
    border: 1px solid var(--line);
    border-radius: 20px;
}

.movement-row--out {
    grid-template-columns: minmax(0, 1.1fr) 130px 180px minmax(0, 0.9fr) 52px;
}

.movement-row--borrow {
    grid-template-columns: minmax(0, 1.2fr) 140px minmax(0, 1fr) 52px;
}

.movement-row > * {
    min-width: 0;
}

.autocomplete {
    position: relative;
    min-width: 0;
}

.autocomplete__menu {
    position: absolute;
    inset: calc(100% + 6px) 0 auto 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 12;
    overflow: hidden;
}

.autocomplete.is-open .autocomplete__menu {
    display: block;
}

.autocomplete__item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 14px 16px;
    cursor: pointer;
    display: block;
}

.autocomplete__item:hover {
    background: #f9fafb;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 700;
}

.status-badge--in {
    background: rgba(21, 128, 61, 0.12);
    color: var(--success);
}

.status-badge--out {
    background: rgba(185, 28, 28, 0.12);
    color: var(--danger);
}

.status-badge--pending {
    background: rgba(180, 83, 9, 0.12);
    color: var(--warning);
}

.status-badge--approved {
    background: rgba(21, 128, 61, 0.12);
    color: var(--success);
}

.status-badge--rejected {
    background: rgba(185, 28, 28, 0.12);
    color: var(--danger);
}

.chart-canvas {
    width: 100%;
    min-height: 320px;
    display: block;
}

.unit-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.unit-bars__label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.unit-bars__track {
    height: 14px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

.unit-bars__track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #f97316);
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(193, 18, 31, 0.08), rgba(15, 15, 16, 0.04));
    min-width: 0;
}

.profile-hero__avatar {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    overflow: hidden;
}

.browse-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    padding: 0 16px;
}

.browse-button input {
    display: none;
}

.upload-preview {
    min-height: 110px;
    margin-top: 10px;
    border: 1px dashed var(--line);
    border-radius: 22px;
    background: #fafafa;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 12px;
}

.upload-preview.has-image {
    background: #fff;
}

.upload-preview img {
    width: auto;
    max-width: 100%;
    max-height: 210px;
    border-radius: 18px;
    object-fit: contain;
    display: block;
}

.upload-preview span {
    color: var(--text-soft);
    font-size: 18px;
}

.inline-form {
    display: inline-flex;
}

.hero-banner {
    background:
        radial-gradient(circle at top right, rgba(193, 18, 31, 0.12), transparent 32%),
        linear-gradient(135deg, rgba(17, 24, 39, 0.03), rgba(193, 18, 31, 0.04));
}

.quick-links,
.stack-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.quick-link,
.stack-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 20px;
    background: #fafafa;
    border: 1px solid var(--line);
}

.quick-link {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.quick-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(15, 15, 16, 0.08);
}

.quick-link__icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(193, 18, 31, 0.12);
    color: var(--primary);
}

.quick-link strong,
.stack-list__item strong,
.table-note strong {
    display: block;
    font-size: 22px;
}

.quick-link small,
.table-note small {
    display: block;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 18px;
    overflow-wrap: anywhere;
}

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

.filter-form,
.approval-actions,
.approval-actions__reject,
.smtp-grid {
    min-width: 0;
}

.filter-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-end;
}

.filter-form__search {
    flex: 1 1 320px;
    max-width: 420px;
}

.filter-form__field {
    width: 180px;
}

.approval-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    min-width: 250px;
    align-items: stretch;
    flex-wrap: nowrap;
}

.approval-actions form {
    min-width: 0;
}

.approval-actions__approve {
    background: linear-gradient(135deg, #15803d, #22c55e);
}

.users-action-row {
    flex-wrap: nowrap;
    width: auto;
}

.users-action-row > * {
    width: auto;
}

.approval-actions__reject {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.approval-actions__reject .input-wrap {
    flex: 1;
}

.approval-actions__reject .input {
    min-height: 42px;
    font-size: 18px;
    padding: 0 14px;
}

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

.footer {
    padding: 22px 24px 30px;
    text-align: center;
    color: var(--text-soft);
    font-size: 20px;
}

.footer--auth {
    flex: 0 0 auto;
    padding: 8px 24px 6px;
}

.auth-body {
    min-height: 100vh;
    padding: 24px;
}

.auth-shell {
    min-height: calc(100vh - 48px);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 34px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.auth-panel {
    background:
        radial-gradient(circle at top left, rgba(229, 57, 53, 0.34), transparent 32%),
        linear-gradient(135deg, #111827 0%, #1f2937 100%);
    color: #fff;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-panel__brand {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 26px;
    font-weight: 700;
}

.auth-panel__brand img {
    height: 48px;
}

.auth-panel__headline p {
    color: rgba(255, 255, 255, 0.76);
    font-size: 24px;
}

.auth-panel__features {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.feature-chip {
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 20px;
}

.auth-card-wrap {
    padding: 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, 0.94);
}

.auth-card {
    padding: 30px;
}

.auth-body--login {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(193, 18, 31, 0.12), transparent 24%),
        radial-gradient(circle at bottom right, rgba(17, 24, 39, 0.06), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.auth-login-shell {
    flex: 1;
    display: grid;
    place-items: center;
    min-height: 0;
}

.auth-login-card-wrap {
    width: min(100%, 1180px);
    display: grid;
    grid-template-columns: minmax(0, 460px);
    justify-content: center;
    min-height: 0;
    padding: 24px 24px 12px;
}

.auth-login-card {
    position: relative;
    padding: 34px 34px 30px;
    border-radius: 36px;
    background:
        radial-gradient(circle at top right, rgba(229, 57, 53, 0.12), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(208, 213, 221, 0.72);
    box-shadow: 0 26px 54px rgba(15, 23, 42, 0.12);
}

.auth-login-card::before {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: 28px;
    border: 1px solid rgba(193, 18, 31, 0.08);
    pointer-events: none;
}

.auth-login-brand,
.auth-login-card h1,
.auth-login-hint {
    position: relative;
    z-index: 1;
}

.auth-login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.auth-login-brand img {
    height: 54px;
}

.auth-login-card h1 {
    margin: 0;
    text-align: center;
    font-size: 46px;
    line-height: 0.94;
}

.auth-login-hint {
    margin: 10px auto 24px;
    max-width: 380px;
    text-align: center;
    color: #4b5563;
    font-size: 22px;
}

.auth-field__label {
    color: #111827;
}

.auth-input-wrap {
    box-shadow: inset 0 0 0 1px rgba(208, 213, 221, 0.72);
    background: rgba(255, 255, 255, 0.96);
}

.auth-input {
    border-color: transparent;
    background: transparent;
}

.auth-submit {
    min-height: 58px;
    font-size: 24px;
}

.remember-check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4b5563;
    font-size: 20px;
}

.remember-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.auth-inline-links {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.auth-inline-link {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 21px;
    font-weight: 700;
    cursor: pointer;
}

.auth-inline-link:hover {
    text-decoration: underline;
}

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
}

.modal--auth-sheet {
    display: grid;
    place-items: center;
    padding: 24px;
    overflow: hidden;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 16, 0.62);
    backdrop-filter: blur(10px);
}

.modal__dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 720px);
    max-height: 86vh;
    overflow: auto;
    margin: 6vh auto 0;
    background: #fff;
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.modal__dialog--compact {
    width: min(92vw, 520px);
}

.modal__dialog--auth {
    width: min(92vw, 560px);
}

.modal--auth-sheet .modal__dialog {
    width: min(100%, 560px);
    max-height: calc(100dvh - 48px);
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal--auth-sheet .modal__content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal__dialog--image {
    width: min(92vw, 920px);
    max-height: 84vh;
    background: rgba(255, 255, 255, 0.98);
}

.modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: rgba(15, 15, 16, 0.08);
    cursor: pointer;
}

.modal__content {
    padding: 28px;
}

.flash {
    display: flex;
    gap: 14px;
    padding: 18px;
    border-radius: 20px;
}

.flash + .flash {
    margin-top: 10px;
}

.flash--success {
    background: rgba(21, 128, 61, 0.09);
}

.flash--error {
    background: rgba(185, 28, 28, 0.09);
}

.flash__icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
}

.flash--success .flash__icon {
    background: rgba(21, 128, 61, 0.16);
    color: var(--success);
}

.flash--error .flash__icon {
    background: rgba(185, 28, 28, 0.16);
    color: var(--danger);
}

.flash p {
    margin: 2px 0 0;
    color: var(--text-soft);
}

.lightbox__image {
    width: auto;
    max-width: 100%;
    max-height: 72vh;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 20px;
    object-fit: contain;
}

.details-grid {
    display: grid;
    gap: 12px;
}

.details-grid img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 24px;
}

.details-grid__row {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.details-grid__row strong {
    color: var(--text-soft);
}

.text-danger {
    color: var(--danger);
}

.empty-state {
    padding: 24px;
    text-align: center;
    color: var(--text-soft);
}

.empty-state--compact {
    padding: 12px 18px 18px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes bell-swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(12deg);
    }
    20% {
        transform: rotate(-10deg);
    }
    30% {
        transform: rotate(6deg);
    }
    40% {
        transform: rotate(-4deg);
    }
}

@media (max-width: 1280px) {
    .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .topbar__inner {
        grid-template-columns: auto auto 1fr auto;
        gap: 10px;
    }

    .nav-toggle {
        display: inline-grid;
        grid-column: 2;
        justify-self: start;
        margin-left: 4px;
    }

    .main-nav {
        display: none;
        grid-column: 1 / -1;
        flex-direction: column;
        align-items: stretch;
        padding-top: 10px;
    }

    .main-nav.is-open {
        display: flex;
    }

    .topbar__actions {
        grid-column: 4;
        justify-self: end;
        gap: 8px;
    }

    .content-grid--sidebar,
    .content-grid--wide,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .smtp-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .app-body {
        padding-top: 84px;
    }

    .topbar__inner {
        grid-template-columns: auto auto 1fr auto;
    }

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

    .panel__head--space {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-form {
        flex: none;
        width: 100%;
    }

    .panel__head--space .search-form {
        margin-left: 0;
        max-width: none;
    }

    .panel__head.panel__head--space {
        margin-bottom: 12px;
    }

    .movement-row,
    .movement-row--out {
        grid-template-columns: 1fr;
    }

    .page-header__actions,
    .action-row {
        width: 100%;
    }

    .page-header__actions > *,
    .action-row > * {
        width: 100%;
    }

    .users-action-row,
    .users-action-row > * {
        width: auto;
    }

    .table {
        min-width: 680px;
    }

    .filter-form {
        justify-content: stretch;
    }

    .filter-form__search,
    .filter-form__field {
        max-width: none;
        width: 100%;
    }

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

    .approval-actions__reject {
        flex-direction: column;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-panel {
        padding: 30px;
    }
}

@media (max-width: 720px) {
    .page-shell,
    .topbar__inner,
    .auth-card-wrap,
    .auth-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .stat-grid--user {
        grid-template-columns: 1fr;
    }

    .profile-chip__info {
        display: none;
    }

    .profile-chip {
        padding-right: 10px;
    }

    .icon--chevron {
        display: none;
    }

    .dropdown__menu {
        width: min(92vw, 340px);
    }

    .panel {
        padding: 20px;
    }

    .quick-link,
    .stack-list__item {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-login-card-wrap {
        padding: 20px 0;
    }

    .auth-login-card {
        padding: 28px 22px 24px;
        border-radius: 28px;
    }

    .auth-login-card::before {
        inset: 12px;
        border-radius: 20px;
    }

    .auth-login-card h1 {
        font-size: 40px;
    }

    .auth-login-hint {
        font-size: 20px;
    }

    .modal--auth-sheet {
        padding: 16px;
    }

    .modal--auth-sheet .modal__dialog {
        max-height: calc(100dvh - 32px);
        border-radius: 24px;
    }

    .modal--auth-sheet .modal__content {
        padding: 24px 20px 20px;
    }

    .table {
        min-width: 560px;
    }

    .table thead th,
    .table tbody td {
        padding: 12px;
        font-size: 18px;
    }

    .table-media {
        gap: 10px;
    }

    .table-media strong,
    .profile-hero strong {
        font-size: 20px;
    }

    .table-media small,
    .profile-hero p {
        font-size: 16px;
    }

    .profile-hero {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .details-grid__row {
        grid-template-columns: 1fr;
    }
}
