
   @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap");

    :root {
        --sidebar-width-lg: 14rem;
        --main-padding-lg: 1.75rem;
        --grid-gap-lg: 1.25rem;
        --card-padding-lg: 1.25rem; /* Padding standar untuk card */
        --font-size-base: 16px;
        --font-size-lg: 17px;
    }

    body {
      font-family: "Inter", sans-serif;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      background-color: #f3f4f6;
      margin: 0;
      padding: 0;
      overflow-x: hidden; /* Prevent horizontal scrollbar on body */
    }

    #main-layout-container {
        flex: 1;
        display: flex;
        width: 100%;
        min-height: 100vh;
        background-color: white;
        border-radius: 0;
        overflow: hidden; /* Crucial for preventing scrollbars from content inside */
        box-shadow: none;
        margin: 0;
    }

    .sidebar {
        min-width: 10rem; /* Default, will be overridden by LG */
        flex-shrink: 0;
        padding: 1.5rem 1rem; /* Default, will be overridden by LG */
        border-right: 1px solid #e5e7eb;
    }
    .sidebar img {
        margin-bottom: 2rem;
        margin-left: 0.5rem;
        height: 72px;
        width: 72px;
    }
    .sidebar nav {
        margin-bottom: 2rem;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    .sidebar nav a {
        padding: 0.625rem 0.75rem;
        border-radius: 0.375rem;
        transition: color 0.15s ease-in-out;
    }
    .sidebar nav a.bg-[#1d4ed8] {
        padding-left: 0.75rem; /* Menjaga padding kiri konsisten */
    }
    .sidebar button.rounded-full {
        margin-left: 0.5rem;
        padding: 0.25rem 0.75rem;
    }

    main {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 1.5rem; /* Default, will be overridden by LG */
    }
    main header {
        padding-bottom: 1.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    main header h1 {
        font-size: 1.25rem;
        font-weight: 600;
        font-style: italic;
    }
    main header div {
        padding: 0.375rem 0.75rem;
        border-radius: 0.375rem;
        font-size: 0.75rem;
        display: flex;
        align-items: center;
        gap: 0.5rem; /* Gap antara elemen di dalam div header kanan */
    }
    main header div span:first-of-type {
        margin-right: -0.25rem; /* Adjust gap for icon */
    }


    /* Grid Konten Utama */
    .content-grid {
        flex: 1; /* Allow content grid to grow */
        display: grid;
        grid-template-columns: 2fr 1fr; /* Default, will be overridden by LG if needed */
        grid-template-rows: auto 1fr; /* Baris pertama auto (konten atas), baris kedua mengisi sisa (konten bawah) */
        gap: 1.5rem; /* Default, will be overridden by LG */
        align-items: stretch; /* Memastikan item mengisi tinggi sel */
        min-height: 0; /* Critical for grid items to shrink */
    }

    /* Setiap Section (card) */
    section {
        background-color: white;
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        padding: var(--card-padding-lg); /* Padding standar untuk semua card */
        display: flex;
        flex-direction: column;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
        flex-grow: 1; /* Memungkinkan card mengisi ruang yang tersedia */
        min-height: 0; /* Penting untuk flex items di dalam flex container */
    }

    /* Statistik Overview */
    .section-overview {
        grid-row: 1;
        grid-column: 1;
        position: relative;
        padding: var(--card-padding-lg); /* Revert to standard padding for the card */
        display: flex;
        flex-direction: column; /* Ensure content stacks vertically */
    }
    .section-overview p.text-xs {
        margin-bottom: 0.25rem;
        font-size: 0.7rem;
        color: #9ca3af;
    }
    .section-overview .header-overview {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem; /* Jarak antara header dan grafik */
    }
    .section-overview .header-overview h2 {
        font-size: 1.25rem;
        font-weight: 600;
        margin: 0;
        color: #1f2937;
    }
    .section-overview .good-tag {
        background-color: #d1fae5;
        color: #065f46;
        font-size: 0.75rem;
        font-weight: 600;
        border-radius: 9999px;
        padding: 0.25rem 0.75rem;
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        height: 1.5rem;
    }
    .chart-container {
        flex-grow: 1; /* Allow chart container to take available height */
        position: relative;
        padding: 0; /* Remove padding from chart-container directly */
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: white;
        overflow: hidden; /* Hide any overflow from SVG if it's too big */
        padding-top: 0.5rem; /* A little padding above the chart */
        padding-bottom: 0.5rem; /* A little padding below the chart */
    }

    /* Wrapper khusus untuk SVG agar bisa mengisi penuh lebar chart-container */
    .chart-wrapper {
        width: 100%; /* MEMASTIKAN WRAPPER MENGISI LEBAR PENUH DARI PARENTNYA */
        height: 100%;
        display: flex; /* Gunakan flex untuk centering jika viewBox tidak mengisi sepenuhnya */
        align-items: center;
        justify-content: center;
        padding: 0 10px; /* Adjust as needed, visual padding for the graph */
        box-sizing: border-box; /* Include padding in width */
    }

    .chart-wrapper svg {
        width: 100%; /* SVG itself fills the wrapper's content area */
        height: 100%;
        display: block;
        overflow: visible; /* Penting agar label tidak terpotong */
    }
    .chart-grid-line {
        stroke: #e5e7eb;
        stroke-width: 0.5;
    }
    .chart-label {
        fill: #9ca3af;
        font-size: 2.5px; /* Tetap kecil karena SVG skalanya kecil */
        font-weight: 600;
    }
    .chart-label.x-axis {
        text-anchor: middle;
    }
    .chart-label:not(.x-axis) {
        text-anchor: end;
    }

    /* Start/Stop Section */
    .section-control {
        grid-row: 1;
        grid-column: 2;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: var(--card-padding-lg);
        align-items: center;
    }
    .section-control .flex.flex-col.gap-4 {
        margin-bottom: 0;
        flex-grow: 1;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
    .section-control .button-pair {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
        width: fit-content;
    }
    .section-control .btn-action {
        width: 6rem;
        padding: 0.75rem 0;
        border-radius: 0.375rem;
        font-weight: 600;
        text-align: center;
        flex-shrink: 0;
        font-size: 0.9rem;
    }
    .section-control .indicator {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.875rem;
        font-weight: 600;
        color: #4b5563;
    }
    .section-control .indicator .icon-circle {
        width: 0.9rem;
        height: 0.9rem;
        border-radius: 9999px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .section-control .time-display {
        align-self: center;
        font-size: 1.5rem;
        font-style: italic;
        color: #1f2937;
        font-weight: bold;
        padding-top: 0.75rem;
        margin-top: auto;
    }
    .section-control .time-display span {
        font-weight: bold;
    }


    /* AI Recommendation Section */
    .section-ai-rec {
        grid-row: 2;
        grid-column: 1;
        border: 2px solid #3b82f6;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow-y: hidden;
        padding: var(--card-padding-lg);
    }
    .section-ai-rec p.font-semibold {
        color: #1e40af;
        margin-bottom: 0.5rem;
        font-weight: bold;
        font-size: 1.125rem;
    }
    .section-ai-rec p.leading-relaxed {
        line-height: 1.625;
        flex-grow: 1;
        font-weight: bold;
        font-size: 0.95rem;
        color: #4b5563;
        max-height: unset;
        overflow-y: hidden;
    }

    /* Pressure Info Section */
    .section-pressure-info {
        grid-row: 2;
        grid-column: 2;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: var(--card-padding-lg);
        min-height: 0;
        align-items: flex-start;
    }
    .section-pressure-info .flex.flex-col {
        width: 100%;
    }
    .section-pressure-info .info-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.8rem;
        font-size: 0.95rem;
        color: #1f2937;
        width: 100%; /* Ensure info-row takes full width */
    }
    .section-pressure-info .info-row:last-of-type {
        margin-bottom: 0;
    }
    .section-pressure-info .info-row span {
        font-weight: 600;
    }
    .section-pressure-info .info-row span:nth-child(1) {
        flex-shrink: 0;
        margin-right: 0.5rem;
    }
    .section-pressure-info .info-row span:nth-child(2) {
        font-size: 1.15rem;
        font-weight: 700;
        min-width: 4.5rem;
        text-align: right;
        flex-grow: 1;
    }
    .section-pressure-info .info-row input[type="number"] {
        font-size: 1.15rem;
        font-weight: 700;
        min-width: 4.5rem;
        text-align: right;
        flex-grow: 1;
        background-color: #f9fafb;
        border: 1px solid #d1d5db;
        border-radius: 0.25rem;
        padding: 0.25rem 0.5rem;
        -moz-appearance: textfield; /* Firefox hide arrows */
    }
    .section-pressure-info .info-row input[type="number"]::-webkit-outer-spin-button,
    .section-pressure-info .info-row input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none; /* Chrome, Safari hide arrows */
        margin: 0;
    }

    .section-pressure-info .info-row span:nth-child(3) {
        flex-shrink: 0;
        margin-left: 0.3rem;
    }
    .section-pressure-info .counting-time {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        border: 1.5px solid black;
        border-radius: 0.375rem;
        padding: 0.5rem 0.9rem;
        font-size: 0.85rem;
        font-weight: 600;
        gap: 0.25rem;
        margin-top: 1.5rem;
        color: #1f2937;
        box-sizing: border-box; /* Include padding in width */
    }
    .section-pressure-info .counting-time span {
        font-weight: bold;
    }
    /* Specific adjustment for the first span in counting-time to ensure left alignment */
    .section-pressure-info .counting-time span:first-of-type {
        margin-right: auto; /* Push subsequent spans to the right */
    }


    /* Responsivitas - iPad Landscape (1024px, seperti gambar target) */
    @media (min-width: 1024px) and (orientation: landscape) {
        body {
            font-size: var(--font-size-lg);
        }

        .sidebar {
            min-width: var(--sidebar-width-lg);
            padding: 2rem 1.5rem;
        }
        .sidebar img {
            height: 80px;
            width: 80px;
            margin-bottom: 2.5rem;
            margin-left: 0.5rem;
        }
        .sidebar nav {
            gap: 1rem;
        }
        .sidebar nav a {
            padding: 0.75rem 1rem;
            font-size: 0.95rem;
        }
        .sidebar button.rounded-full {
            font-size: 0.75rem;
            padding: 0.3rem 0.8rem;
        }

        main {
            padding: var(--main-padding-lg);
        }
        main header {
            padding-bottom: var(--main-padding-lg);
        }
        main header h1 {
            font-size: 1.75rem;
        }
        main header div {
            font-size: 0.9rem;
            padding: 0.5rem 1rem;
            gap: 0.75rem;
        }

        .content-grid {
            gap: var(--grid-gap-lg);
        }

        section {
            padding: var(--card-padding-lg); /* Padding standar untuk semua card */
            border-width: 1.5px;
        }

        /* Statistik Overview */
        .section-overview {
            padding: var(--card-padding-lg); /* Standard padding for the card */
        }
        .section-overview p.text-xs {
            font-size: 0.75rem;
        }
        .section-overview .header-overview h2 {
            font-size: 1.35rem;
        }
        .section-overview .good-tag {
            font-size: 0.8rem;
            padding: 0.3rem 0.9rem;
        }
        .chart-label {
            font-size: 2.5px;
        }
        .chart-grid-line {
            stroke-width: 0.5;
        }

        /* Start/Stop Section */
        .section-control {
            padding: 1.5rem;
            justify-content: center;
        }
        .section-control .flex.flex-col.gap-4 {
            margin-bottom: 0;
        }
        .section-control .button-pair {
            gap: 0.75rem;
            margin-bottom: 1rem;
        }
        .section-control .btn-action {
            width: 7rem;
            padding: 0.8rem 0;
            font-size: 1rem;
        }
        .section-control .indicator {
            font-size: 0.95rem;
        }
        .section-control .indicator .icon-circle {
            width: 1.1rem;
            height: 1.1rem;
        }
        .section-control .time-display {
            font-size: 1.8rem;
            padding-top: 1.2rem;
            margin-top: auto;
        }

        /* AI Recommendation Section */
        .section-ai-rec {
            padding: 1.5rem;
        }
        .section-ai-rec p.font-semibold {
            font-size: 1.15rem;
        }
        .section-ai-rec p.leading-relaxed {
            font-size: 1rem;
            line-height: 1.5;
        }

        /* Pressure Info Section */
        .section-pressure-info {
            padding: 1.5rem;
            justify-content: center;
        }
        .section-pressure-info .info-row {
            font-size: 1rem;
            margin-bottom: 0.8rem;
        }
        .section-pressure-info .info-row span:nth-child(2),
        .section-pressure-info .info-row input[type="number"] {
            font-size: 1.25rem;
            min-width: 5rem;
        }
        .section-pressure-info .counting-time {
            font-size: 0.9rem;
            padding: 0.5rem 1rem;
            margin-top: 1.5rem;
        }
    }

    /* Responsivitas umum untuk tablet (768px - 1023px) */
    @media (min-width: 768px) and (max-width: 1023px) {
        .content-grid {
            grid-template-columns: 1fr 1fr;
            grid-template-rows: auto auto; /* Baris pertama auto, baris kedua auto */
            gap: 1rem;
            align-items: stretch;
        }
        .section-overview,
        .section-control,
        .section-ai-rec,
        .section-pressure-info {
            grid-column: span 1;
            grid-row: auto;
            flex-grow: 1;
            min-height: 0;
        }
        .section-overview {
            padding: var(--card-padding-lg); /* Standard padding for the card */
        }
        .chart-label {
            font-size: 2.5px;
        }
        .chart-grid-line {
            stroke-width: 0.5;
        }
        .section-control {
            padding: 1.25rem;
        }
        .section-control .btn-action {
            width: 6rem;
            font-size: 0.9rem;
        }
        .section-control .time-display {
            font-size: 1.4rem;
        }
        .section-ai-rec {
            padding: 1.25rem;
        }
        .section-pressure-info {
            padding: 1.25rem;
        }
        .section-pressure-info .info-row span:nth-child(2),
        .section-pressure-info .info-row input[type="number"] {
            font-size: 1.1rem;
        }
    }

    /* Responsivitas untuk Mobile (Max 767px) */
    @media (max-width: 767px) {
        #main-layout-container {
            flex-direction: column;
            min-height: auto;
        }
        .sidebar {
            width: 100%;
            border-right: none;
            border-bottom: 1px solid #e5e7eb;
            padding: 0.75rem 1rem;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
        }
        .sidebar img {
            margin-bottom: 0;
            margin-left: 0;
            width: 48px;
            height: 48px;
        }
        .sidebar nav {
            display: none; /* Hide navigation on small screens */
        }
        .sidebar button.rounded-full {
            margin-left: 0;
            padding: 0.2rem 0.5rem;
            font-size: 0.5rem;
        }
        main {
            padding: 1rem;
        }
        main header {
            flex-direction: column;
            align-items: flex-start;
            padding-bottom: 1rem;
        }
        main header h1 {
            font-size: 1.1rem;
        }
        main header div {
            margin-top: 0.5rem;
            font-size: 0.7rem;
            padding: 0.3rem 0.6rem;
        }
        .content-grid {
            grid-template-columns: 1fr;
            grid-template-rows: auto auto auto auto; /* Semua baris auto */
            gap: 1rem;
            align-items: start;
        }
        section {
            padding: 1rem;
            flex-grow: 0; /* Jangan biarkan flex-grow di mobile agar tingginya sesuai konten */
        }
        .section-overview {
            padding: 1rem; /* Standard padding for the card */
        }
        .section-overview .header-overview {
            flex-direction: column;
            align-items: flex-start;
            margin-bottom: 0.75rem;
        }
        .section-overview .good-tag {
            margin-top: 0.5rem;
            align-self: flex-start;
            font-size: 0.7rem;
            padding: 0.2rem 0.6rem;
        }
        .section-overview .header-overview h2 {
            font-size: 1.1rem;
        }
        .chart-label {
            font-size: 2.5px;
        }
        .chart-grid-line {
            stroke-width: 0.5;
        }
        .section-control {
            padding: 1rem;
        }
        .section-control .button-pair {
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.75rem;
        }
        .section-control .btn-action {
            width: 100%;
            max-width: 6rem;
            padding: 0.6rem 0;
            font-size: 0.8rem;
        }
        .section-control .indicator {
            font-size: 0.8rem;
        }
        .section-control .indicator .icon-circle {
            width: 0.8rem;
            height: 0.8rem;
        }
        .section-control .time-display {
            font-size: 1.2rem;
            padding-top: 0.6rem;
        }
        .section-ai-rec p.font-semibold {
            font-size: 1rem;
        }
        .section-ai-rec p.leading-relaxed {
            font-size: 0.85rem;
        }
        .section-pressure-info .info-row {
            font-size: 0.85rem;
            margin-bottom: 0.5rem;
        }
        .section-pressure-info .info-row span:nth-child(2),
        .section-pressure-info .info-row input[type="number"] {
            font-size: 1rem;
            min-width: unset;
        }
        .section-pressure-info .counting-time {
            font-size: 0.7rem;
            padding: 0.3rem 0.6rem;
            margin-top: 1rem;
        }
    }
