:root {
    --app-bg: #f7f7f8;
    --surface: #ffffff;
    --surface-muted: #fafafa;
    --surface-soft: #f3f4f6;
    --sidebar-bg: #ffffff;
    --topbar-bg: rgba(247, 247, 248, 0.94);
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --text: #111827;
    --text-soft: #4b5563;
    --text-faint: #6b7280;
    --primary: #111827;
    --primary-hover: #1f2937;
    --success: #166534;
    --success-soft: #f0fdf4;
    --danger: #b42318;
    --danger-soft: #fff5f5;
    --warning: #92400e;
    --warning-soft: #fffbeb;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-soft: 0 1px 1px rgba(16, 24, 40, 0.04);
    --radius-xl: 14px;
    --radius-lg: 12px;
    --radius-md: 10px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--app-bg);
    color: var(--text);
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    font-feature-settings: "cv11" 1, "ss01" 1;
    text-rendering: optimizeLegibility;
}

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

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

img {
    max-width: 100%;
    display: block;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px 12px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.sidebar-top,
.sidebar-nav-shell,
.sidebar-footer {
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 12px;
}

.brand-mark,
.brand-logo {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-mark {
    background: #111827;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand-logo {
    border: 1px solid var(--border);
    background: #fff;
}

.brand-logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.brand-title {
    margin: 0;
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.brand-subtitle {
    margin: 3px 0 0;
    font-size: 0.78rem;
    color: var(--text-faint);
}

.brand-status {
    min-height: 20px;
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 600;
}

.sidebar-section {
    display: grid;
    gap: 6px;
}

.sidebar-nav-shell {
    min-height: 0;
}

.sidebar-nav-scroll {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
    display: grid;
    align-content: start;
}

.sidebar-nav-scroll::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.sidebar-nav-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-section-title {
    margin: 0;
    color: var(--text-faint);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-links {
    display: grid;
    gap: 3px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 7px 10px;
    color: var(--text-soft);
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    color: var(--text);
    background: #f9fafb;
}

.nav-link.active {
    color: var(--text);
    background: #f3f4f6;
    box-shadow: inset 0 0 0 1px var(--border);
}

.nav-link-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    flex-shrink: 0;
}

.nav-link-icon svg {
    width: 18px;
    height: 18px;
}

.sidebar-group {
    gap: 4px;
}

.sidebar-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-group-toggle:hover {
    color: var(--text);
    background: #f9fafb;
}

.sidebar-group-toggle.active,
.sidebar-group.is-open .sidebar-group-toggle {
    color: var(--text);
    background: #f3f4f6;
    border-color: var(--border);
    box-shadow: inset 0 0 0 1px rgba(229, 231, 235, 0.35);
}

.sidebar-group-leading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sidebar-group-copy {
    min-width: 0;
}

.sidebar-group-label {
    display: block;
    color: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.sidebar-group-chevron {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    transition: transform 0.18s ease, color 0.18s ease;
    flex-shrink: 0;
}

.sidebar-group-chevron svg {
    width: 16px;
    height: 16px;
}

.sidebar-group.is-open .sidebar-group-chevron {
    transform: rotate(180deg);
    color: var(--text-soft);
}

.sidebar-submenu {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.18s ease, opacity 0.18s ease;
    opacity: 0.72;
}

.sidebar-group.is-open .sidebar-submenu {
    grid-template-rows: 1fr;
    opacity: 1;
}

.sidebar-submenu-inner {
    overflow: hidden;
    padding: 6px 0 0 10px;
    position: relative;
}

.sidebar-submenu-inner::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 4px;
    left: 17px;
    width: 1px;
    background: var(--border);
}

.sidebar-submenu-link {
    min-height: 34px;
    padding-left: 14px;
    margin-left: 10px;
    color: var(--text-faint);
}

.sidebar-submenu-link .nav-link-icon {
    width: 16px;
    height: 16px;
}

.sidebar-submenu-link .nav-link-icon svg {
    width: 16px;
    height: 16px;
}

.sidebar-submenu-link.active {
    color: var(--text);
}

.sidebar-footer {
    margin-top: 0;
    padding: 12px;
    display: grid;
    gap: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fcfcfd;
    box-shadow: var(--shadow-soft);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-meta {
    min-width: 0;
}

.user-name {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 600;
}

.user-role,
.sidebar-shop {
    margin: 3px 0 0;
    font-size: 0.78rem;
    color: var(--text-faint);
}

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

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 24px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.app-kicker {
    margin: 0 0 4px;
    color: var(--text-faint);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.app-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.app-subtitle {
    margin: 4px 0 0;
    max-width: 720px;
    color: var(--text-soft);
    font-size: 0.85rem;
}

.app-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.chip {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 500;
}

.content {
    padding: 18px 24px 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.subtitle {
    margin: 6px 0 0;
    max-width: 780px;
    color: var(--text-soft);
    font-size: 0.875rem;
    line-height: 1.45;
}

.surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
}

.surface + .surface {
}

.surface-muted {
    background: var(--surface-muted);
}

.surface-header,
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.surface-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.surface-subtitle {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.84rem;
}

.grid {
    display: grid;
    gap: 16px;
    align-items: start;
}

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

.equal-height-grid {
    align-items: stretch;
}

.equal-height-grid > .surface,
.equal-height-grid > .stat-card,
.equal-height-grid > .empty-state {
    height: 100%;
}

.equal-height-grid > .surface,
.equal-height-grid > .stat-card {
    display: flex;
    flex-direction: column;
}

.filter-form {
    align-items: end;
    gap: 14px 16px;
}

.filter-form > label,
.filter-form > fieldset {
    align-self: end;
}

.filter-actions {
    align-self: stretch;
    display: flex;
    align-items: flex-end;
    min-height: auto;
    padding-top: 0;
}

.filter-actions .btn {
    min-height: 40px;
}

.section-stack {
    margin-top: 16px;
}

.stack-top {
    margin-top: 12px;
}

.stats {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    align-items: stretch;
}

.stat-card {
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-faint);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stat-value {
    margin-top: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

.stat-meta {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-soft);
}

.dashboard-metrics {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.dashboard-topbar {
    margin-bottom: 18px;
}

.dashboard-summary-card {
    position: relative;
    padding: 16px 16px 15px;
    border-radius: 14px;
    border-color: #e6e8ec;
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.dashboard-summary-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dashboard-summary-meta {
    margin-top: auto;
    padding-top: 10px;
    font-size: 0.78rem;
    color: #6b7280;
}

.dashboard-surface {
    border-radius: 16px;
    border-color: #e6e8ec;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.chart-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.chart-card-body {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    align-content: stretch;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.chart-shell {
    position: relative;
    min-height: 236px;
    padding: 14px 14px 12px;
    border: 1px solid #edf0f3;
    border-radius: 14px;
    background: #fcfcfd;
}

.chart-shell-refined {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    height: 100%;
}

.dashboard-chart-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    min-height: 68px;
    margin-bottom: 12px;
}

.dashboard-chart-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-content: flex-start;
    gap: 6px;
    max-width: 240px;
}

.dashboard-chart-metric {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid #eceff3;
    border-radius: 10px;
    background: #fbfcfd;
}

.dashboard-chart-metric-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    flex-shrink: 0;
}

.dashboard-chart-metric-label {
    color: var(--text-faint);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-chart-metric-value {
    margin-top: 1px;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
}

.chart-layout {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
}

.chart-y-axis {
    display: grid;
    align-content: stretch;
}

.chart-y-axis-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: #9aa2af;
    font-size: 0.7rem;
    font-weight: 600;
}

.chart-stage {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 0;
}

.refined-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 25 / 14;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 600;
}

.chart-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex-shrink: 0;
}

.chart-legend-refined {
    gap: 12px;
    min-height: 28px;
    padding-top: 0;
    align-items: center;
}

.chart-svg {
    width: 100%;
    overflow: visible;
}

.chart-grid-line {
    stroke: #e8ebef;
    stroke-width: 1;
    stroke-dasharray: 1.2 2.4;
}

.chart-polyline {
    fill: none;
    stroke-width: 1.95;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-point {
    stroke: #ffffff;
    stroke-width: 1.25;
}

.refined-chart-line {
    filter: drop-shadow(0 1px 1px rgba(17, 24, 39, 0.06));
}

.chart-axis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
}

.chart-axis-label {
    color: #98a2b3;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
}

.refined-chart-axis {
    margin-top: 2px;
}

.dashboard-ranking-shell {
    display: grid;
    gap: 10px;
    flex: 1;
    min-height: 100%;
}

.dashboard-ranking {
    display: grid;
    gap: 12px;
}

.dashboard-ranking-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.dashboard-ranking-index {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid #eceff3;
    background: #f8fafb;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.dashboard-ranking-content {
    display: grid;
    gap: 9px;
}

.dashboard-ranking-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-ranking-copy {
    min-width: 0;
}

.dashboard-ranking-label {
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.35;
}

.dashboard-ranking-caption {
    margin-top: 3px;
    color: #98a2b3;
    font-size: 0.74rem;
}

.dashboard-ranking-value {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-bars {
    display: grid;
    gap: 12px;
}

.dashboard-bar-row {
    display: grid;
    gap: 7px;
}

.dashboard-bar-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
}

.dashboard-bar-label {
    color: var(--text);
    font-weight: 600;
}

.dashboard-bar-value {
    color: var(--text-soft);
    font-weight: 500;
    white-space: nowrap;
}

.dashboard-bar-track {
    height: 8px;
    border-radius: 999px;
    background: #eef2f6;
    overflow: hidden;
}

.dashboard-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #111827 0%, #4b5563 100%);
}

.refined-bar-track {
    height: 9px;
}

.refined-bar-fill {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.dashboard-panel {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.dashboard-table-card {
    border-radius: 16px;
    border-color: #e6e8ec;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.dashboard-section-header {
    margin-bottom: 14px;
}

.dashboard-panel .table-wrap {
    flex: 1;
}

.dashboard-panel table {
    min-width: 100%;
}

.dashboard-kpi-note {
    color: #98a2b3;
    font-size: 0.74rem;
    font-weight: 600;
}

.dashboard-table-wrap {
    border: 1px solid #edf0f3;
    border-radius: 14px;
    background: #fcfcfd;
    overflow: hidden;
}

.dashboard-table {
    min-width: 100%;
}

.dashboard-table thead th {
    padding: 10px 14px;
    background: #f8fafb;
    color: #98a2b3;
    font-size: 0.67rem;
    letter-spacing: 0.12em;
}

.dashboard-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef1f4;
    font-size: 0.82rem;
}

.dashboard-table tbody tr:hover {
    background: #fbfcfd;
}

.dashboard-cell-stack {
    display: grid;
    gap: 3px;
}

.dashboard-cell-primary {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.35;
}

.dashboard-cell-primary a {
    color: inherit;
}

.dashboard-cell-secondary {
    color: #98a2b3;
    font-size: 0.74rem;
    line-height: 1.4;
}

.dashboard-number-cell {
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
}

.dashboard-value-strong {
    color: var(--text);
    font-weight: 700;
}

.dashboard-status-danger {
    color: var(--danger);
    font-weight: 700;
}

.dashboard-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border: 1px solid #e7eaee;
    border-radius: 999px;
    background: #f8fafb;
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 600;
}

.dashboard-product-meter {
    display: grid;
    gap: 6px;
    margin-top: 2px;
}

.dashboard-product-meter-label {
    color: #98a2b3;
    font-size: 0.72rem;
    font-weight: 600;
}

.dashboard-mini-track {
    height: 6px;
}

.dashboard-mini-fill {
    background: linear-gradient(90deg, #111827 0%, #6b7280 100%);
}

.dashboard-empty-state {
    border-radius: 14px;
    border-color: #edf0f3;
    background: #fcfcfd;
}

.detail-list {
    display: grid;
    gap: 10px;
}

.detail-item {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
}

.detail-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-faint);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 600;
}

fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

legend {
    margin: 0 0 6px;
    padding: 0;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border-radius: 9px;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

textarea {
    min-height: 104px;
    resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
    width: 14px;
    height: 14px;
    min-height: auto;
    margin: 0;
    accent-color: #111827;
    box-shadow: none;
}

.form-section-title {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.form-section-subtitle {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.form-helper {
    color: var(--text-faint);
    font-size: 0.76rem;
    line-height: 1.45;
}

.field-group {
    display: grid;
    gap: 10px;
}

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

.choice-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.choice-card:hover {
    border-color: var(--border-strong);
    background: #fcfcfd;
}

.choice-card input {
    margin-top: 2px;
}

.choice-card-title {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
}

.choice-card-copy {
    margin-top: 2px;
    color: var(--text-faint);
    font-size: 0.76rem;
}

.branch-checkbox-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.branch-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 500;
}

.branch-checkbox-item:hover {
    border-color: var(--border-strong);
    background: #fcfcfd;
}

.actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.actions form,
.table-actions form {
    display: inline-flex;
    gap: 0;
    margin: 0;
}

.btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: var(--primary);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

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

.btn.secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}

.btn.secondary:hover {
    background: #f9fafb;
}

.btn.ghost {
    background: #f9fafb;
    color: var(--text-soft);
    border-color: var(--border);
}

.btn.ghost:hover {
    color: var(--text);
    background: #f3f4f6;
}

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

.btn.danger:hover {
    background: #991b1b;
    border-color: #991b1b;
}

.btn.small-btn,
.table-actions .btn,
td .actions .btn {
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 0.78rem;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

th,
td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 0.84rem;
}

th {
    background: #fafafa;
    color: var(--text-faint);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

tbody tr:hover {
    background: #fafafa;
}

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

tbody td[colspan] {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-faint);
    font-size: 0.84rem;
    background: #fcfcfd;
}

table a:not(.btn) {
    color: var(--text);
    font-weight: 600;
}

.table-title {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
}

.table-subtitle {
    margin-top: 2px;
    color: var(--text-faint);
    font-size: 0.76rem;
}

.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.table-media-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge.status-active {
    background: var(--success-soft);
    border-color: #d1fae5;
    color: var(--success);
}

.badge.status-suspended,
.badge.status-inactive,
.badge.status-archived {
    background: var(--danger-soft);
    border-color: #fee2e2;
    color: var(--danger);
}

.badge.status-warning {
    background: var(--warning-soft);
    border-color: #fde68a;
    color: var(--warning);
}

.alert {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.alert strong {
    font-size: 0.84rem;
}

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

.alert.error {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #fee2e2;
}

.alert.warning {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: #fde68a;
}

.empty-state {
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fcfcfd;
    color: var(--text-soft);
}

.empty-state strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.92rem;
}

.small {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.status-danger {
    color: var(--danger);
}

.thumbnail {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.media-thumb,
.media-logo {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-faint);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    overflow: hidden;
    flex-shrink: 0;
}

.media-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.media-thumb img,
.media-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview {
    display: grid;
    gap: 10px;
}

.media-preview-frame {
    width: fit-content;
    max-width: 100%;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.media-preview-frame img {
    display: block;
    max-width: min(100%, 360px);
    max-height: 180px;
    border-radius: 8px;
    object-fit: cover;
}

.receipt-preview-frame img {
    max-width: min(100%, 720px);
    max-height: 520px;
    border-radius: 10px;
}

.hours-grid {
    display: grid;
    gap: 10px;
}

.hours-row {
    display: grid;
    grid-template-columns: 150px repeat(2, minmax(110px, 1fr)) minmax(160px, 1fr);
    gap: 10px;
    align-items: end;
}

.hours-row input[type="checkbox"] {
    width: auto;
    min-height: auto;
}

.stack {
    display: grid;
    gap: 8px;
}

.inline-checks {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.inline-checks input,
.inline-checks label input {
    width: auto;
    min-height: auto;
}

.option-section {
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
}

.option-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.option-list {
    display: grid;
    gap: 10px;
}

.option-row {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(170px, 1.8fr) minmax(110px, 0.9fr) minmax(120px, 1fr) 108px auto;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.option-row.option-row-no-default {
    grid-template-columns: minmax(170px, 1.8fr) minmax(110px, 0.9fr) minmax(120px, 1fr) minmax(140px, 1fr) auto;
}

.option-row.option-row-recipe {
    grid-template-columns: minmax(220px, 1.6fr) minmax(150px, 0.9fr) minmax(180px, 1fr) auto;
}

.option-row.option-row-payment {
    grid-template-columns: minmax(140px, 0.8fr) minmax(110px, 0.7fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
}

.option-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.option-label {
    color: var(--text-faint);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.option-default-cell,
.option-meta-cell,
.option-action-cell {
    min-width: 0;
}

.option-default-cell {
    display: flex;
    align-items: center;
    min-height: 40px;
}

.option-default-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.option-default-control:hover {
    border-color: var(--border-strong);
}

.option-meta-cell {
    display: flex;
    align-items: center;
    min-height: 40px;
    color: var(--text-faint);
    font-size: 0.76rem;
    line-height: 1.4;
}

.option-action-cell {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 40px;
}

.row-remove-btn {
    color: var(--danger);
    border-color: #f1d5d5;
    background: #fff;
}

.row-remove-btn:hover {
    background: #fff5f5;
    border-color: #efc1c1;
}

.product-card {
    display: grid;
    gap: 10px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.report-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 600;
}

.report-tab.active {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.report-note {
    margin-top: 10px;
}

.pos-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(340px, 400px);
    align-items: start;
    gap: 16px;
}

.pos-panel {
    display: grid;
    gap: 14px;
    align-content: start;
}

.pos-cart-panel {
    position: sticky;
    top: 86px;
}

.pos-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 2px;
}

.cart-items {
    display: grid;
    gap: 10px;
}

.cart-item-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.cart-item-title {
    font-size: 0.9rem;
    font-weight: 700;
}

.cart-item-meta {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 0.79rem;
}

.cart-item-grid {
    display: grid;
    gap: 10px;
}

.cart-item-total {
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 600;
}

.dialog-shell {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    width: min(100%, 640px);
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
}

.dialog-shell::backdrop {
    background: rgba(15, 23, 42, 0.24);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.compact-surface {
    padding: 12px;
}

.compact-card-title {
    font-size: 1rem;
}

.compact-summary {
    padding: 12px;
}

.dialog-card {
    margin: 0;
    padding: 14px;
}

.guest-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.guest-card {
    width: min(100%, 980px);
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.guest-aside {
    padding: 28px 24px;
    background: #fafafa;
    border-right: 1px solid var(--border);
    display: grid;
    gap: 20px;
    align-content: space-between;
}

.guest-content {
    padding: 26px 24px;
}

.guest-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.guest-heading {
    margin: 12px 0 0;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.guest-copy {
    margin: 10px 0 0;
    max-width: 400px;
    color: var(--text-soft);
    font-size: 0.88rem;
}

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

.guest-points li {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-soft);
    font-size: 0.84rem;
}

.guest-points strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.86rem;
}

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

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        grid-template-rows: auto auto auto;
        overflow: visible;
    }

    .sidebar-nav-shell,
    .sidebar-nav-scroll {
        min-height: auto;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 960px) {
    .guest-card {
        grid-template-columns: 1fr;
    }

    .guest-aside {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .pos-shell {
        grid-template-columns: 1fr;
    }

    .pos-cart-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .content,
    .app-topbar {
        padding-left: 18px;
        padding-right: 18px;
    }

    .hours-row,
    .option-row,
    .option-row.option-row-no-default,
    .option-row.option-row-recipe,
    .option-row.option-row-payment {
        grid-template-columns: 1fr;
    }

    .choice-grid,
    .branch-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .option-action-cell {
        justify-content: flex-start;
    }

    .filter-actions {
        min-height: auto;
        padding-top: 0;
    }

    .chart-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .chart-y-axis {
        display: none;
    }
}

@media (max-width: 720px) {
    .topbar,
    .app-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .surface {
        padding: 14px;
    }

    .title {
        font-size: 1.24rem;
    }

    .guest-aside,
    .guest-content {
        padding: 20px 18px;
    }

    .dashboard-chart-metrics,
    .dashboard-ranking-meta {
        justify-content: flex-start;
    }

    .dashboard-chart-header {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .dashboard-chart-metrics {
        max-width: none;
    }

    .dashboard-ranking-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
