* {
    box-sizing: border-box
}

[hidden] {
    display: none !important
}

:root {
    --navy: #0b3f73;
    --blue: #1267a5;
    --light: #f5f8fc;
    --border: #dfe6ee;
    --text: #182433;
    --muted: #6b7785;
    --green: #17834a;
    --red: #c83b3b
}

body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: var(--light);
    color: var(--text)
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 245px;
    background: var(--navy);
    color: #fff;
    padding: 24px 16px;
    overflow: auto
}

.brand {
    font-size: 23px;
    font-weight: 800;
    padding: 0 12px 28px
}

.brand span {
    font-weight: 400
}

nav a {
    display: block;
    color: #dceafa;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 8px;
    margin: 3px 0
}

nav a:hover,
nav a.active {
    background: #fff;
    color: var(--navy)
}

.nav-title {
    font-size: 11px;
    letter-spacing: 1.2px;
    color: #8fb4d5;
    font-weight: 700;
    margin: 22px 12px 6px
}

.main {
    margin-left: 245px;
    min-height: 100vh;
    padding: 28px
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px
}

h1 {
    margin: 0 0 5px;
    font-size: 28px
}

.topbar p {
    margin: 0;
    color: var(--muted)
}

.date-badge {
    background: #fff;
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 13px
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .03)
}

.metric-label {
    color: var(--muted);
    font-size: 13px
}

.metric {
    font-size: 28px;
    font-weight: 800;
    margin-top: 7px
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 18px
}

.panel h2 {
    font-size: 18px;
    margin: 0 0 16px
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px
}

.field input,
.field select {
    width: 100%;
    padding: 11px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    font: inherit;
    background: #fff
}

.product-search-field {
    position: relative
}

.product-search-results {
    position: relative;
    z-index: 5;
    display: grid;
    max-height: 240px;
    margin-top: 6px;
    overflow-y: auto;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(10, 14, 42, .12)
}

.product-search-results[hidden] {
    display: none
}

.product-search-result {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #e8edf3;
    border-radius: 0;
    background: #fff;
    color: var(--text);
    text-align: left;
    cursor: pointer
}

.product-search-result:last-child {
    border-bottom: 0
}

.product-search-result:hover,
.product-search-result:focus-visible {
    background: #f0f5ff;
    color: var(--navy)
}

.product-search-result span {
    color: #64748b;
    font-size: 12px
}

.field.full {
    grid-column: 1/-1
}

button,
.btn {
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    background: var(--navy);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    display: inline-block
}

button.secondary,
.btn.secondary {
    background: #eef3f8;
    color: var(--navy)
}

button.green {
    background: var(--green)
}

button.is-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: wait;
    opacity: .85
}

button.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-spin .7s linear infinite
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 18px
}

.table-wrap {
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse
}

th,
td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #edf1f5;
    font-size: 14px
}

th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: .4px;
    background: #fafbfd
}

tfoot th {
    border-top: 2px solid var(--border);
    border-bottom: 0;
    background: #f5f8fc;
    color: var(--navy)
}

.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    background: #eaf5ef;
    color: var(--green)
}

.badge.red {
    background: #fff0f0;
    color: var(--red)
}

.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px
}

.search-row input {
    flex: 1;
    padding: 11px;
    border: 1px solid #cfd8e3;
    border-radius: 8px
}

.notice {
    padding: 13px;
    border-radius: 8px;
    background: #f0f6fc;
    color: #245b87;
    margin-bottom: 16px
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px
}

.analytics-chart {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px
}

.analytics-chart h2 {
    font-size: 17px;
    margin: 0 0 16px
}

.analytics-bar-row {
    display: grid;
    grid-template-columns: minmax(90px, 150px) minmax(50px, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 12px 0
}

.analytics-bar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: var(--text)
}

.analytics-bar-track {
    height: 12px;
    border-radius: 8px;
    background: #edf2f7;
    overflow: hidden
}

.analytics-bar-fill {
    height: 100%;
    min-width: 2px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--blue), #53a6dc)
}

.analytics-bar-value {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--navy)
}

.analytics-kpis {
    margin: 18px 0
}

.report-totals {
    margin-top: 20px
}

.report-totals h2 {
    margin-bottom: 12px
}

.report-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    margin: 10px 0
}

.period-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap
}

.period-actions button {
    flex: 1;
    padding: 10px 12px;
    white-space: nowrap
}

.projection-horizon {
    max-width: 320px;
    margin: 20px 0
}

.forecast-panel {
    margin-top: 20px
}

.forecast-panel .field-hint {
    margin: 0 0 14px
}

.forecast-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 14px 0
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 30px
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px
}

.user-actions button {
    padding: 9px 12px
}

.auth-main {
    margin-left: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px
}

#app {
    position: relative;
    min-height: 160px
}

.page-loading-overlay {
    position: absolute;
    z-index: 20;
    inset: 0;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 12px;
    background: rgba(245, 248, 252, .82);
    color: var(--navy);
    font-weight: 700
}

.page-spinner {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 4px solid #cbdcec;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: button-spin .7s linear infinite
}

.auth-card {
    width: min(100%, 440px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 12px 35px rgba(11, 63, 115, .1)
}

.auth-brand {
    padding: 0 0 20px;
    color: var(--navy)
}

.auth-card h1 {
    font-size: 25px
}

.auth-copy,
.field-hint {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5
}

.auth-card .field {
    margin: 16px 0
}

.auth-card .field input {
    font-size: 16px
}

.password-input {
    position: relative
}

.password-input input {
    padding-right: 48px
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 5px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 8px;
    transform: translateY(-50%);
    background: transparent;
    color: var(--muted)
}

.password-toggle:hover {
    background: #f0f4f8;
    color: var(--navy)
}

.password-toggle:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 1px
}

.password-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

.password-icon-hide,
.password-toggle[aria-pressed="true"] .password-icon-show {
    display: none
}

.password-toggle[aria-pressed="true"] .password-icon-hide {
    display: block
}

.auth-submit {
    width: 100%;
    margin-top: 10px
}

.auth-submit[aria-busy="true"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: wait;
    opacity: .85
}

.button-spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: button-spin .7s linear infinite
}

@keyframes button-spin {
    to {
        transform: rotate(360deg)
    }
}

@media (prefers-reduced-motion: reduce) {
    .button-spinner,
    button.is-loading::after,
    .page-spinner {
        animation: none
    }
}

.auth-switch {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin: 22px 0 0
}

.text-button {
    background: transparent;
    color: var(--blue);
    padding: 0
}

.notifications {
    position: fixed;
    z-index: 1000;
    top: 18px;
    right: 18px;
    width: min(420px, calc(100vw - 36px));
    display: grid;
    gap: 10px
}

.toast {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(11, 63, 115, .16);
    font-size: 14px;
    line-height: 1.5
}

.toast-error {
    border-left-color: var(--red)
}

.toast-close {
    flex: 0 0 auto;
    padding: 0 4px;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1
}

.workspace-error {
    max-width: 680px;
    margin: 24px auto
}

.workspace-error p {
    line-height: 1.5
}

.auth-message {
    color: var(--red);
    font-size: 14px;
    min-height: 20px;
    margin: 12px 0
}

.auth-message.is-success {
    color: var(--green)
}

[hidden] {
    display: none!important
}

@media(max-width:1000px) {
    .grid {
        grid-template-columns: repeat(2, 1fr)
    }
    .form-grid {
        grid-template-columns: repeat(2, 1fr)
    }
    .report-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
    .analytics-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:700px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto
    }
    .main {
        margin-left: 0;
        padding: 18px
    }
    .grid,
    .form-grid,
    .report-filters,
    .forecast-kpis {
        grid-template-columns: 1fr
    }
    .topbar {
        display: block
    }
    .user-actions {
        flex-wrap: wrap;
        margin-top: 12px
    }
    .date-badge {
        display: inline-block;
        margin-top: 0
    }
    .auth-main {
        padding: 16px
    }
    .auth-card {
        padding: 24px
    }
    .analytics-bar-row {
        grid-template-columns: minmax(75px, 110px) minmax(35px, 1fr) auto;
        gap: 7px
    }
    .analytics-bar-value {
        font-size: 11px
    }
}

.stock-warning {
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #d32f2f;
    color: #fff;
    font-weight: 700;
}

input.over-stock {
    border-color: #d32f2f;
    outline: 2px solid #d32f2f;
}

.draft-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fff8e1;
    border: 1px solid #f0c36d;
}

.adjust-btn {
    padding: 4px 10px;
}

.adjust-dialog {
    border: 0;
    border-radius: 12px;
    padding: 22px;
    width: min(420px, 92vw);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}

.adjust-dialog::backdrop {
    background: rgba(0, 0, 0, .45);
}


/* ===== App theme: dark navy chrome, rounded cards ===== */

:root {
    --navy: #0a0e2a;
    --blue: #1a73ff;
    --light: #f2f2f2;
    --border: #e2e4e8;
    --card-dark: #2a2d2f
}

body {
    background: var(--light);
    -webkit-tap-highlight-color: transparent
}

.sidebar {
    background: var(--navy);
    width: 250px
}

.brand {
    color: #fff
}

nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #c7cbe0;
    border-radius: 14px;
    font-weight: 600
}

nav a:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff
}

nav a.active {
    background: rgba(26, 115, 255, .16);
    color: #4d96ff
}

.ico {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.nav-title {
    color: #7c82a8
}

.topbar {
    background: var(--navy);
    color: #fff;
    border-radius: 20px;
    padding: 16px 22px;
    align-items: center;
    box-shadow: 0 4px 14px rgba(10, 14, 42, .25)
}

.topbar h1 {
    font-size: 24px;
    margin: 0
}

.topbar p {
    color: #aab0d0
}

.user-actions {
    color: #dfe3f5
}

.user-actions button.secondary {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border-radius: 999px
}

.date-badge {
    background: #fff;
    color: var(--navy);
    border: 0;
    border-radius: 999px
}

.card {
    background: #083e65;
    color: #570b73;
    border: 0;
    border-radius: 20px;
    padding: 20px 24px;
}

.card .metric-label {
    color: #c4c7ca;
    font-weight: 600
}

.card .metric {
    color: var(--blue)
}

.card .metric.c-green {
    color: #2fb457
}

.card .metric.c-amber {
    color: #f5a623
}

.card .metric.c-blue {
    color: #3d8bff
}

.panel,
.analytics-chart {
    border-radius: 20px;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05)
}

button,
.btn {
    background: var(--navy);
    border-radius: 12px
}

button.secondary,
.btn.secondary {
    background: #e6e9f2;
    color: var(--navy)
}

.field input,
.field select,
.search-row input {
    border-radius: 12px
}

.auth-card {
    border-radius: 24px
}

.greeting {
    margin: 0 0 18px;
    font-size: 26px
}

.status-card {
    background: linear-gradient(120deg, #0d4a8f, #0b6cf0);
    color: #fff;
    border-radius: 20px;
    padding: 20px 24px;
    margin-bottom: 22px
}

.status-card strong {
    font-size: 18px
}

.status-card p {
    margin: 8px 0 0;
    color: #e3f2ff
}

.quick-actions {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto 24px
}

.quick-action {
    display: grid;
    justify-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none
}

.quick-circle {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff
}

.quick-circle svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.employee-dashboard {
    max-width: 900px;
    margin: 0 auto
}

.employee-quick-actions {
    max-width: 420px;
    margin-top: 28px
}

.employee-tips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px
}

.employee-tip {
    display: flex;
    align-items: flex-start;
    gap: 16px
}

.employee-tip svg {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    color: var(--blue);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

.employee-tip h3 {
    margin: 0 0 7px;
    font-size: 16px
}

.employee-tip p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5
}

.shop-adjustment-totals {
    margin: 18px 0
}

.shop-detail-controls {
    grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr);
    align-items: end;
    margin: 18px 0
}

.shop-detail-section .table-wrap {
    margin-bottom: 20px
}

.shop-adjustment-filter {
    max-width: 420px;
    margin-bottom: 18px
}

.shop-adjustment-history-title {
    margin: 28px 0 14px;
    font-size: 18px
}

.employee-assignment-list {
    display: grid;
    gap: 12px
}

.employee-assignment-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(170px, .8fr) minmax(300px, 1.6fr);
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(120deg, #fff, #f8fbff)
}

.employee-assignment-identity {
    display: grid;
    gap: 5px;
    align-self: center;
    min-width: 0
}

.employee-assignment-identity strong {
    color: var(--navy);
    font-size: 15px
}

.employee-assignment-identity span {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 13px
}

.employee-assignment-control {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700
}

.employee-assignment-control select {
    width: 100%;
    min-height: 44px;
    padding: 10px 38px 10px 12px;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    background-color: #fff;
    color: var(--text);
    font: inherit;
    font-size: 14px
}

.employee-assignment-control select:focus {
    border-color: var(--blue);
    outline: 3px solid rgba(18, 103, 165, .14)
}

.employee-assignment-save {
    min-height: 44px;
    white-space: nowrap
}

.employee-assignment-current {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700
}

.employee-assignment-badge {
    justify-self: start;
    padding: 7px 12px;
    border-radius: 999px;
    background: #e3f6e8;
    border: 1px solid #9fd9ae;
    color: #14803a;
    font-size: 14px;
    font-weight: 800
}

.employee-assignment-badge.unassigned {
    background: #f1f3f6;
    border-color: #d5dbe3;
    color: var(--muted)
}

.employee-assignment-reassign {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px
}

.hero-card {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin-top: 22px;
    padding: 40px 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, #0d4a8f, #0b6cf0);
    color: #fff;
    text-align: center;
    text-decoration: none
}

.hero-card svg {
    width: 44px;
    height: 44px;
    fill: #fff
}

.hero-card strong {
    font-size: 22px
}

.hero-card span {
    opacity: .9
}

@media(min-width:1001px) {
    .main {
        margin-left: 250px;
        padding: 24px 32px
    }
    .hero-card {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto
    }
}


/* ===== Phone: native-app layout with bottom tab bar ===== */

@media(max-width:700px) {
    body {
        padding-bottom: 0
    }
    .main:not(.auth-main) {
        padding: 0 0 calc(84px + env(safe-area-inset-bottom))
    }
    #app {
        padding: 16px
    }
    .topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        display: grid;
        gap: 8px;
        margin: 0;
        padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
        border-radius: 0;
        text-align: center
    }
    .topbar h1 {
        font-size: 20px
    }
    .topbar p,
    .date-badge,
    #userName {
        display: none
    }
    .user-actions {
        margin: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none
    }
    .user-actions::-webkit-scrollbar,
    .sidebar::-webkit-scrollbar {
        display: none
    }
    .user-actions button {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 12px;
        padding: 8px 12px
    }
    .sidebar {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: calc(68px + env(safe-area-inset-bottom));
        padding: 6px 4px env(safe-area-inset-bottom);
        z-index: 60;
        overflow-x: auto;
        overflow-y: hidden;
        box-shadow: 0 -4px 14px rgba(0, 0, 0, .2);
        scrollbar-width: none
    }
    .brand,
    .nav-title {
        display: none
    }
    nav {
        display: flex;
        min-width: 100%;
        height: 100%
    }
    nav a {
        flex: 1 0 74px;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        margin: 0;
        padding: 6px 4px;
        font-size: 11px;
        text-align: center;
        white-space: nowrap
    }
    nav a:hover {
        background: transparent
    }
    nav a.active {
        background: transparent
    }
    .metric-row {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        margin: 0 -16px;
        padding: 0 16px 4px;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 16px;
        scrollbar-width: none
    }
    .metric-row .card {
        flex: 0 0 78%;
        scroll-snap-align: start
    }
    .metric {
        font-size: 26px
    }
    .panel {
        padding: 16px
    }
    .notifications {
        top: calc(10px + env(safe-area-inset-top))
    }
    .field input,
    .field select {
        font-size: 16px
    }
    .actions {
        flex-wrap: wrap
    }
    .employee-assignment-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 14px
    }
    .employee-assignment-reassign {
        grid-template-columns: minmax(0, 1fr)
    }
    .employee-assignment-save {
        width: 100%
    }
    .shop-detail-controls {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px
    }
}


/* ===== Profile menu, app grid, floating phone tab bar ===== */

.profile {
    position: relative
}

.avatar-button {
    position: relative;
    display: block;
    width: 46px;
    height: 46px;
    padding: 0;
    overflow: hidden;
    border-radius: 50%;
    background: #fff;
    color: var(--navy);
    border: 3px solid var(--blue);
    font-size: 15px;
    font-weight: 800
}

.avatar-button img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top
}

.avatar-button span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%
}

.profile-menu {
    position: absolute;
    z-index: 200;
    right: 0;
    top: calc(100% + 10px);
    width: 230px;
    padding: 8px;
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 12px 34px rgba(10, 14, 42, .28)
}

.profile-head {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
    font-size: 14px;
    word-break: break-word
}

.profile-menu button {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font-weight: 600
}

.profile-menu button:hover {
    background: #eef1f8
}

.profile-menu button.danger {
    color: var(--red)
}

.quick-circle circle[r="1.6"] {
    fill: currentColor
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px
}

.app-tile {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 14px;
    min-height: 170px;
    padding: 18px 12px;
    border: 2px solid #ececec;
    border-radius: 30px;
    background: #fff;
    color: #3f4140;
    font-weight: 700;
    text-align: center;
    text-decoration: none
}

.app-tile:active {
    background: #f3f5fb
}

.app-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff
}

.app-icon svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

@media(max-width:700px) {
    .employee-tips {
        grid-template-columns: 1fr
    }
    .topbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding-left: 16px;
        padding-right: 16px
    }
    .user-actions {
        overflow: visible
    }
    .avatar-button {
        width: 42px;
        height: 42px
    }
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px
    }
    .sidebar {
        left: 14px;
        right: 14px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: auto;
        height: 68px;
        padding: 0;
        border-radius: 34px;
        overflow: hidden
    }
    .main:not(.auth-main) {
        padding-bottom: calc(100px + env(safe-area-inset-bottom))
    }
    nav {
        display: flex;
        align-items: center;
        justify-content: space-around;
        width: 100%;
        height: 100%;
        padding: 4px 8px
    }
    nav .nav-title {
        display: none
    }
    nav a:not(.core) {
        display: none
    }
    nav a.core {
        flex: 1;
        min-width: 0;
        justify-content: center;
        flex-direction: column;
        gap: 2px;
        margin: 0;
        padding: 4px 2px;
        font-size: 12px;
        line-height: 1.1
    }
    nav a.core .ico {
        width: 26px;
        height: 26px
    }
    nav a[href="#shop-sale"] {
        order: 1
    }
    nav a[href="#dashboard"] {
        order: 2
    }
    nav a[href="#dispatch-new"] {
        order: 3
    }
}


/* ===== Info slider (non-clickable tips) ===== */

.info-slider {
    margin-top: 22px
}

.info-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    border-radius: 24px;
    scrollbar-width: none
}

.info-track::-webkit-scrollbar {
    display: none
}

.info-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 10px;
    min-height: 230px;
    padding: 32px 28px;
    background: linear-gradient(135deg, #0d4a8f, #0b6cf0);
    color: #fff;
    text-align: center;
    cursor: default;
    user-select: none
}

.info-card:nth-child(2) {
    background: linear-gradient(135deg, #0b6b4a, #17a36b)
}

.info-card:nth-child(3) {
    background: linear-gradient(135deg, #6a2c91, #9b4dca)
}

.info-card:nth-child(4) {
    background: linear-gradient(135deg, #b5530b, #f08a24)
}

.info-card svg {
    width: 44px;
    height: 44px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.info-card strong {
    font-size: 22px
}

.info-card span {
    max-width: 460px;
    opacity: .92;
    line-height: 1.5
}

.info-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px
}

.info-dots i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c4c8d4;
    transition: width .2s, background .2s
}

.info-dots i.on {
    width: 22px;
    border-radius: 6px;
    background: var(--blue)
}

@media(min-width:1001px) {
    .info-slider {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto
    }
}


/* ===== Colorful icons; white header/footer on phone only ===== */

.quick-action:nth-child(1) .quick-circle,
.app-tile:nth-child(6n+1) .app-icon {
    background: #fff4cc;
    color: #e0a800;
    box-shadow: 0 0 0 4px #ffc928
}

.quick-action:nth-child(2) .quick-circle,
.app-tile:nth-child(6n+2) .app-icon {
    background: #dff3ff;
    color: #1792e8;
    box-shadow: 0 0 0 4px #33a9f5
}

.quick-action:nth-child(3) .quick-circle,
.app-tile:nth-child(6n+3) .app-icon {
    background: #e3f7e8;
    color: #1e9d4b;
    box-shadow: 0 0 0 4px #3dc46a
}

.app-tile:nth-child(6n+4) .app-icon {
    background: #fde4ec;
    color: #d6336c;
    box-shadow: 0 0 0 4px #f06595
}

.app-tile:nth-child(6n+5) .app-icon {
    background: #efe4fb;
    color: #7a3fc4;
    box-shadow: 0 0 0 4px #a56ee0
}

.app-tile:nth-child(6n) .app-icon {
    background: #ffe9d6;
    color: #e8590c;
    box-shadow: 0 0 0 4px #ff8c42
}

.quick-circle,
.app-icon {
    margin: 4px
}

@media(max-width:700px) {
    .topbar {
        background: #fff;
        color: var(--text);
        box-shadow: 0 1px 8px rgba(0, 0, 0, .1)
    }
    .topbar h1 {
        color: var(--text)
    }
    .sidebar {
        background: #fff;
        box-shadow: 0 6px 24px rgba(0, 0, 0, .18)
    }
    nav a {
        color: #6b7080
    }
    nav a.active {
        color: var(--blue)
    }
}


/* ===== Back button ===== */

.back-button {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    margin-right: 12px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff
}

.back-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round
}

.topbar {
    display: flex;
    align-items: center
}

.topbar .user-actions {
    margin-left: auto
}

@media(max-width:700px) {
    .back-button {
        background: #eef1f8;
        color: var(--navy);
        margin-right: 8px
    }
    .title-block {
        flex: 1;
        min-width: 0
    }
}