@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Nunito:wght@500;600;700&display=swap');

:root {
    --bg-main: #e9eef5;
    --bg-soft: #f7f9fc;
    --panel: #ffffff;
    --ink: #182230;
    --ink-soft: #4a596b;
    --line: #d4dde8;
    --brand: #0f6ad8;
    --brand-strong: #084a9a;
    --accent: #17a36b;
    --danger: #d93a49;
    --shadow-lg: 0 24px 56px rgba(16, 43, 77, 0.16);
    --shadow-md: 0 12px 30px rgba(18, 54, 100, 0.12);
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 0%, #d8e6ff 0%, transparent 32%),
        radial-gradient(circle at 92% 18%, #d9f5ea 0%, transparent 28%),
        linear-gradient(140deg, #e9eef5 0%, #eff3f9 45%, #e6edf7 100%);
    padding: 28px;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid rgba(15, 58, 108, 0.08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 28px;
}

.top-app-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.nav-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #d3dfef;
    background: #f4f8fe;
    color: #2f4661;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
}

.nav-chip:hover {
    background: #e8f1ff;
}

.nav-chip.active {
    color: #fff;
    background: linear-gradient(130deg, #0f6ad8, #084a9a);
    border-color: transparent;
}

.bottom-app-nav {
    display: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.analytics-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.analytics-grid-2col .category {
    margin-bottom: 0;
}

.stat-card {
    border-radius: 16px;
    border: 1px solid #d8e3f1;
    background: linear-gradient(180deg, #ffffff, #f7fbff);
    padding: 14px;
}

.stat-label {
    margin: 0 0 8px;
    font-size: 0.8rem;
    color: #53657d;
    font-weight: 700;
}

.stat-value {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    color: #1c2f47;
}

.stat-note {
    margin: 6px 0 0;
    font-size: 0.83rem;
    color: #5f6f83;
}

.flow-line {
    margin: 0 0 10px;
    color: #33465e;
}

.timeline-filter {
    margin: 16px 0;
    border: 1px solid #d7e2f0;
    border-radius: 14px;
    padding: 12px;
    background: #f8fbff;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1.3fr repeat(4, minmax(150px, 1fr));
    gap: 10px;
    align-items: end;
}

.filter-buttons {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.quick-range-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 8px;
}

.range-chip {
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    color: #33506f;
    background: #edf4ff;
    border: 1px solid #d5e2f4;
    padding: 7px 12px;
    border-radius: 999px;
}

.range-chip.active {
    color: #fff;
    background: linear-gradient(130deg, #0f6ad8, #084a9a);
    border-color: transparent;
}

.active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 8px;
}

.active-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #cfe0f4;
    background: #edf5ff;
    color: #2a4b70;
    font-size: 0.78rem;
    font-weight: 700;
}

.timeline-list {
    display: grid;
    gap: 14px;
}

.timeline-card {
    border: 1px solid #d7e2f0;
    border-radius: 18px;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff, #f9fcff);
}

.timeline-date-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.timeline-date-head h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #20344d;
}

.timeline-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.timeline-section {
    border: 1px solid #e0e9f5;
    border-radius: 14px;
    padding: 10px;
    background: #fff;
}

.timeline-section h4 {
    margin: 0 0 8px;
    font-size: 0.92rem;
    color: #2b415f;
    display: flex;
    align-items: center;
    gap: 7px;
}

.section-count {
    margin-left: auto;
    font-size: 0.74rem;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid #d7e4f4;
    background: #f2f7fd;
    color: #4b6788;
}

.expandable-text {
    margin-top: 4px;
}

.expandable-text summary {
    cursor: pointer;
    color: #1f5fb0;
    font-size: 0.76rem;
    font-weight: 700;
}

.expandable-text div {
    margin-top: 4px;
    font-size: 0.85rem;
    color: #304964;
}

.empty-line {
    margin: 0;
    color: #667a93;
    font-size: 0.88rem;
}

.trend-list {
    display: grid;
    gap: 10px;
}

.trend-row {
    display: grid;
    grid-template-columns: 90px 1fr 34px;
    gap: 8px;
    align-items: center;
}

.trend-label,
.trend-value {
    font-size: 0.82rem;
    color: #334861;
    font-weight: 700;
}

.trend-value {
    text-align: right;
}

.trend-bar-wrap {
    height: 12px;
    border-radius: 999px;
    background: #e5edf8;
    overflow: hidden;
}

.trend-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(130deg, #2f7ae8, #0f5fcf);
}

.trend-bar-wrap.fever {
    background: #f5dce0;
}

.trend-bar.fever {
    background: linear-gradient(130deg, #e65b6c, #ca3147);
}

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}

.page-btn {
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid #d0deef;
    background: #f3f8ff;
    color: #244263;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 10px;
}

.page-meta {
    font-size: 0.84rem;
    color: #4f6782;
    font-weight: 700;
}

h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2.8vw, 2.3rem);
    letter-spacing: -0.02em;
}

h2 {
    margin: 0 0 18px;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.title-with-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.mode-badge.on {
    color: #0f5f3d;
    background: #dff7ec;
    border-color: #8fdbb8;
}

.mode-badge.off {
    color: #8a2d39;
    background: #fae6e9;
    border-color: #ebb8c0;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button-group a,
.button-view,
.header-nav > a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 10px 16px;
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    box-shadow: 0 8px 18px rgba(15, 106, 216, 0.25);
}

.button-add { background: linear-gradient(130deg, #17a36b, #0d7f55); }
.button-plan { background: linear-gradient(130deg, #2f6adf, #1746a9); }
.button-print,
.button-view,
.header-nav > a { background: linear-gradient(130deg, #179ccf, #12689f); }

.button-group a:hover,
.button-view:hover,
.header-nav > a:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(17, 68, 140, 0.28);
}

.success-message {
    margin: 0 0 18px;
    padding: 13px 16px;
    border-radius: var(--radius-md);
    border: 1px solid #9ad8bc;
    background: #e9f8f0;
    color: #15513a;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 18px;
}

.category {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-md);
    animation: riseIn 320ms ease both;
}

.category:nth-child(1) { border-top: 5px solid #f1528f; }
.category:nth-child(2) { border-top: 5px solid #0f89d8; }
.category:nth-child(3) { border-top: 5px solid #f8af1a; }
.category:nth-child(4) { border-top: 5px solid #17a36b; }
.category:nth-child(5) { border-top: 5px solid #5a66d1; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #324357;
    font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    border: 1px solid #ced8e5;
    border-radius: 12px;
    background: #f8fbff;
    color: var(--ink);
    padding: 11px 12px;
    margin-bottom: 14px;
    font: inherit;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #5ea3ff;
    box-shadow: 0 0 0 4px rgba(84, 145, 232, 0.2);
    background: #fff;
}

.datetime-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.radio-group,
.checkbox-group {
    border: 1px solid var(--line);
    background: var(--bg-soft);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.radio-group label,
.checkbox-group label {
    font-weight: 600;
    margin: 0 0 6px;
}

button[type="submit"],
.btn-delete-inline {
    border: 0;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), filter var(--transition), box-shadow var(--transition);
}

button[type="submit"] {
    width: 100%;
    padding: 11px 14px;
    color: #fff;
    background: linear-gradient(130deg, #0f6ad8, #084a9a);
    box-shadow: 0 10px 18px rgba(15, 106, 216, 0.28);
}

button[type="submit"]:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.month-navigation {
    background: linear-gradient(180deg, #f9fbff 0%, #f2f6fc 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nav-button {
    text-decoration: none;
    color: var(--brand-strong);
    font-weight: 700;
    border-radius: 10px;
    padding: 8px 10px;
}

.nav-button:hover {
    background: #e8f1ff;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table thead th {
    background: #f3f7fd;
    color: #2a3c53;
    text-align: left;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    padding: 13px;
}

.data-table td {
    border-top: 1px solid #e4ebf5;
    padding: 13px;
    vertical-align: top;
    font-size: 0.92rem;
}

.data-table tbody tr:nth-child(even) td {
    background: #fbfdff;
}

.data-table td span.mobile-label {
    display: none;
}

.data-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px dashed #dce5f0;
    padding: 6px 0;
}

.data-item:last-child {
    border-bottom: 0;
}

.data-item span {
    flex: 1;
    word-break: break-word;
}

.actions {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-left: 8px;
}

.actions a {
    color: #52657a;
    text-decoration: none;
}

.actions a:hover {
    color: var(--brand);
}

.btn-delete-inline {
    background: transparent;
    color: #7b8695;
    padding: 0;
}

.btn-delete-inline:hover {
    color: var(--danger);
}

.edit-form-container {
    max-width: 720px;
}

.notes-log-container {
    margin-top: 24px;
}

.notes-log-container .data-table td {
    white-space: pre-wrap;
}

.icon-color-1 { color: #f1528f; }
.icon-color-2 { color: #0f89d8; }
.icon-color-3 { color: #f8af1a; }
.icon-color-4 { color: #18a56f; }
.icon-color-5,
.icon-color-purple { color: #5a66d1; }

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Versi Desktop */
body.ui-desktop .container {
    position: relative;
}

body.ui-desktop .container::before {
    content: '';
    position: absolute;
    right: 22px;
    top: -10px;
    width: 220px;
    height: 80px;
    background: linear-gradient(140deg, rgba(15, 106, 216, 0.14), rgba(23, 163, 107, 0.1));
    border-radius: 16px;
    z-index: 0;
    pointer-events: none;
}

body.ui-desktop .container > * {
    position: relative;
    z-index: 1;
}

/* Versi Mobile iOS App */
body.ui-mobile-ios {
    font-family: 'Nunito', sans-serif;
    background:
        radial-gradient(circle at 14% 4%, #d7e8ff 0%, transparent 30%),
        radial-gradient(circle at 94% 0%, #dcf7f0 0%, transparent 22%),
        linear-gradient(180deg, #eef3fa 0%, #e7edf6 100%);
    padding: 10px;
}

body.ui-mobile-ios .container {
    max-width: 460px;
    min-height: calc(100vh - 20px);
    border-radius: 30px;
    padding: 16px;
    box-shadow:
        0 26px 44px rgba(45, 71, 109, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    background: linear-gradient(180deg, #fdfefe 0%, #f6f8fc 100%);
    border: 1px solid rgba(121, 138, 168, 0.3);
    padding-bottom: 86px;
}

body.ui-mobile-ios .top-app-nav {
    display: none;
}

body.ui-mobile-ios .bottom-app-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    width: min(440px, calc(100vw - 20px));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
    background: rgba(250, 252, 255, 0.92);
    border: 1px solid rgba(162, 180, 208, 0.9);
    border-radius: 22px;
    box-shadow: 0 14px 28px rgba(38, 64, 96, 0.26);
    backdrop-filter: blur(10px);
    z-index: 99;
    padding: 8px;
}

.infinite-sentinel {
    margin-top: 12px;
    text-align: center;
}

.infinite-sentinel.loading {
    opacity: 0.6;
}

.skeleton-card {
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.75) 50%, transparent 80%);
    transform: translateX(-100%);
    animation: shimmer 1.2s infinite;
}

.skeleton-line,
.skeleton-box {
    background: #e7eef7;
    border-radius: 10px;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
}

.skeleton-line.short {
    width: 42%;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.skeleton-box {
    height: 66px;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

body.ui-mobile-ios .bottom-tab {
    text-decoration: none;
    color: #4f6686;
    border-radius: 16px;
    text-align: center;
    padding: 6px 4px 7px;
    font-size: 0.66rem;
    font-weight: 800;
    border: 1px solid #d7e2f1;
    background: linear-gradient(180deg, #f8fbff, #eef4fd);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

body.ui-mobile-ios .tab-icon-wrap {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    background: #dfeafb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.ui-mobile-ios .bottom-tab i {
    font-size: 0.88rem;
    color: #356197;
}

body.ui-mobile-ios .tab-label {
    line-height: 1.1;
    letter-spacing: 0.01em;
}

body.ui-mobile-ios .bottom-tab.active {
    background: linear-gradient(145deg, #0f6ad8, #0b4eae);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 9px 16px rgba(12, 82, 170, 0.35);
}

body.ui-mobile-ios .bottom-tab:not(.active) {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body.ui-mobile-ios .bottom-tab.active .tab-icon-wrap {
    background: rgba(255, 255, 255, 0.2);
}

body.ui-mobile-ios .bottom-tab.active i {
    color: #fff;
}

body.ui-mobile-ios .bottom-tab:active {
    transform: scale(0.97);
}

body.ui-mobile-ios .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

body.ui-mobile-ios .stat-card {
    border-radius: 14px;
    padding: 12px;
}

body.ui-mobile-ios .stat-value {
    font-size: 1.35rem;
}

body.ui-mobile-ios .header-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
}

body.ui-mobile-ios h1 {
    font-size: 1.35rem;
    text-align: left;
}

body.ui-mobile-ios .button-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

body.ui-mobile-ios .button-group a,
body.ui-mobile-ios .button-view,
body.ui-mobile-ios .header-nav > a {
    justify-content: center;
    padding: 9px 8px;
    border-radius: 14px;
    font-size: 0.79rem;
    box-shadow: 0 8px 14px rgba(32, 71, 132, 0.2);
}

body.ui-mobile-ios .nav-button,
body.ui-mobile-ios .actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid #d5e2f3;
    background: #eef4ff;
    color: #2c4e78;
    padding: 6px 9px;
    font-size: 0.76rem;
    font-weight: 700;
}

body.ui-mobile-ios .actions {
    gap: 6px;
}

body.ui-mobile-ios .title-with-badge {
    justify-content: space-between;
}

body.ui-mobile-ios .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}

body.ui-mobile-ios .category {
    border-radius: 18px;
    border-top-width: 0;
    border: 1px solid rgba(194, 207, 226, 0.95);
    background: linear-gradient(180deg, #ffffff, #f9fbff);
    padding: 16px;
    box-shadow: 0 8px 18px rgba(46, 73, 112, 0.12);
}

body.ui-mobile-ios .datetime-picker {
    grid-template-columns: 1fr;
    gap: 8px;
}

body.ui-mobile-ios input[type="text"],
body.ui-mobile-ios input[type="number"],
body.ui-mobile-ios input[type="date"],
body.ui-mobile-ios input[type="time"],
body.ui-mobile-ios select,
body.ui-mobile-ios textarea {
    border-radius: 14px;
    background: #f4f7fc;
}

body.ui-mobile-ios .month-navigation {
    padding: 10px;
    border-radius: 14px;
}

body.ui-mobile-ios .month-navigation .current-month {
    font-size: 1rem;
}

body.ui-mobile-ios .data-table {
    border: 0;
    margin-top: 10px;
}

body.ui-mobile-ios .data-table thead {
    display: none;
}

body.ui-mobile-ios .data-table tbody tr {
    display: block;
    border: 1px solid #d7e1ee;
    border-radius: 16px;
    margin-bottom: 11px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 7px 14px rgba(43, 62, 89, 0.09);
}

body.ui-mobile-ios .data-table td {
    display: block;
    border-top: 1px solid #edf2f8;
    padding: 10px 12px;
    position: relative;
}

body.ui-mobile-ios .data-table tr td:first-child {
    border-top: 0;
}

body.ui-mobile-ios .data-table td span.mobile-label {
    display: inline-block;
    font-weight: 700;
    color: #3c4c63;
    margin-right: 6px;
}

body.ui-mobile-ios .actions {
    margin-left: 0;
}

body.ui-mobile-ios .notes-log-container {
    margin-top: 14px;
}

body.ui-mobile-ios .timeline-filter {
    position: static;
    top: auto;
    z-index: auto;
    background: rgba(248, 251, 255, 0.95);
    backdrop-filter: blur(8px);
}

body.ui-mobile-ios .filter-actions-row {
    justify-content: stretch;
}

body.ui-mobile-ios .filter-actions-row .nav-button {
    flex: 1;
    text-align: center;
    justify-content: center;
}

body.ui-mobile-ios .skeleton-grid {
    grid-template-columns: 1fr;
}

body.ui-mobile-ios .filter-grid,
body.ui-mobile-ios .timeline-sections {
    grid-template-columns: 1fr;
}

body.ui-mobile-ios .timeline-date-head {
    align-items: flex-start;
    flex-direction: column;
}

body.ui-mobile-ios .trend-row {
    grid-template-columns: 76px 1fr 28px;
}

body.ui-mobile-ios .pagination-wrap {
    gap: 8px;
}

body.ui-mobile-ios .page-meta {
    font-size: 0.78rem;
}

@media (max-width: 980px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .header-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .analytics-grid-2col {
        grid-template-columns: 1fr;
    }

    .filter-grid,
    .timeline-sections {
        grid-template-columns: 1fr;
    }

    .pagination-wrap {
        flex-wrap: wrap;
    }
}

.filter-actions-row {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ================================================================
   Cycle Status Card — Home Page
   ================================================================ */
.cycle-status-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.cycle-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid #c8dff5;
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f4ff 50%, #f4fbf9 100%);
    align-items: flex-start;
}

.cycle-day-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 66px;
    background: linear-gradient(155deg, #0f6ad8, #063d8c);
    color: #fff;
    border-radius: 14px;
    padding: 14px 8px;
    text-align: center;
    flex-shrink: 0;
}

.cycle-day-num {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.cycle-day-label {
    font-size: 0.6rem;
    font-weight: 700;
    margin-top: 5px;
    opacity: 0.82;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
    white-space: nowrap;
}

.cycle-info-col {
    flex: 1;
    min-width: 0;
}

/* Phase badges */
.phase-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.phase-period     { background: #fde8ef; color: #b91c4a; border: 1px solid #f8bcd0; }
.phase-follicular { background: #fff4e0; color: #b45309; border: 1px solid #fcd9a0; }
.phase-ovulation  { background: #e6f9f1; color: #0a7051; border: 1px solid #86efcb; }
.phase-luteal     { background: #f0ebff; color: #5b21b6; border: 1px solid #c4b5fd; }
.phase-late       { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }

/* Cycle meta rows */
.cycle-meta {
    margin: 3px 0;
    font-size: 0.8rem;
    color: #334b65;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.cycle-meta i {
    color: #5b7aa0;
    width: 13px;
    flex-shrink: 0;
}

.cycle-days-left {
    font-size: 0.75rem;
    color: #6b80a0;
    font-weight: 700;
}

.cycle-due {
    color: #b91c4a;
}

/* Progress bar */
.cycle-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: #dce8f5;
    margin-top: 9px;
    overflow: hidden;
}

.cycle-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
    background: #0f6ad8;
}

.phase-period-fill     { background: #e74c6a; }
.phase-follicular-fill { background: #f59e0b; }
.phase-ovulation-fill  { background: #10b981; }
.phase-luteal-fill     { background: #7c3aed; }
.phase-late-fill       { background: #9ca3af; }

.cycle-progress-label {
    margin: 4px 0 0;
    font-size: 0.72rem;
    color: #7a8fa5;
    font-weight: 700;
}

.cycle-note {
    margin: 6px 0 0;
    font-size: 0.73rem;
    color: #8a9ab5;
    font-style: italic;
}

/* Blok Ovulasi & TTC */
.cycle-ttc-block {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px dashed #ccdaec;
}

.cycle-meta-ovulation i {
    color: #d97706;
}

.cycle-meta-ttc i {
    color: #e11d7a;
}

.cycle-ttc-now {
    color: #e11d7a;
    font-weight: 700;
}

.cycle-ttc-unreliable {
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    border-radius: 8px;
    padding: 7px 10px;
}

/* Today vitals row */
.today-vitals {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.vital-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px 6px;
    border-radius: 14px;
    border: 1px solid #d7e4f2;
    background: #f6faff;
    text-align: center;
}

.vital-chip.vital-ok {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.vital-chip.vital-warn {
    border-color: #fde68a;
    background: #fffbeb;
}

.vital-icon {
    font-size: 1.1rem;
    color: #4472a8;
    margin-bottom: 1px;
}

.vital-ok .vital-icon   { color: #059669; }
.vital-warn .vital-icon { color: #d97706; }

.vital-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    color: #6b7e96;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vital-val {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1c2f47;
}

.vital-date {
    font-size: 0.68rem;
    color: #8a9baf;
    font-weight: 600;
}

.today-insights {
    margin-top: 8px;
}

.today-insights .vital-val i {
    margin-right: 4px;
    color: #5b7aa0;
}

.home-ttc-note {
    margin-top: 10px;
}

.home-ttc-note .flow-line {
    margin-bottom: 6px;
}

/* Mobile overrides for cycle card */
body.ui-mobile-ios .cycle-card {
    border-radius: 16px;
    gap: 12px;
    padding: 14px;
}

body.ui-mobile-ios .cycle-day-col {
    min-width: 58px;
    padding: 12px 6px;
}

body.ui-mobile-ios .cycle-day-num {
    font-size: 1.8rem;
}

body.ui-mobile-ios .cycle-meta {
    font-size: 0.77rem;
}

body.ui-mobile-ios .today-vitals {
    gap: 7px;
}

body.ui-mobile-ios .vital-chip {
    padding: 10px 4px;
    border-radius: 12px;
}

body.ui-mobile-ios .vital-val {
    font-size: 0.82rem;
}

body.ui-mobile-ios .today-insights {
    grid-template-columns: 1fr;
}

/* ================================================================
   Quick Add — Accordion (mobile only)
   ================================================================ */

/* Chevron icon always visible in h2 */
.category h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
}

.acc-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: #92aacb;
    font-size: 0.82rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

/* Accordion — applies on all UI sizes */
.form-grid .category h2 {
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-grid .category:not(.acc-collapsed) h2 {
    margin-bottom: 14px;
}

/* Rotate chevron when open */
.form-grid .category:not(.acc-collapsed) .acc-chevron {
    transform: rotate(180deg);
    color: #3a6aad;
}

/* Hide body when collapsed */
.form-grid .category.acc-collapsed .category-body {
    display: none;
}

/* Animate open */
.form-grid .category .category-body {
    animation: acc-open 0.2s ease;
}

@keyframes acc-open {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}