:root {
    --bg: #f8fafc;
    --surface: #fff;
    --surface-soft: #fbfcfd;
    --border: #e8ecf0;

    --text: #20242a;
    --muted: #737b86;

    --primary: #2f3742;
    --primary-hover: #242b34;

    --success: #2f7d5b;
    --warning: #a66a13;
    --danger: #b54747;
    --info: #416e9c;

    --shadow: 0 6px 22px rgba(31, 41, 55, 0.045);

    --radius: 15px;
    --radius-sm: 10px;

    --sidebar: 248px;
    --topbar: 68px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);
}

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

button {
    cursor: pointer;
}

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

/* =========================
   APP
   ========================= */

.app-shell {
    min-height: 100vh;

    display: grid;
    grid-template-columns:
        var(--sidebar)
        minmax(0, 1fr);
}

/* =========================
   SIDEBAR
   ========================= */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;

    width: var(--sidebar);

    background: #fff;
    border-right: 1px solid var(--border);

    padding: 17px 13px;

    z-index: 50;

    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 4px 9px 20px;
}

.brand-mark {
    width: 34px;
    height: 34px;

    border-radius: 10px;

    background: #313943;
    color: #fff;

    display: grid;
    place-items: center;

    font-size: 12px;
    font-weight: 800;
}

.brand strong {
    display: block;
    font-size: 14px;
}

.brand span {
    display: block;

    color: var(--muted);
    font-size: 10px;

    margin-top: 2px;
}

.nav-section {
    color: #a0a7b0;

    text-transform: uppercase;
    letter-spacing: 0.09em;

    font-size: 9px;
    font-weight: 750;

    padding: 12px 10px 6px;
}

.nav {
    display: grid;
    gap: 2px;
}

.nav button {
    width: 100%;

    border: 0;
    background: transparent;

    color: #5e6670;

    text-align: left;

    padding: 9px 10px;

    border-radius: 9px;

    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 12.5px;
}

.nav button:hover {
    background: #f5f7f9;
    color: var(--text);
}

.nav button.active {
    background: #eef2f5;
    color: #29313a;
    font-weight: 650;
}

.nav-icon {
    width: 18px;
    text-align: center;
    opacity: 0.72;
}

.sidebar-bottom {
    margin-top: auto;

    border-top: 1px solid var(--border);

    padding-top: 11px;
}

.profile-nav {
    margin-bottom: 4px;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 8px;
}

.user-mini strong {
    display: block;
    font-size: 11.5px;
}

.user-mini span {
    display: block;

    color: var(--muted);
    font-size: 10px;

    margin-top: 2px;
}

/* =========================
   AVATAR
   ========================= */

.avatar {
    width: 33px;
    height: 33px;

    border-radius: 50%;

    background: #edf0f3;
    color: #424a54;

    display: grid;
    place-items: center;

    font-weight: 700;
    font-size: 11px;

    flex: 0 0 auto;
}

.avatar.large {
    width: 54px;
    height: 54px;

    font-size: 15px;
}

/* =========================
   MAIN / TOPBAR
   ========================= */

.main {
    grid-column: 2;
    min-width: 0;
}

.topbar {
    height: var(--topbar);

    background: rgba(255, 255, 255, 0.94);

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 28px;

    position: sticky;
    top: 0;

    z-index: 30;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 13px;
}

.mobile-menu {
    display: none;
}

.page-title {
    font-size: 14px;
    font-weight: 700;
}

.breadcrumb {
    color: #9aa1aa;
    font-size: 10px;
    margin-top: 2px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-button {
    border: 1px solid var(--border);
    background: #fff;

    border-radius: 10px;

    padding: 4px 9px 4px 4px;

    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 11.5px;
}

/* =========================
   CONTENT
   ========================= */

.content {
    max-width: 1540px;

    margin: 0 auto;

    padding: 27px 30px 52px;
}

/* Contenedor aislado de la pantalla de acceso; evita estilos inline. */
.login-content {
    max-width: 440px;
    margin: 8vh auto;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}

.page-head h1 {
    font-size: 24px;

    margin: 0 0 5px;

    letter-spacing: -0.035em;
}

.page-head p {
    margin: 0;

    color: var(--muted);

    font-size: 12px;
}

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

/* =========================
   BUTTONS
   ========================= */

.btn {
    border: 1px solid var(--border);
    background: #fff;

    color: #4b535d;

    border-radius: 9px;

    padding: 8px 12px;

    font-size: 11.5px;
    font-weight: 600;

    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.01);
}

.btn:hover {
    background: #f8fafb;
}

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

    color: #fff;
}

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

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

.btn.small {
    padding: 6px 9px;
    font-size: 10.5px;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.full-width {
    width: 100%;
    margin-top: 8px;
}

.icon-btn {
    border: 1px solid var(--border);
    background: #fff;

    width: 32px;
    height: 32px;

    border-radius: 9px;

    color: #5d6670;
}

.icon-btn:hover {
    background: #f6f7f8;
}

/* =========================
   GRIDS
   ========================= */

.grid {
    display: grid;
    gap: 13px;
}

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

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

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

.gap-top {
    margin-top: 14px;
}

/* =========================
   CARDS
   ========================= */

.card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.card-pad {
    padding: 19px;
}

/* =========================
   METRICS
   ========================= */

.metric {
    padding: 17px 18px;
    min-height: 125px;
}

.metric-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-icon {
    width: 28px;
    height: 28px;

    border-radius: 8px;

    background: #f3f5f7;

    display: grid;
    place-items: center;

    color: #626b75;
    font-size: 12px;
}

.metric-label {
    font-size: 11px;
    color: #737b85;
}

.metric-value {
    font-size: 23px;
    font-weight: 760;

    letter-spacing: -0.035em;

    margin-top: 12px;
}

.metric-hint {
    font-size: 10px;
    color: #9aa1aa;

    margin-top: 4px;
}

/* =========================
   DASHBOARD
   ========================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        1.02fr
        0.98fr;

    gap: 14px;

    margin-top: 14px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 14px;
}

.section-title h2 {
    font-size: 13px;
    margin: 0;
}

.section-title span {
    display: block;

    color: #9aa1aa;

    font-size: 10px;

    margin-top: 3px;
}

.summary-list {
    display: grid;
    gap: 2px;
}

.summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 11px 0;

    border-bottom: 1px solid #f0f2f4;
}

.summary-line:last-child {
    border-bottom: 0;
}

.summary-line div {
    display: grid;
    gap: 3px;
}

.summary-line strong {
    font-size: 11.5px;
}

.summary-line span {
    font-size: 9.5px;
    color: #9aa1aa;
}

.summary-line b {
    font-size: 12px;
}

.summary-line .emphasis {
    font-size: 14px;
}

.quick-actions {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    padding: 11px 0;

    border-bottom: 1px solid #f0f2f4;
}

.setting-row:last-child {
    border-bottom: 0;
}

.setting-row strong {
    font-size: 11.5px;
}

.setting-row p {
    margin: 4px 0 0;

    color: #929aa3;

    font-size: 10px;
}

.empty {
    padding: 24px;

    text-align: center;

    color: #9aa1aa;

    font-size: 11px;
}

.large-empty {
    padding: 54px 20px;
}

/* =========================
   TABLES
   ========================= */

.table-wrap {
    overflow: auto;
}

.table-wrap table {
    width: 100%;

    border-collapse: collapse;

    min-width: 720px;
}

.table-wrap th {
    font-size: 9.5px;

    text-transform: uppercase;
    letter-spacing: 0.04em;

    color: #98a0a9;

    font-weight: 700;

    text-align: left;

    padding: 10px 9px;

    border-bottom: 1px solid var(--border);

    white-space: nowrap;
}

.table-wrap td {
    font-size: 11px;

    padding: 11px 9px;

    border-bottom: 1px solid #f0f2f4;

    vertical-align: middle;
}

.table-wrap tr:last-child td {
    border-bottom: 0;
}

.table-sub {
    display: block;

    color: #a0a7af;

    font-size: 9px;

    margin-top: 3px;
}

/* =========================
   TOOLBAR
   ========================= */

.toolbar {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-bottom: 14px;

    flex-wrap: wrap;
}

.search {
    flex: 1;
    min-width: 220px;
}

.search input,
.toolbar select,
.toolbar label input,
.toolbar label select {
    width: 100%;
    height: 34px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: #fff;

    padding: 0 10px;

    font-size: 11px;

    color: var(--text);
}

.toolbar label {
    display: grid;
    gap: 4px;

    font-size: 9px;

    color: #9098a1;

    min-width: 130px;
}

/* =========================
   FILTER TOOLBAR (reutilizable)
   ========================= */

.filter-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 240px;
}

.filter-field-select {
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0 10px;
    font-size: 11px;
    color: var(--text);
    min-width: 130px;
}

.filter-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.filter-search-icon {
    position: absolute;
    left: 10px;
    font-size: 12px;
    color: #9aa1aa;
    pointer-events: none;
}

.filter-input-wrap input {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0 12px 0 28px;
    font-size: 11px;
    color: var(--text);
    outline: 0;
}

.filter-input-wrap input:focus {
    border-color: #c7ced6;
    box-shadow: 0 0 0 3px rgba(55, 65, 81, 0.05);
}

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

.filter-panel {
    background: #f8f9fa;
    border: 1px solid #eef1f3;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.filter-panel .field label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9098a1;
}

.filter-panel .field input,
.filter-panel .field select {
    height: 34px;
    font-size: 11px;
}

@media (max-width: 640px) {
    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-search {
        flex-direction: column;
        align-items: stretch;
        min-width: 0;
    }
    .filter-field-select {
        width: 100%;
    }
    .filter-panel {
        grid-template-columns: 1fr;
    }
}

/* =========================
   BADGES
   ========================= */

.badge {
    display: inline-flex;
    align-items: center;

    border-radius: 999px;

    padding: 4px 7px;

    font-size: 9px;
    font-weight: 700;

    white-space: nowrap;
}

.badge.success {
    background: #edf7f2;
    color: var(--success);
}

.badge.warning {
    background: #fff6e8;
    color: var(--warning);
}

.badge.danger {
    background: #fff0f0;
    color: var(--danger);
}

.badge.info {
    background: #eef4fa;
    color: var(--info);
}

/* =========================
   NOTICES
   ========================= */

.notice {
    padding: 11px 12px;

    border-radius: 10px;

    font-size: 10.5px;

    line-height: 1.5;
}

.notice-neutral {
    background: #f6f8fa;

    border: 1px solid #edf0f3;

    color: #66707b;
}

.notice-warning {
    background: #fff8ed;

    border: 1px solid #f7ead2;

    color: #8c601c;
}

.notice-info {
    background: #f1f6fb;

    border: 1px solid #e0eaf3;

    color: #476987;
}

.notice-danger {
    background: #fff0f0;

    border: 1px solid #f0d0d0;

    color: #8c1c1c;
}

.page-notice {
    margin: -6px 0 14px;
}

/* =========================
   SALES
   ========================= */

.sale-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        320px;

    gap: 14px;
}

.sticky-card {
    align-self: start;

    position: sticky;
    top: 88px;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 16px;
    align-items: start;
}

.sale-form-grid {
    align-items: start;
}

.field {
    display: grid;
    gap: 7px;
    align-content: start;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    font-size: 10.5px;

    font-weight: 650;

    color: #5d6670;
    letter-spacing: 0.01em;
}
.field label .req {
    color: var(--danger);
    margin-left: 3px;
    font-weight: 800;
}

.field input,
.field select,
.field textarea {
    width: 100%;

    border: 1px solid var(--border);

    background: #fff;

    border-radius: 10px;

    padding: 10px 11px;

    outline: 0;

    font-size: 12px;

    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #a8b0ba;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #c7ced6;

    box-shadow:
        0 0 0 3px
        rgba(55, 65, 81, 0.06);
    background: #fff;
}

.field textarea {
    min-height: 78px;
    resize: vertical;
    line-height: 1.5;
}

.field small {
    font-size: 10px;
    color: #8f98a3;
    line-height: 1.4;
}

.section-space {
    margin-top: 23px;
}

/* Nueva venta — cabecera y combobox */
.sale-main-card {
    padding: 22px;
    overflow: visible;
}
.sale-main-card .form-grid,
.sale-main-card .field,
.sale-main-card .client-combobox {
    overflow: visible;
}
.sale-form-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f0f2f4;
}
.sale-form-kicker {
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #3a434e;
}
.sale-form-hint {
    font-size: 10.5px;
    color: #9aa1aa;
}

.client-field {
    align-content: start;
    position: relative;
    z-index: 10;
}
.client-combobox {
    display: grid;
    gap: 6px;
}
.client-combobox-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.client-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.client-input-wrap input#client-search {
    padding-left: 36px;
    height: 42px;
    font-size: 12px;
    border-radius: 10px;
    background: #fff;
}
.client-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #9aa1aa;
    pointer-events: none;
    line-height: 1;
}
.client-add-btn {
    height: 42px;
    padding: 0 14px;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 10px;
    font-weight: 650;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.client-add-btn:hover {
    background: #f8fafb;
    border-color: #d7dde3;
}

.client-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 50;
    display: none;
    gap: 4px;
    max-height: 260px;
    overflow: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid #e6eaed;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(31,41,55,0.11), 0 4px 10px rgba(31,41,55,0.06);
    scrollbar-width: thin;
    scrollbar-color: #d7dde3 transparent;
}
.client-results.is-open {
    display: grid;
}
.client-results::-webkit-scrollbar {
    width: 6px;
}
.client-results::-webkit-scrollbar-thumb {
    background: #d7dde3;
    border-radius: 99px;
}
.client-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 9px 10px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.client-option:hover {
    background: #f5f7f9;
    border-color: #eef1f3;
}
.client-option.is-selected {
    background: #eef2f5;
    border-color: #cbd5de;
    box-shadow: 0 0 0 1px #cbd5de inset;
}
.client-option-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.client-option-main strong {
    font-size: 12px;
    font-weight: 650;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.client-option-main span {
    font-size: 10.5px;
    color: #7d8690;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.client-option-check {
    font-size: 11px;
    color: var(--primary);
    font-weight: 800;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}
.client-empty {
    padding: 14px 10px;
    text-align: center;
    font-size: 11px;
    color: #9aa1aa;
    line-height: 1.5;
}

/* Select elegante */
.select-wrap {
    position: relative;
}
.select-wrap select {
    height: 42px;
    padding-right: 32px;
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #9aa1aa 50%), linear-gradient(135deg, #9aa1aa 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 13px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
.payment-field .select-wrap select {
    font-weight: 650;
    letter-spacing: 0.02em;
    color: #2e353d;
}

/* Crédito preview / info — fuentes normalizadas en nueva venta */
.credito-preview {
    font-family: inherit;
    font-size: 11px;
    line-height: 1.7;
    background: #f8f9fa;
    border: 1px solid #eef1f3;
    border-radius: 10px;
    padding: 12px 14px;
    color: #4b535d;
}
.sale-preview-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
    font-size: 11px;
    line-height: 1.6;
}
.sale-preview-row span {
    color: var(--muted);
    font-weight: 400;
}
.sale-preview-row strong {
    font-weight: 650;
    color: var(--text);
}
.sale-notice {
    margin-bottom: 8px;
    font-size: 11px;
    line-height: 1.5;
    font-family: inherit;
}
.sale-notice-detail {
    font-size: 11px;
    line-height: 1.5;
    font-family: inherit;
}
.sale-muted-text {
    font-size: 11px;
    line-height: 1.5;
    color: var(--muted);
    font-family: inherit;
}
#credito-info .notice {
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.5;
    font-family: inherit;
}
#credito-info .notice span {
    font-size: 11px;
}

/* Productos header */
.sale-products-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0 0;
    border-top: 1px solid #f0f2f4;
    margin-top: 22px;
}
.sale-products-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.sale-products-title h2 {
    font-size: 13px;
    margin: 0;
    letter-spacing: -0.01em;
}
.sale-products-title span {
    font-size: 10.5px;
    color: #9aa1aa;
    background: #f5f7f9;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.sale-products-hint {
    font-size: 11px;
    color: var(--muted);
}
.sale-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 650;
}

.sale-items {
    display: grid;
    gap: 7px;
}

.sale-item {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        82px
        105px
        32px;

    align-items: center;

    gap: 10px;

    border: 1px solid #eef1f3;

    border-radius: 10px;

    padding: 9px;
}

.sale-item strong {
    font-size: 11px;
}

.sale-item small {
    display: block;

    color: #9aa1aa;

    font-size: 9px;

    margin-top: 3px;
}

.sale-item input {
    width: 100%;
    height: 32px;

    border: 1px solid var(--border);

    border-radius: 8px;

    padding: 0 8px;

    font-size: 12px;
    text-align: center;
    font-weight: 600;
    background: #fbfcfd;
}
.sale-item input:focus {
    background: #fff;
    border-color: #c7ced6;
    box-shadow: 0 0 0 3px rgba(55,65,81,0.06);
    outline: 0;
}
.sale-item-info {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.sale-item-info strong {
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sale-item-info small {
    font-size: 10px;
    color: #8f98a3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0;
}
.sale-item-total {
    font-size: 12px;
    text-align: right;
    font-weight: 750;
    letter-spacing: -0.02em;
}
.sale-item-del {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 14px;
    line-height: 1;
}
.sale-item-del:hover {
    background: #fff0f0;
    border-color: #f0d0d0;
    color: var(--danger);
}
.sale-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 22px;
    border: 1px dashed #e6eaed;
    border-radius: 12px;
    background: #fcfdfe;
    color: #8f98a3;
    text-align: left;
}
.sale-empty-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f0f3f5;
    display: grid;
    place-items: center;
    font-size: 16px;
    color: #9aa1aa;
    flex-shrink: 0;
}
.sale-empty strong {
    display: block;
    font-size: 12px;
    color: #5d6670;
    margin-bottom: 2px;
}
.sale-empty span {
    font-size: 11px;
    line-height: 1.4;
}

.payment-summary {
    display: grid;
    gap: 0;
}

.payment-summary > div {
    display: flex;
    justify-content: space-between;

    padding: 10px 0;

    border-bottom: 1px solid #f0f2f4;

    font-size: 10.5px;
}

.payment-summary b {
    font-size: 11px;
}

.payment-summary .total-row {
    font-size: 13px;

    border-bottom: 0;

    padding-top: 15px;
}

.payment-summary .total-row b {
    font-size: 17px;
}

/* =========================
   CASH
   ========================= */

.cash-summary-grid {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 10px;
}

.cash-box {
    background: #fafbfc;

    border: 1px solid #eef1f3;

    border-radius: 10px;

    padding: 13px;
}

.cash-box span {
    display: block;

    font-size: 10px;

    color: #7d8690;
}

.cash-box b {
    display: block;

    font-size: 17px;

    margin: 8px 0 4px;
}

.cash-box small {
    display: block;

    color: #a0a7af;

    font-size: 9px;
}

/* =========================
   CHARTS
   ========================= */

.chart {
    height: 245px;
    overflow: hidden;

    display: grid;

    grid-template-rows:
        1fr
        auto;

    gap: 7px;
}

.chart-small {
    height: 215px;
}

.chart svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden;

    color: #65707b;
}

.chart svg line {
    stroke: #eef1f3;
    stroke-width: 1;
}

.chart svg polyline {
    stroke: #4c5661;
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart svg circle {
    fill: #4c5661;
}

.chart-labels {
    display: flex;
    justify-content: space-between;

    color: #a0a7af;

    font-size: 9px;
}

.bar-chart {
    display: grid;

    gap: 17px;

    padding: 12px 0;
}

.bar-row > div:first-child {
    display: flex;
    justify-content: space-between;

    font-size: 10px;

    margin-bottom: 6px;
}

.bar-row b {
    font-size: 9px;
    color: #8d959e;
}

.bar-track {
    height: 9px;

    background: #eef1f3;

    border-radius: 99px;

    overflow: hidden;
}

.bar-track i {
    display: block;

    height: 100%;

    background: #68727d;

    border-radius: 99px;
}

.chart-controls {
    display: grid;

    grid-template-columns:
        1fr
        1fr
        1fr;

    gap: 13px;
}

.donut-wrap {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 35px;

    min-height: 245px;
}

.donut {
    width: 170px;
    height: 170px;

    border-radius: 50%;

    background:
        conic-gradient(
            #5d6873 0 52%,
            #a8b0b8 52% 84%,
            #dfe3e7 84% 100%
        );

    display: grid;
    place-items: center;
}

.donut:after {
    content: "";

    width: 106px;
    height: 106px;

    background: #fff;

    border-radius: 50%;

    position: absolute;
}

.donut span {
    position: relative;
    z-index: 1;

    text-align: center;

    font-size: 21px;

    font-weight: 750;
}

.donut small {
    display: block;

    font-size: 9px;

    color: #9aa1aa;

    font-weight: 500;
}

.legend {
    display: grid;

    gap: 9px;

    font-size: 10px;

    color: #69727c;
}

.legend i {
    display: inline-block;

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #7c8792;

    margin-right: 7px;
}

.columns {
    height: 250px;

    display: flex;
    align-items: flex-end;
    justify-content: space-around;

    gap: 12px;

    padding: 15px 20px;
}

.columns > div {
    height: 100%;

    flex: 1;

    display: flex;
    flex-direction: column;

    justify-content: flex-end;
    align-items: center;

    gap: 7px;
}

.columns i {
    width: min(34px, 70%);

    background: #68737e;

    border-radius:
        6px 6px
        2px 2px;
}

.columns span {
    font-size: 9px;
    color: #9aa1aa;
}

/* =========================
   PROFILE
   ========================= */

.profile-grid {
    display: grid;

    grid-template-columns:
        0.8fr
        1.2fr;

    gap: 14px;
}

.profile-head {
    display: flex;
    align-items: center;

    gap: 13px;
}

.profile-head h2 {
    font-size: 16px;

    margin: 0 0 4px;
}

.profile-head p {
    font-size: 10.5px;

    color: #8f979f;

    margin: 0 0 7px;
}

/* =========================
   SWITCH
   ========================= */

.switch {
    width: 36px;
    height: 20px;

    border-radius: 99px;

    border: 0;

    background: #dfe3e7;

    position: relative;
}

.switch:after {
    content: "";

    position: absolute;

    width: 16px;
    height: 16px;

    border-radius: 50%;

    background: #fff;

    left: 2px;
    top: 2px;

    box-shadow:
        0 1px 3px
        rgba(0, 0, 0, 0.15);
}

.switch.on {
    background: #65717c;
}

.switch.on:after {
    left: 18px;
}

.future-list {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}

.future-list span {
    padding: 8px 10px;

    border: 1px dashed #dfe3e7;

    border-radius: 8px;

    color: #8a929b;

    font-size: 10px;

    background: #fcfdfe;
}

/* =========================
   ROLES
   ========================= */

.role-card {
    padding: 20px;
}

.role-card .role-icon {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: #f0f3f5;

    color: #5f6974;

    font-weight: 750;
}

.role-card h2 {
    font-size: 14px;

    margin: 16px 0 5px;
}

.role-card p {
    font-size: 10.5px;

    color: #8f979f;

    line-height: 1.55;

    min-height: 49px;
}

.role-card b {
    font-size: 9px;
    color: #7b858f;
}

/* =========================
   MODAL
   ========================= */

.modal-backdrop {
    position: fixed;

    inset: 0;

    background: rgba(24, 30, 36, 0.24);

    z-index: 100;

    display: grid;
    place-items: center;

    padding: 18px;
}

.modal {
    width: min(600px, 100%);

    max-height: 90vh;

    overflow: auto;

    background: #fff;

    border: 1px solid var(--border);

    border-radius: 15px;

    box-shadow:
        0 20px 60px
        rgba(20, 25, 30, 0.16);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 15px 17px;

    border-bottom: 1px solid var(--border);

    font-size: 13px;
}

.modal-body {
    padding: 18px;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;

    gap: 8px;

    padding: 12px 17px;

    border-top: 1px solid var(--border);
}

/* =========================
   TOAST
   ========================= */

.toast {
    position: fixed;

    right: 20px;
    bottom: 20px;

    z-index: 200;

    background: #2e353d;
    color: #fff;

    padding: 10px 13px;

    border-radius: 9px;

    font-size: 11px;

    box-shadow:
        0 8px 25px
        rgba(0, 0, 0, 0.16);
}

/* =========================
   RESPONSIVE
   ========================= */

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

    .cash-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .sale-layout {
        grid-template-columns: 1fr;
    }

    .sticky-card {
        position: static;
    }
}

.menu-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 70;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    background: #5d6670;
    border-radius: 2px;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: #f8f9fa;
    border: 1px solid #eef1f3;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 6px;
}

.admin-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-role-badge {
    font-size: 11px;
    color: #65707b;
    white-space: nowrap;
}

.user-info-grid {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.6;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 820px) {
    :root {
        --sidebar: 248px;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);

        transition:
            transform 0.18s ease;

        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);

        box-shadow:
            8px 0 30px
            rgba(0, 0, 0, 0.08);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 32, 0.18);
        z-index: 40;
        backdrop-filter: blur(1px);
    }

    .main {
        margin-left: 0;
    }

    .mobile-menu {
        display: inline-grid;
        place-items: center;
    }

    .menu-toggle {
        display: flex;
    }

    .topbar {
        padding: 0 16px 0 56px;
    }

    .content {
        padding: 21px 16px 40px;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .hide-mobile {
        display: none;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .chart-controls {
        grid-template-columns: 1fr;
    }

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

    .field.full {
        grid-column: auto;
    }

    .sale-item {
        grid-template-columns:
            1fr
            70px
            85px
            30px;
    }
}

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

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

    .profile-button span {
        display: none;
    }

    .top-actions {
        gap: 4px;
    }

    .content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .card-pad {
        padding: 15px;
    }
    .sale-main-card {
        padding: 16px;
    }
    .sale-form-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .client-combobox-row {
        flex-direction: column;
        align-items: stretch;
    }
    .client-add-btn {
        width: 100%;
        justify-content: center;
    }
    .sale-products-head {
        flex-direction: column;
        align-items: stretch;
    }
    .sale-add-btn {
        width: 100%;
        justify-content: center;
    }

    .page-head h1 {
        font-size: 21px;
    }

    .metric-value {
        font-size: 20px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .donut-wrap {
        flex-direction: column;
        gap: 15px;
    }

    .vertical-mobile {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Montos monetarios: campo de entrada, no contador (sin flechas). */
input[data-monto]::-webkit-outer-spin-button,
input[data-monto]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[data-monto] {
    -moz-appearance: textfield;
    appearance: textfield;
}
