/* Shared interface materials, typography and controls. */
:root {
  --background: #f5f5f7;
  --foreground: #1d1d1f;
  --card: #ffffff;
  --card-foreground: #1d1d1f;
  --primary: #0071e3;
  --primary-hover: #005bb5;
  --primary-soft: #eaf3ff;
  --primary-foreground: #ffffff;
  --muted: #f0f0f3;
  --muted-foreground: #65656b;
  --border: #e2e2e7;
  --input: #d2d2d7;
  --sidebar: rgba(239, 240, 244, .78);
  --sidebar-foreground: #414148;
  --sidebar-muted: #64646b;
  --sidebar-accent: rgba(0, 113, 227, .1);
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 2px 4px rgba(25, 28, 42, .03), 0 14px 40px rgba(25, 28, 42, .06);
}

@media screen {
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    letter-spacing: -.012em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  button, input, select, textarea { font: inherit; }
  a { color: var(--primary); }
  .app-shell { background: var(--background); }
  .app-main { padding: 36px 40px 48px; }
  .sidebar {
    width: 256px;
    min-width: 256px;
    padding: 24px 14px 18px;
    background: var(--sidebar);
    border-right: 1px solid rgba(100, 100, 115, .1);
    box-shadow: inset -1px 0 rgba(255, 255, 255, .6);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
  }
  .sidebar-brand { gap: 11px; padding: 0 12px 32px; }
  .brand-mark {
    background: #1d1d1f;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .15);
    box-shadow: 0 3px 8px rgba(0, 0, 0, .08), inset 0 1px rgba(255, 255, 255, .12);
    border-radius: 12px;
    font-weight: 650;
  }
  .small-mark { width: 36px; height: 36px; }
  .brand-copy strong { font-size: 16px; font-weight: 650; letter-spacing: -.025em; }
  .brand-copy small { font-size: 11px; color: var(--sidebar-muted); margin-top: 2px; }
  .nav-label { font-size: 11px; letter-spacing: .015em; font-weight: 600; color: #73737a; padding: 0 12px; margin: 20px 0 8px; }
  .nav-label:first-child { margin-top: 0; }
  .nav-link { min-height: 42px; padding: 10px 12px; margin: 2px 0; border-radius: 10px; gap: 11px; font-size: 13px; font-weight: 500; }
  .sidebar .nav-link svg, .sidebar .nav-link:first-of-type svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; opacity: 1; }
  .nav-link:hover { background: rgba(90, 90, 110, .065); color: var(--foreground); }
  .sidebar .nav-link.active { background: rgba(0, 113, 227, .1); color: #0064c7; box-shadow: none; font-weight: 600; }
  .nav-submenu { margin: 6px 0 10px 30px; gap: 3px; }
  .nav-submenu a { padding: 8px 10px; font-size: 12px; line-height: 1.35; }
  .nav-submenu a:hover { color: var(--foreground); background: rgba(90, 90, 110, .065); }
  .nav-detail { border-top-color: rgba(100, 100, 115, .12); }
  .sidebar-collapse { width: 27px; height: 27px; border-color: var(--border); background: rgba(255, 255, 255, .86); color: #7b7b82; box-shadow: 0 2px 6px rgba(0, 0, 0, .04); }
  .sidebar-footer { border-top: 1px solid rgba(100, 100, 115, .12); padding: 17px 9px 0; }
  .avatar { width: 32px; height: 32px; border-radius: 50%; background: #e2e3e9; color: #6b6d76; }
  .avatar svg { width: 17px; height: 17px; }
  .user-chip strong { font-size: 12px; font-weight: 600; }
  .user-chip small { font-size: 10px; color: var(--muted-foreground); }
  .btn-icon { color: #73737a; }
  .mobile-nav-trigger { border-radius: 12px; background: rgba(255, 255, 255, .85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-color: rgba(0, 0, 0, .06); box-shadow: 0 3px 12px rgba(0, 0, 0, .06); }
  .sidebar-overlay { background: rgba(29, 29, 31, .2); }
  .topbar { align-items: center; margin-bottom: 28px; }
  .topbar h1, .page-header h1 { font-size: clamp(26px, 2.4vw, 34px); font-weight: 650; letter-spacing: -.04em; line-height: 1.15; margin: 0 0 8px; }
  .eyebrow { color: #73737a; font-size: 11px; font-weight: 600; letter-spacing: .04em; margin-bottom: 10px; }
  .topbar .eyebrow { display: none; }
  .page-description { font-size: 13px; color: var(--muted-foreground); line-height: 1.6; }
  .btn { border-radius: 10px; font-size: 13px; font-weight: 550; padding: 9px 16px; min-height: 36px; letter-spacing: -.01em; }
  .btn-primary { --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-border-color: var(--primary-hover); box-shadow: 0 1px 2px rgba(0, 75, 160, .14), inset 0 1px rgba(255, 255, 255, .12); }
  .btn-primary:hover { box-shadow: 0 2px 5px rgba(0, 75, 160, .16); }
  .btn-light, .btn-outline-secondary { background: rgba(255, 255, 255, .88); color: #424249; border: 1px solid #dedee3; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
  .btn-light:hover, .btn-outline-secondary:hover { color: var(--foreground); background: #fff; border-color: #bcbcc4; }
  .form-control, .form-select { border-radius: 10px; border-color: var(--input); min-height: 38px; background-color: #fff; font-size: 13px; }
  .form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 113, 227, .15); }
  .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
  input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
  .panel, .metric-card { border: 1px solid rgba(30, 30, 40, .07); box-shadow: 0 1px 3px rgba(20, 20, 30, .025); border-radius: 16px; }
  .panel-header { padding: 20px 22px; border-bottom-color: #eeeef1; }
  .panel-header h2 { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
  .panel-header p { font-size: 12px; margin-top: 4px; }
  .metrics-grid { gap: 16px; }
  .metric-card { padding: 22px; }
  .metric-card>strong { font-size: 30px; letter-spacing: -.04em; font-weight: 600; font-variant-numeric: tabular-nums; }
  .metric-head { font-size: 12px; }
  .metric-card small { font-size: 11px; }
  .metric-icon { border-radius: 10px; font-weight: 500; }
  .metric-icon-primary { background: var(--primary-soft); color: var(--primary); }
  .control-strip { background: rgba(255, 255, 255, .7); border-color: rgba(30, 30, 40, .07); border-radius: 14px; padding: 14px 18px; }
  .period-switch { border: none; padding: 3px; border-radius: 9px; background: #eaeaef; gap: 2px; }
  .period-switch button { border-radius: 7px; padding: 7px 14px; font-size: 12px; color: #616168; font-weight: 500; }
  .period-switch button[aria-pressed="true"] { background: #fff; color: var(--foreground); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
  .app-table { font-size: 13px; }
  .app-table th { background: #fafafa; color: #6e6e73; font-size: 11px; font-weight: 600; letter-spacing: .015em; border-bottom: 1px solid #eaeaef; }
  .app-table td { border-bottom-color: #eeeef1; padding-top: 16px; padding-bottom: 16px; }
  .table-value, .app-table td strong { font-weight: 550; }
  .row-action { background: var(--primary-soft); color: var(--primary-hover); border-radius: 8px; font-size: 12px; font-weight: 550; }
  .catalog-action, .inventory-action, .client-action { border-radius: 14px; background: #fff; border-color: rgba(30, 30, 40, .07); box-shadow: none; }
  .action-icon { border-radius: 11px; background: var(--primary-soft); color: var(--primary); }
  .status-badge { border-radius: 7px; font-size: 11px; font-weight: 550; }
  .app-alert { border-radius: 12px; box-shadow: none; font-size: 13px; }
  .filter-bar, .catalog-filters, .inventory-filters { background: #fff; border-radius: 12px; }

  /* Launcher and preference controls */
  .workspace-main { max-width: none; padding: 0 42px 48px; }
  .workspace-toolbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; color: #73737a; font-size: 13px; border-bottom: 1px solid rgba(100, 100, 115, .1); }
  .workspace-account { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #61616a; background: #e8e8ed; border: 1px solid rgba(100, 100, 115, .06); }
  .workspace-account:hover { background: #dddde5; color: var(--foreground); }
  .workspace-account svg { width: 16px; height: 16px; }
  .home-page .app-shell, .standalone-page .app-shell { display: block; }
  .home-page .workspace-main { max-width: 1200px; margin: 0 auto; }
  .home-page .workspace-header { text-align: center; justify-content: center; }
  .home-page .workspace-toolbar { padding-left: 0; }
  .standalone-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--foreground); text-decoration: none; }
  .standalone-brand strong { font-size: 16px; font-weight: 600; }
  .standalone-toolbar { max-width: 1200px; min-height: 80px; margin: 0 auto; padding: 0 40px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--border); }
  .standalone-title { color: var(--muted-foreground); font-size: 13px; }
  .standalone-actions { margin-left: auto; display: flex; align-items: center; gap: 22px; }
  .standalone-actions>a { font-size: 12px; text-decoration: none; }
  .standalone-page .app-main { max-width: 1200px; margin: 0 auto; overflow: visible; }
  .standalone-page .workspace-content { margin-top: 24px; }
  .profile-menu { position: relative; z-index: 30; }
  .profile-menu summary { list-style: none; cursor: pointer; }
  .profile-menu summary::-webkit-details-marker { display: none; }
  .profile-menu[open]>summary { background: #dddde6; }
  .profile-dropdown { position: absolute; right: 0; top: calc(100% + 12px); width: 232px; padding: 8px; border: 1px solid rgba(40, 40, 50, .1); border-radius: 16px; background: rgba(255, 255, 255, .94); box-shadow: 0 12px 36px rgba(20, 20, 35, .13); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
  .profile-dropdown p { padding: 8px 10px; margin: 0 0 3px; color: var(--muted-foreground); font-size: 11px; }
  .profile-dropdown a, .profile-dropdown button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 42px; padding: 10px; border: 0; border-radius: 9px; background: transparent; color: var(--foreground); font-size: 13px; text-decoration: none; text-align: left; }
  .profile-dropdown a:hover, .profile-dropdown button:hover { background: var(--primary-soft); color: var(--primary-hover); }
  .profile-dropdown svg { width: 18px; height: 18px; flex-shrink: 0; }
  .profile-dropdown form { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
  .sidebar-profile { width: 100%; }
  .sidebar-profile>summary { width: 100%; height: 40px; border: 0; border-radius: 10px; background: transparent; display: flex; gap: 12px; padding: 10px; }
  .profile-label { color: var(--foreground); font-size: 12px; font-weight: 500; }
  .sidebar-profile .profile-dropdown { top: auto; bottom: calc(100% + 12px); left: 0; right: auto; }
  .sidebar-collapsed .profile-label, .pos-page .profile-label { display: none; }
  .sidebar-collapsed .sidebar-profile>summary, .pos-page .sidebar-profile>summary { justify-content: center; padding: 0; }
  .workspace-content { max-width: 1060px; margin: 60px auto 0; }
  .home-page .workspace-content { margin-top: 84px; }
  .workspace-header { margin-bottom: 36px; }
  .workspace-header h1 { font-size: clamp(30px, 3vw, 42px); font-weight: 650; letter-spacing: -.045em; margin-bottom: 12px; }
  .workspace-greeting { font-size: 15px; color: #6e6e73; margin: 0 0 12px; }
  .workspace-header .page-description { font-size: 15px; margin: 0; }
  .workspace-grid { gap: 20px; margin-bottom: 36px; }
  .workspace-card { position: relative; min-height: 228px; padding: 28px; border: 1px solid rgba(30, 30, 40, .07); border-radius: 22px; background: #fff; box-shadow: 0 2px 5px rgba(25, 28, 42, .025), 0 10px 28px rgba(25, 28, 42, .035); transition: transform .18s ease, box-shadow .18s ease; }
  .workspace-card:hover { transform: translateY(-3px); border-color: rgba(30, 30, 40, .1); box-shadow: 0 5px 10px rgba(25, 28, 42, .03), 0 18px 40px rgba(25, 28, 42, .08); }
  .workspace-symbol { width: 48px; height: 48px; border-radius: 13px; margin-bottom: 24px; color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
  .workspace-symbol svg { width: 26px; height: 26px; }
  .workspace-entry-grid .workspace-symbol { width: 60px; height: 60px; border-radius: 17px; background: linear-gradient(180deg, #248bff, #0071e3); color: #fff; border: 1px solid rgba(0, 0, 0, .055); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .3), 0 4px 9px rgba(0, 90, 190, .14); }
  .workspace-entry-grid .workspace-symbol svg { width: 32px; height: 32px; stroke-width: 1.6; }
  .workspace-entry-grid .workspace-symbol[data-destination="/operaciones"] { background: linear-gradient(180deg, #9376ef, #7354cf); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .3), 0 4px 9px rgba(100, 60, 190, .12); }
  .workspace-entry-grid .workspace-symbol[data-destination="/reportes"] { background: linear-gradient(180deg, #627183, #404d60); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .2), 0 4px 9px rgba(30, 40, 60, .12); }
  .workspace-card h2 { font-size: 20px; font-weight: 600; letter-spacing: -.025em; margin-bottom: 10px; }
  .workspace-card p { font-size: 13px; color: #6e6e73; line-height: 1.65; margin-bottom: 28px; }
  .workspace-card-action { width: 100%; justify-content: space-between; font-size: 13px; font-weight: 550; color: var(--primary); }
  .workspace-card-action svg { width: 17px; height: 17px; }
  .start-preference { grid-template-columns: 1fr auto; padding: 22px 24px 16px; border-radius: 18px; background: rgba(255, 255, 255, .65); border-color: rgba(30, 30, 40, .07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
  .preference-heading { display: flex; align-items: center; gap: 14px; }
  .preference-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #e9e9ef; color: #6e6e78; flex-shrink: 0; }
  .preference-icon svg { width: 21px; height: 21px; }
  .start-preference h2 { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
  .start-preference p { font-size: 12px; }
  .start-preference form { gap: 8px; }
  .start-preference label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .start-preference select { min-height: 36px; width: 170px; font-size: 12px; border-radius: 9px; }
  .start-preference .btn { min-height: 36px; padding: 7px 14px; font-size: 12px; }
  .preference-note { font-size: 11px; padding-top: 12px; border-top: 1px solid rgba(100, 100, 115, .08); }

  /* Selling keeps a clear, solid content surface beneath the toolbar. */
  .pos-page .sidebar { background: var(--sidebar); }
  .pos-main { background: var(--background); }
  .pos-header { margin-bottom: 22px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
  .pos-title h1 { font-size: 24px; font-weight: 650; letter-spacing: -.035em; }
  .pos-title span, .pos-warehouse>span { color: var(--muted-foreground); }
  .pos-live-dot { background: var(--success); box-shadow: none; }
  .pos-search { border-radius: 14px; border-color: var(--input); box-shadow: 0 1px 3px rgba(0, 0, 0, .025); }
  .pos-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 113, 227, .12); }
  .pos-search input:focus-visible { outline: none; }
  .camera-scan-button, .barcode-camera-button { border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 550; }
  .pos-sale-panel, .pos-checkout { background: #fff; border: 1px solid rgba(30, 30, 40, .07); border-radius: 20px; box-shadow: var(--shadow); }
  .pos-checkout { padding: 24px; }
  .pos-cart-title h2, .checkout-heading span, .pos-empty-cart strong { font-weight: 600; }
  .pos-submit strong, .pos-submit b { font-weight: 600; }
  .pos-submit, .mobile-pay-bar { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(0, 100, 210, .14); font-weight: 600; }
  .pos-submit:disabled, .mobile-pay-bar:disabled { background: #b8c5d7; color: #fff; box-shadow: none; }
  .pos-grand-total strong { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
  .change-box { background: var(--muted); border-color: var(--border); }
  .change-box strong { color: var(--foreground); }
  .cart-line { border-bottom-color: #eeeef1; }
  .cart-quantity button { background: #f2f2f7; color: var(--primary); border-radius: 8px; }
  .sale-complete, .barcode-scanner { border-radius: 24px; box-shadow: 0 25px 80px rgba(0, 0, 0, .18); }
  dialog::backdrop { background: rgba(29, 29, 31, .22); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
  .product-save-bar { left: calc(256px + 2rem); background: rgba(255, 255, 255, .85); border-radius: 18px; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
  .sidebar-collapsed .product-save-bar { left: calc(76px + 2rem); }

  .auth-page { background: var(--background); }
  .auth-shell { display: grid; grid-template-columns: 1fr; place-items: center; }
  .auth-access { min-height: 100vh; width: 100%; padding: 40px 20px; background: none; }
  .auth-card-header { text-align: center; margin-bottom: 28px; }
  .login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 30px; }
  .login-brand .brand-mark { width: 56px; height: 56px; border-radius: 17px; font-size: 27px; }
  .login-brand>span { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
  .auth-card-header h1 { font-size: 28px; font-weight: 600; letter-spacing: -.04em; margin: 0 0 9px; }
  .auth-showcase { background: #eceef4; color: var(--foreground); }
  .auth-showcase::before, .auth-showcase::after { display: none; }
  .auth-brand .brand-mark { background: #1d1d1f; box-shadow: none; }
  .auth-kicker, .auth-benefits small, .auth-showcase footer { color: #6e6e73; }
  .auth-kicker i { background: var(--primary); }
  .auth-message h1 { font-weight: 650; }
  .auth-message h1 em, .auth-benefits>div>span { color: var(--primary); }
  .auth-message>p { color: #65656b; }
  .auth-product-tags span { background: rgba(255, 255, 255, .6); border-color: rgba(30, 30, 40, .07); color: #64646b; font-weight: 500; }
  .auth-benefits>div { border-top-color: #d8dae2; }
  .auth-benefits strong { color: var(--foreground); font-weight: 600; }
  .auth-card { background: #fff; border: 1px solid rgba(30, 30, 40, .06); border-radius: 24px; box-shadow: var(--shadow); padding: 36px; }
  .auth-submit { background: var(--primary); box-shadow: none; font-weight: 600; }
  .auth-submit:hover { background: var(--primary-hover); }
  .auth-input input:focus-visible { outline: none; }
  .auth-remember { display: flex; align-items: flex-start; gap: 10px; color: var(--foreground); font-size: 12px; cursor: pointer; }
  .auth-remember input { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; accent-color: var(--primary); cursor: pointer; }
  .auth-remember span { line-height: 1.5; }
  .auth-remember small { display: block; color: var(--muted-foreground); font-size: 11px; margin-top: 2px; }
  .auth-password-hint { color: var(--muted-foreground); font-size: 11px; line-height: 1.5; margin: 0; }
  :focus-visible { outline: 3px solid rgba(0, 113, 227, .7); outline-offset: 3px; }
}

@media screen and (min-width: 769px) {
  .sidebar { z-index: 35; }
}
@media screen and (max-width: 1100px) {
  .app-main { padding-inline: 28px; }
  .workspace-content, .home-page .workspace-content { margin-top: 54px; }
  .workspace-main { padding: 0 28px 36px; }
  .workspace-card { padding: 24px; }
  .workspace-card h2 { font-size: 18px; }
  .workspace-grid { gap: 14px; }
  .start-preference { grid-template-columns: 1fr; gap: 18px; }
  .start-preference form { padding-left: 52px; }
  .start-preference select { width: 200px; }
}
@media screen and (max-width: 768px) {
  .sidebar, .pos-page .sidebar, .sidebar-collapsed .sidebar { width: 256px; min-width: 256px; padding: 24px 14px; box-shadow: 12px 0 40px rgba(0, 0, 0, .1); }
  .workspace-main { padding: 0 20px 32px !important; }
  .workspace-toolbar { min-height: 68px; padding-left: 42px; }
  .standalone-toolbar { min-height: 72px; padding-inline: 20px; gap: 12px; }
  .standalone-title { display: none; }
  .standalone-actions { gap: 16px; }
  .standalone-page .app-main { padding: 28px 20px; }
  .sidebar-collapsed .sidebar-profile .profile-label, .pos-page .sidebar-profile .profile-label { display: inline; }
  .sidebar-collapsed .sidebar-profile>summary, .pos-page .sidebar-profile>summary { justify-content: flex-start; padding: 10px; }
  .workspace-content, .home-page .workspace-content { margin-top: 36px; }
  .workspace-header { margin-bottom: 26px; }
  .workspace-header h1 { font-size: 31px; }
  .workspace-header .page-description { font-size: 14px; }
  .workspace-greeting { font-size: 14px; margin-bottom: 10px; }
  .workspace-entry-grid { grid-template-columns: 1fr; }
  .workspace-grid { gap: 14px; margin-bottom: 24px; }
  .workspace-card { min-height: 0; padding: 22px; }
  .workspace-entry-grid .workspace-card { display: grid; grid-template-columns: 54px 1fr 16px; column-gap: 17px; row-gap: 5px; align-items: start; }
  .workspace-entry-grid .workspace-symbol { grid-column: 1; grid-row: 1 / 3; width: 54px; height: 54px; border-radius: 15px; margin: 0; }
  .workspace-entry-grid .workspace-symbol svg { width: 28px; height: 28px; }
  .workspace-entry-grid .workspace-card h2 { grid-column: 2; grid-row: 1; margin: 3px 0 0; font-size: 17px; }
  .workspace-entry-grid .workspace-card p { grid-column: 2; grid-row: 2; margin: 0; font-size: 12px; line-height: 1.55; }
  .workspace-entry-grid .workspace-card-action { grid-column: 3; grid-row: 1 / 3; align-self: center; font-size: 0; gap: 0; }
  .workspace-entry-grid .workspace-card-action svg { width: 16px; }
  .start-preference { padding: 20px; gap: 18px; }
  .start-preference form { padding-left: 0; flex-wrap: nowrap; }
  .start-preference select { width: auto; flex: 1; min-width: 0; }
  .preference-note { font-size: 10px; line-height: 1.6; }
  .pos-header { padding-top: 8px; }
  .pos-title h1 { font-size: 19px; }
  .pos-checkout { padding: 20px; border-radius: 24px 24px 0 0; }
  .product-save-bar, .sidebar-collapsed .product-save-bar { left: 10px; right: 10px; }
  .auth-card { padding: 28px; }
  .auth-input input, .pos-search input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-card, .sidebar, .sidebar-collapse svg { transition: none; }
  .workspace-card:hover { transform: none; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .sidebar { background: #efeff4; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .start-preference, .workspace-card, .control-strip, .product-save-bar, .profile-dropdown { background: #fff; }
  .workspace-card, .panel, .metric-card { border-color: #aaaab2; }
}
@media (forced-colors: active) {
  .workspace-symbol, .workspace-entry-grid .workspace-symbol[data-destination] { background: Canvas; color: CanvasText; border: 1px solid CanvasText; box-shadow: none; }
  .nav-link.active { outline: 1px solid Highlight; }
}

/* Keep quantities and delivery balances visible in the dispatch form. */
.dispatch-lines .app-table th,.dispatch-lines .app-table td{padding:10px 8px;white-space:normal}
.dispatch-lines .app-table td:nth-child(2){min-width:130px}
.dispatch-lines input[type=number]{width:90px;min-width:90px}
.document-viewer{overflow:hidden;margin-top:1rem}.document-toolbar{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;padding:1.25rem;border-bottom:1px solid var(--border,#e5e5ea)}.document-toolbar-title{display:flex;flex-direction:column;gap:.25rem}.document-toolbar-title strong{font-size:1rem}.document-toolbar-title span{font-size:.82rem;color:var(--muted-foreground,#6e6e73)}.document-actions{display:flex;align-items:end;gap:.5rem;flex-wrap:wrap}.document-actions label{display:flex;flex-direction:column;gap:.35rem;font-size:.75rem;color:var(--muted-foreground,#6e6e73)}.document-actions .btn,.document-actions select{min-height:42px;white-space:nowrap}.document-preview{background:#e8e9ed;min-height:480px;max-height:78vh;overflow:auto;padding:1.5rem;text-align:center}.document-pages{display:flex;flex-direction:column;align-items:center;gap:1.25rem;width:100%}.document-pages canvas{display:block;max-width:100%;height:auto!important;background:white;box-shadow:0 4px 24px #00000014;border-radius:2px}.document-preview-status{padding:3rem 1rem;color:#606068}.document-preview [hidden]{display:none!important}@media(max-width:1000px){.document-toolbar{align-items:flex-start;flex-direction:column;gap:1rem}.document-actions{width:100%}}@media(max-width:600px){.document-toolbar{padding:1rem}.document-actions{display:grid;grid-template-columns:1fr 1fr}.document-actions label{grid-column:1/-1}.document-actions .btn{font-size:.8rem;padding:.65rem}.document-preview{padding:1rem .25rem;min-height:360px}}
.quick-client{width:min(480px,calc(100vw - 2rem));padding:1.5rem;border:1px solid var(--border,#e5e5ea);border-radius:20px;background:var(--card,#fff);color:var(--foreground,#1d1d1f);box-shadow:0 24px 80px #0003}.quick-client::backdrop{background:#13172255;backdrop-filter:blur(4px)}.quick-client-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:1.25rem}.quick-client-head h2{font-size:1.25rem;font-weight:700;margin:0 0 .4rem}.quick-client-head p,.quick-client-footer{font-size:.8rem;color:var(--muted-foreground,#6e6e73)}.quick-client-head button{font-size:1.6rem;min-width:36px;min-height:36px}.quick-client-search{display:flex;gap:.5rem}.quick-client-search input{min-width:0;flex:1;font-size:1.15rem;letter-spacing:.06em}.quick-client-search button{white-space:nowrap}#quick-client-status{font-size:.85rem;line-height:1.5;margin:.8rem 0}#quick-client-save{width:100%;margin-top:1rem}.quick-client-more{font-size:.85rem;margin-top:.75rem}.quick-client-more summary{padding:.4rem 0;color:var(--muted-foreground,#6e6e73)}.quick-client-footer{display:flex;justify-content:space-between;gap:.5rem;flex-wrap:wrap;border-top:1px solid var(--border,#e5e5ea);margin-top:1.25rem;padding-top:1rem}.pos-shortcuts{font-size:.75rem;color:var(--muted-foreground,#6e6e73);margin:1rem 0}.pos-shortcuts kbd{margin-left:.5rem}.quick-client [hidden]{display:none!important}.product-result:focus-visible{outline:3px solid var(--primary,#0071e3);outline-offset:-3px}

.series-section{scroll-margin-top:24px;padding:24px;margin:20px 0}.series-section .panel-header{padding:0;border-bottom:0;margin-bottom:24px}.series-section .panel-header>div{padding-left:0}.series-card .status-badge{font-size:12px;padding:5px 8px;background:var(--primary-soft);color:var(--primary)}.series-create{display:grid;grid-template-columns:minmax(200px,1.5fr) minmax(100px,.65fr) auto auto;align-items:end;gap:16px;margin-bottom:24px;padding-bottom:24px;border-bottom:1px solid var(--border,#e3e5eb)}.series-create p{grid-column:1/-1;margin:0;color:var(--muted-foreground,#63666f);font-size:13px}.series-default-check{display:flex;align-items:center;gap:8px;min-height:44px;font-size:13px}.series-create input[name=serie]{text-transform:uppercase}.series-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.series-card{padding:20px;border:1px solid var(--border,#e3e5eb);border-radius:16px;background:var(--card,#fff);min-width:0}.series-card header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.series-card h3{margin:0;font-size:16px;font-weight:600}.series-card p{font-size:12px;color:var(--muted-foreground,#63666f);margin:12px 0 0}.series-choice{display:flex;align-items:end;gap:10px}.series-choice .form-field{flex:1;min-width:0}.series-choice .btn{white-space:nowrap;min-height:44px}.series-choice select,.series-create select{width:100%;min-width:0}@media(max-width:1000px){.series-create{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}@media(max-width:640px){.series-section{padding:18px}.series-grid,.series-create{grid-template-columns:minmax(0,1fr)}.series-card{padding:16px}.series-card header{align-items:flex-start}.series-choice{flex-wrap:wrap}.series-choice .form-field{flex-basis:100%}.series-choice .btn{width:100%}}
/* Quotation workspace */
.quote-layout{display:grid;grid-template-columns:minmax(0,1fr) 350px;gap:20px;align-items:start}
.quote-products,.quote-summary{padding:24px;min-width:0}.quote-summary{position:sticky;top:24px}
.quote-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}
.quote-section-heading h2{font-size:20px;margin:0;letter-spacing:-.4px}.quote-products .pos-search-row{margin-bottom:18px;grid-template-columns:1fr}
.quote-cart-head,.quote-line{display:grid;grid-template-columns:minmax(150px,1fr) 124px 120px 100px 26px;gap:14px;align-items:center}
.quote-cart-head{color:#74777e;font-size:11px;text-transform:uppercase;border-bottom:1px solid #e2e4e9;padding:12px 0}
.quote-line{padding:18px 0;border-bottom:1px solid #eceef2}.quote-line small{display:block;color:#777;font-size:11px;margin-top:4px}
.quote-line strong{font-size:13px}.quote-line .cart-quantity{width:124px}.quote-unit-price input{width:100%;min-width:0;padding:9px;border:1px solid #d4d7de;border-radius:10px}
.quote-line .cart-product strong{white-space:normal;overflow:visible;display:block;line-height:1.5}
.quote-unit-price input:disabled{background:#f5f6f8;color:#34373c}.quote-unit-price .quote-promotion{color:#138447}
.quote-cart-footer{display:flex;justify-content:space-between;gap:14px;padding-top:16px;color:#74777e;font-size:11px}
.quote-price-policy{display:flex;gap:10px;font-size:13px;align-items:start;padding:14px;background:#f6f8fb;border-radius:12px;margin:10px 0 20px}
.quote-price-policy input{margin-top:4px;flex-shrink:0}.quote-price-policy small{display:block;font-size:11px;color:#6b7080;margin-top:6px;line-height:1.6}
.quote-save{width:100%;min-height:46px}.quote-history{margin-top:24px;overflow:hidden}.quote-history>.quote-section-heading{padding:22px 24px 0}.quote-history .btn{font-size:12px}
.quote-source{grid-column:1/-1;margin:0!important}
@media(max-width:1200px){.quote-layout{grid-template-columns:minmax(0,1fr) 300px;gap:14px}.quote-products,.quote-summary{padding:18px}.quote-cart-head,.quote-line{grid-template-columns:minmax(100px,1fr) 110px 90px 80px 20px;gap:8px}.quote-line .cart-quantity{width:110px}}
@media(max-width:1000px){.quote-layout{grid-template-columns:1fr}.quote-summary{position:static}.quote-products{min-height:350px}}
@media(max-width:600px){.quote-products,.quote-summary{padding:16px}.quote-cart-head{display:none}.quote-line{grid-template-columns:minmax(0,1fr) 110px 24px;gap:12px}.quote-line .cart-product{grid-column:1/3}.quote-line .cart-remove{grid-column:3;grid-row:1}.quote-unit-price{grid-column:1;grid-row:2}.quote-line .cart-quantity{grid-column:2;grid-row:2}.quote-line-total{grid-column:1/3;text-align:right}.quote-cart-footer{flex-direction:column}.quote-products .pos-search input{font-size:13px}}

.quote-product-search{position:relative;margin-bottom:18px;min-width:0}
.quote-product-search .pos-search-row{margin-bottom:0}
.quote-product-search .pos-results{top:calc(100% + 8px);left:0;right:0;max-height:min(350px,50vh)}
.quote-product-search .product-result{grid-template-columns:minmax(0,1fr) auto}
.quote-product-search .product-result-copy strong{white-space:normal;overflow-wrap:anywhere}
.quote-product-search .product-result-value{min-width:72px}

/* Cash sessions, counting and movement ledger. */
.cash-main { max-width: 1920px; }
.cash-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.cash-session-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:22px; }
.cash-session-heading h2 { font-size:21px; margin:0; }
.cash-session-heading p { margin:8px 0 0; color:var(--muted-foreground); }
.cash-meta { font-size:12px; }
.cash-warning { border:1px solid #efd298; border-radius:16px; background:#fff8ea; padding:18px 22px; margin-bottom:22px; color:#78500c; }
.cash-warning p { margin:6px 0 0; }
.cash-cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:22px; }
.cash-card { padding:22px; display:flex; flex-direction:column; gap:12px; min-width:0; }
.cash-card>span { color:var(--muted-foreground); font-size:13px; }
.cash-card>strong { font-size:clamp(21px,1.8vw,32px); line-height:1.15; letter-spacing:-.04em; overflow-wrap:anywhere; }
.cash-card small { font-size:11px; color:var(--muted-foreground); }
.cash-card-primary { background:var(--primary-soft); border-color:#d2e6ff; }
.cash-card-primary>strong { color:#005bb5; }
.cash-overview { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(320px,1fr); gap:22px; margin-bottom:22px; align-items:start; }
.cash-panel { padding:24px; min-width:0; }
.cash-panel-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.cash-panel-title h2 { margin:0; font-size:19px; }
.cash-panel-title p { font-size:12px; color:var(--muted-foreground); margin:7px 0 0; }
.cash-note { color:var(--muted-foreground); font-size:12px; line-height:1.6; margin:16px 0 0; }
.cash-table { width:100%; }
.cash-table th,.cash-table td { white-space:nowrap; }
.cash-table td small { max-width:320px; white-space:normal; color:var(--muted-foreground); font-size:11px; margin-top:4px; }
.cash-table td:last-child { font-variant-numeric:tabular-nums; }
.cash-formula { margin:0; font-size:13px; }
.cash-formula>div { display:flex; gap:12px; justify-content:space-between; padding:8px 0; }
.cash-formula dt { font-weight:400; color:var(--muted-foreground); }
.cash-formula dd { margin:0; font-weight:600; text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.cash-formula .cash-formula-total { margin-top:9px; padding-top:16px; border-top:1px solid var(--border); font-size:17px; }
.cash-formula-total dt { font-weight:600; color:var(--foreground); }
.cash-formula .cash-close-reason { display:block; white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; }
.cash-session-actions { margin-top:22px; }
.cash-ledger,.cash-history { margin-bottom:22px; }
.cash-filters { display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin-bottom:18px; }
.cash-filters label { display:grid; gap:6px; font-size:12px; color:var(--muted-foreground); flex:1; min-width:130px; }
.cash-filters .form-control,.cash-filters .form-select { width:100%; }
.cash-empty { padding:64px 24px; text-align:center; margin-bottom:22px; }
.cash-empty p { color:var(--muted-foreground); margin:16px 0 24px; }
.cash-empty-icon { display:inline-grid; place-items:center; width:54px; height:54px; border-radius:18px; background:var(--primary-soft); color:var(--primary); font-size:26px; margin-bottom:16px; }
.cash-negative { color:#b42318; }
.cash-dialog { padding:28px; width:min(480px,calc(100% - 32px)); max-height:calc(100dvh - 40px); overflow:auto; border:1px solid var(--border); border-radius:22px; box-shadow:0 24px 90px #1d1d1f30; color:var(--foreground); background:var(--card); }
.cash-dialog::backdrop { background:#17172255; backdrop-filter:blur(5px); }
.cash-dialog form { display:grid; gap:18px; }
.cash-dialog .cash-panel-title { margin:0; }
.cash-dialog label { display:grid; gap:8px; font-size:13px; }
.cash-dialog .cash-note { margin:0; }
.cash-balance-preview { background:var(--muted); padding:14px; border-radius:12px; font-size:13px; line-height:1.6; margin:0; }
.pos-cash-status { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:12px 16px; border:1px solid var(--border); border-radius:14px; font-size:12px; margin:0 0 18px; background:var(--card); }
.pos-cash-status.is-ready { color:#21603f; background:#f0faf4; border-color:#d9eddf; }
.pos-cash-status.is-pending { color:#78500c; background:#fff8ea; border-color:#efd298; }
.pos-cash-status a { font-weight:600; white-space:nowrap; }
.cash-print { background:#f5f5f7; padding:30px; }
.cash-print-actions { max-width:800px; margin:0 auto 22px; display:flex; gap:12px; }
.cash-print article { background:white; max-width:800px; padding:45px; margin:auto; border-radius:16px; }
.cash-print h1 { font-size:28px; }.cash-print h2 { font-size:19px; margin:24px 0 12px; }
.cash-print p { line-height:1.8; }.cash-print table { width:100%; border-collapse:collapse; font-size:13px; }
.cash-print td,.cash-print th { padding:9px 5px; border-bottom:1px solid #ddd; text-align:right; }
.cash-print td:first-child,.cash-print th:first-child { text-align:left; }
.cash-print footer { margin-top:48px; font-size:13px; }
@media(max-width:1200px) { .cash-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }.cash-overview { grid-template-columns:1fr; } }
@media(max-width:600px) { .cash-session-heading { flex-direction:column; align-items:stretch; }.cash-card { padding:16px; }.cash-cards { gap:10px; }.cash-panel { padding:18px; }.cash-panel-title { flex-wrap:wrap; }.cash-dialog { padding:22px; }.cash-print { padding:12px; }.cash-print article { padding:22px; }.pos-cash-status { align-items:flex-start; } }
@media print { .cash-print { background:white; padding:0; }.cash-print-actions { display:none; }.cash-print article { max-width:none; border-radius:0; padding:0; }.cash-print table { break-inside:avoid; } }

/* Reports Workspace Enhanced Styles */
.reports-toolbar-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.custom-range-inputs { display: inline-flex; align-items: center; gap: 6px; background: var(--muted); padding: 3px 6px; border-radius: 8px; border: 1px solid var(--border); }
.custom-range-inputs input[type="date"] { border: 0; background: transparent; color: var(--foreground); font-size: 11px; padding: 3px 4px; outline: none; }
.custom-range-inputs span { font-size: 11px; color: var(--muted-foreground); }
.reports-kpis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.payment-item-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.payment-item-row:last-child { border-bottom: 0; }
.payment-item-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.payment-item-head strong { font-weight: 600; }
.payment-item-head .payment-amount { font-weight: 700; color: var(--foreground); }
.payment-progress { height: 6px; width: 100%; background: var(--muted); border-radius: 999px; overflow: hidden; }
.payment-progress-bar { height: 100%; border-radius: inherit; background: var(--primary); transition: width 0.3s ease; }
.payment-progress-bar.bar-cash { background: #10b981; }
.payment-progress-bar.bar-yape { background: #8b5cf6; }
.payment-progress-bar.bar-card { background: #3b82f6; }
.payment-progress-bar.bar-transfer { background: #06b6d4; }
.payment-progress-bar.bar-credit { background: #f59e0b; }
.fiscal-highlight-box { display: flex; justify-content: space-between; gap: 12px; background: var(--muted); padding: 12px 16px; border-radius: 10px; margin-top: 14px; }
.fiscal-highlight-item { display: flex; flex-direction: column; }
.fiscal-highlight-item small { font-size: 11px; color: var(--muted-foreground); text-transform: uppercase; font-weight: 600; }
.fiscal-highlight-item strong { font-size: 14px; color: var(--foreground); }
.cash-reconcile-list { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.cash-reconcile-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.cash-reconcile-row:last-child { border-bottom: 0; }
.cash-reconcile-row.row-total { padding-top: 10px; border-top: 2px solid var(--border); border-bottom: 0; font-weight: 700; }
.text-diff-positive { color: #10b981; }
.text-diff-negative { color: #ef4444; }
.text-diff-zero { color: var(--muted-foreground); }
@media(max-width: 768px) {
  .reports-toolbar-custom { width: 100%; flex-direction: column; align-items: stretch; }
  .custom-range-inputs { width: 100%; justify-content: space-between; }
}
