:root {
    --bg-base: #f8f9fa;
    --surface: #ffffff;
    --surface-alt: #fdfdfd;
    --line: #e5e8ef;
    --line-soft: #f1f3f7;
    --text-primary: #222222;
    --text-muted: #555555;
    --accent: #f5c518;
    --accent-hover: #ffd54f;
    --danger: #e74c3c;
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 8px 16px rgba(15, 23, 42, 0.08);
    --radius-sm: 6px;
    --radius-md: 8px;
    --control-height: 48px;
    --font-stack: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --statusbar-height: 52px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body.pos-body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: 1.5;
    padding-bottom: calc(var(--statusbar-height) + 5px);
}

.home-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 68px 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 38px;
}

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

.home-header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin: 12px 0 12px;
}

.home-header p {
    margin: 0;
    color: var(--text-muted);
    max-width: 560px;
}

.home-badge {
    display: inline-block;
    background: rgba(245, 197, 24, 0.15);
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    text-transform: uppercase;
}

.home-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    color: var(--text-muted);
}

.home-meta strong {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.home-card {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 28px 26px;
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-card i {
    font-size: 2rem;
    color: var(--accent);
}

.home-card h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.home-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.simple-shell {
    min-height: calc(100vh - var(--statusbar-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 55px 24px;
}

.simple-card {
    max-width: 520px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.simple-card h1 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.simple-card p {
    margin: 0;
    color: var(--text-muted);
}

.simple-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #1c1c1c;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
}

.simple-link:hover {
    background: var(--accent-hover);
}

.pos-screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.pos-shell {
    width: 100%;
    min-height: calc(100vh - var(--statusbar-height));
    height: calc(100vh - var(--statusbar-height));
    display: flex;
    flex: 1;
    overflow: hidden;
}

.pos-column {
    display: flex;
    flex-direction: column;
    padding: 32px 36px;
    border-left: 1px solid var(--line-soft);
    height: 100%;
    min-height: 0;
    overflow: hidden;
    gap: 24px;
}

.pos-column:first-child {
    border-left: none;
}

.pos-column--schedule {
    width: 340px;
    background: var(--surface);
}

.pos-column--catalog {
    flex: 1;
    background: var(--surface-alt);
}

.pos-column--checkout {
    width: 360px;
    background: var(--surface);
}

.pos-column__header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.pos-column__icon {
    width: 46px;
    height: 46px;
    background: var(--bg-base);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent);
}

.pos-column__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.pos-column__subtitle {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.schedule-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding-right: 6px;
}

.schedule-new,
.catalog-toolbar,
.catalog-meta,
.checkout-summary,
.checkout-button,
.checkout-clear,
.checkout-header,
.pos-column__header {
    flex-shrink: 0;
}

.schedule-new {
    margin-top: 0;
    margin-bottom: 4px;
}

.schedule-list,
.catalog-grid,
.checkout-list {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    min-height: 0;
    padding-bottom: 12px;
}

.schedule-list::-webkit-scrollbar,
.catalog-grid::-webkit-scrollbar,
.checkout-list::-webkit-scrollbar {
    width: 6px;
}

.schedule-list::-webkit-scrollbar-thumb,
.catalog-grid::-webkit-scrollbar-thumb,
.checkout-list::-webkit-scrollbar-thumb {
    background: var(--line);
}

.schedule-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text-primary);
    padding: 20px 22px;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.schedule-item:is(:hover, :focus-visible) {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.schedule-item.is-active {
    background: var(--accent);
    border-color: transparent;
    color: #1c1c1c;
    box-shadow: 0 6px 14px rgba(245, 197, 24, 0.35);
}

.schedule-item__time {
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    font-size: 0.92rem;
}

.schedule-item__name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.schedule-item__service {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.schedule-item.is-active .schedule-item__time,
.schedule-item.is-active .schedule-item__service {
    color: rgba(34, 34, 34, 0.75);
}

.schedule-item.is-active .schedule-item__name {
    color: #1c1c1c;
}

.schedule-new {
    margin-top: 28px;
    height: var(--control-height);
    border: 1px dashed var(--accent);
    background: rgba(245, 197, 24, 0.08);
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.18s ease, transform 0.18s ease;
}

.schedule-new:hover {
    background: rgba(245, 197, 24, 0.18);
    transform: translateY(-1px);
}

.catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.catalog-tabs {
    display: inline-flex;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
}

.catalog-tab {
    height: var(--control-height);
    padding: 0 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    border-radius: var(--radius-sm);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: color 0.18s ease, background 0.18s ease;
}

.catalog-tab i {
    color: var(--accent);
}

.catalog-tab:is(:hover, :focus-visible) {
    color: var(--text-primary);
    background: rgba(245, 197, 24, 0.12);
}

.catalog-tab.is-active {
    background: rgba(245, 197, 24, 0.16);
    color: var(--text-primary);
    font-weight: 600;
}

.catalog-tab.is-active::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -6px;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
}

.catalog-search {
    flex: 1 1 280px;
    min-width: 240px;
    height: var(--control-height);
    border: 1px solid var(--line);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.catalog-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 500;
}

.catalog-search input:focus {
    outline: none;
}

.catalog-search button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.catalog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.catalog-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 22px;
    overflow-y: auto;
    padding-bottom: 28px;
    padding-right: 10px;
    align-content: flex-start;
}

.catalog-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 20px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-primary);
    text-align: center;
    cursor: pointer;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    min-height: 170px;
}

.catalog-tile:is(:hover, :focus-visible) {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.catalog-tile.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.catalog-tile.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(245, 197, 24, 0.25);
}

.catalog-tile__badge {
    position: absolute;
    top: 16px;
    right: 16px;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--accent);
    color: #1c1c1c;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.catalog-tile__icon {
    font-size: 2.1rem;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.catalog-tile__name {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.01em;
    text-align: center;
    margin: 0;
}

.catalog-tile__price {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.05rem;
    text-align: center;
    margin-top: 4px;
}

.catalog-empty {
    grid-column: 1 / -1;
    border: 1px dashed var(--line);
    padding: 52px 36px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    border-radius: var(--radius-md);
    background: var(--surface);
}

.catalog-empty i {
    font-size: 2rem;
    color: var(--accent);
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.checkout-title {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 1.18rem;
    font-weight: 600;
}

.checkout-subtitle {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.checkout-counter {
    background: var(--bg-base);
    border: 1px solid var(--line);
    padding: 6px 16px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 999px;
}

.checkout-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding-right: 8px;
}

.checkout-item {
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.checkout-item__info {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.checkout-item__name {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.checkout-item__meta {
    display: inline-flex;
    gap: 14px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.checkout-item__actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.quantity-control button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    background: var(--bg-base);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.quantity-control button[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.quantity-control span {
    min-width: 26px;
    text-align: center;
    font-weight: 600;
}

.checkout-item__price {
    font-weight: 600;
    font-size: 1rem;
    margin-left: auto;
}

.checkout-item__remove {
    border: none;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
}

.checkout-empty {
    border: 1px dashed var(--line);
    padding: 52px 18px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    border-radius: var(--radius-md);
    background: var(--surface);
}

.checkout-summary {
    margin-top: 32px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.checkout-row,
.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkout-total {
    font-size: 1.22rem;
    font-weight: 700;
}

.checkout-button {
    margin-top: 32px;
    height: 58px;
    border: none;
    background: var(--accent);
    color: #1c1c1c;
    font-size: 1.02rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.checkout-button:not([disabled]):hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(245, 197, 24, 0.35);
}

.checkout-button[disabled] {
    background: rgba(245, 197, 24, 0.4);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.checkout-clear {
    margin-top: 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.feedback-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1200;
}

.feedback-toast {
    background: rgba(255, 255, 255, 0.96);
    color: var(--text-primary);
    border: 1px solid var(--line);
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    transition: opacity 0.18s linear;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
    border-radius: var(--radius-md);
}

.feedback-toast i {
    color: var(--accent);
    font-size: 1.1rem;
}

.pos-status-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--statusbar-height);
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-family: var(--font-stack);
    z-index: 1200;
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.08);
}

.status-home {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
}

.status-home:hover {
    color: var(--accent);
}

.status-connection {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-connection.is-online {
    color: #16a34a;
}

.status-connection.is-offline {
    color: #dc2626;
}

.status-connection i {
    font-size: 1.2rem;
}

@media (max-width: 1400px) {
    .pos-column--schedule {
        width: 300px;
    }

    .pos-column--checkout {
        width: 320px;
    }
}

@media (max-width: 1100px) {
    .pos-shell {
        flex-direction: column;
        min-height: auto;
        border-top: 1px solid var(--line);
    }

    .pos-column {
        border-left: none;
        border-top: 1px solid var(--line);
        padding: 28px;
    }

    .pos-column:first-child {
        border-top: none;
    }

    .pos-column--schedule,
    .pos-column--checkout {
        width: 100%;
    }
}
