:root {
    /* Authentic Apple System Colors */
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-blue: #0071e3;
    --accent-red: #ff3b30;
    --accent-orange: #ff9500;
    --accent-yellow: #ffcc00;
    --accent-green: #34c759;
    --accent-mint: #00c7be;
    --accent-teal: #30b0c7;
    --accent-cyan: #32ade6;
    --accent-indigo: #5856d6;
    --accent-purple: #af52de;
    --accent-pink: #ff2d55;
    --accent-gray: #8e8e93;

    --gradient-1: linear-gradient(135deg, #0071e3 0%, #af52de 100%);
    --gradient-warm: linear-gradient(135deg, #ff9500 0%, #ff2d55 100%);
    --gradient-cute: linear-gradient(135deg, #ff8bac 0%, #ffb6c1 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 100%);

    --shadow-soft: 0 4px 24px 0 rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 12px 40px 0 rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 60px 0 rgba(0, 0, 0, 0.12);

    --border-radius: 24px;
    --border-radius-sm: 12px;
    --border-radius-lg: 32px;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --birth-date: "2025-12-24";
}

/* Dark Mode Override */
body.dark-mode {
    --bg-primary: #000000;
    --bg-secondary: #1d1d1f;
    --bg-glass: rgba(29, 29, 31, 0.8);
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.7);
}

body.dark-mode {
    background: #000000;
}

body.dark-mode .advisor-card,
body.dark-mode .inventory-card,
body.dark-mode .advisor-item,
body.dark-mode .stat-card,
body.dark-mode .chart-card,
body.dark-mode .timeline-filter-card,
body.dark-mode .modal,
body.dark-mode .data-table-card,
body.dark-mode .lang-switcher {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1c1c1e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .advisor-item {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .date-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 182, 193, 0.2);
}

body.dark-mode .advisor-status-badge {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;
    overflow-x: hidden;
}

header {
    text-align: left;
    padding: 60px 0 40px;
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.022em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.subtitle .day-count {
    display: inline-block;
    background: var(--gradient-cute);
    padding: 4px 12px;
    border-radius: 20px;
    color: #fff;
    font-weight: 700;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(252, 182, 159, 0.4);
}

.top-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn-add {
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 980px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add:hover {
    background: #f5f5f7;
    border-color: rgba(0, 0, 0, 0.12);
    transform: scale(1.02);
    box-shadow: var(--shadow-medium);
}

/* Timeline Filter Card */
.timeline-filter-card {
    background: var(--bg-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: var(--transition);
}

.timeline-filter-card:hover {
    box-shadow: var(--shadow-medium);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 600px) {
    .timeline-dates {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr auto 1fr auto;
        gap: 8px;
        align-items: center;
    }

    .date-input {
        padding: 8px;
        font-size: 0.85rem;
        width: 100% !important;
    }
}

.timeline-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.stats-section-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-left: 4px;
}

.timeline-dates {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-input {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.date-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.date-separator {
    color: var(--text-secondary);
    font-weight: 600;
}

.btn-reset {
    background: var(--gradient-2);
    border: none;
    color: #fff;
    padding: 10px 16px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 237, 234, 0.4);
    font-size: 0.875rem;
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 237, 234, 0.5);
}

.timeline-slider-container {
    padding: 10px 8px 0;
}

.timeline-track {
    position: relative;
    height: 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    cursor: pointer;
}

.timeline-range {
    position: absolute;
    height: 100%;
    background: var(--gradient-1);
    border-radius: 6px;
    pointer-events: none;
}

.timeline-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: #fff;
    border: 3px solid var(--accent-pink);
    border-radius: 50%;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
    z-index: 10;
}

.timeline-handle:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 12px rgba(255, 139, 172, 0.4);
}

.timeline-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

.timeline-handle.start {
    left: 0%;
}

.timeline-handle.end {
    left: 100%;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.timeline-labels span {
    text-align: center;
}

.toast.warning {
    border: 2px solid #ffb87e;
    color: #e07b39;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-medium);
}

.stat-card .icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 16px;
}

.stat-card.weight .icon {
    background: linear-gradient(135deg, #7ee8b8 0%, #a8edea 100%);
}

.stat-card.weight::before {
    background: linear-gradient(90deg, #7ee8b8, #a8edea);
}

.stat-card.feeding .icon {
    background: linear-gradient(135deg, #ffb6c1 0%, #ffc8dd 100%);
}

.stat-card.feeding::before {
    background: linear-gradient(90deg, #ffb6c1, #ffc8dd);
}

.stat-card.breast .icon {
    background: linear-gradient(135deg, #ffb87e 0%, #ffe57e 100%);
}

.stat-card.breast::before {
    background: linear-gradient(90deg, #ffb87e, #ffe57e);
}

.stat-card.formula .icon {
    background: linear-gradient(135deg, #7ec8ff 0%, #b388ff 100%);
}

.stat-card.formula::before {
    background: linear-gradient(90deg, #7ec8ff, #b388ff);
}

.stat-card.bath .icon {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.stat-card.bath::before {
    background: linear-gradient(90deg, #a29bfe, #6c5ce7);
}

.stat-card.height .icon {
    background: linear-gradient(135deg, #81ecec 0%, #74b9ff 100%);
}

.stat-card.height::before {
    background: linear-gradient(90deg, #81ecec, #74b9ff);
}

.stat-card .label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card .change {
    font-size: 0.875rem;
    margin-top: 8px;
    font-weight: 600;
}

.stat-card .change.positive {
    color: #4ade80;
}

.stat-card .change.negative {
    color: #fb7185;
}

.predicted-weight-box {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode .predicted-weight-box {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.predicted-weight-box .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0;
}

.predicted-weight-box .value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: var(--bg-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: var(--transition);
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-card.full-width {
    grid-column: 1 / -1;
    width: 100%;
}

.chart-card h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.chart-card h2::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

canvas {
    max-width: 100% !important;
}

.chart-container.tall {
    height: 400px;
}

.feeding-table-container {
    max-height: 500px;
    overflow-y: auto;
}

.feeding-table {
    width: 100%;
    border-collapse: collapse;
}

.feeding-table th,
.feeding-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 182, 193, 0.2);
}

.feeding-table th {
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.875rem;
    position: sticky;
    top: 0;
}

.feeding-table td {
    font-size: 0.875rem;
    font-weight: 500;
}

.feeding-table tr:hover td {
    background: rgba(255, 182, 193, 0.05);
}

.date-display {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-display .actual-date {
    color: var(--text-primary);
    font-weight: 600;
}

.date-display .day-age {
    font-size: 0.75rem;
    color: var(--accent-pink);
    font-weight: 800;
}

body.dark-mode .date-display .day-age {
    color: #ff8bac;
}

.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.type-badge.breast,
.type-badge.breastMilk {
    background: rgba(255, 149, 0, 0.12);
    color: #ff9500;
}

.type-badge.formula {
    background: rgba(0, 113, 227, 0.12);
    color: #0071e3;
}

.type-badge.water,
.type-badge.waterMilk {
    background: rgba(52, 199, 89, 0.12);
    color: #34c759;
}

.type-badge.direct {
    background: rgba(175, 82, 222, 0.12);
    color: #af52de;
}

.type-badge.mixed {
    background: rgba(255, 45, 85, 0.12);
    color: #ff2d55;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(74, 74, 106, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-glass);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: modalIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.modal textarea {
    width: 100%;
    height: 200px;
    padding: 16px;
    border: 2px solid rgba(255, 182, 193, 0.3);
    border-radius: 16px;
    font-family: 'Menlo', 'Monaco', monospace;
    font-size: 0.875rem;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin-bottom: 16px;
}

.modal textarea:focus {
    outline: none;
    border-color: var(--accent-pink);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-cancel {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    padding: 12px 24px;
    border-radius: 980px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.btn-submit {
    background: var(--accent-blue);
    border: none;
    color: #fff;
    padding: 12px 28px;
    border-radius: 980px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-submit:hover {
    background: #0077ed;
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.2);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.format-hint {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.format-hint code {
    background: rgba(255, 182, 193, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Menlo', monospace;
    color: var(--accent-pink);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    padding: 16px 28px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    z-index: 1001;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border: 2px solid #7ee8b8;
    color: #059669;
}

.toast.error {
    border: 2px solid #fb7185;
    color: #e11d48;
}

footer {
    text-align: center;
    padding: 32px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ffb6c1, #ffc8dd);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff8bac, #ffb6c1);
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-secondary);
    font-weight: 600;
}

.loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 4px solid var(--bg-primary);
    border-top-color: var(--accent-pink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Language Switcher */
.lang-switcher {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    gap: 4px;
    background: var(--bg-glass);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 4px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.lang-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.theme-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    margin-right: 4px;
}

body.dark-mode .theme-btn {
    border-right-color: rgba(255, 255, 255, 0.1);
}

.theme-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

body.dark-mode .theme-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.lang-btn.active {
    background: white;
    color: var(--accent-pink);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.dark-mode .lang-btn.active {
    background: var(--accent-pink);
    color: white;
}

.lang-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* Mobile & Tablet Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    header {
        padding: 60px 0 24px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    .subtitle .day-count {
        display: block;
        margin: 8px auto 0;
        width: fit-content;
    }

    .lang-switcher {
        top: 8px;
        right: 8px;
        padding: 2px;
        gap: 2px;
        transform: scale(0.85);
        transform-origin: top right;
    }

    .lang-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .top-actions {
        margin-bottom: 16px;
    }

    .btn-add {
        padding: 12px 20px;
        font-size: 0.875rem;
        width: 100%;
        justify-content: center;
    }

    /* Timeline filter */
    .timeline-filter-card {
        padding: 16px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .timeline-title {
        text-align: center;
    }

    .timeline-dates {
        justify-content: center;
        flex-wrap: wrap;
    }

    .date-input {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .timeline-slider-container {
        padding: 16px 4px 0;
    }

    .timeline-handle {
        width: 28px;
        height: 28px;
    }

    .timeline-labels {
        font-size: 0.7rem;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        margin-bottom: 12px;
    }

    .stat-card .value {
        font-size: 1.5rem;
    }

    .stat-card .label {
        font-size: 0.75rem;
    }

    .stat-card .change {
        font-size: 0.75rem;
    }

    /* Charts */
    .charts-grid {
        gap: 16px;
    }

    .chart-card {
        padding: 16px;
    }

    .chart-card h2 {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    .chart-container {
        height: 250px;
    }

    .chart-container.tall {
        height: 300px;
    }

    /* Table */
    .feeding-table th,
    .feeding-table td {
        padding: 10px 8px;
        font-size: 0.75rem;
    }

    .type-badge {
        padding: 3px 8px;
        font-size: 0.65rem;
    }

    .date-display .actual-date {
        font-size: 0.8rem;
    }

    /* Modal */
    .modal {
        padding: 20px;
        margin: 10px;
        max-height: 90vh;
    }

    .modal h3 {
        font-size: 1.25rem;
    }

    .modal textarea {
        height: 150px;
        font-size: 0.8rem;
    }

    .format-hint {
        padding: 12px;
        font-size: 0.75rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
        text-align: center;
    }

    /* Toast */
    .toast {
        left: 16px;
        right: 16px;
        transform: translateY(100px);
        text-align: center;
        font-size: 0.875rem;
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* Redesigned Dashboard CSS */
.main-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 64px;
}

@media (max-width: 1024px) {
    .main-dashboard {
        grid-template-columns: 1fr;
    }
}

.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 768px) {
    .stats-grid.compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .stats-grid.compact {
        grid-template-columns: 1fr;
    }
}

.inventory-grid-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 64px;
}

@media (max-width: 900px) {
    .inventory-grid-wrapper {
        grid-template-columns: 1fr;
    }

    .stat-card.bath.full-height {
        height: auto;
    }
}

.stat-card.bath.full-height {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stats-section-title {
    margin-top: 0 !important;
    margin-bottom: 16px !important;
}

.charts-grid.secondary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

@media (max-width: 600px) {
    .charts-grid.secondary {
        grid-template-columns: 1fr;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .timeline-dates {
        gap: 8px;
    }

    .date-input {
        width: 100%;
    }
}

/* iPad / Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-card .value {
        font-size: 1.5rem;
    }

    .timeline-header {
        flex-wrap: nowrap;
    }
}

/* Large iPad Pro / Desktop */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
    }
}

/* Feeding Advisor Card - Minimal Unified */
.advisor-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 0;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: var(--shadow);
    z-index: 1;
    flex: 1;
}

.advisor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.advisor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.advisor-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.advisor-header .icon {
    font-size: 1.6rem;
}

.advisor-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.advisor-status-badge {
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.advisor-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .advisor-main {
        grid-template-columns: 1fr;
    }
}

.advisor-item {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    position: relative;
}

.advisor-item:hover {
    background: #eeeeef;
    border-color: rgba(0, 0, 0, 0.1);
}

.advisor-item .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.advisor-item .value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.advisor-item .value.time-range {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.advisor-item .sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 600;
}

/* Revised Intake Visuals */
.advisor-intake-visual {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(162, 155, 254, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(162, 155, 254, 0.1);
}

@media (max-width: 480px) {
    .advisor-intake-visual {
        flex-direction: column;
        gap: 20px;
        padding: 16px;
    }
}

.intake-gauge-container {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.intake-gauge {
    transform: rotate(-90deg);
}

.intake-gauge circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.gauge-bg {
    stroke: rgba(162, 155, 254, 0.1);
}

.gauge-progress {
    stroke: var(--gradient-1);
    /* Note: SVG stroke doesn't support linear-gradient directly without defs, fallback to color */
    stroke: #a29bfe;
    stroke-dasharray: 283;
    /* 2 * PI * 45 */
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
}

.gauge-percent {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.gauge-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 4px;
}

.gauge-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-top: 2px;
}

.intake-stats-modern {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modern-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

body.dark-mode .modern-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.modern-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.modern-item .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.modern-item .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modern-item .value.highlight {
    color: var(--accent-pink);
    font-weight: 800;
}

/* Inventory Card */
.inventory-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 0;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.inventory-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.inventory-item {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .inventory-item {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.inventory-item .can-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-purple);
    margin-bottom: 8px;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(175, 82, 222, 0.1);
}

.inventory-item.diaper .can-label {
    color: #10ac84;
    background: rgba(85, 239, 196, 0.2);
}

.inventory-item .can-duration {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.inventory-item .can-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.feeding-column .chart-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 24-Hour Clock Visualization */
.clock-24h-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.clock-24h-svg {
    width: 100%;
    height: 100%;
    max-width: 300px;
    max-height: 300px;
}

.clock-hour-label {
    font-size: 10px;
    font-weight: 700;
    fill: var(--text-secondary);
    text-anchor: middle;
    dominant-baseline: middle;
}

.clock-hour-label.major {
    font-size: 12px;
    font-weight: 800;
    fill: var(--text-primary);
}

.clock-bar {
    transition: opacity 0.2s, transform 0.2s;
    cursor: pointer;
}

.clock-bar:hover {
    opacity: 1 !important;
    filter: brightness(1.1);
}

.clock-center-text {
    font-size: 12px;
    font-weight: 700;
    fill: var(--text-primary);
    text-anchor: middle;
}

.clock-center-value {
    font-size: 18px;
    font-weight: 800;
    fill: var(--text-primary);
    text-anchor: middle;
}

.clock-tooltip {
    position: absolute;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    white-space: nowrap;
    box-shadow: var(--shadow-hover);
}

.clock-tooltip.visible {
    opacity: 1;
}

.clock-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding: 0 8px;
}

.clock-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.clock-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .clock-24h-container {
        height: 240px;
    }

    .clock-24h-svg {
        max-width: 220px;
        max-height: 220px;
    }

    .clock-legend {
        gap: 8px;
    }

    .clock-legend-item {
        font-size: 0.7rem;
    }
}