@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f5f6fa;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #667085;
    --line: #e5e7eb;

    --blue: #1f7aff;
    --blue-soft: #eaf2ff;

    --brown: #7a3f22;
    --brown-soft: #f3ebe6;

    --red-soft: #f5f5f7;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
    --radius: 22px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    font-family: 'Inter', sans-serif !important;
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    overscroll-behavior-y: contain;
}

.webix_view,
.webix_template,
.webix_button {
    font-family: 'Inter', sans-serif !important;
}

.webix_view {
    background: var(--bg) !important;
}

.webix_multiview {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.webix_scroll_cont {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

.cg-topbar {
    height: 58px;
    padding: 10px 16px;
    background: #ffffff;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.cg-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.cg-refresh {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    color: #344054;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.cg-page {
    padding: 12px;
    padding-bottom: 110px;
    min-height: calc(100vh - 120px);
}

.cg-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 14px;
    margin-bottom: 10px;
}

.cg-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.cg-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.2px;
}

.cg-subtitle {
    margin-top: 5px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
}

.cg-icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
    color: #475467;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.cg-card-main {
    display: grid;
    grid-template-columns: 0.95fr 1.15fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.cg-info-list {
    display: grid;
    gap: 10px;
}

.cg-info-item {
    min-height: 62px;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 9px 10px;
}

.cg-info-icon {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.cg-info-item.coffee .cg-info-icon {
    background: var(--brown-soft);
    color: var(--brown);
}

.cg-info-item.water .cg-info-icon {
    background: var(--blue-soft);
    color: var(--blue);
}

.cg-info-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 2px;
}

.cg-info-item b {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.cg-mini-bar {
    margin-top: 7px;
    height: 5px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.cg-mini-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.cg-info-item.coffee .cg-mini-bar i {
    background: var(--brown);
}

.cg-info-item.water .cg-mini-bar i {
    background: var(--blue);
}

.cg-donuts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cg-donut {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    min-width: 86px;
}

.cg-donut svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.cg-donut-bg {
    fill: none;
    stroke: #edf0f4;
    stroke-width: 8;
}

.cg-donut-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

.cg-donut.coffee .cg-donut-progress {
    stroke: var(--brown);
}

.cg-donut.water .cg-donut-progress {
    stroke: var(--blue);
}

.cg-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cg-donut-center b {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.cg-donut-center span {
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
}

.cg-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cg-btn {
    height: 42px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 800;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    color: #475569;
    box-shadow: none;
}

.cg-btn.primary,
.cg-btn.danger {
    background: #f3f4f6;
    color: #475569;
    border: 1px solid #e5e7eb;
}

.cg-btn.full {
    width: 100%;
    margin-top: 16px;
}

.cg-bottom-nav {
    height: 68px;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 8px;
    gap: 8px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.cg-nav-btn {
    border: none;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.cg-nav-btn.active {
    background: #edf4ff;
    color: var(--blue);
}

.cg-form {
    display: grid;
    gap: 12px;
}

.cg-counter {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px;
}

.cg-counter label {
    display: block;
    margin-bottom: 9px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.cg-counter-row {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    gap: 8px;
    align-items: center;
}

.cg-counter-row button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 14px;
    background: #e2e8f0;
    color: var(--text);
    font-size: 24px;
    font-weight: 800;
}

.cg-counter-row input {
    height: 44px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.cg-modal-body {
    padding: 14px;
    background: var(--bg);
}

.cg-big-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.cg-big-stats div {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    text-align: center;
}

.cg-big-stats span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.cg-big-stats b {
    font-size: 34px;
    font-weight: 800;
}

.webix_template {
    padding: 0 !important;
    background: var(--bg) !important;
}

.webix_window {
    border-radius: 22px !important;
    overflow: hidden;
}

.webix_win_head {
    background: white !important;
    border-bottom: 1px solid var(--line) !important;
}

.webix_win_head .webix_template {
    background: white !important;
    padding: 13px 16px !important;
    font-weight: 800;
}

.webix_message {
    border-radius: 14px !important;
    font-family: 'Inter', sans-serif !important;
}

.webix_view[view_id="mainViews"],
.webix_view[view_id="home"],
.webix_view[view_id="warehouse"],
.webix_view[view_id="stats"] {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

.webix_template {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 420px) {
    .cg-card-main {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .cg-donuts {
        gap: 6px;
    }

    .cg-donut-center b {
        font-size: 18px;
    }

    .cg-donut-center span {
        font-size: 10px;
    }

    .cg-info-item {
        min-height: 58px;
        grid-template-columns: 30px 1fr;
        gap: 8px;
        padding: 8px;
    }

    .cg-info-icon {
        width: 26px;
        height: 26px;
        border-radius: 10px;
    }

    .cg-info-item b {
        font-size: 13px;
    }
}

@media (min-width: 900px) {
    .cg-page {
        max-width: 1100px;
        margin: 0 auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .cg-card {
        margin-bottom: 0;
    }

    .cg-bottom-nav {
        left: 50%;
        transform: translateX(-50%);
        width: 480px;
        border-radius: 22px 22px 0 0;
    }
}


/* Compact progress layout */

.cg-card-main,
.cg-donuts,
.cg-donut,
.cg-info-list {
    display: none !important;
}

.cg-compact-stats {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.cg-progress-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: center;
}

.cg-progress-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.cg-progress-item.coffee .cg-progress-icon {
    background: #f3ebe6;
    color: #7a3f22;
}

.cg-progress-item.water .cg-progress-icon {
    background: #eaf2ff;
    color: #1f7aff;
}

.cg-progress-body {
    min-width: 0;
}

.cg-progress-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.cg-progress-top span {
    display: block;
    font-size: 13px;
    color: #667085;
    line-height: 1.2;
}

.cg-progress-top b {
    display: block;
    font-size: 15px;
    color: #0f172a;
    font-weight: 800;
    line-height: 1.2;
}

.cg-progress-top strong {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.cg-progress-item.coffee strong {
    color: #7a3f22;
}

.cg-progress-item.water strong {
    color: #1f7aff;
}

.cg-progress-bar {
    height: 7px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.cg-progress-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.cg-progress-item.coffee .cg-progress-bar i {
    background: #7a3f22;
}

.cg-progress-item.water .cg-progress-bar i {
    background: #1f7aff;
}

/* Softer Webix confirm popup */

.webix_modal_box {
    border-radius: 22px !important;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18) !important;
    font-family: 'Inter', sans-serif !important;
    overflow: hidden !important;
}

.webix_modal_box .webix_popup_title {
    font-weight: 800 !important;
    color: #0f172a !important;
}

.webix_modal_box .webix_popup_text {
    color: #667085 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.webix_modal_box .webix_popup_button {
    border-radius: 14px !important;
    font-weight: 800 !important;
}

.webix_modal_box .webix_popup_button.confirm {
    background: #f3f4f6 !important;
    color: #475569 !important;
    border: 1px solid #e5e7eb !important;
}

.webix_modal_box .webix_popup_button.cancel {
    background: #f8fafc !important;
    color: #667085 !important;
    border: 1px solid #e5e7eb !important;
}
