@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #0d9488;
    --primary-strong: #0f766e;
    --accent: #2563eb;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

* {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Outfit', Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 14px;
}

body.menu-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.sidebar {
    display: none !important;
}

.mobile-overlay,
.mobile-topbar,
.topbar {
    display: none !important;
}

.app-shell {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #14b8a6;
    color: #052e2b;
    font-weight: 800;
}

.brand small {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    margin-top: 2px;
}

.nav {
    display: grid;
    gap: 5px;
}

.nav a {
    border-radius: 8px;
    color: #cbd5e1;
    padding: 11px 12px;
}

.nav a:hover,
.nav a.active {
    background: rgba(20, 184, 166, .14);
    color: #ffffff;
}

.app-shell {
    margin-left: 255px;
    min-height: 100vh;
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.topbar-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.notification-bell {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    color: var(--text);
    display: inline-flex;
    font-weight: 900;
    gap: 8px;
    min-height: 42px;
    padding: 10px 13px;
    position: relative;
}

.notification-bell svg {
    fill: currentColor;
    height: 18px;
    width: 18px;
}

.notification-bell.has-unread {
    border-color: #fecaca;
    color: #991b1b;
}

.notification-badge {
    background: var(--danger);
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    min-width: 21px;
    padding: 4px 6px;
    position: absolute;
    right: -8px;
    text-align: center;
    top: -8px;
}

.topbar h1,
.install-box h1 {
    margin: 2px 0 0;
    font-size: 28px;
    letter-spacing: 0;
}

.eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.two {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.panel,
.metric,
.install-box {
    background: var(--surface);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
}

.panel:hover,
.metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.04), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    border-color: rgba(13, 148, 136, 0.2);
}

.panel {
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.panel-header h2,
.panel h2,
.section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.panel-header p,
.muted {
    color: var(--muted);
}

.metric {
    padding: 20px;
}

.metric span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric strong {
    display: block;
    font-size: 26px;
    font-weight: 800;
    margin-top: 8px;
    letter-spacing: -0.02em;
}

.metric small {
    color: var(--muted);
}

.metric .badge {
    display: inline-flex;
    font-size: 11px;
    margin-left: 4px;
    text-transform: none;
}

.metric.positive strong {
    color: var(--success);
}

.metric.negative strong {
    color: var(--danger);
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.bulk-delete-form {
    margin: 0 0 12px;
}

.bulk-delete-form.actions {
    margin-top: 0;
}

.bulk-check {
    text-align: center;
    width: 38px;
}

.bulk-check input {
    height: 16px;
    margin: 0;
    min-height: 0;
    padding: 0;
    width: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
}

tr {
    transition: background-color 0.15s ease;
}

tr:hover td {
    background-color: var(--surface-2);
}

th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    position: sticky;
    top: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
}

thead th {
    box-shadow: 0 1px 0 var(--line);
}

tr:last-child td {
    border-bottom: 0;
}

.number {
    text-align: right;
    white-space: nowrap;
}

.form-grid {
    align-items: start;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    align-content: start;
    display: grid;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    color: #344054;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: var(--text);
    font: inherit;
    padding: 12px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input,
select {
    min-height: 45px;
}

.field small {
    display: block;
    line-height: 1.42;
}

textarea {
    min-height: 82px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

.button,
button {
    align-items: center;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 600;
    justify-content: center;
    min-height: 40px;
    padding: 10px 18px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.button:hover,
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.button:active,
button:active {
    transform: translateY(0);
}

.button.primary,
button.primary {
    background: var(--primary);
    color: #ffffff;
}

.button.primary:hover,
button.primary:hover {
    background: var(--primary-strong);
}

.button.subtle,
button.subtle {
    background: var(--surface-2);
    color: var(--text);
}

.button.danger,
button.danger {
    background: #fee2e2;
    color: #991b1b;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 14px;
}

.row-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.image-thumb {
    background: transparent;
    border: 0;
    min-height: 0;
    padding: 0;
}

.image-thumb img {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: block;
    height: 72px;
    object-fit: cover;
    width: 72px;
}

.image-modal {
    display: grid;
    inset: 0;
    place-items: center;
    position: fixed;
    z-index: 80;
}

.image-modal[hidden] {
    display: none !important;
}

.image-modal-backdrop {
    background: rgba(15, 23, 42, .72);
    border-radius: 0;
    inset: 0;
    min-height: 0;
    padding: 0;
    position: absolute;
    width: 100%;
}

.image-modal-dialog {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(15, 23, 42, .34);
    max-height: 92vh;
    max-width: min(92vw, 980px);
    overflow: hidden;
    position: relative;
    width: max-content;
}

.image-modal-header {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 11px 12px;
}

.image-modal-close {
    background: var(--surface-2);
    color: var(--text);
    height: 36px;
    min-height: 36px;
    padding: 0;
    width: 36px;
}

.image-modal-dialog img {
    display: block;
    max-height: calc(92vh - 59px);
    max-width: min(92vw, 980px);
    object-fit: contain;
}

.alert {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error,
.alert.danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert.warning {
    background: #fef3c7;
    color: #92400e;
}

.badge {
    border-radius: 8px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 12px;
}

.badge.success,
.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge.warning,
.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge.danger,
.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge-primary {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.badge-info {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.badge-wh {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.sku-tag {
    font-family: monospace;
    font-size: 11px;
    background-color: var(--surface-2);
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--text);
    display: inline-block;
}

.stat-list {
    display: grid;
    gap: 10px;
}

.stat-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(120px, 1fr) minmax(140px, 2fr) auto;
}

.bar {
    background: #e2e8f0;
    border-radius: 999px;
    height: 9px;
    overflow: hidden;
}

.bar span {
    background: var(--accent);
    display: block;
    height: 100%;
}

.product-showcase {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 5px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 14px;
    padding: 16px;
}

.product-card.positive {
    border-left-color: var(--success);
}

.product-card.negative {
    border-left-color: var(--danger);
}

.product-card-header {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.product-card-header h2 {
    font-size: 16px;
    margin: 0;
}

.product-card-header p {
    margin: 5px 0 0;
}

.product-money span,
.product-stats span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.product-money strong {
    display: block;
    font-size: 24px;
    margin-top: 5px;
}

.product-money small {
    color: var(--muted);
}

.product-money.positive strong,
.profit-positive {
    color: var(--success);
}

.product-money.negative strong,
.profit-negative {
    color: var(--danger);
}

.product-stats {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
}

.product-stats div {
    background: var(--surface-2);
    border-radius: 8px;
    padding: 10px;
}

.product-stats strong {
    display: block;
    margin-top: 4px;
}

.chart-box {
    height: 300px;
    width: 100%;
}

.chart-box canvas {
    display: block;
    height: 100%;
    width: 100%;
}

.toolbar {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar .field {
    min-width: 180px;
}

.recipe-lines {
    display: grid;
    gap: 10px;
}

.recipe-line {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(260px, 2fr) minmax(110px, .8fr) minmax(90px, .7fr) 70px;
}

.pending-lines {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.pending-lines-header {
    margin-bottom: 10px;
}

.pending-line {
    align-items: end;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 10px 12px;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
    padding: 12px;
}

.pending-line-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.pending-line-field small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.pending-line-field input,
.pending-line-field select,
.pending-line-field .select-combo-input {
    background: var(--card);
}

.pending-line-item {
    grid-column: 1 / -1;
    min-width: 0;
}

.pending-line-notes {
    grid-column: 1 / -1;
}

.pending-line-remove {
    grid-column: 1 / -1;
    justify-self: end;
    min-height: 34px;
    padding: 7px 12px;
}

.pending-add-row {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
}

.pending-add-row .button {
    min-height: 38px;
    padding: 8px 12px;
}

.pending-item-list {
    display: grid;
    gap: 8px;
}

.pending-item-list div {
    background: var(--surface-2);
    border-radius: 8px;
    display: grid;
    gap: 3px;
    padding: 8px 10px;
}

.pending-item-list span,
.pending-item-list small {
    color: var(--muted);
    font-size: 12px;
}

.pending-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.ingredient-combobox,
.select-combobox {
    position: relative;
}

.ingredient-combo-input,
.select-combo-input {
    padding-right: 34px;
}

.ingredient-combobox::after,
.select-combobox::after {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--muted);
    content: "";
    pointer-events: none;
    position: absolute;
    right: 14px;
    top: 21px;
}

.ingredient-options,
.select-combo-options {
    background: var(--surface);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
    left: 0;
    right: auto;
    min-width: 100%;
    width: max-content;
    max-width: min(320px, 85vw);
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    position: absolute;
    top: calc(100% + 5px);
    z-index: 25;
}

.ingredient-options[hidden],
.ingredient-options button[hidden],
.ingredient-empty[hidden],
.select-combo-options[hidden],
.select-combo-options button[hidden],
.select-combo-empty[hidden] {
    display: none !important;
}

.ingredient-options button,
.select-combo-options button {
    background: transparent;
    border-radius: 6px;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    min-height: 38px;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.ingredient-options button:hover,
.ingredient-options button:focus,
.select-combo-options button:hover,
.select-combo-options button:focus {
    background: var(--surface-2);
    outline: 0;
}

.select-combo-options button:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    opacity: .85;
}

.select-combo-options button:disabled:hover,
.select-combo-options button:disabled:focus {
    background: transparent;
}

.ingredient-options small {
    color: var(--muted);
    font-weight: 700;
}

.ingredient-empty,
.select-combo-empty {
    color: var(--muted);
    padding: 12px 10px;
    text-align: center;
}

.native-combo-select {
    clip-path: inset(50%);
    height: 1px !important;
    margin: -1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute !important;
    white-space: nowrap;
    width: 1px !important;
}

.install-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
}

.install-box {
    max-width: 520px;
    padding: 28px;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    padding: 24px;
    text-align: center;
}

.is-hidden {
    display: none !important;
}

.calendar-header {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.calendar-header h2 {
    margin: 0;
}

.calendar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.calendar-legend {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.calendar-legend span {
    align-items: center;
    background: var(--surface-2);
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    gap: 7px;
    padding: 6px 10px;
}

.calendar-dot {
    border-radius: 999px;
    display: inline-block;
    height: 9px;
    width: 9px;
}

.calendar-dot.work,
.calendar-event.work,
.calendar-upcoming-card.work {
    --calendar-color: #0f766e;
    --calendar-bg: #ccfbf1;
}

.calendar-dot.event,
.calendar-event.event,
.calendar-upcoming-card.event {
    --calendar-color: #2563eb;
    --calendar-bg: #dbeafe;
}

.calendar-dot.bazar,
.calendar-event.bazar,
.calendar-upcoming-card.bazar {
    --calendar-color: #b7791f;
    --calendar-bg: #fef3c7;
}

.calendar-dot.holiday,
.calendar-event.holiday,
.calendar-upcoming-card.holiday {
    --calendar-color: #dc2626;
    --calendar-bg: #fee2e2;
}

.calendar-dot.note,
.calendar-event.note,
.calendar-upcoming-card.note {
    --calendar-color: #475569;
    --calendar-bg: #e2e8f0;
}

.calendar-dot.blocking {
    background: var(--danger);
}

.calendar-dot {
    background: var(--calendar-color, var(--muted));
}

.calendar-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(7, minmax(118px, 1fr));
}

.calendar-weekday {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .05em;
    padding: 0 4px 3px;
    text-transform: uppercase;
}

.calendar-day {
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 150px;
    padding: 10px;
}

.calendar-day.outside {
    background: #f8fafc;
    color: #94a3b8;
}

.calendar-day.today {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, .13);
}

.calendar-day-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.calendar-day-head strong {
    font-size: 16px;
}

.calendar-day-head span {
    background: #dcfce7;
    border-radius: 999px;
    color: #166534;
    font-size: 11px;
    font-weight: 900;
    padding: 3px 8px;
}

.calendar-event {
    background: var(--calendar-bg, var(--surface-2));
    border-left: 4px solid var(--calendar-color, var(--muted));
    border-radius: 8px;
    color: var(--text);
    display: grid;
    gap: 5px;
    margin-top: 7px;
    padding: 8px;
}

.calendar-event.blocking {
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .14);
}

.calendar-event-top {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: space-between;
}

.calendar-event-top span,
.calendar-event-top b {
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    padding: 3px 7px;
    text-transform: uppercase;
}

.calendar-event-top span {
    background: rgba(255, 255, 255, .62);
    color: var(--calendar-color, var(--muted));
}

.calendar-event-top b {
    background: #fee2e2;
    color: #991b1b;
}

.calendar-event strong {
    line-height: 1.3;
}

.calendar-event small {
    color: #475569;
    line-height: 1.35;
}

.calendar-event-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.calendar-event-actions a,
.calendar-event-actions button {
    background: rgba(255, 255, 255, .72);
    color: var(--text);
    font-size: 11px;
    font-weight: 900;
    min-height: 27px;
    padding: 5px 8px;
}

.calendar-event-actions form {
    margin: 0;
}

.calendar-guide {
    display: grid;
    gap: 10px;
}

.calendar-guide div {
    background: var(--surface-2);
    border-radius: 8px;
    padding: 12px;
}

.calendar-guide strong,
.calendar-guide span {
    display: block;
}

.calendar-guide span {
    color: var(--muted);
    margin-top: 4px;
}

.calendar-upcoming {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.calendar-upcoming-card {
    background: var(--calendar-bg, var(--surface-2));
    border: 1px solid rgba(15, 23, 42, .08);
    border-left: 5px solid var(--calendar-color, var(--muted));
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 13px;
}

.calendar-upcoming-card span {
    color: var(--calendar-color, var(--muted));
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.calendar-upcoming-card p {
    color: var(--muted);
    margin: 0;
}

.calendar-upcoming-card small {
    color: #991b1b;
    font-weight: 900;
}

.attendance-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
}

.attendance-window {
    background: #0f766e;
    border-radius: 8px;
    color: #ffffff;
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
    padding: 14px;
}

.attendance-window span,
.attendance-window small {
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.attendance-window strong {
    font-size: 30px;
}

.attendance-status {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 14px;
}

.approval-stack {
    display: grid;
    gap: 14px;
}

.approval-stack h3 {
    font-size: 14px;
    margin: 0 0 9px;
}

.approval-card {
    background: var(--surface-2);
    border-radius: 8px;
    display: grid;
    gap: 7px;
    margin-bottom: 9px;
    padding: 12px;
}

.approval-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.approval-card p {
    margin: 0;
}

.schedule-matrix th,
.schedule-matrix td {
    vertical-align: middle;
}

.schedule-chip,
.schedule-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 900;
    justify-content: center;
}

.schedule-chip {
    height: 26px;
    min-width: 26px;
    padding: 0 7px;
}

.schedule-chip.work {
    background: #e2e8f0;
    color: #475569;
}

.schedule-chip.present {
    background: #dcfce7;
    color: #166534;
}

.schedule-chip.pending,
.schedule-chip.permission,
.schedule-chip.sick {
    background: #fef3c7;
    color: #92400e;
}

.schedule-chip.absent,
.schedule-chip.off,
.schedule-chip.leave {
    background: #fee2e2;
    color: #991b1b;
}

.schedule-pill {
    background: #fee2e2;
    color: #991b1b;
    display: grid;
    gap: 2px;
    justify-items: start;
    margin-bottom: 8px;
    padding: 7px 10px;
}

.schedule-pill.permission,
.schedule-pill.sick {
    background: #fef3c7;
    color: #92400e;
}

.schedule-pill small {
    color: inherit;
    font-weight: 700;
    opacity: .82;
}

.notification-list {
    display: grid;
    gap: 12px;
}

.notification-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    display: grid;
    gap: 14px;
    grid-template-columns: 12px minmax(0, 1fr);
    padding: 16px;
}

.notification-item.is-unread {
    border-color: #5eead4;
    box-shadow: 0 14px 30px rgba(15, 118, 110, .1);
}

.notification-marker {
    border-radius: 999px;
    min-height: 100%;
}

.notification-marker.news,
.notification-marker.bonus,
.notification-marker.idea {
    background: #10b981;
}

.notification-marker.event,
.notification-marker.schedule,
.notification-marker.system {
    background: #f59e0b;
}

.notification-marker.complaint {
    background: #ef4444;
}

.notification-item-head,
.notification-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.notification-item h3 {
    margin: 10px 0 6px;
}

.notification-item p {
    color: var(--muted);
    margin: 0 0 12px;
}

.notification-meta {
    color: var(--muted);
    font-size: 12px;
}

.bonus-panel {
    position: relative;
    overflow: hidden;
}

.bonus-panel::before {
    background: linear-gradient(135deg, rgba(15, 118, 110, .14), rgba(37, 99, 235, .08));
    border-radius: 999px;
    content: "";
    height: 120px;
    pointer-events: none;
    position: absolute;
    right: -44px;
    top: -58px;
    width: 120px;
}

.complaint-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.complaint-category-list span {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    color: #047857;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 10px;
}

.complaint-category-list span.inactive {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #64748b;
}

.idea-reward-card {
    background:
        radial-gradient(circle at top right, rgba(20, 184, 166, .18), transparent 34%),
        #ffffff;
}

.idea-reward-copy {
    display: grid;
    gap: 10px;
}

.idea-reward-copy strong {
    font-size: 18px;
}

.idea-reward-copy p,
.idea-reward-copy ul {
    color: var(--muted);
    margin: 0;
}

.idea-reward-copy ul {
    padding-left: 18px;
}

.idea-grid {
    display: grid;
    gap: 14px;
}

.idea-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    display: grid;
    gap: 16px;
    grid-template-columns: 160px minmax(0, 1fr);
    padding: 16px;
}

.idea-card-photo .image-thumb {
    height: 140px;
    width: 100%;
}

.idea-card-photo .image-thumb img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.idea-card-body {
    min-width: 0;
}

.idea-card-head,
.idea-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.idea-card h3 {
    font-size: 20px;
    margin: 10px 0 4px;
}

.idea-meta {
    justify-content: flex-start;
    margin: 10px 0;
}

.idea-recipe {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 13px;
}

.idea-recipe summary {
    cursor: pointer;
    font-weight: 900;
}

.idea-recipe p,
.idea-admin-note {
    color: var(--muted);
    margin: 10px 0 0;
}

.idea-review-form {
    border-top: 1px solid var(--line);
    margin-top: 14px;
    padding-top: 14px;
}

.sales-lines {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.sales-lines-header {
    margin-bottom: 10px;
}

.sales-line {
    align-items: end;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 10px 12px;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(90px, 0.7fr) minmax(60px, 0.4fr) minmax(95px, 0.7fr) minmax(60px, 0.4fr) minmax(100px, 1fr) auto;
    min-width: 0;
    padding: 12px;
}

.sales-line-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.sales-line-field small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.sales-line-field input,
.sales-line-field select,
.sales-line-field .select-combo-input {
    background: var(--card);
}

.sales-line-item {
    min-width: 0;
}

.sales-line-remove {
    grid-column: auto;
    justify-self: end;
    min-height: 38px;
    padding: 8px 16px;
    margin-bottom: 2px;
}

.sales-add-row {
    margin-top: 12px;
}

@media (max-width: 1100px) {
    .grid.five,
    .grid.four,
    .grid.three,
    .grid.two,
    .form-grid,
    .form-grid.two,
    .form-grid.three {
        grid-template-columns: 1fr 1fr;
    }

    .recipe-line {
        grid-template-columns: 1fr 1fr;
    }



    .pending-line-remove {
        grid-column: 1 / -1;
        justify-self: stretch;
        width: 100%;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .idea-card {
        grid-template-columns: 1fr;
    }

    .calendar-weekday {
        display: none;
    }

    .sales-line {
        grid-template-columns: repeat(6, 1fr);
    }

    .sales-line-item {
        grid-column: span 3;
    }

    .sales-line-field:not(.sales-line-item):not(.notes) {
        grid-column: span 2;
    }

    .sales-line-field.notes {
        grid-column: span 4;
    }

    .sales-line-remove {
        grid-column: span 2;
        justify-self: stretch;
        width: 100%;
        min-height: 38px;
        margin-bottom: 0;
    }
}

@media (max-width: 760px) {
    .sidebar {
        height: 100vh;
        left: 0;
        padding: 20px 16px;
        position: fixed;
        top: 0;
        transform: translateX(-104%);
        transition: transform .22s ease;
        width: min(82vw, 310px);
        z-index: 40;
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    .mobile-overlay {
        background: rgba(15, 23, 42, .48);
        display: block;
        inset: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        transition: opacity .22s ease;
        z-index: 30;
    }

    body.menu-open .mobile-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .app-shell {
        margin-left: 0;
        padding: 14px;
        padding-top: 74px;
    }

    .mobile-topbar {
        align-items: center;
        background: #ffffff;
        border-bottom: 1px solid var(--line);
        box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
        display: flex;
        gap: 12px;
        height: 58px;
        left: 0;
        padding: 0 14px;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 20;
    }

    .menu-toggle {
        background: var(--surface-2);
        display: inline-grid;
        gap: 4px;
        height: 42px;
        min-height: 42px;
        padding: 10px;
        width: 42px;
    }

    .menu-toggle span {
        background: var(--text);
        border-radius: 999px;
        display: block;
        height: 2px;
        width: 20px;
    }

    .mobile-brand {
        font-size: 16px;
        font-weight: 900;
    }

    .mobile-notification-bell {
        margin-left: auto;
        min-height: 40px;
        padding: 10px;
    }

    .mobile-notification-bell span:not(.notification-badge) {
        display: none;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 14px;
    }

    .topbar-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        margin-top: 10px;
    }
    .topbar-actions .button, 
    .topbar-actions a {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }

    .topbar h1 {
        font-size: 30px;
        line-height: 1.16;
        overflow-wrap: anywhere;
    }

    .grid.five,
    .grid.four,
    .grid.three,
    .grid.two,
    .form-grid,
    .form-grid.two,
    .form-grid.three,
    .recipe-line {
        grid-template-columns: 1fr;
    }

    .grid,
    .form-grid,
    .recipe-line,
    .pending-line {
        min-width: 0;
    }

    .grid > *,
    .form-grid > *,
    .recipe-line > *,
    .pending-line > * {
        min-width: 0;
    }

    .pending-line {
        grid-template-columns: 1fr;
    }

    .pending-lines-header {
        margin-bottom: 8px;
    }

    .pending-add-row .button {
        width: 100%;
    }

    .stat-row {
        grid-template-columns: 1fr;
    }

    .calendar-header {
        display: grid;
    }

    .calendar-nav {
        justify-content: stretch;
    }

    .calendar-nav .button,
    .calendar-nav button {
        width: 100%;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .calendar-day {
        min-height: 0;
    }

    .sales-line {
        grid-template-columns: 1fr;
    }

    .sales-line-item,
    .sales-line-field,
    .sales-line-field.notes {
        grid-column: 1 / -1;
    }

    .sales-line-remove {
        grid-column: 1 / -1;
        justify-self: stretch;
        width: 100%;
        margin-bottom: 0;
    }

    .sales-add-row .button {
        width: 100%;
    }
}

/* Fix checkbox sizing issues */
input[type="checkbox"][data-bulk-item],
input[type="checkbox"][data-bulk-toggle] {
    width: 16px !important;
    height: 16px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    display: inline-block;
}

/* Tooltip styling */
.info-tooltip {
    position: relative;
    cursor: help;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 10px;
    font-weight: bold;
    margin-left: 6px;
    user-select: none;
    text-transform: none !important;
}

.info-tooltip:hover {
    background: #cbd5e1;
    color: #1e293b;
}

/* Tooltip Modal Styling */
.tooltip-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.tooltip-modal-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.tooltip-modal-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    width: min(90vw, 420px);
    padding: 24px;
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 1px solid var(--line);
}

.tooltip-modal-overlay.is-active .tooltip-modal-container {
    transform: scale(1);
}

.tooltip-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.tooltip-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.tooltip-modal-close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.tooltip-modal-close-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.tooltip-modal-body {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 20px;
}

.tooltip-modal-footer {
    display: flex;
    justify-content: flex-end;
}

.tooltip-modal-footer button {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.tooltip-modal-footer button:hover {
    background: var(--primary-strong);
}

/* AI Target & Insights Styling */
.insight-card {
    border-left: 4px solid var(--muted);
    transition: all 0.25s ease;
}

.insight-card.border-blue {
    border-left-color: var(--accent);
}

.insight-card.border-red {
    border-left-color: var(--danger);
}

.insight-card.border-orange {
    border-left-color: var(--warning);
}

.insight-card.border-green {
    border-left-color: var(--success);
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Tab Control Styles */
.tab-controls {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    border-bottom: 2px solid var(--line);
    padding-bottom: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 8px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -10px;
    transition: all 0.2s ease;
    border-radius: 0;
    font-size: 14px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text);
    background: var(--surface-2);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.tab-content.is-hidden {
    display: none !important;
}

/* Financial Color Helper Classes */
.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}


