:root {
    --color-blue: #81A6C6;
    --color-sky: #AACDDC;
    --color-cream: #F3E3D0;
    --color-stone: #D2C4B4;
    --color-ink: #26333d;
    --color-muted: #677782;
    --color-line: rgba(38, 51, 61, 0.12);
    --color-danger: #9d2f2f;
    --color-success: #2f7757;
    --radius: 8px;
    --shadow: 0 18px 48px rgba(38, 51, 61, 0.12);
    --sidebar-width: 292px;
}

@font-face {
    font-family: "Sahel";
    src: url("../fonts/Sahel/Sahel-FD-WOL.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Sahel";
    src: url("../fonts/Sahel/Sahel-SemiBold-FD-WOL.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Sahel";
    src: url("../fonts/Sahel/Sahel-Bold-FD-WOL.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--color-ink);
    font-family: "Sahel", Tahoma, Arial, sans-serif;
    background: #f8f4ee;
}

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

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

a {
    color: inherit;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(129, 166, 198, 0.22), rgba(243, 227, 208, 0.72)),
        #f8f4ee;
}

.auth-card {
    width: min(100%, 420px);
    padding: 32px;
    border: 1px solid rgba(38, 51, 61, 0.08);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
    text-align: center;
}

.brand-mark {
    display: inline-grid;
    width: 56px;
    height: 56px;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    margin-bottom: 16px;
    color: var(--color-ink);
    background: var(--color-cream);
    font-size: 28px;
    font-weight: 700;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-mark.small {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    margin: 0;
    font-size: 20px;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0 0 12px;
    font-size: 26px;
    line-height: 1.5;
}

h2 {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.6;
}

h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.7;
}

p {
    margin: 0 0 20px;
    color: var(--color-muted);
    line-height: 1.9;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 0;
    border-radius: var(--radius);
    padding: 10px 16px;
    color: #fff;
    background: var(--color-blue);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: #6f97ba;
}

.danger-button {
    background: var(--color-danger);
}

.danger-button:hover {
    background: #842626;
}

.button.compact {
    width: auto;
    min-width: 168px;
}

.button svg,
.icon-button svg,
.nav-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.icon-text {
    white-space: nowrap;
}

.form-stack,
.form-preview,
.equipment-form,
.request-form,
.management-form {
    display: grid;
    gap: 14px;
    text-align: right;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(38, 51, 61, 0.18);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: #fff;
}

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

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

.checkbox-label {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    align-self: end;
    border: 1px solid rgba(38, 51, 61, 0.18);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: #fff;
}

.checkbox-label input {
    width: 18px;
    min-height: auto;
}

.form-actions {
    display: flex;
    justify-content: flex-start;
}

.notice {
    margin-bottom: 16px;
    border-radius: var(--radius);
    padding: 12px;
    line-height: 1.8;
    text-align: right;
}

.notice.success {
    color: var(--color-success);
    background: rgba(47, 119, 87, 0.1);
}

.notice.danger {
    color: var(--color-danger);
    background: rgba(157, 47, 47, 0.1);
}

.panel-page {
    display: grid;
    min-height: 100vh;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    min-height: 100vh;
    height: 100vh;
    flex-direction: column;
    gap: 24px;
    border-left: 1px solid var(--color-line);
    padding: 22px;
    background: #fff;
}

.sidebar-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.sidebar-brand div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.sidebar-brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-brand small {
    color: var(--color-muted);
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav a,
.sidebar-logout {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 10px;
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--color-ink);
    text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.sidebar-logout:hover {
    background: rgba(129, 166, 198, 0.16);
}

.sidebar-nav a.active {
    box-shadow: inset -3px 0 0 var(--color-blue);
    font-weight: 700;
}

.sidebar-logout {
    margin-top: auto;
    color: var(--color-danger);
}

.nav-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: var(--radius);
    color: var(--color-blue);
    background: rgba(170, 205, 220, 0.28);
}

.panel-main {
    min-width: 0;
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

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

.topbar-title h1 {
    margin-bottom: 0;
}

.eyebrow {
    margin-bottom: 4px;
    color: #5f8fb5;
    font-weight: 700;
}

.user-chip,
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
}

.user-chip {
    max-width: 280px;
}

.user-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip strong {
    color: #5f8fb5;
    font-size: 12px;
}

.icon-button {
    display: none;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    color: var(--color-ink);
    background: #fff;
    cursor: pointer;
}

.mobile-backdrop {
    display: none;
}

.hero-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    margin-bottom: 22px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(170, 205, 220, 0.42), rgba(243, 227, 208, 0.58)),
        #fff;
    box-shadow: var(--shadow);
}

.hero-action h2 {
    max-width: 720px;
    font-size: 28px;
}

.hero-action p {
    max-width: 680px;
    margin-bottom: 0;
}

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

.metric-card,
.page-section,
.profile-panel {
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.84);
}

.metric-card {
    display: grid;
    gap: 8px;
    padding: 18px;
}

.metric-card span,
.profile-panel span {
    color: var(--color-muted);
}

.metric-card strong {
    font-size: 30px;
}

.metric-card small {
    color: var(--color-muted);
    line-height: 1.8;
}

.page-section {
    padding: 24px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    margin-bottom: 14px;
}

.page-section.narrow {
    max-width: 760px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.section-header p {
    margin-bottom: 0;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.secondary-button {
    color: var(--color-ink);
    background: var(--color-cream);
}

.secondary-button:hover {
    background: #ead6bd;
}

.pack-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.pack-strip span {
    display: inline-flex;
    gap: 8px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(170, 205, 220, 0.16);
    font-weight: 700;
}

.pack-strip small {
    color: var(--color-muted);
    font-weight: 400;
}

.pack-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pack-items span {
    border-radius: 999px;
    padding: 5px 9px;
    color: var(--color-muted);
    background: rgba(38, 51, 61, 0.06);
    font-size: 12px;
}

.empty-state {
    display: grid;
    min-height: 320px;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px dashed rgba(38, 51, 61, 0.18);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    background: rgba(255, 255, 255, 0.72);
}

.empty-state.slim {
    min-height: 220px;
}

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

.form-preview {
    max-width: 680px;
}

.equipment-form {
    margin-bottom: 24px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 18px;
    background: rgba(243, 227, 208, 0.32);
}

.management-form {
    margin-bottom: 24px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 18px;
    background: rgba(170, 205, 220, 0.12);
}

.current-image {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-muted);
}

.current-image img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
    object-fit: cover;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.equipment-card {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: #fff;
}

.equipment-card.is-inactive {
    opacity: 0.68;
}

.equipment-image {
    display: grid;
    min-height: 170px;
    place-items: center;
    background: linear-gradient(135deg, rgba(170, 205, 220, 0.36), rgba(210, 196, 180, 0.38));
}

.equipment-image img {
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.equipment-image span {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    border-radius: 50%;
    color: var(--color-blue);
    background: rgba(255, 255, 255, 0.72);
}

.equipment-image svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.equipment-body {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.inventory-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--color-muted);
    font-size: 13px;
}

.inventory-meta strong {
    color: var(--color-ink);
}

.equipment-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.equipment-title-row h3,
.equipment-body p {
    margin-bottom: 0;
}

.equipment-code,
.equipment-body small {
    color: var(--color-muted);
}

.status-pill {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.status-pill.success {
    color: var(--color-success);
    background: rgba(47, 119, 87, 0.1);
}

.status-pill.warning {
    color: #8a650f;
    background: rgba(210, 196, 180, 0.36);
}

.status-pill.danger {
    color: var(--color-danger);
    background: rgba(157, 47, 47, 0.1);
}

.status-pill.muted {
    color: var(--color-muted);
    background: rgba(38, 51, 61, 0.08);
}

.card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--color-line);
    padding: 12px 16px;
}

.card-actions form {
    margin: 0;
}

.text-button {
    border: 0;
    padding: 0;
    color: #5f8fb5;
    background: transparent;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

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

.text-button.success {
    color: var(--color-success);
}

.request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 180px;
}

.request-actions form {
    margin: 0;
}

.tabs-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin-right: auto;
    margin-bottom: 18px;
    margin-left: auto;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 6px;
    background: rgba(170, 205, 220, 0.12);
}

.tabs-bar a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: var(--radius);
    padding: 8px 14px;
    color: var(--color-muted);
    text-decoration: none;
    font-weight: 700;
}

.tabs-bar a.active {
    color: var(--color-ink);
    background: #fff;
    box-shadow: 0 8px 20px rgba(38, 51, 61, 0.08);
}

.tabs-bar strong {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--color-blue);
    font-size: 13px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jalali-picker {
    position: absolute;
    z-index: 120;
    width: min(300px, calc(100vw - 24px));
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

.jalali-picker-header {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    text-align: center;
}

.jalali-picker-header button,
.jalali-picker-grid button {
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
}

.jalali-picker-header button {
    min-height: 36px;
    color: var(--color-blue);
    font-size: 22px;
}

.jalali-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.jalali-picker-grid button {
    min-height: 34px;
    padding: 0;
}

.jalali-picker-grid button:hover {
    color: #fff;
    background: var(--color-blue);
}

.pwa-install {
    position: fixed;
    z-index: 80;
    right: 16px;
    bottom: 16px;
    display: grid;
    width: min(420px, calc(100vw - 32px));
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

.pwa-install[hidden] {
    display: none;
}

.pwa-install div {
    display: grid;
    gap: 4px;
}

.pwa-install strong {
    font-size: 15px;
}

.pwa-install span {
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.8;
}

.pwa-install .button {
    min-width: 92px;
}

.pwa-install:not(.has-native-install) [data-pwa-install-action] {
    display: none;
}

.pwa-install .icon-button {
    display: inline-grid;
}

.modal {
    position: fixed;
    z-index: 50;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    display: grid;
    place-items: center;
    width: min(920px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 40px);
    border: 0;
    border-radius: var(--radius);
    margin: 0;
    padding: 0;
    background: transparent;
    transform: translate(-50%, -50%);
    overflow: visible !important;
}

.modal::backdrop {
    background: rgba(38, 51, 61, 0.38);
}

.modal[open]::before {
    position: fixed;
    z-index: -1;
    inset: -100vmax;
    content: "";
    background: rgba(38, 51, 61, 0.38);
}

.modal-card {
    display: grid;
    gap: 18px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow: auto;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 22px;
    background: #fff;
    box-shadow: var(--shadow);
}

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

.modal-header h2,
.modal-header p {
    margin-bottom: 0;
}

.modal-close {
    display: inline-grid;
    color: var(--color-ink);
    text-decoration: none;
    font-size: 24px;
    line-height: 1;
}

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

.detail-grid div,
.detail-block {
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 14px;
    background: rgba(243, 227, 208, 0.22);
}

.detail-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--color-muted);
}

.detail-block h3,
.detail-block p {
    margin-bottom: 0;
}

.detail-list,
.timeline {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.detail-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--color-line);
    padding-bottom: 10px;
}

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

.detail-list span,
.timeline span,
.timeline small {
    color: var(--color-muted);
}

.timeline li {
    border-right: 3px solid var(--color-blue);
    padding-right: 12px;
}

.timeline p {
    margin-bottom: 0;
}

.decision-form {
    display: grid;
    gap: 12px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 14px;
    background: rgba(170, 205, 220, 0.12);
}

.form-actions.split {
    gap: 10px;
}

.request-form {
    max-width: 920px;
}

.equipment-picker {
    margin: 0;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 16px;
    background: rgba(170, 205, 220, 0.12);
}

.equipment-picker legend {
    padding: 0 8px;
    font-weight: 700;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.check-card {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 10px;
    background: #fff;
}

.check-card.is-disabled {
    background: rgba(38, 51, 61, 0.04);
}

.check-card input {
    width: 18px;
    min-height: auto;
}

.check-card span {
    display: grid;
    gap: 2px;
}

.check-card small {
    color: var(--color-muted);
    font-weight: 400;
}

.busy-note {
    color: var(--color-danger);
}

.stock-note {
    color: var(--color-success);
}

.table-wrap {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--color-line);
    padding: 14px 12px;
    text-align: right;
    vertical-align: top;
}

.data-table th {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 700;
}

.data-table td strong,
.data-table td small {
    display: block;
}

.data-table td small {
    margin-top: 4px;
    color: var(--color-muted);
    line-height: 1.8;
}

.profile-panel {
    display: grid;
    gap: 0;
}

.profile-panel.compact {
    max-width: 520px;
}

.profile-panel div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--color-line);
    padding: 16px;
}

.profile-panel div:last-child {
    border-bottom: 0;
}

@media (max-width: 980px) {
    .panel-page {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 20;
        inset: 0 0 0 auto;
        width: min(86vw, var(--sidebar-width));
        transform: translateX(105%);
        transition: transform 180ms ease;
        box-shadow: -18px 0 42px rgba(38, 51, 61, 0.18);
    }

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

    .mobile-backdrop {
        position: fixed;
        z-index: 10;
        inset: 0;
        display: none;
        background: rgba(38, 51, 61, 0.36);
    }

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

    .icon-button {
        display: inline-grid;
    }

    .panel-main {
        padding: 20px;
    }

    .topbar {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
    }

    .mobile-menu-button {
        grid-column: 3;
        grid-row: 1;
    }

    .topbar-title {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        text-align: center;
    }

    .topbar-title h1,
    .topbar-title .eyebrow {
        text-align: center;
    }

    .user-chip {
        display: none;
    }
}

@media (max-width: 760px) {
    .hero-action,
    .section-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .section-actions {
        justify-content: stretch;
    }

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

    .hero-action {
        padding: 22px;
    }

    .hero-action h2 {
        font-size: 24px;
    }

    .button.compact {
        width: 100%;
    }

    .profile-panel div {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid,
    .equipment-grid,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .tabs-bar {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        display: grid;
    }

    .form-actions {
        display: block;
    }

    .form-actions.split {
        display: grid;
        gap: 10px;
    }

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

    .detail-list li {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .data-table thead {
        display: none;
    }

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

    .data-table tr {
        border: 1px solid var(--color-line);
        border-radius: var(--radius);
        margin-bottom: 12px;
        padding: 10px;
        background: #fff;
    }

    .data-table td {
        display: grid;
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 10px;
        border-bottom: 0;
        padding: 8px;
    }

    .data-table td::before {
        content: attr(data-label);
        color: var(--color-muted);
        font-weight: 700;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
    }

    h1 {
        font-size: 22px;
    }

    .panel-main {
        padding: 16px;
    }

    .topbar {
        gap: 12px;
    }

    .page-section,
    .empty-state {
        padding: 18px;
    }

    .page-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .pwa-install {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .pwa-install .button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .modal {
        width: min(100vw - 24px, 920px);
        max-height: calc(100dvh - 24px);
    }

    .modal-card {
        max-height: calc(100dvh - 24px);
        padding: 18px;
    }
}

/* Category Management & Custom Dropdown Styles */
.category-dropdown-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    position: relative;
    width: 100%;
}

.custom-category-select,
.custom-location-select {
    position: relative;
    flex-grow: 1;
    cursor: pointer;
}

.custom-select-trigger {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(38, 51, 61, 0.18);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    box-sizing: border-box;
}

.custom-select-options {
    position: absolute;
    background: #fff;
    border: 1px solid rgba(38, 51, 61, 0.18);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-sizing: border-box;
}

.custom-category-select.open .custom-select-options,
.custom-location-select.open .custom-select-options {
    display: block;
}

.custom-select-option {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(38, 51, 61, 0.05);
    user-select: none;
    direction: rtl;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background: #f3e3d0;
}

.custom-select-option .opt-name {
    flex-grow: 1;
    text-align: right;
}

.delete-cat-btn,
.delete-loc-btn {
    background: #ffdede;
    color: #c92a2a;
    border: 1px solid #ffc9c9;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-right: 8px;
    padding: 0;
    line-height: 1;
}

.delete-cat-btn:hover,
.delete-loc-btn:hover {
    background: #fa5252;
    color: #fff;
    border-color: #fa5252;
}

.category-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    background: #81a6c6;
    color: #fff;
    border-radius: 4px;
    margin-bottom: 6px;
    font-weight: bold;
}

/* Search & Filter Bar Styles */
.search-filter-actions-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
    direction: rtl;
    flex-wrap: wrap;
}

.search-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 12px 16px;
    flex-grow: 1;
    flex-wrap: nowrap;
}

.search-input-wrapper {
    position: relative;
    flex: 3 1 320px;
}

.search-input {
    width: 100%;
    min-height: 40px;
    height: 40px;
    border: 1px solid rgba(38, 51, 61, 0.18);
    border-radius: var(--radius);
    padding: 8px 12px;
    background: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.filter-select {
    min-height: 40px;
    height: 40px;
    flex: 1 1 180px;
    border: 1px solid rgba(38, 51, 61, 0.18);
    border-radius: var(--radius);
    padding: 8px 12px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    box-sizing: border-box;
    width: auto;
}

.page-actions-wrapper {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    flex-shrink: 0;
}

@media (max-width: 992px) {
    .search-filter-actions-container {
        flex-direction: column;
        align-items: stretch;
    }
    .search-filter-bar {
        flex-wrap: wrap;
    }
    .search-input-wrapper {
        flex: 1 1 100%;
    }
    .filter-select {
        flex: 1 1 calc(50% - 6px);
    }
    .page-actions-wrapper {
        justify-content: center;
        margin-top: 8px;
    }
}

