:root {
    --navy: #12344d;
    --navy-2: #1b4a6a;
    --gold: #c9a227;
    --sand: #f6f1e7;
    --white: #ffffff;
    --text: #1c2733;
    --muted: #667384;
    --line: #e6ddcc;
    --ok: #1f7a4d;
    --ok-bg: #e6f6ee;
    --bad: #b42318;
    --bad-bg: #fdecea;
    --wait: #b54708;
    --wait-bg: #fff4e5;
    --back: #175cd3;
    --back-bg: #eff4ff;
    --mute: #667084;
    --mute-bg: #eef1f4;
    --radius: 16px;
    --tap: 48px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: #ece6d8;
    color: var(--text);
    font-family: Cairo, Tahoma, sans-serif;
    -webkit-text-size-adjust: 100%;
}

html[dir="ltr"] body {
    font-family: Inter, Cairo, Tahoma, sans-serif;
}

body {
    min-height: 100dvh;
}

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

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

.app-shell {
    min-height: 100dvh;
    max-width: 560px;
    margin: 0 auto;
    background: var(--sand);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 0 1px rgba(18, 52, 77, 0.06);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(12px + var(--safe-top)) 16px 12px;
    background: var(--navy);
    color: #fff;
    min-height: calc(56px + var(--safe-top));
}

.topbar-lead {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.topbar-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar-text strong {
    font-size: 17px;
    line-height: 1.3;
}

.topbar-text span {
    font-size: 12px;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.topbar-switch span {
    flex-shrink: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 2px;
    gap: 2px;
}

.lang-switch form {
    margin: 0;
}

.lang-switch button {
    border: 0;
    background: transparent;
    color: inherit;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.lang-switch button.is-active {
    background: #fff;
    color: var(--navy);
}

.lang-switch.is-light {
    background: #eef1f4;
    color: var(--navy);
}

.lang-switch.is-light button.is-active {
    background: var(--navy);
    color: #fff;
}

.login-lang {
    position: absolute;
    top: calc(12px + var(--safe-top));
    inset-inline-end: 16px;
    z-index: 5;
}

html[dir="ltr"] .back-btn svg {
    transform: scaleX(-1);
}

html[dir="ltr"] .bell-badge {
    left: auto;
    right: 4px;
}

html[dir="ltr"] .priority-panel summary::after {
    float: right;
}

html[dir="ltr"] .workflow-preview ol {
    padding-right: 0;
    padding-left: 18px;
}

.company-switch label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.company-switch.is-topbar select {
    max-width: 170px;
    min-height: 28px;
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
}

.company-switch.field {
    margin: 0 0 12px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #fff;
    display: grid;
    place-items: center;
    position: relative;
    flex-shrink: 0;
}

.topbar-logo,
.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    background: #fff;
}

.brand-logo {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    margin: 0 auto 12px;
    display: block;
}

.bell-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
    padding: 0 4px;
}

.page {
    flex: 1;
    padding: 16px 16px calc(108px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.is-login .page {
    padding: 32px 20px calc(24px + var(--safe-bottom));
    justify-content: center;
}

.flash {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
}

.flash.success { background: var(--ok-bg); color: var(--ok); }
.flash.danger { background: var(--bad-bg); color: var(--bad); }

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: block;
}

.card h2 {
    margin: 0 0 6px;
    font-size: 18px;
}

.request-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.request-card-link {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.company-logo,
.company-logo-lg,
.company-logo-sm {
    flex-shrink: 0;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
}

.company-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.company-logo-lg {
    width: 56px;
    height: 56px;
    border-radius: 14px;
}

.company-logo-sm {
    width: 22px;
    height: 22px;
    border-radius: 6px;
}

.company-logo.is-fallback,
.company-logo-lg.is-fallback,
.company-logo-sm.is-fallback {
    display: grid;
    place-items: center;
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    border: 0;
}

.company-logo.is-fallback { font-size: 16px; }
.company-logo-lg.is-fallback { font-size: 20px; }
.company-logo-sm.is-fallback { font-size: 11px; }

.meta-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.meta-head h2 { margin: 0 0 6px; }
.meta-head p { margin: 0; }

.request-card-main {
    min-width: 0;
    flex: 1;
}

.request-card-main strong {
    display: block;
    font-size: 15px;
}

.request-card-main p,
.request-card-main small,
.muted,
.hint {
    color: var(--muted);
    margin: 4px 0 0;
    font-size: 13px;
}

.request-card-description {
    color: var(--text, #1f2a37);
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chip {
    flex-shrink: 0;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.wait { background: var(--wait-bg); color: var(--wait); }
.chip.back { background: var(--back-bg); color: var(--back); }
.chip.mute { background: var(--mute-bg); color: var(--mute); }

.filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.filter {
    flex: 0 0 auto;
    background: #fff;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter.is-active {
    background: var(--navy);
    color: #fff;
}

.filter-count {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    font-size: 11px;
    font-weight: 800;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    line-height: 1;
}

.filter.is-active .filter-count {
    background: #fff;
    color: var(--navy);
}

.name-filters {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.name-filters .field {
    background: #fff;
    border-radius: var(--radius);
    padding: 12px 14px;
}

.name-filters .field select {
    background: var(--sand);
}

.archive-search {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    border-radius: var(--radius);
    padding: 14px;
}

.archive-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.archive-actions {
    display: flex;
    gap: 8px;
}

.archive-actions .btn.primary {
    flex: 1;
}

.archive-hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.priority-panel {
    background: #fff;
    border-radius: var(--radius);
    padding: 12px 14px;
}

.priority-panel summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--navy);
    list-style: none;
}

.priority-panel summary::-webkit-details-marker {
    display: none;
}

.priority-panel summary::after {
    content: "▾";
    float: left;
    color: var(--muted);
}

.priority-panel[open] summary::after {
    content: "▴";
}

.priority-hint {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.priority-list {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
}

.priority-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.priority-num {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.priority-name {
    font-size: 14px;
    font-weight: 700;
}

.priority-move {
    display: flex;
    gap: 4px;
    margin-inline-start: auto;
}

.priority-move form {
    margin: 0;
}

.priority-move button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--sand);
    color: var(--navy);
    font-size: 16px;
    font-weight: 800;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.field span { font-weight: 700; }

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: var(--tap);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
    font-size: 16px;
}

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

.field input[type="file"] {
    min-height: auto;
    padding: 10px;
}

.field input:disabled,
.field select:disabled {
    background: var(--mute-bg);
    color: var(--muted);
}

.error { color: var(--bad); font-size: 13px; }

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--tap);
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    width: 100%;
}

.btn.primary { background: var(--navy); color: #fff; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--navy); }
.btn.compact { min-height: 40px; width: auto; padding: 8px 12px; font-size: 13px; }

.fab {
    position: fixed;
    left: 50%;
    bottom: calc(84px + var(--safe-bottom));
    transform: translateX(-50%);
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--navy);
    color: #fff;
    border-radius: 999px;
    min-height: 52px;
    padding: 0 18px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(18, 52, 77, 0.28);
    width: auto;
    max-width: calc(560px - 32px);
}

.tabbar {
    position: sticky;
    bottom: 0;
    z-index: 25;
    display: flex;
    justify-content: space-around;
    gap: 8px;
    padding: 8px 8px calc(8px + var(--safe-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
}

.tab {
    flex: 1;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.tab.is-active { color: var(--navy); }
.tab-icon { position: relative; display: inline-flex; }
.badge {
    position: absolute;
    top: -7px;
    left: -10px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    font-size: 11px;
    display: grid;
    place-items: center;
    font-style: normal;
    padding: 0 4px;
}

.empty {
    background: #fff;
    border-radius: var(--radius);
    padding: 36px 16px;
    text-align: center;
    color: var(--muted);
    display: grid;
    gap: 14px;
    justify-items: center;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 0 16px;
}

.pager-btn {
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 12px;
    background: #fff;
}

.pager-btn.is-disabled { color: #bbb; }
.pager-info { color: var(--muted); }

.login-card {
    background: #fff;
    border-radius: 24px;
    padding: 28px 20px;
}

.brand {
    text-align: center;
    margin-bottom: 24px;
}

.brand-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: var(--navy);
    color: var(--gold);
}

.brand h1 { margin: 0; font-size: 22px; }
.brand p { margin: 6px 0 0; color: var(--muted); }

.meta h2 { margin: 0 0 6px; font-size: 20px; }
.meta p { margin: 0 0 10px; color: var(--muted); }

.app-version {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.app-version p {
    margin: 0;
}

.app-version p + p {
    margin-top: 4px;
}

.app-version span {
    margin-inline-end: 6px;
}

.app-version strong {
    color: var(--navy);
    font-weight: 700;
}

.details {
    display: grid;
    gap: 12px;
    margin: 0;
}

.details dt { color: var(--muted); font-size: 13px; }
.details dd { margin: 2px 0 0; font-weight: 700; }
.details a { color: var(--back); text-decoration: underline; }

.file-existing,
.file-chosen,
.attachment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.file-existing li,
.file-chosen li,
.attachment-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--sand);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
}

.file-existing a,
.file-chosen span,
.attachment-list a {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.check.compact {
    margin: 0;
    color: var(--bad);
    font-weight: 700;
    font-size: 12px;
}

.attachment-thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.timeline li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.timeline .dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 13px;
    flex-shrink: 0;
}

.timeline .dot svg {
    width: 16px;
    height: 16px;
    display: block;
}

.timeline li.is-approved .dot { background: var(--ok); }
.timeline li.is-rejected .dot { background: var(--bad); }
.timeline li.is-returned .dot { background: var(--back); }
.timeline li.is-pending .dot { background: var(--wait); }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.step-title,
.step-person {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.step-title strong { min-width: 0; }
.step-people {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}
.step-person span { font-size: 13px; font-weight: 700; }
.seen-mark {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    color: var(--mute);
}
.seen-mark svg { width: 18px; height: 18px; display: block; }
.seen-mark.is-seen { color: var(--ok); }
.timeline time {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.timeline .seen-mark time {
    display: inline;
    margin: 0;
    color: var(--ok);
    font-size: 12px;
}

.workflow-preview {
    background: #fff;
    border-radius: var(--radius);
    padding: 12px 16px;
}

.workflow-preview span { font-weight: 700; font-size: 13px; }
.workflow-preview ol {
    margin: 8px 0 0;
    padding-right: 18px;
    color: var(--muted);
}

.toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar a {
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
}

.type-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.type-head h3 { margin: 0 0 6px; }

.row-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.row-actions form { margin: 0; }

.step-card {
    background: var(--sand);
    border-radius: 14px;
    padding: 12px;
}

.step-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.text-btn {
    border: 0;
    background: transparent;
    color: var(--bad);
    font-weight: 700;
    padding: 0;
    min-height: auto;
}
.notice p { margin: 4px 0; color: var(--muted); }
.notice.is-unread {
    border-inline-start: 4px solid var(--gold);
}
.mark-read { display: flex; justify-content: flex-end; }

h3 { margin: 0 0 12px; font-size: 16px; }

.panel-toggles {
    display: flex;
    gap: 8px;
}

.panel-toggle {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.panel-toggle.has-value { border-color: var(--navy); }

.panel-toggle.is-open {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
}

.toggle-panel[hidden] { display: none !important; }

.filter-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    border-radius: var(--radius);
    padding: 14px;
}

.filter-panel .filter { background: var(--sand); }
.filter-panel .filter.is-active { background: var(--navy); }
.filter-panel .name-filters .field,
.filter-panel .priority-panel { padding: 0; }

.folder-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.folder-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    position: relative;
    background: #fff;
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 12px;
    color: var(--navy);
    transition: border-color .15s, background .15s, transform .15s;
}

.folder-tile > svg { color: var(--gold); }

.folder-tile-name {
    font-weight: 800;
    font-size: 14px;
    word-break: break-word;
}

.folder-tile-count {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--sand);
    color: var(--navy);
    font-size: 12px;
    font-weight: 800;
    display: inline-grid;
    place-items: center;
}

.folder-tile-new {
    border: 2px dashed var(--line);
    background: transparent;
}

.folder-tile-new summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    cursor: pointer;
    list-style: none;
    color: var(--muted);
}

.folder-tile-new summary::-webkit-details-marker { display: none; }

.folder-tile-new[open] {
    grid-column: 1 / -1;
    background: #fff;
}

.folder-new-form {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}

.folder-new-form input {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 15px;
}

.folder-hint {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.folder-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.folder-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 2px dashed var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--navy);
    font-weight: 700;
    font-size: 14px;
}

html[dir="ltr"] .folder-back svg { transform: scaleX(-1); }

.folder-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    color: var(--navy);
}

.folder-title svg { color: var(--gold); }

.folder-manage summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.folder-manage .folder-tools { margin-top: 10px; }

.request-card[draggable="true"] { cursor: grab; }
.request-card[draggable="true"] img { -webkit-user-drag: none; }
.request-card.is-dragging { opacity: .45; }
.request-card.is-moving { opacity: .35; pointer-events: none; }

body.is-dragging-request [data-drop-folder] {
    border-color: var(--gold);
    border-style: dashed;
}

[data-drop-folder].is-drop-target {
    border-color: var(--navy) !important;
    border-style: solid !important;
    background: var(--sand);
    transform: scale(1.03);
}

.folder-panel {
    background: #fff;
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.folder-panel h3 { margin: 0; }

.folder-panel p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.folder-create,
.folder-rename {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.folder-create .field,
.folder-rename .field { flex: 1 1 180px; }

.folder-tools {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.folder-assign .field {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.folder-assign .field span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
}

.folder-assign .field select {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    padding: 8px 12px;
    font-size: 14px;
}

.attachment-download { margin-top: 12px; }

@media (min-width: 720px) {
    body { padding: 16px 0; }
    .app-shell {
        min-height: calc(100dvh - 32px);
        border-radius: 24px;
        overflow: hidden;
    }
    .fab {
        left: auto;
        right: calc(50% - 280px + 24px);
        transform: none;
    }
    html[dir="ltr"] .fab {
        right: auto;
        left: calc(50% - 280px + 24px);
    }
}

.desktop-hero,
.side-brand {
    display: none;
}

.detail-layout,
.detail-main,
.detail-side,
.detail-actions,
.settings-layout,
.settings-main,
.settings-side {
    display: contents;
}

@media (min-width: 1024px) {
    body:not(.is-login) {
        padding: 0;
        background: var(--sand);
        font-size: 16px;
    }

    body:not(.is-login) .app-shell {
        max-width: none;
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        border-radius: 0;
        overflow: hidden;
        box-shadow: none;
        display: grid;
        grid-template-columns: 260px minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-areas:
            "nav header"
            "nav main";
    }

    body:not(.is-login) .app-shell:not(:has(.tabbar)) {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "header"
            "main";
    }

    body:not(.is-login) .topbar {
        grid-area: header;
        position: relative;
        top: auto;
        min-height: 68px;
        padding: 14px 28px;
    }

    body:not(.is-login) .topbar-text strong {
        font-size: 18px;
    }

    body:not(.is-login) .topbar-text span {
        font-size: 13px;
    }

    .company-switch.is-topbar select {
        max-width: 280px;
        min-height: 34px;
        font-size: 13px;
    }

    body:not(.is-login) .page {
        grid-area: main;
        min-height: 0;
        overflow: auto;
        overscroll-behavior: contain;
        padding: 22px 28px 36px;
        gap: 16px;
    }

    body:not(.is-login) .tabbar {
        grid-area: nav;
        position: relative;
        top: auto;
        bottom: auto;
        height: auto;
        min-height: 0;
        overflow: auto;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 4px;
        padding: 8px 12px 20px;
        border-top: 0;
        border-inline-end: 1px solid var(--line);
        background: #fff;
    }

    .side-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0 0 12px;
        padding: 14px 10px 16px;
        border-bottom: 1px solid var(--line);
        color: var(--navy);
    }

    .side-brand span {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .side-brand strong {
        font-size: 16px;
        line-height: 1.3;
    }

    .side-brand small {
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body:not(.is-login) .tab {
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-height: 48px;
        padding: 10px 12px;
        border-radius: 12px;
        font-size: 15px;
        text-align: start;
    }

    body:not(.is-login) .tab svg {
        flex-shrink: 0;
    }

    body:not(.is-login) .tab:hover {
        background: #f6f1e7;
        color: var(--navy);
    }

    body:not(.is-login) .tab.is-active {
        background: var(--navy);
        color: #fff;
    }

    body:not(.is-login) .fab,
    html[dir="ltr"] body:not(.is-login) .fab {
        position: fixed;
        inset-inline-start: auto;
        inset-inline-end: 28px;
        bottom: 28px;
        transform: none;
        max-width: none;
    }

    .card {
        padding: 16px 18px;
    }

    .card h2,
    .meta h2 {
        font-size: 22px;
    }

    .page.is-board {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: start;
        gap: 16px 18px;
        padding-bottom: 96px;
    }

    .page.is-board > :not(.request-card):not(article.card) {
        grid-column: 1 / -1;
    }

    .page.is-board .toolbar {
        justify-content: flex-start;
    }

    .page.is-board .filters {
        flex-wrap: wrap;
        overflow: visible;
        gap: 10px;
    }

    .page.is-board .filter {
        font-size: 15px;
        padding: 10px 16px;
    }

    .page.is-board .panel-toggles {
        justify-content: flex-start;
    }

    .page.is-board .panel-toggle {
        flex: 0 1 auto;
        min-width: 150px;
    }

    .page.is-board .folder-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .page.is-board .request-card-main strong {
        font-size: 16px;
    }

    .page.is-board .request-card-description,
    .page.is-board .request-card-main p,
    .page.is-board .request-card-main small {
        font-size: 14px;
    }

    .page.is-board .request-card {
        height: 100%;
        transition: box-shadow .15s ease;
    }

    .page.is-board .request-card:hover {
        box-shadow: 0 10px 24px rgba(18, 52, 77, 0.08);
    }

    .page.is-board > .empty {
        max-width: 640px;
        width: 100%;
        justify-self: center;
    }

    .page.is-board > .empty .btn {
        width: auto;
        min-width: 220px;
    }

    .page.is-feed {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: start;
        gap: 14px 16px;
    }

    .page.is-feed > :not(.notice) {
        grid-column: 1 / -1;
    }

    .page.is-feed .notice {
        height: 100%;
    }

    .detail-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr);
        gap: 16px 20px;
        align-items: start;
    }

    .detail-main,
    .detail-side,
    .detail-actions {
        display: flex;
        flex-direction: column;
        gap: 16px;
        min-width: 0;
    }

    .detail-side {
        grid-column: 2;
        grid-row: 1 / span 2;
        position: sticky;
        top: 0;
    }

    .detail-actions {
        grid-column: 1;
    }

    .detail-main > .meta {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
    }

    .detail-main > .meta .meta-head {
        flex: 1;
        margin-bottom: 0;
    }

    .detail-main > .card.stack {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        align-items: end;
    }

    .detail-main .details {
        grid-template-columns: 1fr 1fr;
        column-gap: 28px;
    }

    .detail-main .details dt {
        font-size: 13px;
    }

    .detail-main .details dd {
        font-size: 16px;
    }

    .detail-main .details > div:has(.attachment-list) {
        grid-column: 1 / -1;
    }

    .detail-actions > .btn,
    .detail-actions > form:not(.decision) {
        width: auto;
        align-self: flex-start;
    }

    .detail-actions > .btn,
    .detail-actions > form:not(.decision) .btn {
        width: auto;
        min-width: 220px;
    }

    .detail-actions > form.decision {
        display: grid;
        grid-template-columns: repeat(3, minmax(140px, 1fr));
        gap: 12px;
        width: 100%;
    }

    .detail-actions > form.decision .field {
        grid-column: 1 / -1;
    }

    .detail-actions > form.decision .btn {
        width: 100%;
        min-width: 0;
    }

    .settings-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.9fr);
        gap: 18px 22px;
        align-items: start;
    }

    .settings-main,
    .settings-side {
        display: flex;
        flex-direction: column;
        gap: 16px;
        min-width: 0;
    }

    .settings-main .btn,
    .settings-side .btn {
        width: auto;
        min-width: 220px;
        align-self: flex-start;
    }

    .page.is-workspace > form.stack {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 20px;
        align-items: start;
    }

    .page.is-workspace > form.stack > :is(
        .field:has(textarea),
        .field:has(input[type="file"]),
        .card,
        .check,
        .workflow-preview,
        .stack
    ) {
        grid-column: 1 / -1;
    }

    .page.is-workspace > form.stack > .btn {
        width: auto;
        min-width: 220px;
        justify-self: start;
    }

    body.is-login {
        padding: 0;
        background: #fff;
    }

    body.is-login .app-shell {
        max-width: none;
        width: 100%;
        height: 100dvh;
        min-height: 100dvh;
        border-radius: 0;
        overflow: hidden;
        box-shadow: none;
        background: #fff;
    }

    body.is-login .page {
        display: grid;
        grid-template-columns: minmax(380px, 1.05fr) minmax(440px, 0.95fr);
        min-height: 100dvh;
        padding: 0;
        gap: 0;
        justify-content: stretch;
        overflow: hidden;
    }

    body.is-login .desktop-hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 48px;
        text-align: center;
        background:
            radial-gradient(circle at 50% 42%, rgba(201, 162, 39, 0.28), transparent 46%),
            var(--navy);
        color: #fff;
    }

    body.is-login .desktop-hero .brand-logo {
        width: 104px;
        height: 104px;
        margin: 0 0 8px;
        border-radius: 28px;
    }

    body.is-login .desktop-hero h1 {
        margin: 0;
        font-size: 34px;
        color: #fff;
    }

    body.is-login .desktop-hero p {
        margin: 0;
        color: rgba(255, 255, 255, 0.78);
        font-size: 18px;
    }

    body.is-login .login-card {
        width: min(460px, calc(100% - 80px));
        margin: auto;
        padding: 12px 8px 28px;
        background: transparent;
        box-shadow: none;
    }

    body.is-login .login-card .brand {
        display: none;
    }

    body.is-login .login-lang {
        top: 24px;
        inset-inline-end: 28px;
    }
}

@media (min-width: 1540px) {
    .page.is-board,
    .page.is-feed {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
