:root {
    --bg: #fff8f2;
    --surface: #ffffff;
    --surface-soft: #fff4ea;
    --surface-strong: #ffe6d0;
    --text: #31140c;
    --text-soft: #7a5a4b;
    --text-faint: #b38a74;
    --border: #f1ddcd;
    --border-strong: #e8c8b1;
    --primary: #f97316;
    --primary-hover: #ea580c;
    --primary-soft: #fff2e8;
    --primary-ring: rgba(249, 115, 22, .18);
    --success: #15803d;
    --success-soft: #ecfdf3;
    --warning: #c26112;
    --warning-soft: #fff4e6;
    --danger: #d9481a;
    --danger-soft: #fff1eb;
    --info: #ea580c;
    --info-soft: #fff1e8;
    --shadow-sm: 0 1px 2px rgba(87, 33, 14, .05);
    --shadow-md: 0 10px 30px rgba(87, 33, 14, .08), 0 2px 8px rgba(87, 33, 14, .04);
    --shadow-lg: 0 24px 64px rgba(87, 33, 14, .14);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --sidebar-width: 256px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

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

button {
    border: 0;
}

svg {
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff7f0, #fff2e6);
    border: 1px solid rgba(249,115,22,.14);
    box-shadow: 0 12px 28px rgba(249, 115, 22, .16);
    overflow: hidden;
}

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

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

.brand-title {
    margin: 0;
    font-size: 15px;
    font-weight: 780;
    letter-spacing: -.02em;
}

.brand-subtitle {
    margin-top: 1px;
    color: var(--text-soft);
    font-size: 12px;
}

/* Buttons */
.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

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

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.nav-link:focus-visible,
.input-control:focus-visible,
.select-control:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.btn-primary {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 10px 20px rgba(249, 115, 22, .18);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    color: #344054;
    background: #fff;
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #fff7f2;
    border-color: #efb990;
}

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

.btn svg,
.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: #475467;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.icon-btn:hover {
    background: #fff5ec;
    border-color: #efb990;
    color: #8a3200;
}

/* Forms */
.form-group {
    display: grid;
    gap: 7px;
}

.form-group + .form-group {
    margin-top: 18px;
}

.form-label {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.form-hint {
    margin: 0;
    color: var(--text-soft);
    font-size: 12px;
}

.input-wrap {
    position: relative;
}

.input-control,
.select-control {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.input-control:hover,
.select-control:hover {
    border-color: #98a2b3;
}

.input-control:focus,
.select-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.input-control::placeholder {
    color: #98a2b3;
}

.input-with-icon {
    padding-left: 42px;
}

.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 18px;
    height: 18px;
    color: #98a2b3;
    transform: translateY(-50%);
    pointer-events: none;
}

.password-toggle {
    position: absolute;
    right: 5px;
    top: 50%;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #667085;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    color: #344054;
    background: #f2f4f7;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.input-with-toggle {
    padding-right: 46px;
}

/* Alerts */
.alert {
    display: flex;
    gap: 11px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 13px;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.alert-danger {
    color: #9f3214;
    background: var(--danger-soft);
    border-color: #ffc9b8;
}

.alert-success {
    color: #05603f;
    background: var(--success-soft);
    border-color: #abefc6;
}

.alert ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

/* Login */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) minmax(460px, .95fr);
    background: linear-gradient(180deg, #fffdfa, #fff7f0);
}

.auth-visual {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px clamp(38px, 5vw, 76px);
    color: #fff;
    background:
        radial-gradient(circle at 14% 15%, rgba(249, 115, 22, .34), transparent 24%),
        radial-gradient(circle at 88% 80%, rgba(251, 146, 60, .32), transparent 28%),
        radial-gradient(circle at 66% 22%, rgba(220, 38, 38, .18), transparent 22%),
        linear-gradient(145deg, #4a1409 0%, #8f2909 46%, #f97316 100%);
}

.auth-visual::before,
.auth-visual::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 50%;
    pointer-events: none;
}

.auth-visual::before {
    width: 520px;
    height: 520px;
    right: -250px;
    top: 8%;
}

.auth-visual::after {
    width: 360px;
    height: 360px;
    left: -170px;
    bottom: -120px;
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand .brand-mark {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.24);
    box-shadow: none;
    backdrop-filter: blur(8px);
}

.auth-brand .brand-title {
    font-size: 16px;
}

.auth-brand .brand-subtitle {
    color: rgba(255,255,255,.62);
}

.auth-hero {
    position: relative;
    z-index: 1;
    max-width: 620px;
    margin: auto 0;
    padding: 80px 0;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    color: rgba(255,255,255,.8);
    background: rgba(255,255,255,.07);
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.auth-eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffd7a8;
    box-shadow: 0 0 0 4px rgba(255, 215, 168, .18);
}

.auth-hero h1 {
    max-width: 560px;
    margin: 22px 0 16px;
    font-size: clamp(36px, 4vw, 58px);
    line-height: 1.03;
    letter-spacing: -.045em;
}

.auth-hero p {
    max-width: 520px;
    margin: 0;
    color: rgba(255,255,255,.68);
    font-size: 16px;
    line-height: 1.75;
}

.auth-feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.auth-feature {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: 999px;
    color: rgba(255,255,255,.78);
    background: rgba(255,255,255,.07);
    font-size: 12px;
}

.auth-feature svg {
    width: 15px;
    height: 15px;
}

.auth-footer {
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,.45);
    font-size: 12px;
}

.auth-form-side {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 44px clamp(28px, 5vw, 84px);
    background: #fff;
}

.auth-card {
    width: 100%;
    max-width: 430px;
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 11px;
    margin-bottom: 42px;
}

.auth-card h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.auth-card > p {
    margin: 10px 0 28px;
    color: var(--text-soft);
}

.auth-card .alert {
    margin-bottom: 20px;
}

.auth-submit {
    width: 100%;
    min-height: 46px;
    margin-top: 24px;
}

.auth-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 20px;
    color: var(--text-faint);
    font-size: 11px;
}

.auth-security-note svg {
    width: 14px;
    height: 14px;
}

/* App shell */
.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 22px 16px 18px;
    background: linear-gradient(180deg, rgba(255,250,245,.98), rgba(255,255,255,.98));
    border-right: 1px solid var(--border);
}

.sidebar::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ea580c 0%, #f97316 55%, #fbbf24 100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 8px 24px;
}

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

.nav-label {
    padding: 9px 11px 6px;
    color: #98a2b3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 10px;
    color: #475467;
    font-size: 13px;
    font-weight: 700;
    transition: background-color .16s ease, color .16s ease;
}

.nav-link svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
}

.nav-link:hover {
    color: #6b2500;
    background: #fff5ec;
}

.nav-link.active {
    color: #b64b05;
    background: var(--primary-soft);
}

.sidebar-spacer {
    flex: 1;
}

.sidebar-profile {
    padding: 14px 8px 2px;
    border-top: 1px solid var(--border);
}

.profile-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #b64b05;
    background: #fff0e2;
    font-size: 12px;
    font-weight: 800;
}

.profile-copy {
    min-width: 0;
    flex: 1;
}

.profile-name {
    overflow: hidden;
    color: #344054;
    font-size: 12px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-role {
    margin-top: 1px;
    overflow: hidden;
    color: #98a2b3;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: capitalize;
}

.profile-logout {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
}

.mobile-topbar {
    display: none;
}

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.content-wrap {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 34px clamp(24px, 3.6vw, 52px) 50px;
}

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

.page-header-copy {
    min-width: 0;
}

.page-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -.035em;
}

.page-subtitle {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    min-width: 0;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff, #fffaf6);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.stat-label {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
}

.stat-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--primary);
    background: var(--primary-soft);
}

.stat-icon svg {
    width: 17px;
    height: 17px;
}

.stat-value {
    margin-top: 14px;
    font-size: 27px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.035em;
}

.stat-foot {
    margin-top: 9px;
    color: var(--text-faint);
    font-size: 11px;
}

.stat-card.pending .stat-icon {
    color: var(--warning);
    background: var(--warning-soft);
}

.stat-card.success .stat-icon {
    color: var(--success);
    background: var(--success-soft);
}

.stat-card.processing .stat-icon {
    color: var(--info);
    background: var(--info-soft);
}

/* Panels / table */
.panel {
    background: linear-gradient(180deg, #ffffff, #fffdfb);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 18px;
    border-bottom: 1px solid var(--border);
}

.panel-title-wrap {
    min-width: 0;
}

.panel-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.015em;
}

.panel-kicker {
    margin-top: 3px;
    color: var(--text-faint);
    font-size: 11px;
}

.table-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.search-box {
    position: relative;
    width: min(280px, 28vw);
}

.search-box .input-control {
    min-height: 38px;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 38px;
    font-size: 12px;
}

.search-box .input-icon {
    left: 12px;
    width: 16px;
    height: 16px;
}

.filter-select {
    width: 132px;
    min-height: 38px;
    padding: 7px 30px 7px 10px;
    font-size: 12px;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th {
    padding: 11px 14px;
    color: #8a5d47;
    background: #fff8f2;
    border-bottom: 1px solid var(--border);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}

.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #eef0f3;
    color: #475467;
    font-size: 12px;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color .15s ease;
}

.data-table tbody tr:hover {
    background: #fff8f2;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.cell-primary {
    color: #344054;
    font-weight: 750;
}

.cell-secondary {
    margin-top: 2px;
    color: #98a2b3;
    font-size: 10px;
}

.request-id {
    display: inline-flex;
    align-items: center;
    padding: 5px 7px;
    border-radius: 7px;
    color: #7b4a2d;
    background: #fff3ea;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    font-weight: 700;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    color: #7b5a47;
    background: #fff7f2;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .015em;
}

.status-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #98a2b3;
}

.status-pending {
    color: var(--warning);
    background: var(--warning-soft);
}

.status-pending::before {
    background: #e38a00;
}

.status-processing {
    color: var(--info);
    background: var(--info-soft);
}

.status-processing::before {
    background: #f97316;
}

.status-success,
.status-completed,
.status-done {
    color: var(--success);
    background: var(--success-soft);
}

.status-success::before,
.status-completed::before,
.status-done::before {
    background: #12b76a;
}

.status-failed,
.status-error {
    color: var(--danger);
    background: var(--danger-soft);
}

.status-failed::before,
.status-error::before {
    background: #f04438;
}

.message-cell {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    display: grid;
    place-items: center;
    padding: 54px 20px;
    text-align: center;
}

.empty-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 13px;
    border-radius: 14px;
    color: #b64b05;
    background: #fff0e2;
}

.empty-icon svg {
    width: 22px;
    height: 22px;
}

.empty-state h3 {
    margin: 0;
    font-size: 14px;
}

.empty-state p {
    max-width: 380px;
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 12px;
}

.table-empty-filter {
    display: none;
    padding: 34px 18px;
    color: var(--text-soft);
    text-align: center;
    font-size: 12px;
}

.table-empty-filter.visible {
    display: block;
}

/* Form page */
.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 680px) minmax(250px, 360px);
    gap: 18px;
    align-items: start;
}

.form-card,
.info-card,
.result-card {
    background: linear-gradient(180deg, #ffffff, #fffdfb);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.form-card {
    padding: 24px;
}

.form-section-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 800;
}

.form-section-copy {
    margin: 0 0 24px;
    color: var(--text-soft);
    font-size: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-grid .form-group + .form-group {
    margin-top: 0;
}

.form-grid .full-span {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.info-card {
    padding: 20px;
}

.info-card + .info-card {
    margin-top: 14px;
}

.info-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 11px;
    color: var(--primary);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 1px rgba(249,115,22,.08);
}

.info-icon svg {
    width: 19px;
    height: 19px;
}

.info-card h3 {
    margin: 0;
    font-size: 13px;
}

.info-card p {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.65;
}

.info-list {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.info-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #667085;
    font-size: 11px;
}

.info-list svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--success);
}

/* Result page */
.result-wrap {
    min-height: calc(100vh - 100px);
    display: grid;
    place-items: center;
    padding: 34px 20px;
}

.result-card {
    width: 100%;
    max-width: 560px;
    padding: 34px;
    text-align: center;
}

.result-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 18px;
    color: var(--success);
    background: var(--success-soft);
}

.result-icon.danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.result-icon svg {
    width: 28px;
    height: 28px;
}

.result-card h1 {
    margin: 0;
    font-size: 23px;
    letter-spacing: -.03em;
}

.result-card > p {
    margin: 8px auto 0;
    max-width: 420px;
    color: var(--text-soft);
    font-size: 13px;
}

.result-details {
    margin: 24px 0;
    padding: 5px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff8f2;
    text-align: left;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.result-row:last-child {
    border-bottom: 0;
}

.result-key {
    color: #667085;
    font-size: 11px;
}

.result-value {
    max-width: 65%;
    overflow-wrap: anywhere;
    color: #344054;
    font-size: 11px;
    font-weight: 800;
    text-align: right;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 9px;
}

/* Mobile */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

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

    .auth-hero h1 {
        font-size: 42px;
    }
}

@media (max-width: 860px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        display: none;
    }

    .mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 30;
        min-height: 64px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 18px;
        background: rgba(255,250,245,.94);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(12px);
    }

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

    .mobile-brand .brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 11px;
    }

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

    .mobile-actions {
        display: flex;
        gap: 7px;
    }

    .mobile-actions .icon-btn {
        width: 38px;
        height: 38px;
    }

    .app-main {
        margin-left: 0;
    }

    .content-wrap {
        padding: 26px 18px 42px;
    }

    .form-layout {
        grid-template-columns: 1fr;
    }

    .form-aside {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .info-card + .info-card {
        margin-top: 0;
    }

    .auth-page {
        display: block;
        min-height: 100vh;
        background:
            radial-gradient(circle at 50% -10%, rgba(249,115,22,.12), transparent 36%),
            #fff8f2;
    }

    .auth-visual {
        display: none;
    }

    .auth-form-side {
        min-height: 100vh;
        padding: 34px 24px;
        background: transparent;
    }

    .auth-card {
        max-width: 440px;
        padding: 28px;
        border: 1px solid var(--border);
        border-radius: 20px;
        background: #fffdfb;
        box-shadow: var(--shadow-md);
    }

    .auth-mobile-brand {
        display: flex;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .content-wrap {
        padding: 22px 14px 34px;
    }

    .page-header {
        margin-bottom: 20px;
    }

    .page-title {
        font-size: 23px;
    }

    .page-subtitle {
        font-size: 12px;
        line-height: 1.55;
    }

    .page-actions .btn-secondary {
        display: none;
    }

    .page-actions .btn {
        min-height: 40px;
        padding: 8px 11px;
        font-size: 12px;
    }

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

    .stat-card {
        padding: 14px;
    }

    .stat-icon {
        width: 31px;
        height: 31px;
    }

    .stat-value {
        margin-top: 11px;
        font-size: 23px;
    }

    .stat-foot {
        margin-top: 7px;
        font-size: 10px;
    }

    .panel {
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .panel-header {
        display: block;
        padding: 0 0 13px;
        border-bottom: 0;
    }

    .table-tools {
        justify-content: stretch;
        margin-top: 12px;
    }

    .search-box {
        width: auto;
        flex: 1;
    }

    .filter-select {
        width: 118px;
    }

    .table-scroll {
        overflow: visible;
    }

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

    .data-table thead {
        display: none;
    }

    .data-table {
        white-space: normal;
    }

    .data-table tbody {
        display: grid;
        gap: 10px;
    }

    .data-table tbody tr {
        padding: 14px;
        background: #fffdfb;
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: var(--shadow-sm);
    }

    .data-table tbody tr:hover {
        background: #fffdfb;
    }

    .data-table td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        align-items: start;
        gap: 12px;
        padding: 8px 0;
        border: 0;
        font-size: 11px;
    }

    .data-table td::before {
        content: attr(data-label);
        color: #98a2b3;
        font-size: 9px;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .data-table td:first-child {
        padding-top: 0;
    }

    .data-table td:last-child {
        padding-bottom: 0;
    }

    .message-cell {
        max-width: none;
        overflow: visible;
        text-overflow: clip;
    }

    .request-id,
    .status-pill {
        justify-self: start;
    }

    .form-card {
        padding: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .form-grid .full-span {
        grid-column: auto;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .form-actions .btn {
        width: 100%;
    }

    .form-aside {
        grid-template-columns: 1fr;
    }

    .result-wrap {
        min-height: calc(100vh - 64px);
        padding: 22px 14px;
    }

    .result-card {
        padding: 26px 18px;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }

    .auth-form-side {
        display: block;
        padding: 22px 14px;
    }

    .auth-card {
        max-width: none;
        margin: 0 auto;
        padding: 24px 18px;
        border-radius: 18px;
        box-shadow: var(--shadow-sm);
    }

    .auth-mobile-brand {
        margin-bottom: 34px;
    }

    .auth-card h2 {
        font-size: 25px;
    }
}

@media (max-width: 390px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        column-gap: 12px;
    }

    .stat-top {
        grid-column: 1 / -1;
    }

    .stat-value {
        grid-column: 1;
    }

    .stat-foot {
        grid-column: 1 / -1;
    }

    .table-tools {
        display: grid;
        grid-template-columns: 1fr;
    }

    .filter-select {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
