/* ==========================================================================
   MabrookTech Calculators, Business & Network Suite — Studio Styles
   Daylight Editorial / Apple Liquid Glass Accent Layer
   ========================================================================== */

:root {
    --cs-sapphire: var(--mt-primary, #0F4C81);
    --cs-teal: var(--mt-teal, #0F766E);
    --cs-ink: var(--mt-ink, #1D1D1F);
    --cs-muted: var(--mt-muted, #515154);
    --cs-bg: var(--mt-bg, #F5F5F7);
    --cs-surface: var(--mt-surface, rgba(255, 255, 255, 0.88));
    --cs-border: var(--mt-border, rgba(29, 29, 31, 0.10));
    --cs-radius: 16px;
}

.mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-variant-numeric: tabular-nums;
}

/* Sidebar Brand & Companion Links */
.cs-suite-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 4px 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--cs-border);
}

.cs-suite-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0F4C81 0%, #0F766E 100%);
    color: #fff;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(15, 76, 129, 0.22);
}

.cs-suite-title {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cs-ink);
    line-height: 1.2;
}

.cs-suite-sub {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--cs-muted);
}

.cs-group-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cs-muted);
    padding: 10px 8px 6px;
}

.cs-companion-group {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--cs-border);
}

.cs-companion-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--cs-muted);
    text-decoration: none;
    transition: background 0.16s ease, color 0.16s ease;
}

.cs-companion-link:hover {
    background: rgba(15, 76, 129, 0.07);
    color: var(--cs-sapphire);
}

.cs-companion-link .cs-ext {
    margin-left: auto;
    font-size: 0.72rem;
    opacity: 0.65;
}

/* Panel Header */
.cs-panel-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.cs-panel-header h2 {
    margin: 8px 0 4px;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    font-weight: 700;
    color: var(--cs-ink);
    letter-spacing: -0.02em;
}

.cs-panel-header p {
    margin: 0;
    color: var(--cs-muted);
    font-size: 0.94rem;
    max-width: 72ch;
}

.cs-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Cards & Typography helpers */
.cs-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.cs-card-head h3,
.cs-card-head h4,
.mt-card > h3 {
    margin: 0 0 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cs-ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cs-card-head h3,
.cs-card-head h4 {
    margin-bottom: 0;
}

.cs-gap-top { margin-top: 16px; }
.cs-gap-sm { margin-top: 8px; }
.cs-muted { color: var(--cs-muted); }
.cs-small { font-size: 0.82rem; }
.cs-text-teal { color: var(--cs-teal); }

.cs-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cs-stat-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cs-muted);
    margin-bottom: 4px;
}

.cs-stat-val {
    font-size: 1.32rem;
    font-weight: 700;
    color: var(--cs-ink);
    line-height: 1.2;
    word-break: break-word;
}

.cs-stat-sub {
    margin-top: 5px;
    font-size: 0.78rem;
    color: var(--cs-muted);
}

.cs-mini-copy {
    border: 1px solid var(--cs-border);
    background: rgba(255, 255, 255, 0.8);
    color: var(--cs-muted);
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.15s ease;
}

.cs-mini-copy:hover {
    color: var(--cs-sapphire);
    border-color: rgba(15, 76, 129, 0.35);
}

.cs-compact-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Sub-tabs (Finance & Health 9-in-1 / 6-in-1) */
.cs-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 16px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--cs-border);
    backdrop-filter: blur(14px);
}

.cs-subtab {
    border: 1px solid transparent;
    background: transparent;
    color: var(--cs-muted);
    font-family: 'Inter Tight', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.16s ease;
}

.cs-subtab:hover {
    background: rgba(15, 76, 129, 0.08);
    color: var(--cs-sapphire);
}

.cs-subtab.active {
    background: var(--cs-sapphire);
    color: #fff;
    box-shadow: 0 4px 12px rgba(15, 76, 129, 0.22);
}

.cs-subpanel {
    display: none;
}

.cs-subpanel.active {
    display: block;
}

/* Form Grids & Controls */
.cs-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.cs-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.cs-field-grow {
    flex: 1 1 220px;
}

.cs-inline-pair {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 8px;
}

.cs-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.cs-btn-row.cs-center {
    justify-content: center;
}

.cs-btn-sm {
    padding: 6px 11px !important;
    font-size: 0.8rem !important;
}

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

.cs-check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.cs-check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--cs-ink);
    cursor: pointer;
}

.cs-link-btn {
    border: none;
    background: transparent;
    color: var(--cs-sapphire);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
}

.cs-link-btn:hover {
    text-decoration: underline;
}

/* Chips */
.cs-chip-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 10px 0;
}

.cs-chip-label {
    font-size: 0.78rem;
    color: var(--cs-muted);
    font-weight: 600;
}

.cs-chip {
    border: 1px solid var(--cs-border);
    background: rgba(15, 76, 129, 0.06);
    color: var(--cs-sapphire);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.77rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.14s ease;
}

.cs-chip:hover {
    background: var(--cs-sapphire);
    color: #fff;
}

/* Tables */
.cs-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--cs-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.cs-scroll-table {
    max-height: 360px;
    overflow-y: auto;
}

.cs-scroll-table-sm {
    max-height: 210px;
    overflow-y: auto;
}

.cs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.cs-table th,
.cs-table td {
    padding: 9px 11px;
    text-align: left;
    border-bottom: 1px solid var(--cs-border);
    vertical-align: middle;
}

.cs-table th {
    position: sticky;
    top: 0;
    background: #F8F9FB;
    color: var(--cs-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    z-index: 1;
}

.cs-table tbody tr:last-child td {
    border-bottom: none;
}

/* Telemetry & Ratio Bars */
.cs-telemetry-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 10px;
}

.cs-tele-item {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(245, 245, 247, 0.75);
    border: 1px solid var(--cs-border);
}

.cs-tele-k {
    font-size: 0.74rem;
    color: var(--cs-muted);
    font-weight: 600;
}

.cs-tele-v {
    margin-top: 3px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cs-ink);
    word-break: break-word;
}

.cs-ua-box {
    font-size: 0.78rem;
    line-height: 1.45;
    word-break: break-all;
}

.cs-ratio-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.cs-ratio-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.22);
    overflow: hidden;
}

.cs-ratio-fill {
    height: 100%;
    background: linear-gradient(90deg, #0F4C81, #2563EB);
    border-radius: 999px;
    transition: width 0.25s ease;
}

/* World Timezone Planner */
.cs-tz-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    align-items: end;
}

.cs-tz-slider-wrap input[type="range"] {
    width: 100%;
    accent-color: var(--cs-sapphire);
    cursor: pointer;
}

.cs-tz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 12px;
}

.cs-tz-card {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--cs-border);
    background: rgba(255, 255, 255, 0.9);
}

.cs-tz-card.work-hours {
    border-color: rgba(15, 118, 110, 0.35);
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(255, 255, 255, 0.95));
}

.cs-tz-city {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--cs-ink);
}

.cs-tz-time {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--cs-sapphire);
    margin: 4px 0;
}

.cs-tz-status {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.73rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

.cs-tz-status.ok {
    background: rgba(15, 118, 110, 0.14);
    color: #0F766E;
}

.cs-tz-status.shoulder {
    background: rgba(217, 119, 6, 0.14);
    color: #B45309;
}

.cs-tz-status.off {
    background: rgba(107, 114, 128, 0.14);
    color: #4B5563;
}

.cs-overlap-strip {
    padding-top: 12px;
    border-top: 1px solid var(--cs-border);
}

.cs-overlap-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.84rem;
    margin-bottom: 8px;
}

.cs-overlap-hours {
    display: grid;
    grid-template-columns: repeat(24, minmax(22px, 1fr));
    gap: 3px;
    overflow-x: auto;
}

.cs-hour-pill {
    border: 1px solid var(--cs-border);
    border-radius: 7px;
    padding: 6px 2px;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    background: #fff;
    cursor: pointer;
}

.cs-hour-pill.ideal {
    background: rgba(15, 118, 110, 0.16);
    border-color: rgba(15, 118, 110, 0.4);
    color: #0F766E;
}

.cs-hour-pill.partial {
    background: rgba(217, 119, 6, 0.12);
    color: #B45309;
}

.cs-hour-pill.active {
    outline: 2px solid var(--cs-sapphire);
}

/* Macro Cards */
.cs-macro-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.cs-macro-box {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--cs-border);
    background: rgba(245, 245, 247, 0.7);
}

/* Pomodoro Ring & Stopwatch */
.cs-pomo-modes {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cs-ring-wrap {
    position: relative;
    width: 196px;
    height: 196px;
    margin: 10px auto 16px;
}

.cs-pomo-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.cs-ring-bg {
    fill: none;
    stroke: rgba(15, 76, 129, 0.11);
    stroke-width: 10;
}

.cs-ring-prog {
    fill: none;
    stroke: var(--cs-sapphire);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 490.09;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.35s linear, stroke 0.25s ease;
}

.cs-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cs-pomo-time {
    font-size: 2.35rem;
    font-weight: 700;
    color: var(--cs-ink);
    line-height: 1;
}

.cs-pomo-label {
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cs-muted);
}

.cs-sw-display-box {
    padding: 26px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(15, 76, 129, 0.06), rgba(15, 118, 110, 0.06));
    border: 1px solid var(--cs-border);
    text-align: center;
}

.cs-sw-time {
    font-size: clamp(1.85rem, 3vw, 2.65rem);
    font-weight: 700;
    color: var(--cs-ink);
}

.cs-lap-best {
    color: #0F766E;
    font-weight: 700;
}

.cs-lap-slow {
    color: #B91C1C;
    font-weight: 700;
}

/* Web POS Terminal */
.cs-pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 310px;
    gap: 16px;
    align-items: start;
}

.cs-pos-toggles {
    display: flex;
    gap: 6px;
}

.cs-select-sm,
.cs-search-sm {
    padding: 6px 10px !important;
    font-size: 0.82rem !important;
    width: auto !important;
    min-width: 96px;
}

.cs-pos-scan-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cs-pos-scan-row .mt-input {
    flex: 1 1 200px;
}

.cs-camera-box {
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--cs-border);
    background: #111827;
    color: #fff;
}

.cs-camera-box video {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

.cs-camera-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
}

.cs-pos-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 2px;
}

.cs-sku-btn {
    text-align: left;
    border: 1px solid var(--cs-border);
    border-radius: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cs-sku-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 76, 129, 0.45);
    box-shadow: 0 6px 16px rgba(15, 76, 129, 0.1);
}

.cs-sku-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--cs-muted);
}

.cs-sku-name {
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--cs-ink);
    line-height: 1.25;
}

.cs-sku-price {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--cs-sapphire);
}

.cs-add-sku-details summary {
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--cs-sapphire);
}

.cs-pos-cart-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.cs-cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid var(--cs-border);
    background: rgba(245, 245, 247, 0.65);
}

.cs-cart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cs-ink);
}

.cs-cart-sub {
    font-size: 0.74rem;
    color: var(--cs-muted);
}

.cs-qty-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cs-qty-btn {
    width: 25px;
    height: 25px;
    border-radius: 7px;
    border: 1px solid var(--cs-border);
    background: #fff;
    cursor: pointer;
    font-weight: 700;
}

.cs-pos-totals {
    border-top: 1px dashed var(--cs-border);
    border-bottom: 1px dashed var(--cs-border);
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cs-tot-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
}

.cs-tot-grand {
    font-size: 1.08rem;
    color: var(--cs-sapphire);
    padding-top: 4px;
}

.cs-change-pill {
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(15, 118, 110, 0.1);
    color: #0F766E;
    font-weight: 700;
    font-size: 0.95rem;
}

/* 80mm Thermal Receipt Paper */
.cs-thermal-paper {
    width: 100%;
    max-width: 302px;
    margin: 0 auto;
    background: #FFFFFF;
    color: #111111;
    border: 1px solid rgba(29, 29, 31, 0.14);
    border-radius: 8px;
    padding: 16px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    line-height: 1.45;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

.cs-rec-center { text-align: center; }
.cs-rec-hr {
    border: none;
    border-top: 1px dashed #444;
    margin: 8px 0;
}

.cs-rec-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.cs-rec-barcode {
    margin: 10px auto 4px;
    display: block;
    max-width: 100%;
}

/* Responsive */
@media (max-width: 1220px) {
    .cs-pos-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .cs-pos-right {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .cs-pos-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .cs-macro-grid {
        grid-template-columns: 1fr;
    }
}

/* Print ONLY 80mm Thermal Receipt when printing from POS */
@media print {
    body * {
        visibility: hidden !important;
    }
    #pos-thermal-receipt,
    #pos-thermal-receipt * {
        visibility: visible !important;
    }
    #pos-thermal-receipt {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 80mm !important;
        max-width: 80mm !important;
        border: none !important;
        box-shadow: none !important;
        padding: 4mm !important;
        margin: 0 !important;
    }
}
