.barn-container.gender-gutt,
.stats-container.gender-gutt {
    --accent-color: #60a5fa;
    /* Clearer Sky Blue */
    --accent-light: #eff6ff;
    --accent-gradient: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%);
    --weight-color: #60a5fa;
    --height-color: #818cf8;
    --head-color: #2dd4bf;
}

.barn-container.gender-jente,
.stats-container.gender-jente {
    --accent-color: #f472b6;
    /* Blossom Pink */
    --accent-light: #fff1f2;
    --accent-gradient: linear-gradient(135deg, #f472b6 0%, #f9a8d4 100%);
    --weight-color: #f472b6;
    --height-color: #c084fc;
    --head-color: #fb7185;
}

.gender-gutt::before,
.gender-jente::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: 24px 24px;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
}

.gender-gutt::before {
    background-image: radial-gradient(#93c5fd 0.5px, transparent 0.5px);
}

.gender-jente::before {
    background-image: radial-gradient(#cf9fb3 0.5px, transparent 0.5px);
}

.barn-container {
    --accent-color: #5c5f94;
    /* Muted Indigo default */
    --accent-light: #f0f1f7;
    --accent-gradient: linear-gradient(135deg, #5c5f94 0%, #7e81b4 100%);
    padding: 3.2rem 0 0;
    /* Space for fixed header */
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

.barn-container.has-quick-logs {
    padding-bottom: 15rem;
}

.empty-state,
.alert-warning {
    padding: 1.5rem 0.75rem;
}

.barn-header {
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    z-index: 1010;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 0;
    box-sizing: border-box;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}




.btn-settings-icon,
.btn-stats-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0.35;
}

.btn-settings-icon:hover,
.btn-stats-link:hover {
    color: var(--accent-color);
    opacity: 1;
}

.barn-header h1 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.5px;
}

.child-switcher {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    position: relative;
    user-select: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
    min-width: 0;
    flex-shrink: 1;
}

.child-switcher.has-multiple:hover {
    background: rgba(0, 0, 0, 0.03);
}

.switcher-icon {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.switcher-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    background: white;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    min-width: 220px;
    overflow: hidden;
    animation: switcher-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes switcher-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.switcher-item {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.switcher-item:hover {
    background: var(--accent-light);
    color: var(--accent-color);
}

.child-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    padding: 0 0.75rem;
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--accent-light);
    padding: 0.25rem;
    border-radius: 2rem;
    gap: 0.2rem;
    margin-top: 0;
    flex-shrink: 0;
}

.tab {
    flex: initial;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tab.active {
    background: white;
    color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab i {
    font-size: 1.1rem;
}

.tab-content {
    flex: 1;
    margin-top: 1rem;
}

/* Quick Log Grid Fixed at Bottom */
.quick-log-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    position: fixed;
    bottom: 0rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    padding: 1rem 1rem 0.5rem;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    transition: bottom 0.3s ease;
}

.nav-hidden .quick-log-grid {
    bottom: 0;
}

.log-card {
    background: white;
    backdrop-filter: none;
    padding: 1.25rem;
    border-radius: 1.75rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.log-card.active {
    border-color: var(--accent-color);
    background: rgba(99, 102, 241, 0.03);
}

.log-card h3 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.log-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
}

.log-card-header i {
    font-size: 1.25rem;
}

.timer {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    font-family: inherit;
}

.side-selector {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.btn-side,
.btn-start,
.btn-stop,
.btn-primary,
.btn-secondary,
.btn-secondary-outline,
.btn-calm-red {
    padding: 0.8rem 1.2rem;
    border-radius: 1rem;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
    background: var(--accent-light);
    color: var(--accent-color);
}

.btn-secondary-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary-outline:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-calm-red:hover {
    background: #fee2e2;
    color: #7f1d1d;
}

.btn-side.suggested {
    border: 2px solid var(--accent-color) !important;
    background: var(--accent-light) !important;
    color: var(--accent-color) !important;
}

.btn-side {
    background: var(--accent-light);
    color: var(--accent-color);
    border: 2px solid transparent;
}

.btn-calm-stop {
    background: #475569 !important;
    /* Slate 600 */
    color: white !important;
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.2);
}

.btn-calm-stop:hover {
    background: #334155 !important;
}

.btn-side {
    background: var(--accent-light);
    color: var(--accent-color);
}

.btn-start {
    background: var(--success-color);
    color: white;
}

.btn-stop {
    background: #ef4444;
    color: white;
}

.btn-side:active,
.btn-start:active,
.btn-stop:active,
.btn-primary:active {
    transform: scale(0.96);
}

.last-activity {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 0.25rem;
}

/* List Styling */
/* Filter Buttons */
.log-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.log-filter {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem;
    padding-bottom: 0.5rem;
    align-items: center;
    flex: 1;
    -ms-overflow-style: none;
    /* Hide scrollbar for IE/Edge */
    scrollbar-width: none;
    /* Hide scrollbar for Firefox */
}

.log-filter::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome/Safari */
}

.btn-manual-add {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    font-size: 1.1rem;
}

.btn-manual-add:hover {
    border-color: var(--accent-color);
    transform: rotate(90deg);
}

.manual-add-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1020;
    /* Higher than other log items */
}

.manual-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1030;
    min-width: 180px;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    animation: fade-up 0.2s ease-out;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

.menu-item {
    padding: 0.85rem 1.1rem;
    border-radius: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-item:hover {
    background: var(--accent-light);
    color: var(--accent-color);
    transform: translateX(-2px);
}

.menu-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}


.filter-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.filter-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.filter-btn.amming.active {
    background: #f472b6;
    box-shadow: 0 4px 12px rgba(244, 114, 182, 0.2);
}

.filter-btn.sleep.active {
    background: #93c5fd;
    box-shadow: 0 4px 12px rgba(147, 197, 253, 0.2);
}

.filter-btn:not(.active):hover {
    background: white;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.log-item {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 0.65rem 1rem;
    border-radius: 1.25rem;
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.log-item.is-ongoing {
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.log-item.is-ongoing::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    opacity: 0.03;
    z-index: 0;
    transform: rotate(-15deg);
    animation: ongoing-bg-scroll 80s linear infinite;
    pointer-events: none;
    background-repeat: repeat;
}

.log-item.is-ongoing.type-amming::before {
    background-image: url("/person-breastfeeding.svg");
    background-size: 60px 60px;
}

.log-item.is-ongoing.type-sleep::before {
    background-image: url("/cloud-moon.svg");
    background-size: 60px 60px;
}

@keyframes ongoing-bg-scroll {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 120px 0;
    }
}

.log-item.prev-week {
    opacity: 0.7;
    filter: grayscale(0.3);
    transform: scale(0.98);
    border-style: dashed;
}

.log-icon {
    width: 38px;
    height: 38px;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    font-size: 1.1rem;
    position: relative;
    padding-bottom: 8px;
}

.log-day-label {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    font-weight: 900;
    color: var(--text-secondary);
    opacity: 0.7;
    line-height: 1;
    letter-spacing: 0.2px;
}

.text-pink {
    color: #d69fbb !important;
    /* Dusty Rose */
}

.text-blue {
    color: #93c5fd !important;
    /* Pastel blue */
}

.log-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevents flex items from overflowing */
}

.log-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.log-meta-row {
    display: flex;
    align-items: center;
    margin-top: 4px;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    /* Ensure it spans full width */
}

.log-time-meta,
.log-duration-meta,
.log-side-meta {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    /* Consistent distance between icon and text */
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    /* Prevents jumping as seconds update */
}

.log-time-meta {
    min-width: 90px;
    color: var(--text-secondary);
}

.log-duration-meta {
    color: var(--accent-color);
    margin-left: auto;
    /* Pushes to the right if space allows */
}

.log-side-meta,
.amming-purple {
    color: #f472b6;
}

.btn-edit-inline {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.btn-edit-inline:hover {
    opacity: 1;
    color: var(--accent-color);
}

.btn-edit {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.age-col {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.5rem !important;
}

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

.growth-history th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.growth-history td {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-add-growth {
    width: 3rem !important;
    height: 3rem !important;
    border-radius: 50% !important;
    display: flex !important;
}

.growth-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.chart-toggles {
    display: flex;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.2rem;
    border-radius: 2rem;
    gap: 0.2rem;
    width: 280px;
}

.chart-container {
    height: 480px;
    background: white;
    border-radius: 1.25rem;
    padding: 1rem 0.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.growth-history table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.6rem;
    margin-top: -0.6rem;
}

.growth-history th {
    text-align: left;
    padding: 0.5rem 0.25rem;
    font-size: 0.55rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 800;
    white-space: nowrap;
}

.growth-history td {
    background: white;
    padding: 0.75rem 0.5rem;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
}

.growth-history tr td:nth-child(3) {
    color: var(--weight-color);
}

/* Vekt - Main Accent */
.growth-history tr td:nth-child(4) {
    color: var(--height-color);
}

/* Høyde - High Opacity */
.growth-history tr td:nth-child(5) {
    color: var(--head-color);
}

/* Hode - Medium Opacity */

.growth-history tr td {
    padding: 0.85rem 0.6rem;
}

.growth-history tr td:first-child {
    border-radius: 1rem 0 0 1rem;
    padding-left: 1rem;
}

.growth-history tr td:last-child {
    border-radius: 0 1rem 1rem 0;
    padding-right: 1rem;
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    margin-left: 0.25rem;
}

.form-control {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-light);
    outline: none;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border-radius: 1.75rem;
    padding: 1.75rem;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

.me-auto {
    margin-right: auto;
}

/* Utilities */
hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

@media (max-width: 600px) {
    .quick-log-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0.75rem;
        padding-bottom: 1.5rem;
    }

    .log-card {
        padding: 0.75rem;
        gap: 0.25rem;
    }

    .log-card h3 {
        font-size: 0.65rem;
    }

    .timer {
        font-size: 1.5rem;
    }

    .log-card-header i {
        font-size: 1.1rem;
    }

    .btn-side,
    .btn-stop,
    .btn-start {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }

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

/* Week Paginator */
.week-paginator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    background: var(--card-bg);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.week-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    min-width: 140px;
    text-align: center;
}

.week-paginator button {
    background: transparent;
    border: none;
    color: var(--accent-color);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.week-paginator button:disabled {
    color: var(--text-muted);
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chart Toggles (Tab-like) */
.chart-toggles {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem;
    border-radius: 1rem;
    gap: 0.25rem;
}

.btn-chart-toggle {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-chart-toggle.active {
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-chart-toggle.active:nth-child(1) {
    color: var(--weight-color);
}

.btn-chart-toggle.active:nth-child(2) {
    color: var(--height-color);
}

.btn-chart-toggle.active:nth-child(3) {
    color: var(--head-color);
}

/* Growth History Section Title */
.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section-title-row h3 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 800;
}

.btn-add-inline {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px var(--accent-light);
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-add-inline:active {
    transform: scale(0.95);
}

/* Amming Edit Modal Extensions */
.side-selector-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.side-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.6rem;
    border-radius: 0.6rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.side-tab.active {
    background: white;
    color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.duration-editor {
    padding: 1rem;
    background: var(--accent-light);
    border-radius: 0.75rem;
}

.duration-editor label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    display: block;
}

.duration-inputs {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.duration-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.duration-input-group input {
    width: 70px !important;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.add-side-prompt {
    text-align: center;
    padding: 2rem 1rem;
    background: #f8fafc;
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-secondary);
}

.add-side-prompt p {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

/* --- Barn Stats Specifics --- */
.stats-container {
    --accent-color: #5c5f94;
    --accent-light: #f0f1f7;
    --accent-gradient: linear-gradient(135deg, #5c5f94 0%, #7e81b4 100%);
    padding: 3.2rem 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.barn-stats-header {
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    z-index: 1010;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 0;
    box-sizing: border-box;
}

.barn-stats-header .header-main {
    justify-content: flex-start;
    gap: 1rem;
}

.stats-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.5px;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.stats-grid-row {
    display: grid;
    gap: 1.5rem;
}

.stats-content-scroll {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0 0.75rem 2rem;
}

.stats-filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--accent-light);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Person Summary Cards (Total Tid / Antall Økter) */
.person-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.person-card {
    background: white;
    border-radius: 1.75rem;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-icon {
    font-size: 1.25rem;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
    opacity: 0.8;
}

.person-name {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.person-main-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.person-total {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
}

.person-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* General Stats Card (Sidefordeling, Heatmaps) */
.stats-card {
    background: white;
    border-radius: 2rem;
    padding: 1.75rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

.card-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

/* Side Distribution Bars */
.side-distribution {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.side-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.s-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
}

.s-count {
    color: var(--accent-color);
    font-size: 0.85rem;
}

.s-bar-bg {
    height: 10px;
    background: var(--accent-light);
    border-radius: 5px;
    overflow: hidden;
}

.s-bar-fill {
    height: 100%;
    background: #f472b6;
    border-radius: 5px;
}

/* Specific colors for sides if needed, otherwise rely on theme */
.s-bar-fill.left {
    opacity: 0.6;
}

.s-bar-fill.right {
    opacity: 1;
}

.s-bar-fill.both {
    opacity: 0.8;
}

/* Hourly Heatmap */
.hourly-pattern {
    display: flex;
    align-items: flex-end;
    height: 120px;
    gap: 4px;
    padding-bottom: 25px;
    position: relative;
}

.hour-slot {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.hour-bar {
    width: 100%;
    background: var(--accent-gradient);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
}

.hourly-pattern.sleep .hour-bar {
    background: #93c5fd;
}

.hourly-pattern.amming .hour-bar {
    background: #f472b6;
}

.hour-label {
    position: absolute;
    bottom: 0;
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-muted);
}

/* Split Stat (Day vs Night) */
.split-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 1.5rem;
}

.split-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.split-item i {
    font-size: 1.5rem;
}

.split-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.split-val {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-primary);
}

.split-divider {
    width: 1px;
    height: 3rem;
    background: var(--border-color);
}

.split-bar-bg {
    height: 14px;
    background: #93c5fd;
    /* "Night" now uses the consistent sleep color */
    border-radius: 7px;
    overflow: hidden;
    display: flex;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.split-bar-fill.day {
    background: var(--accent-light);
    /* "Day" now uses the light theme color for contrast */
    height: 100%;
}

.split-item i.night-icon {
    color: #93c5fd;
}

.split-item i.day-icon {
    color: var(--accent-color);
    opacity: 0.7;
}

/* Helper Utils */
.back-btn-stats {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: none;
    background: var(--accent-light);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.back-btn-stats:hover {
    transform: scale(1.1);
    background: var(--accent-color);
    color: white;
}

.period-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
    background: white;
    padding: 0.75rem;
    border-radius: 1.25rem;
    border: 1px solid var(--border-color);
}

.current-period-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: capitalize;
    min-width: 140px;
    text-align: center;
}

.nav-btn-mini {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: none;
    background: var(--accent-light);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn-mini:hover:not(:disabled) {
    transform: scale(1.1);
}

.nav-btn-mini:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Reusing chart toggles styles for Range Selector if needed, or specific: */
.range-selector {
    display: flex;
    gap: 0.4rem;
    background: var(--accent-light);
    padding: 0.3rem;
    border-radius: 1.25rem;
    margin-top: 1rem;
}

.range-btn {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.type-selector {
    display: flex;
    gap: 0.5rem;
}

.type-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 1.25rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.type-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Daily Sleep Summary */
.daily-sleep-summary {
    margin-bottom: 0.75rem;
    background: white;
    padding: 0.6rem;
    border-radius: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.summary-scroll {
    display: flex;
    gap: 0.25rem;
    padding: 2px;
}

.summary-day {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.1rem;
    border-radius: 0.6rem;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--accent-light);
    opacity: 0.6;
}

.summary-day.is-today {
    background: #93c5fd;
    border: 1px solid #93c5fd;
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(93, 197, 253, 0.2);
}

.day-name {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.1rem;
}

.summary-day.is-today .day-name {
    color: rgba(255, 255, 255, 0.9);
}

.day-total {
    font-size: 0.8rem;
    font-weight: 800;
    color: #93c5fd;
}

.summary-day.is-today .day-total {
    color: white;
}

/* Stats Chart Container */
.chart-container-stats {
    height: 300px;
    margin-top: 1rem;
}