:root {
    --brand-yellow: #F2A026;
    --brand-black: #000000;
    --brand-white: #FFFFFF;
    --bg-soft: #f6f6f6;
    --border-soft: #e7e7e7;
    --text-soft: #5d5d5d;
    --danger: #9d1b1b;
    --success: #155724;
    --shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg-soft);
    color: var(--brand-black);
}

body { min-height: 100vh; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 280px;
    background: var(--brand-black);
    color: var(--brand-white);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 0;
    min-height: 100vh;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
}

.brand-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #fff;
    padding: 6px;
    border-radius: 16px;
}

.brand-block h1,
.brand-block p { margin: 0; }
.brand-block p { color: #d1d1d1; font-size: 14px; }

.nav-menu { display: grid; gap: 10px; }

.nav-link {
    display: block;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    font-weight: 700;
}

.nav-link:hover {
    background: var(--brand-yellow);
    color: var(--brand-black);
}

.nav-link-logout { margin-top: 6px; }

.user-box {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px;
    display: grid;
    gap: 6px;
}

.user-box span {
    font-size: 13px;
    color: #d3d3d3;
    text-transform: uppercase;
}

.main-content {
    flex: 1;
    padding: 24px;
}

.main-content-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background:
        radial-gradient(circle at top left, rgba(242,160,38,0.95), rgba(242,160,38,0.88) 25%, transparent 26%),
        linear-gradient(135deg, #fff8ef, #fff 55%);
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 22px;
}

.page-header h2 { margin: 0 0 6px; }
.page-header p { margin: 0; color: var(--text-soft); }

.panel-card {
    background: var(--brand-white);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}
.panel-head h3 { margin: 0; }
.panel-head-stack { flex-direction: column; align-items: stretch; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #fff8ee 100%);
    border: 2px solid rgba(242, 160, 38, 0.18);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 8px;
}

.stat-card span { color: var(--text-soft); font-weight: 700; }
.stat-card strong { font-size: 30px; line-height: 1.1; }
.stat-card small { color: var(--text-soft); }

.stat-breakdown {
    display: grid;
    gap: 8px;
    margin-top: 2px;
}

.stat-breakdown div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(242, 160, 38, 0.08);
    border: 1px solid rgba(242, 160, 38, 0.16);
    border-radius: 12px;
    padding: 8px 10px;
}

.stat-breakdown span {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
}

.stat-breakdown b {
    font-size: 15px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid label { display: grid; gap: 8px; font-weight: 700; }

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 14px 14px;
    background: #fff;
    font-size: 16px;
}

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

.btn {
    border: none;
    border-radius: 16px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 800;
    font-size: 15px;
    transition: transform .15s ease, opacity .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand-yellow); color: var(--brand-black); }
.btn-secondary { background: #f0f0f0; color: var(--brand-black); }
.btn-dark { background: var(--brand-black); color: var(--brand-white); }
.btn-small { font-size: 13px; padding: 10px 12px; border-radius: 12px; }
.btn-big { min-height: 54px; font-size: 17px; }

.actions-row { display: flex; gap: 12px; flex-wrap: wrap; }

.flash {
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 700;
    margin-bottom: 18px;
}

.flash-success { background: #dbf7df; color: var(--success); }
.flash-error { background: #ffe1e1; color: var(--danger); }

.login-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.login-card {
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 24px 40px rgba(0,0,0,0.12);
}

.login-logo {
    width: 140px;
    margin: 0 auto 18px;
    background: #fff;
    border-radius: 20px;
    padding: 10px;
}

.login-card h2,
.login-card p { text-align: center; }

.muted { color: var(--text-soft); }

.demo-box {
    margin-top: 18px;
    border-radius: 18px;
    padding: 16px;
    background: #fff7e9;
}

.table-wrap { overflow-x: auto; }

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

.data-table th,
.data-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #efefef;
    text-align: left;
    vertical-align: middle;
}

.data-table th { background: #fffaf3; }

.thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 14px;
}

.image-preview img {
    width: 140px;
    border-radius: 16px;
}

.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.is-active { background: #ddf4df; color: #0a6f22; }
.is-inactive { background: #f2f2f2; color: #666; }

.actions-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.two-col-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 22px;
}

.sales-layout {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 22px;
    align-items: start;
}

.sales-products-panel,
.sales-cart-panel {
    position: sticky;
    top: 20px;
}

.search-inline input {
    width: 100%;
    border: 1px solid var(--border-soft);
    padding: 14px;
    border-radius: 14px;
    font-size: 16px;
}

.category-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.category-tab {
    border: 2px solid #f0e0c2;
    background: #fff;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.category-tab.active {
    background: var(--brand-yellow);
    border-color: var(--brand-yellow);
    color: var(--brand-black);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.product-card {
    background: #fff;
    border: 2px solid #f3e8d1;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.product-image-wrap {
    height: 180px;
    background: #fff8ef;
}

.product-image-wrap img,
.product-image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-weight: 700;
}

.product-card-body {
    padding: 14px;
    display: grid;
    gap: 6px;
    flex: 1;
}

.product-card-body span {
    color: var(--text-soft);
    font-size: 14px;
}

.product-card .btn {
    margin: 0 14px 14px;
    min-height: 48px;
}

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

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 1px solid #eee;
    border-radius: 18px;
    padding: 14px;
    background: #fffaf4;
}

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

.cart-item-info span {
    color: var(--text-soft);
    font-size: 14px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.qty-btn,
.remove-btn {
    border: none;
    background: var(--brand-black);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}

.remove-btn { background: #b62525; }

.qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 800;
}

.empty-cart {
    padding: 18px;
    border-radius: 16px;
    background: #fafafa;
    color: var(--text-soft);
}

.cart-total-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--brand-black);
    color: var(--brand-white);
    border-radius: 18px;
    padding: 16px 18px;
}

.cart-total-box strong {
    font-size: 28px;
}

.inline-check {
    display: flex;
    align-items: center;
}

.check-label {
    display: inline-flex !important;
    align-items: center;
    gap: 12px;
}

.check-label input {
    width: 20px !important;
    height: 20px;
}

.hidden { display: none !important; }
.subsection-title { margin: 8px 0 0; }

.mini-history {
    margin-top: 18px;
    border-top: 1px solid #efefef;
    padding-top: 16px;
}

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

.mini-sale-card {
    background: #fffaf3;
    border: 1px solid #f1e1c4;
    border-radius: 16px;
    padding: 12px;
    display: grid;
    gap: 4px;
}

.sale-breakdown-card {
    gap: 8px;
}

.mini-sale-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.mini-sale-header-main {
    display: grid;
    gap: 4px;
}

.mini-sale-total-pill {
    background: var(--brand-black);
    color: var(--brand-yellow);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 800;
    white-space: nowrap;
}

.mini-sale-meta small {
    display: block;
    color: var(--text-soft);
    font-size: 12px;
}

.mini-sale-items {
    display: grid;
    gap: 6px;
    margin-top: 4px;
}

.mini-sale-item-line,
.mini-sale-total-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.mini-sale-item-line {
    padding: 9px 10px;
    background: rgba(255,255,255,0.92);
    border: 1px dashed #efd9b4;
    border-radius: 12px;
}

.mini-sale-item-text {
    display: grid;
    gap: 3px;
}

.mini-sale-item-line span,
.mini-sale-total-row span {
    color: var(--brand-black);
    font-size: 14px;
    font-weight: 700;
}

.mini-sale-item-text small {
    color: var(--text-soft);
    font-size: 12px;
}

.mini-sale-item-line b,
.mini-sale-total-row b {
    font-size: 14px;
    white-space: nowrap;
}

.mini-sale-total-row {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid #ecd9b6;
    align-items: center;
}

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

    .sales-layout,
    .two-col-layout {
        grid-template-columns: 1fr;
    }

    .sales-products-panel,
    .sales-cart-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        position: static;
    }

    .main-content {
        padding: 16px;
    }

    .stats-grid,
    .form-grid,
    .products-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-item {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-item-controls {
        justify-content: flex-start;
    }
}


.is-warning { background: #fff1cf; color: #8a5b00; }
.small-text { font-size: 13px; }
.top-separator { margin-top: 18px; padding-top: 18px; border-top: 1px solid #efefef; }
.panel-head-spaced { margin-top: 10px; }

.inventory-layout,
.recipe-layout,
.client-layout {
    grid-template-columns: 460px 1fr;
}

.recipe-product-list {
    display: grid;
    gap: 12px;
    max-height: 70vh;
    overflow: auto;
    padding-right: 6px;
}

.recipe-product-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    background: #fffaf3;
    border: 1px solid #f1e1c4;
    border-radius: 18px;
    padding: 14px;
}

.recipe-product-item.active {
    background: #fff2d8;
    border-color: var(--brand-yellow);
}

.recipe-product-item small {
    color: var(--text-soft);
    display: block;
    margin-top: 4px;
}

.client-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 1200px) {
    .inventory-layout,
    .recipe-layout,
    .client-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .client-summary-grid {
        grid-template-columns: 1fr;
    }
}

.nav-link.is-active {
    background: var(--brand-yellow);
    color: var(--brand-black);
}

.stats-grid-admin {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.goal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.goal-grid-top {
    margin-bottom: 24px;
}

.goal-card {
    background: linear-gradient(180deg, #fffdf8 0%, #fff5e7 100%);
    border: 1px solid #f0dfbf;
    border-radius: 20px;
    padding: 18px;
    display: grid;
    gap: 12px;
}

.goal-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.goal-card-head span,
.goal-foot,
.goal-money-row small {
    color: var(--text-soft);
}

.goal-money-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.goal-money-row b {
    font-size: 26px;
}

.progress-track {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: #f1eadb;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f2a026, #ffcb72);
    border-radius: 999px;
}

.goal-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.bar-chart-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 14px;
}

.bar-day-card {
    background: #fffaf2;
    border: 1px solid #f3e4c7;
    border-radius: 18px;
    padding: 14px 12px;
    display: grid;
    gap: 10px;
    text-align: center;
}

.bar-day-card strong {
    font-size: 14px;
}

.bar-day-card span {
    font-size: 12px;
    color: var(--text-soft);
}

.bar-columns {
    height: 180px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
}

.bar-column {
    width: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    height: 100%;
}

.bar {
    width: 100%;
    min-height: 6px;
    border-radius: 12px 12px 6px 6px;
}

.bar-sales {
    background: linear-gradient(180deg, #f2a026 0%, #d68400 100%);
}

.bar-expenses {
    background: linear-gradient(180deg, #242424 0%, #000 100%);
}

.week-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.note-box {
    background: #fff7e8;
    border: 1px solid #f0d59f;
    border-radius: 18px;
    padding: 14px;
}

.note-box p {
    margin: 8px 0 0;
    color: var(--text-soft);
}

.text-success { color: #0a6f22; font-weight: 800; }
.text-danger { color: #b62525; font-weight: 800; }

@media (max-width: 1200px) {
    .goal-grid,
    .week-summary-grid,
    .bar-chart-grid,
    .stats-grid-admin {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .goal-grid,
    .week-summary-grid,
    .bar-chart-grid,
    .stats-grid-admin {
        grid-template-columns: 1fr;
    }

    .goal-foot,
    .goal-card-head,
    .goal-money-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .bar-columns {
        height: 140px;
    }
}


.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 80;
    background: #111;
    color: #fff;
    padding: 10px 14px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mobile-brand-mini {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-brand-mini img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    border-radius: 10px;
}

.mobile-brand-mini span {
    display: block;
    color: #d7d7d7;
    font-size: 12px;
}

.sidebar-toggle {
    border: none;
    background: var(--brand-yellow);
    color: #000;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 70;
}

.inline-form-compact {
    display: inline;
}

.invoice-sheet {
    background: #fff;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.invoice-header h1 {
    margin: 8px 0 4px;
}

.invoice-header p {
    margin: 0;
    color: var(--text-soft);
}

.invoice-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    background: #fff8ef;
    border-radius: 16px;
    padding: 8px;
}

.invoice-meta {
    display: grid;
    gap: 8px;
    text-align: right;
}

.invoice-client-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.invoice-client-grid article {
    background: #fffaf3;
    border: 1px solid #f1e1c4;
    border-radius: 18px;
    padding: 16px;
}

.invoice-client-grid h3,
.invoice-client-grid p {
    margin: 0 0 8px;
}

.invoice-total-box {
    margin-top: 18px;
    margin-left: auto;
    max-width: 320px;
    display: grid;
    gap: 8px;
    text-align: right;
}

.invoice-grand-total {
    font-size: 34px;
}

.invoice-table th,
.invoice-table td {
    font-size: 15px;
}

.audit-table td {
    vertical-align: top;
}

.json-code {
    display: inline-block;
    max-width: 480px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    background: #fafafa;
    padding: 8px 10px;
    border-radius: 12px;
}

.report-layout-tight {
    grid-template-columns: 1.1fr 0.9fr;
}

.week-summary-grid-1col {
    grid-template-columns: 1fr;
}

.form-align-end {
    align-items: end;
    display: flex;
}

@media (max-width: 1100px) {
    .sales-layout {
        grid-template-columns: 1fr;
    }

    .sales-products-panel,
    .sales-cart-panel {
        position: static;
    }

    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .mobile-topbar {
        display: flex;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-105%);
        transition: transform .22s ease;
        z-index: 90;
        width: min(86vw, 320px);
        min-height: 100vh;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-overlay.is-visible {
        display: block;
    }

    .main-content {
        padding: 14px;
    }

    .page-header {
        gap: 14px;
    }

    .stats-grid,
    .stats-grid-admin,
    .goal-grid,
    .week-summary-grid,
    .invoice-client-grid,
    .report-layout-tight,
    .two-col-layout,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .product-card {
        border-radius: 18px;
    }

    .product-image-wrap {
        height: 138px;
    }

    .product-card .btn,
    .btn-big {
        min-height: 50px;
    }

    .cart-total-box strong {
        font-size: 24px;
    }

    .invoice-header {
        flex-direction: column;
    }

    .invoice-meta {
        text-align: left;
    }
}

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

    .product-card-body {
        padding: 12px;
    }

    .product-card-body strong {
        font-size: 14px;
    }

    .product-card-body span,
    .bar-day-card span,
    .mini-sale-card small {
        font-size: 12px;
    }

    .sticky-actions-mobile {
        position: sticky;
        bottom: 10px;
        background: #fff;
        padding-top: 10px;
        z-index: 3;
    }
}

@media print {
    .sidebar,
    .mobile-topbar,
    .sidebar-overlay,
    .flash,
    .no-print,
    .page-header {
        display: none !important;
    }

    .main-content {
        padding: 0;
    }

    .panel-card {
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
    }

    body {
        background: #fff;
    }
}


.cash-close-summary-grid {
    display: grid;
    gap: 10px;
}

@media (max-width: 900px) {
    .data-table th,
    .data-table td {
        font-size: 13px;
        white-space: nowrap;
    }
}


.table-actions-cell,
.data-table td .btn.btn-small {
    white-space: nowrap;
}

/* Admin dashboard live metrics */
.live-panel-head {
    align-items: flex-start;
}

.live-panel-note {
    margin: 6px 0 0;
}

.live-status-pill {
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
}

.live-status-pill b {
    color: var(--brand-yellow);
}

.admin-period-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.admin-period-card {
    background: linear-gradient(180deg, #111 0%, #242424 100%);
    color: #fff;
    border: 1px solid rgba(242, 160, 38, 0.45);
    border-radius: 22px;
    padding: 18px;
    display: grid;
    gap: 8px;
    box-shadow: var(--shadow);
}

.admin-period-card span,
.admin-period-card small {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 700;
}

.admin-period-card > strong {
    color: var(--brand-yellow);
    font-size: 32px;
    line-height: 1.05;
}

.admin-period-breakdown {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.admin-period-breakdown div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

.admin-period-breakdown b {
    color: #fff;
    white-space: nowrap;
}

.admin-cuts-table td {
    vertical-align: top;
}

.cut-cell-total {
    font-size: 20px;
    font-weight: 900;
    color: var(--brand-black);
    margin-bottom: 4px;
}

.admin-cuts-table small {
    color: var(--text-soft);
    line-height: 1.4;
}

@media (max-width: 1200px) {
    .admin-period-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .live-panel-head {
        flex-direction: column;
    }

    .live-status-pill {
        white-space: normal;
        width: 100%;
    }

    .admin-period-grid {
        grid-template-columns: 1fr;
    }

    .admin-period-card > strong {
        font-size: 28px;
    }
}

/* Módulo admin: productos más vendidos por corte */
.cut-products-head {
    align-items: flex-start;
}

.cut-live-pill {
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
}

.cut-live-pill b {
    color: var(--brand-yellow);
}

.cut-period-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.cut-period-tab {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff7e9;
    color: #111;
    border-radius: 999px;
    padding: 11px 16px;
    font-weight: 900;
    cursor: pointer;
}

.cut-period-tab:hover,
.cut-period-tab.is-selected {
    background: var(--brand-yellow);
    border-color: var(--brand-yellow);
}

.cut-products-status {
    background: #fffaf3;
    border: 1px solid rgba(242, 160, 38, 0.25);
    border-radius: 16px;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.cut-products-status.is-error {
    background: #fff1f1;
    border-color: rgba(157, 27, 27, 0.25);
    color: var(--danger);
}

.cut-period-banner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.cut-period-banner > div {
    background: linear-gradient(180deg, #111 0%, #242424 100%);
    color: #fff;
    border: 1px solid rgba(242, 160, 38, 0.45);
    border-radius: 22px;
    padding: 18px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 6px;
}

.cut-period-banner span,
.cut-period-banner small {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 700;
}

.cut-period-banner strong {
    color: var(--brand-yellow);
    font-size: 26px;
    line-height: 1.1;
}

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

.cut-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.cut-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px;
    background: #fffaf3;
    border-bottom: 1px solid rgba(242, 160, 38, 0.2);
}

.cut-card-head span {
    color: var(--text-soft);
    font-weight: 900;
    font-size: 13px;
    text-transform: uppercase;
}

.cut-card-head h3 {
    margin: 4px 0 6px;
}

.cut-card-head p {
    margin: 0;
    color: var(--text-soft);
}

.cut-card-head > strong {
    background: #111;
    color: var(--brand-yellow);
    border-radius: 18px;
    padding: 12px 14px;
    font-size: 24px;
    white-space: nowrap;
}

.cut-mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 18px;
}

.cut-mini-stats div {
    background: #f8f8f8;
    border-radius: 16px;
    padding: 12px;
    display: grid;
    gap: 4px;
}

.cut-mini-stats span {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

.cut-mini-stats b {
    font-size: 20px;
}

.cut-products-table {
    min-width: 880px;
}

.cut-products-table td strong,
.cut-products-table td small {
    display: block;
}

.cut-products-table td small {
    color: var(--text-soft);
    font-size: 12px;
    margin-top: 3px;
}

.cut-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--brand-yellow);
    color: #111;
    font-weight: 900;
}

.cut-empty-state {
    margin: 0 18px 18px;
    background: #f8f8f8;
    border: 1px dashed var(--border-soft);
    border-radius: 18px;
    color: var(--text-soft);
    font-weight: 800;
    padding: 18px;
    text-align: center;
}

@media (max-width: 900px) {
    .cut-products-head,
    .cut-card-head {
        flex-direction: column;
    }

    .cut-live-pill,
    .cut-card-head > strong {
        width: 100%;
        white-space: normal;
    }

    .cut-period-banner,
    .cut-mini-stats {
        grid-template-columns: 1fr;
    }
}

/* Módulo de horario de llegada y estado de pago */
.attendance-hero-card {
    background: linear-gradient(135deg, #111 0%, #242424 58%, #fff3dc 58%, #fffaf3 100%);
    color: #fff;
    overflow: hidden;
}

.attendance-hero-card .muted,
.attendance-hero-card p {
    color: rgba(255,255,255,0.78);
}

.attendance-hero-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.attendance-kicker {
    display: inline-flex;
    width: fit-content;
    background: var(--brand-yellow);
    color: #111;
    border-radius: 999px;
    padding: 6px 10px;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.attendance-hero-main h3 {
    font-size: 32px;
    margin: 8px 0 6px;
}

.attendance-employee-picker {
    min-width: 280px;
    background: rgba(255,255,255,0.96);
    color: #111;
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.attendance-employee-picker label,
.attendance-calendar-filters label {
    display: grid;
    gap: 8px;
    font-weight: 800;
}

.attendance-employee-picker select,
.attendance-calendar-filters select,
.attendance-calendar-filters input,
.export-filter-grid input,
.export-filter-grid select,
.payroll-filter-grid input,
.payroll-filter-grid select {
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
    font-size: 15px;
}

.attendance-shift-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.attendance-shift-card {
    background: rgba(255,255,255,0.96);
    color: #111;
    border: 1px solid rgba(242,160,38,.38);
    border-radius: 22px;
    padding: 18px;
    display: grid;
    gap: 16px;
    box-shadow: var(--shadow);
}

.attendance-shift-card span,
.attendance-shift-card small {
    color: var(--text-soft);
    font-weight: 800;
}

.attendance-countdown {
    display: block;
    font-size: 30px;
    line-height: 1.1;
    margin: 6px 0;
    color: #111;
}

.attendance-countdown.is-late {
    color: var(--danger);
}

.attendance-marked-box {
    background: #111;
    color: #fff;
    border-radius: 18px;
    padding: 14px;
    display: grid;
    gap: 4px;
}

.attendance-marked-box b {
    color: var(--brand-yellow);
}

.attendance-marked-box span {
    color: #fff;
    font-size: 24px;
}

.attendance-marked-box small {
    color: rgba(255,255,255,.78);
}

.attendance-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.attendance-calendar-head {
    align-items: flex-start;
}

.attendance-calendar-filters {
    align-items: end;
}

.attendance-month-summary,
.payroll-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.attendance-month-summary div,
.payroll-summary-grid article {
    background: #fffaf3;
    border: 1px solid #f1e1c4;
    border-radius: 18px;
    padding: 14px;
    display: grid;
    gap: 4px;
}

.attendance-month-summary span,
.payroll-summary-grid span {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.attendance-month-summary b,
.payroll-summary-grid b {
    font-size: 22px;
}

.payroll-summary-grid small {
    color: var(--text-soft);
}

.payroll-payable {
    background: #111 !important;
    color: #fff;
    border-color: #111 !important;
}

.payroll-payable span,
.payroll-payable small {
    color: rgba(255,255,255,.72);
}

.payroll-payable b {
    color: var(--brand-yellow);
    font-size: 30px;
}

.attendance-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.attendance-calendar-day-name {
    background: #111;
    color: var(--brand-yellow);
    border-radius: 14px;
    padding: 10px;
    text-align: center;
    font-weight: 900;
}

.attendance-day {
    min-height: 150px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 18px;
    padding: 12px;
    display: grid;
    gap: 8px;
    align-content: start;
}

.attendance-day.is-empty {
    background: #f6f6f6;
    border-style: dashed;
}

.attendance-day.is-today {
    border: 2px solid var(--brand-yellow);
    background: #fffaf3;
}

.attendance-day-number {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--brand-yellow);
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.attendance-record-pill {
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 8px;
    display: grid;
    gap: 3px;
}

.attendance-record-pill b,
.attendance-record-pill span,
.attendance-record-pill small {
    font-size: 12px;
}

.attendance-record-pill small {
    width: fit-content;
    border-radius: 999px;
    padding: 3px 8px;
    font-weight: 900;
}

.attendance-danger-badge {
    background: #ffe1e1 !important;
    color: var(--danger) !important;
}

.attendance-admin-layout {
    grid-template-columns: 460px 1fr;
}

.payroll-admin-card .form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.payroll-sheet {
    max-width: 980px;
    margin: 0 auto 24px;
    border: 1px solid #f0dfbf;
}

.payroll-sheet-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    border-bottom: 4px solid var(--brand-yellow);
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.payroll-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.payroll-brand img {
    width: 92px;
    height: 92px;
    object-fit: contain;
    background: #fffaf3;
    border-radius: 18px;
    padding: 8px;
}

.payroll-brand h1,
.payroll-brand p,
.payroll-sheet-meta span,
.payroll-sheet-meta strong,
.payroll-sheet-meta small {
    margin: 0;
}

.payroll-brand h1 {
    font-size: 26px;
}

.payroll-sheet-meta {
    text-align: right;
    display: grid;
    gap: 5px;
}

.payroll-sheet-meta span,
.payroll-sheet-meta small {
    color: var(--text-soft);
}

.payroll-employee-band {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.payroll-employee-band div {
    background: #111;
    color: #fff;
    border-radius: 18px;
    padding: 16px;
    display: grid;
    gap: 5px;
}

.payroll-employee-band span {
    color: rgba(255,255,255,.72);
    font-weight: 800;
}

.payroll-employee-band strong {
    color: var(--brand-yellow);
    font-size: 24px;
}

.payroll-summary-print {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payroll-signature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 46px;
}

.payroll-signature-grid div {
    border-top: 2px solid #111;
    padding-top: 8px;
    color: var(--text-soft);
    font-weight: 800;
}

.export-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.export-card {
    margin-bottom: 0;
    display: grid;
    gap: 18px;
    align-content: space-between;
}

.export-card h3 {
    margin: 10px 0 6px;
}

.export-card p,
.export-card small {
    color: var(--text-soft);
}

@media (max-width: 1200px) {
    .attendance-month-summary,
    .payroll-summary-grid,
    .export-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payroll-admin-card .form-grid,
    .attendance-admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .attendance-hero-card {
        background: #111;
    }

    .attendance-hero-main,
    .attendance-calendar-head,
    .payroll-sheet-header,
    .payroll-brand {
        flex-direction: column;
    }

    .attendance-employee-picker,
    .payroll-sheet-meta {
        width: 100%;
        text-align: left;
    }

    .attendance-shift-grid,
    .attendance-stats-grid,
    .attendance-month-summary,
    .payroll-summary-grid,
    .payroll-summary-print,
    .payroll-employee-band,
    .payroll-signature-grid,
    .export-grid {
        grid-template-columns: 1fr;
    }

    .attendance-calendar {
        grid-template-columns: 1fr;
    }

    .attendance-calendar-day-name {
        display: none;
    }

    .attendance-day.is-empty {
        display: none;
    }
}

@media print {
    .payroll-sheet {
        max-width: 100%;
        border: none;
    }

    .payroll-summary-print,
    .payroll-employee-band,
    .payroll-signature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Fase 4.2 · control interno, pagos mixtos y seguridad visual */
.nav-group {
    margin: 4px 0;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}
.nav-group summary {
    cursor: pointer;
    padding: 10px 14px;
    color: rgba(255,255,255,0.78);
    font-weight: 800;
    list-style: none;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group[open] summary { color: #fff; }
.nav-group .nav-link {
    margin: 2px 8px 6px;
    padding-left: 18px;
    font-size: 0.93rem;
}

.mixed-payment-box {
    border: 1px dashed rgba(242,160,38,0.65);
    border-radius: 18px;
    background: #fff9ed;
    padding: 14px;
}
.mini-panel-head {
    margin-bottom: 10px;
    align-items: flex-start;
}
.mini-panel-head h4 {
    margin: 0;
}
.compact-form-grid {
    gap: 12px;
}
.mixed-payment-summary {
    font-weight: 800;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #f0dfbf;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.control-card {
    display: block;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fffaf0, #ffffff);
    border: 1px solid #f0dfbf;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 12px 24px rgba(52, 36, 12, 0.06);
    transition: transform .18s ease, box-shadow .18s ease;
}
.control-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(52, 36, 12, 0.10);
}
.control-card strong {
    display: block;
    font-size: 1.02rem;
    margin-bottom: 6px;
}
.control-card span {
    display: block;
    color: #6f675d;
    line-height: 1.35;
}

.success-soft-row { background: rgba(34, 197, 94, 0.08); }
.danger-soft-row { background: rgba(239, 68, 68, 0.08); }
.report-filter-card { margin-bottom: 18px; }
.login-note { margin-top: 18px; }
.public-invoice-sheet { max-width: 920px; margin-inline: auto; }

@media (max-width: 760px) {
    .control-grid { grid-template-columns: 1fr; }
    .nav-group .nav-link { margin-left: 6px; margin-right: 6px; }
}

/* v4.2.2 ajustes operativos */
.btn-danger {
    background: #8f1d1d;
    color: #fff;
    border: 1px solid #8f1d1d;
}
.btn-danger:hover { filter: brightness(0.95); }
.inline-form { display: inline-flex; margin: 0; }
.actions-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.change-box {
    border: 1px solid var(--border-color, #f1dfbd);
    border-radius: 18px;
    padding: 14px;
    background: #fff9ee;
}
.change-summary,
.mixed-payment-summary {
    align-self: end;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #f1dfbd;
    font-weight: 800;
}
.compact-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-recommendation-panel { border: 1px solid #f1dfbd; }
.employee-action-panel { background: #fffaf0; }
.employee-control-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.schedule-table input[type="time"],
.schedule-table select {
    width: 100%;
    min-width: 110px;
    border: 1px solid #ead8b8;
    border-radius: 12px;
    padding: 10px;
    background: #fff;
}
.schedule-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
}
.schedule-table-form .table-wrap { overflow-x: auto; }
.attendance-hero-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, #fff7e6, #ffffff);
}
.pill-label {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f6a91a;
    color: #111;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 12px;
}
.attendance-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}
.calendar-head-cell,
.calendar-cell {
    border: 1px solid #efd9b5;
    border-radius: 14px;
    padding: 10px;
    min-height: 74px;
    background: #fff;
}
.calendar-head-cell { min-height: auto; font-weight: 900; text-align: center; background: #fff7e6; }
.calendar-cell.is-empty { opacity: .35; background: #f7f7f7; }
.calendar-cell.is-day-off { background: #eef7ef; }
.calendar-cell small { display: block; color: #5d6b5f; margin-top: 4px; }
@media (max-width: 900px) {
    .compact-stats-grid,
    .employee-control-grid { grid-template-columns: 1fr; }
    .attendance-hero-card { align-items: stretch; flex-direction: column; }
    .attendance-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Dashboard admin v4.2.3: resumen en vivo, barras de productos y ventas detalladas */
.admin-dashboard-panel,
.admin-products-panel,
.admin-recent-sales-panel {
    border: 1px solid rgba(242, 160, 38, 0.22);
}

.admin-overview-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    gap: 14px;
}

.admin-metric-card {
    background: linear-gradient(180deg, #ffffff 0%, #fff8ee 100%);
    border: 1px solid #f0dfbf;
    border-radius: 20px;
    padding: 16px;
    display: grid;
    gap: 7px;
    min-height: 138px;
    box-shadow: 0 12px 24px rgba(52, 36, 12, 0.06);
}

.admin-metric-card.is-main {
    background: linear-gradient(180deg, #111 0%, #242424 100%);
    border-color: rgba(242, 160, 38, 0.55);
    color: #fff;
}

.admin-metric-card.is-cash,
.admin-metric-card.is-yappy {
    background: linear-gradient(180deg, #fffaf2 0%, #ffffff 100%);
}

.admin-metric-card span {
    color: var(--text-soft);
    font-weight: 900;
    font-size: 14px;
}

.admin-metric-card.is-main span,
.admin-metric-card.is-main small {
    color: rgba(255, 255, 255, 0.75);
}

.admin-metric-card strong {
    font-size: 27px;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.admin-metric-card.is-main strong {
    color: var(--brand-yellow);
}

.admin-metric-card small {
    color: var(--text-soft);
    line-height: 1.35;
}

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

.product-bar-row {
    display: grid;
    grid-template-columns: minmax(210px, 320px) 1fr;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: #fffaf2;
    border: 1px solid #f0dfbf;
    border-radius: 18px;
    contain: layout paint;
}

.product-bar-info {
    display: grid;
    gap: 4px;
}

.product-bar-info strong {
    font-size: 16px;
}

.product-bar-info small {
    color: var(--text-soft);
    font-weight: 700;
}

.product-bar-track {
    height: 26px;
    border-radius: 999px;
    background: #f1eadb;
    overflow: hidden;
    border: 1px solid rgba(242, 160, 38, 0.16);
}

.product-bar-fill {
    height: 100%;
    min-width: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f2a026, #ffcb72);
    transition: width .3s ease;
}

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

.admin-sale-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(260px, 2fr) minmax(120px, .7fr) minmax(90px, .55fr);
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #eee2ca;
    border-radius: 18px;
    background: #fff;
    contain: layout paint;
}

.admin-sale-id,
.admin-sale-products {
    min-width: 0;
}

.admin-sale-id strong {
    display: block;
    font-size: 15px;
}

.admin-sale-id small {
    color: var(--text-soft);
    display: block;
    margin-top: 3px;
    line-height: 1.35;
}

.admin-sale-products {
    color: #2b2b2b;
    line-height: 1.35;
}

.admin-sale-method {
    justify-self: start;
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 8px 11px;
    font-size: 13px;
    font-weight: 900;
}

.admin-sale-total {
    justify-self: end;
    font-size: 18px;
    font-weight: 900;
    color: var(--brand-black);
    white-space: nowrap;
}

.admin-toggle-btn {
    white-space: nowrap;
}

.is-hidden-by-toggle {
    display: none !important;
}

@media (max-width: 1450px) {
    .admin-overview-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

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

    .product-bar-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

@media (max-width: 900px) {
    .admin-sale-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .admin-sale-method,
    .admin-sale-total {
        justify-self: start;
    }
}

@media (max-width: 768px) {
    .admin-overview-grid {
        grid-template-columns: 1fr;
    }

    .admin-metric-card {
        min-height: auto;
    }

    .admin-metric-card strong {
        font-size: 25px;
    }
}


/* Dashboard empleado v4.2.5: resumen sin gastos, productos, ventas y caja */
.employee-dashboard-panel,
.employee-products-panel,
.employee-recent-sales-panel,
.employee-cash-panel,
.employee-goals-panel {
    border: 1px solid rgba(242, 160, 38, 0.22);
}

.employee-overview-grid {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.employee-cash-list {
    display: grid;
    gap: 12px;
}

.employee-cash-row {
    display: grid;
    grid-template-columns: minmax(200px, 1.4fr) repeat(5, minmax(110px, .75fr));
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #eee2ca;
    border-radius: 18px;
    background: #fffaf2;
}

.employee-cash-row > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.employee-cash-row strong {
    font-size: 15px;
}

.employee-cash-row small,
.employee-cash-row span {
    color: var(--text-soft);
    line-height: 1.35;
}

.employee-cash-row span {
    font-size: 13px;
    font-weight: 900;
}

.employee-cash-row b {
    font-size: 15px;
}

.employee-goal-card .goal-money-row small {
    white-space: nowrap;
}

@media (max-width: 1450px) {
    .employee-overview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .employee-cash-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .employee-overview-grid,
    .employee-goal-grid {
        grid-template-columns: 1fr;
    }

    .employee-cash-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

/* Ventas admin v4.2.6: filtros, lista editable y clientes desde ventas */
.admin-sales-control-panel,
.admin-sales-admin-panel,
.admin-clients-panel {
    border: 1px solid rgba(242, 160, 38, 0.22);
}

.admin-sales-filter-grid {
    grid-template-columns: 220px repeat(3, minmax(180px, 1fr));
    align-items: end;
}

.admin-sales-overview-grid {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.admin-sales-management-list,
.admin-client-list {
    display: grid;
    gap: 12px;
}

.admin-manage-sale-card,
.admin-client-card {
    background: #fff;
    border: 1px solid #eee2ca;
    border-radius: 20px;
    padding: 14px;
    box-shadow: 0 10px 20px rgba(52, 36, 12, 0.04);
}

.admin-manage-sale-main {
    display: grid;
    grid-template-columns: minmax(210px, 1.1fr) minmax(260px, 1.7fr) minmax(160px, .9fr) minmax(100px, .55fr);
    align-items: center;
    gap: 14px;
}

.admin-manage-sale-main strong,
.admin-client-card strong {
    display: block;
    font-size: 15px;
}

.admin-manage-sale-main small,
.admin-client-card small,
.admin-manage-sale-payment small,
.admin-sale-note {
    display: block;
    color: var(--text-soft);
    line-height: 1.35;
    margin-top: 3px;
}

.admin-manage-sale-products {
    line-height: 1.45;
    font-weight: 700;
    color: #242424;
}

.admin-manage-sale-payment {
    display: grid;
    gap: 6px;
    justify-items: start;
}

.admin-sale-note {
    background: #fffaf2;
    border: 1px dashed #efd9b4;
    border-radius: 14px;
    padding: 10px 12px;
    margin: 12px 0 0;
}

.admin-manage-sale-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    margin-top: 12px;
}

.admin-edit-details {
    display: grid;
    justify-items: end;
}

.admin-edit-details summary {
    list-style: none;
}

.admin-edit-details summary::-webkit-details-marker {
    display: none;
}

.admin-edit-sale-form {
    margin-top: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid #f0dfbf;
    background: #fffaf2;
    min-width: min(760px, 86vw);
}

.admin-client-card {
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(130px, .75fr)) auto;
    align-items: center;
    gap: 14px;
}

.admin-client-card.needs-phone {
    background: linear-gradient(180deg, #fff 0%, #fff7ed 100%);
}

.admin-client-card span {
    display: block;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 4px;
}

.admin-client-card b {
    font-size: 15px;
}

.admin-limit-note {
    margin-top: 12px;
}

@media (max-width: 1300px) {
    .admin-sales-filter-grid,
    .admin-sales-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-manage-sale-main,
    .admin-client-card {
        grid-template-columns: 1fr 1fr;
    }

    .admin-sale-total {
        justify-self: start;
    }
}

@media (max-width: 760px) {
    .admin-sales-filter-grid,
    .admin-sales-overview-grid,
    .admin-manage-sale-main,
    .admin-client-card {
        grid-template-columns: 1fr;
    }

    .admin-manage-sale-actions {
        justify-content: flex-start;
    }

    .admin-edit-sale-form {
        min-width: 0;
        width: 100%;
    }
}

/* v4.2.7 cajas por rol */
.cash-action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.cash-history-days {
    display: grid;
    gap: 12px;
}
.cash-day-detail {
    border: 1px solid var(--border-color, #f1dfbd);
    border-radius: 18px;
    background: #fffaf2;
    padding: 0;
    overflow: hidden;
}
.cash-day-detail summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
}
.cash-day-detail summary::-webkit-details-marker { display: none; }
.cash-day-detail summary small {
    display: block;
    color: #5f5a52;
    margin-top: 4px;
}
.cash-day-detail summary b {
    border-radius: 14px;
    background: #f1f1f1;
    padding: 10px 16px;
    white-space: nowrap;
}
.empty-state {
    border: 1px dashed var(--border-color, #f1dfbd);
    border-radius: 18px;
    padding: 18px;
    color: #5f5a52;
    background: #fffaf2;
}
@media (max-width: 760px) {
    .cash-day-detail summary {
        align-items: flex-start;
        flex-direction: column;
    }
    .cash-action-stack {
        align-items: stretch;
        flex-direction: column;
    }
}

/* v4.2.8 aviso de cierre anterior sin bloquear apertura del día */
.notice-box.warning-note {
    border: 1px solid #f1dfbd;
    border-radius: 16px;
    background: #fff7e8;
    padding: 14px 16px;
    margin: 14px 0;
    display: grid;
    gap: 6px;
}
.notice-box.warning-note strong {
    color: #8a5b00;
}
.notice-box.warning-note span {
    color: #4f4a43;
}
.mini-sale-card.is-warning-soft {
    border-color: #f1c878;
    background: #fff7e8;
}

/* v4.3.0 asistencia por horarios creados, calendario oculto y edición admin */
.attendance-admin-intro,
.attendance-schedule-builder,
.attendance-employee-picker {
    border-color: rgba(242, 160, 38, 0.24);
}
.attendance-schedule-builder .form-grid,
.attendance-view-filter {
    align-items: end;
}
.attendance-builder-table input[type="text"],
.attendance-builder-table input[type="time"],
.attendance-builder-table select,
.inline-edit-form input[type="time"] {
    width: 100%;
    border: 1px solid #ead8b8;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}
.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    white-space: nowrap;
}
.inline-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
}
.form-actions-inline {
    display: flex;
    align-items: end;
    gap: 10px;
    min-height: 54px;
}
.inline-edit-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}
.inline-edit-form input[type="time"] {
    max-width: 130px;
}
.calendar-cell.is-no-schedule {
    background: #f5f5f5;
    border-style: dashed;
    color: #777;
}
.calendar-cell.is-no-schedule small {
    color: #777;
}
.attendance-report-print {
    background: #fff;
    border-radius: 18px;
}
.admin-only-print .text-danger,
.text-danger {
    color: #b91c1c;
}
.text-success {
    color: #087a2a;
}
@media (max-width: 900px) {
    .attendance-builder-table,
    .attendance-builder-table tbody,
    .attendance-builder-table tr,
    .attendance-builder-table td {
        display: block;
        width: 100%;
    }
    .attendance-builder-table thead {
        display: none;
    }
    .attendance-builder-table tr {
        border: 1px solid #efd9b5;
        border-radius: 16px;
        margin-bottom: 12px;
        padding: 12px;
        background: #fffaf3;
    }
    .inline-edit-form {
        align-items: stretch;
        flex-direction: column;
    }
    .inline-edit-form input[type="time"] {
        max-width: none;
    }
}
@media print {
    .sidebar,
    .mobile-topbar,
    .sidebar-overlay,
    .page-header,
    .flash,
    .no-print,
    #crear-horario,
    #crear-empleado,
    .attendance-view-filter,
    #registros-llegada,
    .actions-row {
        display: none !important;
    }
    .app-shell,
    .main-content {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }
    .panel-card,
    .attendance-report-print {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .attendance-calendar {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }
    .calendar-cell,
    .calendar-head-cell {
        min-height: 60px !important;
        padding: 6px !important;
    }
}
.attendance-hero-card,
.attendance-hero-card h3,
.attendance-hero-card p,
.attendance-hero-card .muted {
    color: #111;
}
.attendance-hero-card p,
.attendance-hero-card .muted {
    color: #5f5a52;
}
