* {
    box-sizing: border-box;
}

:root {
    --bg: #0f1113;
    --panel: rgba(22, 24, 28, 0.88);
    --panel-strong: rgba(18, 20, 24, 0.96);
    --panel-soft: rgba(255, 255, 255, 0.04);
    --text: #f5f7f8;
    --muted: #9fa8b2;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.14);
    --accent: #f4f4f5;
    --accent-ink: #15171a;
    --amber: #f7d188;
    --danger: #ef7373;
    --danger-bg: rgba(183, 53, 53, 0.18);
    --success-bg: rgba(23, 104, 70, 0.28);
    --success-border: rgba(67, 187, 123, 0.22);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 8% 12%, rgba(161, 98, 7, 0.14), transparent 35%),
        radial-gradient(circle at 92% 8%, rgba(68, 64, 60, 0.2), transparent 32%),
        linear-gradient(180deg, #111315 0%, #0f1113 100%);
    color: var(--text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: var(--amber);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input,
select,
textarea {
    font: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.page,
.login-shell,
.policy-shell {
    position: relative;
    z-index: 1;
}

.page {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.login-shell,
.policy-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.card,
.auth-card,
.policy-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.hero-card,
.panel-card,
.auth-card,
.policy-card {
    padding: 24px;
}

.hero-grid {
    display: grid;
    gap: 20px;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
}

.pill,
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 7px 12px;
}

.pill {
    border: 1px solid rgba(245, 183, 72, 0.35);
    background: rgba(245, 183, 72, 0.1);
    color: #ffdea0;
    text-transform: uppercase;
}

.badge {
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.badge.active {
    background: rgba(89, 142, 255, 0.16);
    border-color: rgba(89, 142, 255, 0.24);
    color: #d8e5ff;
}

.badge.done {
    background: rgba(55, 160, 106, 0.16);
    border-color: rgba(55, 160, 106, 0.26);
    color: #daf7e6;
}

.badge.neutral {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.hero-card h1,
.section-head h2,
.auth-card h1,
.modal-title,
.panel-card h3,
.policy-card h1 {
    margin: 0;
}

.hero-card h1 {
    font-size: clamp(1.9rem, 2vw + 1rem, 2.7rem);
    line-height: 1.08;
    margin-top: 10px;
}

.muted {
    color: var(--muted);
}

.user-chip {
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: rgba(20, 22, 24, 0.72);
    padding: 14px 16px;
    min-width: 240px;
}

.summary-grid {
    display: grid;
    gap: 16px;
    margin-top: 20px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.summary-card {
    padding: 18px 20px;
}

.summary-card strong {
    display: block;
    font-size: 2rem;
    margin-top: 10px;
}

.flash {
    margin-top: 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 14px 16px;
}

.flash.success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: #def6ea;
}

.flash.error {
    background: var(--danger-bg);
    border-color: rgba(239, 115, 115, 0.26);
    color: #ffd8d8;
}

.toolbar {
    display: grid;
    gap: 12px;
    align-items: start;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 20px;
}

.tab-list,
.tab-list.superadmin {
    display: grid;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(20, 22, 24, 0.74);
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.tab-trigger {
    appearance: none;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 600;
    min-height: 46px;
    padding: 10px 14px;
}

.tab-trigger.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.inline-actions,
.toolbar-actions,
.entity-actions,
.stack-actions,
.modal-actions,
.admin-role-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-actions {
    justify-content: flex-end;
}

.button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: 160ms ease;
    font-weight: 600;
}

.button.primary,
.button-link.primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.button.secondary,
.button-link.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-color: var(--line);
}

.button.ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}

.button.danger {
    background: var(--danger-bg);
    color: #ffd8d8;
    border-color: rgba(239, 115, 115, 0.32);
}

.button:hover,
.button-link:hover,
.tab-trigger:hover {
    filter: brightness(1.07);
    text-decoration: none;
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tab-panel {
    display: none;
    margin-top: 18px;
}

.tab-panel.is-active {
    display: block;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.filters-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) 190px;
    margin-bottom: 18px;
}

.table-toolbar {
    margin-bottom: 18px;
}

.table-search {
    max-width: 420px;
}

.table-sort-select {
    max-width: 280px;
}

.input,
.select,
.textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(10, 12, 14, 0.74);
    color: var(--text);
    padding: 12px 14px;
}

.textarea {
    min-height: 132px;
    resize: vertical;
}

label {
    display: grid;
    gap: 8px;
}

label > span {
    color: var(--muted);
    font-size: 0.95rem;
}

.card-grid {
    display: grid;
    gap: 18px;
    align-items: start;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.entity-card {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(19, 22, 26, 0.82);
    overflow: hidden;
}

.entity-card-head {
    display: grid;
    gap: 18px;
    padding: 20px;
    border-bottom: 1px solid var(--line);
    grid-template-columns: minmax(0, 1fr) minmax(240px, 290px);
    align-items: start;
}

.entity-card-body {
    display: grid;
    gap: 18px;
    padding: 18px 20px 20px;
}

.entity-title {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 12px;
}

.entity-subtitle {
    margin-top: 8px;
}

.entity-meta {
    display: grid;
    gap: 10px;
    line-height: 1.5;
}

.entity-meta-stack {
    align-content: start;
}

.preline {
    white-space: pre-line;
}

.labelled {
    margin-top: 14px;
    color: var(--text);
    line-height: 1.5;
}

.attachments {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(12, 15, 18, 0.84);
    padding: 14px;
}

.attachments > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.attachments > summary::-webkit-details-marker {
    display: none;
}

.attachments-panel {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.attachments-upload {
    display: grid;
    gap: 10px;
}

.attachment-list {
    display: grid;
    gap: 10px;
}

.attachment-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(7, 10, 12, 0.76);
    padding: 10px;
}

.attachment-preview {
    width: 56px;
}

.attachment-preview-link {
    position: relative;
    display: inline-block;
    text-decoration: none;
}

.attachment-preview-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    max-width: min(240px, 75vw);
    width: max-content;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(8, 10, 12, 0.96);
    color: var(--text);
    font-size: 0.72rem;
    line-height: 1.25;
    padding: 6px 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 140ms ease;
    z-index: 9999;
    white-space: normal;
}

.attachment-preview-link:hover::after,
.attachment-preview-link:focus-visible::after {
    opacity: 1;
}

.attachment-preview-link:hover,
.attachment-preview-link:focus-visible {
    z-index: 10000;
}

.attachment-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.attachment-fallback {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.84rem;
}

.attachment-main {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.attachment-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted);
}

.attachment-name:hover {
    color: var(--text);
}

.attachment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-shell {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(15, 18, 21, 0.74);
}

.table-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 100%;
}

.data-table th,
.data-table td {
    padding: 15px 16px;
    text-align: left;
    border-top: 1px solid var(--line);
    vertical-align: top;
}

.data-table thead th {
    border-top: 0;
    background: rgba(10, 12, 15, 0.82);
    color: #c7ced6;
    font-weight: 600;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.table-action-cell {
    width: 210px;
}

.stack-actions {
    align-items: center;
}

.empty-row td,
.empty-state {
    color: var(--muted);
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 160px;
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    text-align: center;
    padding: 24px;
}

.empty-state.compact {
    min-height: 0;
    padding: 14px;
}

.admin-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.admin-card {
    padding: 20px;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-tight {
    grid-template-columns: 1fr;
}

.field-span-2 {
    grid-column: span 2;
}

.admin-users {
    display: grid;
    gap: 12px;
}

.admin-user-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
    padding: 14px 16px;
}

.admin-role-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.admin-role-actions .select {
    min-width: 170px;
}

.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 50;
}

.modal.is-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 10, 0.76);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: min(88vh, 920px);
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    padding: 22px;
}

.modal-dialog.wide {
    width: min(760px, 100%);
}

.modal-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-close {
    appearance: none;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
}

.modal-form {
    display: grid;
    gap: 18px;
}

.modal-actions {
    justify-content: flex-end;
}

.auth-card,
.policy-card {
    width: min(560px, 100%);
}

.auth-card {
    display: flex;
    flex-direction: column;
}

.auth-card .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}

.auth-card .form-grid .button {
    justify-self: center;
    min-width: 160px;
    margin-top: 4px;
    margin-bottom: 4px;
}

.auth-card form,
.policy-card .content {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.footer-links {
    margin-top: 8px;
    padding-top: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.footer-links a {
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--text);
}

.policy-card {
    width: min(860px, 100%);
}

.policy-updated {
    margin-top: 6px;
}

.policy-content {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.policy-block {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(12, 15, 18, 0.72);
    padding: 14px 16px;
}

.policy-block h2 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.policy-block p {
    margin: 0;
    color: #d6dde4;
    line-height: 1.6;
}

.policy-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #d6dde4;
    line-height: 1.6;
}

.policy-list li + li {
    margin-top: 6px;
}

.policy-card .footer-links {
    margin-top: 14px;
    padding-top: 10px;
}

@media (max-width: 620px) {
    .policy-card {
        padding: 18px;
    }

    .policy-content {
        gap: 10px;
    }

    .policy-block {
        padding: 12px;
    }

    .policy-block h2 {
        font-size: 0.95rem;
    }

    .policy-card .footer-links {
        gap: 12px;
        flex-wrap: wrap;
    }
}
.hidden {
    display: none !important;
}

.mobile-inline-action {
    display: none;
}

.user-chip-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.user-chip-actions .button-link {
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

section[data-tab-panel="projects"] .card-grid,
section[data-tab-panel="service"] .card-grid {
    gap: 14px;
    align-items: start;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 248px), 1fr));
}

section[data-tab-panel="projects"] .entity-card,
section[data-tab-panel="service"] .entity-card {
    border-radius: 18px;
    overflow: visible;
}

section[data-tab-panel="projects"] .entity-card-head,
section[data-tab-panel="service"] .entity-card-head {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 14px 12px;
}

section[data-tab-panel="projects"] .entity-card-body,
section[data-tab-panel="service"] .entity-card-body {
    gap: 14px;
    padding: 14px;
}

section[data-tab-panel="projects"] .entity-title,
section[data-tab-panel="service"] .entity-title {
    margin-top: 8px;
    font-size: 1.1rem;
}

section[data-tab-panel="projects"] .entity-subtitle,
section[data-tab-panel="service"] .entity-subtitle,
section[data-tab-panel="projects"] .entity-meta,
section[data-tab-panel="service"] .entity-meta,
section[data-tab-panel="projects"] .labelled,
section[data-tab-panel="service"] .labelled {
    font-size: 0.92rem;
}

section[data-tab-panel="projects"] .labelled,
section[data-tab-panel="service"] .labelled {
    margin-top: 10px;
}

section[data-tab-panel="projects"] .attachments,
section[data-tab-panel="service"] .attachments {
    border-radius: 12px;
    padding: 8px 10px;
}

section[data-tab-panel="projects"] .attachments-panel,
section[data-tab-panel="service"] .attachments-panel {
    gap: 8px;
    margin-top: 8px;
}

section[data-tab-panel="projects"] .attachments-upload,
section[data-tab-panel="service"] .attachments-upload {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

section[data-tab-panel="projects"] .attachments-upload .button,
section[data-tab-panel="service"] .attachments-upload .button {
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
}

section[data-tab-panel="projects"] .attachment-actions,
section[data-tab-panel="service"] .attachment-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}

section[data-tab-panel="projects"] .attachment-actions form,
section[data-tab-panel="service"] .attachment-actions form {
    display: flex;
    margin: 0;
}

section[data-tab-panel="projects"] .attachment-actions .button,
section[data-tab-panel="service"] .attachment-actions .button {
    min-height: 28px;
    padding: 5px 8px;
    border-radius: 9px;
    font-size: 0.76rem;
    line-height: 1;
}

section[data-tab-panel="projects"] .attachment-item,
section[data-tab-panel="service"] .attachment-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    padding: 6px;
    overflow: visible;
}

section[data-tab-panel="projects"] .attachment-thumb,
section[data-tab-panel="service"] .attachment-thumb {
    width: 48px;
    height: 48px;
}

section[data-tab-panel="projects"] .attachment-name,
section[data-tab-panel="service"] .attachment-name {
    font-size: 0.72rem;
}

section[data-tab-panel="projects"] .entity-actions .button,
section[data-tab-panel="service"] .entity-actions .button {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 12px;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}



.table-toolbar::after {
    content: 'Dra i kolumnrubrikens kant för att justera bredd.';
    color: var(--muted);
    font-size: 0.85rem;
}
.orders-table,
.inventory-table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
}

.orders-table th,
.orders-table td,
.inventory-table th,
.inventory-table td {
    overflow-wrap: anywhere;
}

@media (min-width: 981px) {
    .orders-table th:not(.table-action-cell),
    .orders-table td:not(.table-action-cell),
    .inventory-table th:not(.table-action-cell),
    .inventory-table td:not(.table-action-cell) {
        width: calc((100% - 12%) / 5);
    }

    .orders-table .table-action-cell,
    .inventory-table .table-action-cell {
        width: 12%;
    }
}


.orders-table .stack-actions,
.inventory-table .stack-actions {
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}

.orders-table .stack-actions form,
.inventory-table .stack-actions form {
    display: flex;
    margin: 0;
}

.orders-table .stack-actions .button,
.inventory-table .stack-actions .button {
    position: relative;
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 10px;
    font-size: 0;
    line-height: 0;
    gap: 0;
    overflow: hidden;
}

.orders-table .stack-actions .button::before,
.inventory-table .stack-actions .button::before {
    display: block;
    font-size: 15px;
    line-height: 1;
}

.orders-table .stack-actions .button.ghost::before,
.inventory-table .stack-actions .button.ghost::before {
    content: '\270E';
}

.orders-table .stack-actions .button.danger::before,
.inventory-table .stack-actions .button.danger::before {
    content: '\1F5D1';
    font-size: 14px;
}

.data-table th {
    position: relative;
}

.data-table th.is-resizable {
    padding-right: 26px;
}

.column-resizer {
    position: absolute;
    top: 0;
    right: -6px;
    width: 12px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
}

.column-resizer::after {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 5px;
    width: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

body.is-resizing-columns,
body.is-resizing-columns * {
    cursor: col-resize !important;
    user-select: none !important;
}
@media (max-width: 980px) {
    .orders-table,
    .orders-table tbody,
    .orders-table tr,
    .orders-table td,
    .inventory-table,
    .inventory-table tbody,
    .inventory-table tr,
    .inventory-table td {
        display: block;
        width: 100%;
    }

    .orders-table thead,
    .inventory-table thead {
        display: none;
    }

    .orders-table tbody tr,
    .inventory-table tbody tr {
        border-top: 1px solid var(--line);
        padding: 12px 14px;
        display: grid;
        gap: 9px;
    }

    .orders-table tbody tr:first-child,
    .inventory-table tbody tr:first-child {
        border-top: 0;
    }

    .orders-table td,
    .inventory-table td {
        border-top: 0;
        padding: 0;
        display: grid;
        gap: 2px;
    }

    .orders-table td::before,
    .inventory-table td::before {
        content: attr(data-label);
        font-size: 0.72rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--muted);
        font-weight: 600;
    }

    .orders-table .table-action-cell,
    .inventory-table .table-action-cell {
        width: auto;
    }

    .orders-table .stack-actions,
    .inventory-table .stack-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .orders-table .stack-actions .button,
    .inventory-table .stack-actions .button {
        min-width: 0;
        width: auto;
        min-height: 36px;
        padding: 8px 12px;
        border-radius: 10px;
        font-size: 0.86rem;
        line-height: 1;
    }

    .orders-table .stack-actions .button::before,
    .inventory-table .stack-actions .button::before {
        content: none;
    }
}

@media (max-width: 1120px) {
    .summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .toolbar {
        grid-template-columns: 1fr;
    }

    .toolbar-actions {
        justify-content: flex-start;
    }

    .entity-card-head {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .page {
        width: min(100%, calc(100% - 20px));
        padding-top: 16px;
    }

    .hero-grid,
    .filters-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .field-span-2 {
        grid-column: span 1;
    }

    .tab-list,
    .tab-list.superadmin {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    section[data-tab-panel="projects"] .card-grid,
    section[data-tab-panel="service"] .card-grid {
        grid-template-columns: 1fr;
    }

    .mobile-inline-action {
        display: inline-flex;
    }

    .modal {
        padding: 14px;
    }
}

@media (max-width: 620px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .toolbar-actions,
    .entity-actions,
    .stack-actions,
    .modal-actions,
    .inline-form,
    .admin-role-form,
    .admin-role-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .attachment-item {
        grid-template-columns: 1fr;
    }

    .attachment-preview {
        width: auto;
    }

    .attachment-thumb {
        width: 60px;
        height: 60px;
    }

    .orders-table .stack-actions,
    .inventory-table .stack-actions {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
    }

    .orders-table .stack-actions form,
    .inventory-table .stack-actions form {
        display: flex;
        margin: 0;
    }

    .orders-table .stack-actions .button,
    .inventory-table .stack-actions .button {
        position: relative;
        width: 32px;
        min-width: 32px;
        min-height: 32px;
        padding: 0;
        border-radius: 10px;
        font-size: 0;
        line-height: 0;
        gap: 0;
        overflow: hidden;
    }

    .orders-table .stack-actions .button::before,
    .inventory-table .stack-actions .button::before {
        display: block;
        font-size: 15px;
        line-height: 1;
    }

    .orders-table .stack-actions .button.ghost::before,
    .inventory-table .stack-actions .button.ghost::before {
        content: '\270E';
    }

    .orders-table .stack-actions .button.danger::before,
    .inventory-table .stack-actions .button.danger::before {
        content: '\1F5D1';
        font-size: 14px;
    }

    .modal-dialog,
    .modal-dialog.wide {
        width: 100%;
        padding: 18px;
    }
}
