@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Poppins:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

/* ==========================================================================
   IncuVision Mobile-First Dashboard - Custom Warm Yolk Theme
   Faithfully crafted to match the IncuVision research design mockups
   ========================================================================== */

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

:root {
    /* Brand Theme Colors */
    --app-bg: #FBE6B9;                /* Warm soft egg yolk background */
    --card-bg: #FFFFFF;               /* Crisp pure white rounded cards */
    --card-subtle: #FFF8E7;
    --card-accent-gold: #FBD487;      /* Warm golden yellow container */
    --btn-gold: #F8CF66;              /* Golden yellow button pill */
    --btn-gold-hover: #F2C247;
    
    /* Status & Brand Accents */
    --brand-maroon: #7A1D16;          /* Deep maroon/brown for typography & icons */
    --brand-red: #A82820;             /* Vibrant red/maroon for outline icons */
    --color-green-active: #5FE260;    /* Vibrant lime/green for active temp card */
    --color-fertile: #15803D;         /* Fertile green text */
    --color-infertile: #B91C1C;       /* Infertile red text */
    
    /* Toggle switch maroon */
    --switch-track: #A53C35;
    --switch-inactive: #D1D5DB;
    
    /* Text */
    --text-dark: #1E1B18;
    --text-muted: #6B7280;
    --text-white: #FFFFFF;
    
    /* Formal Clinical Dashboard Fonts */
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Poppins', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Radii & Shadows */
    --radius-card: 18px;
    --radius-pill: 50px;
    --shadow-card: 0 4px 12px rgba(120, 60, 0, 0.07);
    --shadow-soft: 0 2px 6px rgba(0, 0, 0, 0.05);
}

body {
    background-color: #FBE6B9;
    font-family: var(--font-body);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Mobile Frame Wrapper (centered on desktop, native on mobile) */
.mobile-app-wrapper {
    width: 100%;
    max-width: 440px;
    min-height: 100vh;
    background-color: var(--app-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Top Header App Bar
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 14px 20px;
    background-color: #FBD487;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.brand-group:hover {
    transform: scale(1.02);
}

.brand-chick-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.brand-chick-icon-img {
    height: 38px;
    width: auto;
    max-width: 38px;
    object-fit: contain;
    display: block;
}

.brand-wordmark-img {
    height: 26px;
    width: auto;
    max-width: 170px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}

.header-bell-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FBAE36;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.18s ease;
}

.header-bell-btn.active {
    background: #A82820;
    box-shadow: 0 0 0 3px rgba(168, 40, 32, 0.25);
}

.header-bell-btn.active svg {
    fill: #FFFFFF;
}

.header-bell-btn:active {
    transform: scale(0.92);
}

.bell-alert-dot {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 9px;
    height: 9px;
    background-color: #DC2626;
    border-radius: 50%;
    border: 2px solid #FBAE36;
    display: block;
}

/* ==========================================================================
   Main Body & Screens
   ========================================================================== */
.app-body {
    flex: 1;
    padding: 10px 20px 85px 20px;
    overflow-y: auto;
}

.app-screen {
    display: none;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.25s ease-out;
}

.app-screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Generic White Rounded Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px;
}

/* ==========================================================================
   SCREEN 1: HOME
   ========================================================================== */

/* 1. Countdown Days Card */
.card-countdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
    background: #FFFFFF;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.countdown-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.countdown-left-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clock-icon-bubble {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-clock {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
}

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

.countdown-main-val {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #1A1615;
    line-height: 1.15;
}

.countdown-phase-sub {
    font-size: 0.74rem;
    font-weight: 600;
    color: #786C5A;
}

.countdown-phase-badge {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    flex-shrink: 0;
}

.countdown-phase-badge.badge-setting {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FCD34D;
}

.countdown-phase-badge.badge-hatching {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

/* 21-Day Incubation Milestone Progress Bar */
.countdown-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}

.countdown-progress-bar {
    width: 100%;
    height: 6px;
    background: #F3F4F6;
    border-radius: 9999px;
    overflow: hidden;
}

.countdown-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #F59E0B 0%, #D97706 100%);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.countdown-progress-fill.hatching {
    background: linear-gradient(90deg, #EF4444 0%, #B91C1C 100%);
}

.countdown-milestones {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    font-weight: 600;
    color: #9CA3AF;
}

.countdown-milestones .milestone-lockdown {
    color: #D97706;
    font-weight: 700;
}

/* Footer row: Est. Completion */
.countdown-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #F3F4F6;
    padding-top: 8px;
    margin-top: 2px;
}

.countdown-footer-lbl {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 800;
    color: #8C6D23;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.countdown-footer-val {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    color: #1F2937;
}

/* 2. The 4 Big Metric Square Cards (2x2 Grid) */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.metric-box {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 125px;
    gap: 10px;
    transition: transform 0.15s ease;
}

.metric-box:active {
    transform: scale(0.97);
}
.metric-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
}

.metric-icon-img {
    height: 38px;
    max-width: 48px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.15s ease;
}

.metric-box:hover .metric-icon-img {
    transform: scale(1.08);
}

.text-icon {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--brand-red);
    line-height: 1;
}

.text-icon.italic {
    font-style: italic;
    font-size: 2.5rem;
}

.metric-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.metric-val {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #1A1615;
}

.metric-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* 3. Actuator Control Bar (Warm Yellow Container with 3 White Cards) */
/* 3. Actuator Control Bar (2x2 ACTUATOR STATUS Grid) */
.card-actuators-panel {
    background: var(--card-accent-gold);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.actuator-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.actuator-panel-title {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 800;
    color: #1E1B18;
    letter-spacing: 0.04em;
}

.badge-mode-pill {
    background: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 800;
    color: #8A4E08;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.actuators-2x2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.actuator-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    cursor: default;
    transition: transform 0.12s ease, border-color 0.2s ease;
    border: 1.5px solid transparent;
}

.actuators-2x2-grid.manual-mode-active .actuator-card {
    cursor: pointer;
    border-color: rgba(220, 38, 38, 0.35);
}

.actuators-2x2-grid.manual-mode-active .actuator-card:active {
    transform: scale(0.96);
}

.actuator-icon-bubble {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #F8F9FA;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4B5563;
    overflow: hidden;
}

.actuator-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease;
}

.actuator-card:hover .actuator-icon-img {
    transform: scale(1.12);
}

.actuator-title {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 800;
    color: #1A1615;
}

/* Dot + ON/OFF Status Pill matching research mockup */
.status-pill-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #E5E7EB;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 800;
    color: #6B7280;
    font-family: var(--font-heading);
    transition: all 0.2s ease;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9CA3AF;
    transition: background-color 0.2s ease;
}

.status-pill-toggle.is-on {
    background: #DCFCE7;
    color: #15803D;
}

.status-pill-toggle.is-on .status-dot {
    background: #22C55E;
    box-shadow: 0 0 6px #22C55E;
}

.actuator-sub {
    font-size: 0.68rem;
    color: #9CA3AF;
    font-weight: 600;
    line-height: 1.2;
}



.btn-pill-gold {
    background: var(--btn-gold);
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    border: none;
    box-shadow: 0 2px 4px rgba(180, 110, 0, 0.15);
    cursor: pointer;
}

/* ==========================================================================
   SCREEN 2: TEMPERATURE ANALYTICS
   ========================================================================== */
.card-analytics-main {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.metric-reading-badge-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.pill-metric-current {
    background: var(--btn-gold);
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.label-status {
    font-size: 0.68rem;
    font-weight: 700;
    color: #D97706;
}

.graph-metric-tabs {
    display: flex;
    background: #F5E8C3;
    border-radius: 12px;
    padding: 3px;
    gap: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.g-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 9px;
    padding: 7px 4px;
    font-family: var(--font-heading);
    font-size: 0.74rem;
    font-weight: 800;
    color: #786C5A;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.g-tab-btn.active {
    background: #FFFFFF;
    color: #1A1615;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Chart Canvas & Axes */
.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
    background: #FFFFFF;
    border-bottom: 3px solid #F5C754;
    margin-top: 10px;
}

#tempWaveChart {
    width: 100%;
    height: 100%;
    display: block;
}

.chart-y-axis {
    position: absolute;
    left: -2px;
    top: 4px;
    bottom: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 800;
    color: #D97706;
}

.chart-x-axis {
    display: flex;
    justify-content: space-between;
    padding: 6px 4px 0 4px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #D97706;
}

.analytics-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.card-sub-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    gap: 6px;
    cursor: pointer;
}

.sub-info-val {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: #1A1615;
}

.sub-info-val.text-digits {
    font-family: var(--font-mono);
    font-size: 1.35rem;
}

.sub-info-lbl {
    font-size: 0.72rem;
    font-weight: 700;
    color: #1A1615;
}

/* ==========================================================================
   SCREEN 3: SMART ALERTS & NOTIFICATIONS
   ========================================================================== */
.card-alerts-container {
    padding: 20px 16px;
    min-height: 480px;
}

/* Push Notification Bar */
.notif-bar-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFDF8;
    border: 1.5px solid #F3DFC1;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.notif-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.icon-circle-notif {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FEF3C7;
    color: #D97706;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.icon-circle-notif.active {
    background: #D1FAE5;
    color: #059669;
}

.notif-bar-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.notif-bar-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1A1615;
    letter-spacing: -0.01em;
}

.notif-bar-sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: #78716C;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-bar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-notif-action {
    background: #E09930;
    color: #FFFFFF;
    font-size: 0.74rem;
    font-weight: 800;
    border: none;
    padding: 7px 12px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(224, 153, 48, 0.3);
    transition: transform 0.15s ease, background 0.2s;
}

.btn-notif-action.active {
    background: #059669;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-notif-action:active {
    transform: scale(0.95);
}

.btn-notif-test {
    background: #F5E8C7;
    color: #8C6D23;
    font-size: 0.72rem;
    font-weight: 700;
    border: none;
    padding: 7px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-notif-test:active {
    transform: scale(0.95);
}

.btn-clear-alerts {
    background: #F3F4F6;
    color: #4B5563;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-clear-alerts:hover {
    background: #E5E7EB;
    color: #111827;
}

.btn-clear-alerts:active {
    transform: scale(0.95);
}

.alerts-scroll-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.alert-time-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.time-header {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    color: #4B5563;
    background: #F3F4F6;
    padding: 3px 12px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}

.alert-box {
    width: 100%;
    background: #FAD980;
    border-radius: 12px;
    padding: 13px 15px;
    position: relative;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.alert-box.alert-warning {
    background: #FEF3C7;
    border: 1.5px solid #F59E0B;
}

.alert-box.alert-critical {
    background: #FEE2E2;
    border: 1.5px solid #EF4444;
}

.alert-box.alert-success {
    background: #ECFDF5;
    border: 1.5px solid #10B981;
}

.alert-box.alert-info {
    background: #EFF6FF;
    border: 1.5px solid #3B82F6;
}

.alert-warn-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-msg {
    font-size: 0.76rem;
    font-weight: 700;
    color: #1A1615;
    line-height: 1.35;
    padding-right: 24px;
    text-transform: uppercase;
    margin: 0;
}

.alert-empty-card {
    background: #F9FAFB;
    border: 1.5px dashed #D1D5DB;
    border-radius: 14px;
    padding: 24px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.alert-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #D1FAE5;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-empty-title {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 800;
    color: #111827;
}

.alert-empty-desc {
    font-size: 0.74rem;
    color: #6B7280;
    line-height: 1.4;
    max-width: 290px;
}

/* ==========================================================================
   SCREEN 4: EGG FERTILITY CHECKER (AI CANDLING & CAMERA)
   ========================================================================== */
.fertility-title-banner {
    background: var(--btn-gold);
    border-radius: var(--radius-card);
    padding: 14px;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.fertility-title-banner h2 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: #1A1615;
    letter-spacing: 0.04em;
}

/* Camera Mode Switcher & Controls */
.camera-mode-tabs {
    display: flex;
    background: #EBDCA8;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}

.cam-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 9px;
    padding: 7px 10px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
    color: #5D564C;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cam-tab-btn.active {
    background: #FFFFFF;
    color: #1A1615;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    animation: livePulse 1.8s infinite;
}

.paused-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9CA3AF;
    display: inline-block;
}

.audit-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #F59E0B;
    display: inline-block;
}

@keyframes livePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Central Camera Viewport */
.camera-stage {
    width: 100%;
    height: 260px;
    background: #000000;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-stream-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.camera-overlay-center {
    position: absolute;
    pointer-events: none;
    opacity: 0.85;
}

.camera-status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #10B981;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.04em;
}

.camera-status-badge.audit-mode {
    color: #F59E0B;
}

.camera-status-badge.paused-mode {
    color: #9CA3AF;
}

.camera-quick-bar {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
}

.cam-btn {
    background: rgba(0, 0, 0, 0.7);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    transition: all 0.15s ease;
}

.cam-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

.cam-btn.is-active-gold {
    background: #F59E0B;
    border-color: #FCD34D;
    color: #1E1B18;
    font-weight: 800;
}

.btn-return-live {
    position: absolute;
    bottom: 12px;
    background: #10B981;
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-pill);
    padding: 7px 16px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
    display: none;
    align-items: center;
    gap: 6px;
    transition: transform 0.12s ease;
    z-index: 5;
}

.btn-return-live:active {
    transform: scale(0.95);
}

.camera-paused-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #9CA3AF;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    padding: 20px;
}

.cam-btn-resume {
    margin-top: 6px;
    background: #10B981;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.cam-btn-resume:hover {
    background: #059669;
}

/* Fertility Scores Row */
.fertility-scores-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    gap: 6px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.score-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.score-box-fertile {
    background: linear-gradient(180deg, #FFFFFF 0%, #F0FDF4 100%);
    border-color: rgba(34, 197, 94, 0.25);
}

.score-box-infertile {
    background: linear-gradient(180deg, #FFFFFF 0%, #FEF2F2 100%);
    border-color: rgba(239, 68, 68, 0.25);
}

.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.badge-fertile {
    background: rgba(34, 197, 94, 0.14);
    color: #15803D;
}

.badge-infertile {
    background: rgba(239, 68, 68, 0.14);
    color: #B91C1C;
}

.score-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot-fertile {
    background: #16A34A;
}

.dot-infertile {
    background: #DC2626;
}

.score-title {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
}

.score-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
}

.score-subtext {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}

.fertile-text {
    color: #15803D;
}

.infertile-text {
    color: #B91C1C;
}

/* Calendar Button Card */
.card-action-calendar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    background: #FFFFFF;
    border: 1.5px solid rgba(168, 40, 32, 0.25);
    box-shadow: 0 4px 14px rgba(168, 40, 32, 0.08);
    transition: all 0.15s ease;
}

.card-action-calendar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(168, 40, 32, 0.14);
    border-color: rgba(168, 40, 32, 0.45);
}

.card-action-calendar:active {
    transform: scale(0.97);
}

.calendar-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(168, 40, 32, 0.08);
    color: var(--brand-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-btn-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.calendar-btn-label {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--brand-maroon);
}

.calendar-btn-sub {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* 56-Egg Matrix Collapsible */
.matrix-collapsible-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-matrix-toggle {
    background: var(--card-bg);
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1A1615;
    cursor: pointer;
    box-shadow: var(--shadow-card);
}

.matrix-drawer {
    display: none;
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 14px;
    box-shadow: var(--shadow-card);
}

.matrix-drawer.open {
    display: block;
}

.egg-matrix-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.egg-slot-pill {
    aspect-ratio: 1;
    border-radius: 6px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.egg-slot-pill:active {
    transform: scale(0.9);
}

.egg-slot-pill.fertile {
    background: #DCFCE7;
    border-color: #86EFAC;
    color: #166534;
}

.egg-slot-pill.infertile {
    background: #FEE2E2;
    border-color: #FCA5A5;
    color: #991B1B;
}

/* ==========================================================================
   SCREEN 5: MENU / SETTINGS
   ========================================================================== */
/* ==========================================================================
   SCREEN 5: PROTOCOL SETTINGS (Visual Card Grid Matching Home Screen)
   ========================================================================== */
.card-protocol-top {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px;
    background: #FFFFFF;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.phase-tabs-row {
    display: flex;
    background: #F3F4F6;
    border-radius: var(--radius-pill);
    padding: 4px;
    gap: 4px;
}

.phase-tab-pill {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    padding: 9px 12px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
}

.phase-tab-pill.active {
    background: #FFFFFF;
    color: #111827;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.protocol-day-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
}

.stepper-bubble-clock {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper-clock-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.stepper-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    color: #1F2937;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
}

.btn-step-circle:active {
    background: #E5E7EB;
    transform: scale(0.92);
}

.stepper-day-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: #1A1615;
    min-width: 65px;
    text-align: center;
}

/* Incubation Schedule Set Timestamp Container */
.schedule-set-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 10px 14px;
}

.schedule-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-field-label {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 800;
    color: #6B7280;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.btn-batch-reset {
    background: #F3F4F6;
    color: #4B5563;
    border: 1px solid #D1D5DB;
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    font-size: 0.68rem;
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-batch-reset:hover {
    background: #E5E7EB;
    color: #111827;
}

.btn-batch-reset:active {
    transform: scale(0.96);
}

.schedule-datetime-inputs {
    display: flex;
    gap: 8px;
}

.schedule-input-date,
.schedule-input-time {
    background: #FFFFFF;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    padding: 7px 10px;
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: #111827;
    outline: none;
    transition: border-color 0.15s ease;
}

.schedule-input-date {
    flex: 1.3;
}

.schedule-input-time {
    flex: 0.9;
}

.schedule-input-date:focus,
.schedule-input-time:focus {
    border-color: #D97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15);
}

/* Schedule Live Status Banner */
.schedule-status-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFFDF7;
    border: 1px solid #FDE68A;
    border-radius: 12px;
    padding: 10px 14px;
}

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

.status-right {
    text-align: right;
}

.status-sub {
    font-family: var(--font-heading);
    font-size: 0.64rem;
    font-weight: 800;
    color: #92400E;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-main {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    color: #1A1615;
}

.btn-schedule-apply {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 0.84rem;
    font-weight: 800;
    padding: 11px 16px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.25);
    transition: all 0.15s ease;
    text-align: center;
    width: 100%;
    margin-top: 4px;
}

.btn-schedule-apply:hover {
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.35);
    transform: translateY(-1px);
}

.btn-schedule-apply:active {
    transform: scale(0.98);
}

.btn-protocol-apply {
    background: linear-gradient(135deg, #7A1D16 0%, #991B1B 100%);
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 800;
    padding: 13px 20px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(122, 29, 22, 0.3);
    transition: all 0.15s ease;
    text-align: center;
    width: 100%;
    margin-top: 4px;
    margin-bottom: 8px;
}

.btn-protocol-apply:hover {
    box-shadow: 0 5px 14px rgba(122, 29, 22, 0.4);
    transform: translateY(-1px);
}

.btn-protocol-apply:active {
    transform: scale(0.98);
}

/* Metric Stepper Row inside .metric-box */
.metric-stepper-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-mini-step {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    flex-shrink: 0;
}

.btn-mini-step:active {
    background: #E5E7EB;
    transform: scale(0.9);
}

/* Protocol Section Headers */
.protocol-section-header {
    margin: 16px 4px 6px 4px;
}

.protocol-section-title {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    color: #8C6D23;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Protocol Setpoints Grid (2x2: Temp, RH, CO2, O2) */
.protocol-setpoints-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

/* Egg Turner Quick Action Card */
.card-protocol-turner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    cursor: pointer;
    background: #FFFFFF;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    border: 1.5px solid transparent;
    transition: transform 0.12s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 4px;
}

.card-protocol-turner:hover {
    border-color: #FCD34D;
}

.card-protocol-turner:active {
    transform: scale(0.98);
}

.turner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.turner-icon-bubble {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.turner-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

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

.turner-title {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 800;
    color: #1A1615;
}

.turner-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: #786C5A;
}

.turner-action-pill {
    background: #7A1D16;
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(122, 29, 22, 0.25);
    transition: all 0.15s ease;
    flex-shrink: 0;
    pointer-events: none;
}

.card-protocol-turner.is-locked {
    opacity: 0.65;
    cursor: not-allowed;
}

.card-protocol-turner.is-locked .turner-action-pill {
    background: #9CA3AF;
    box-shadow: none;
}

/* CSV Export Card */
.card-export-csv {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 18px;
    text-decoration: none;
    background: #FFFBEB;
    border: 1.5px solid #F59E0B;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    transition: transform 0.15s ease, background 0.15s ease;
}

.card-export-csv:hover {
    background: #FEF3C7;
}

.card-export-csv:active {
    transform: scale(0.98);
}

.card-export-csv span {
    font-family: var(--font-heading);
    font-size: 0.86rem;
    font-weight: 800;
    color: #92400E;
}

/* Full Width Apply Button */
.btn-protocol-apply {
    width: 100%;
    background: var(--brand-red);
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    padding: 14px 20px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(168, 40, 32, 0.28);
    transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn-protocol-apply:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Countdown phase subtitle on home card */
.countdown-phase-sub {
    font-size: 0.76rem;
    font-weight: 700;
    color: #78350F;
    margin-top: 2px;
}

.countdown-phase-sub.hatching {
    color: #C2410C;
    font-weight: 800;
}

/* Floating Toast Notification */
.app-toast {
    position: fixed;
    bottom: 84px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: #1F2937;
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 9999px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    max-width: 90vw;
    text-align: center;
}

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

.app-toast.toast-error {
    background: #DC2626;
}

/* ==========================================================================
   Bottom Navigation Bar (Matching research design)
   ========================================================================== */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 440px;
    height: 70px;
    background-color: #FBD487;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: #7A4F08;
    cursor: pointer;
    padding: 6px 14px;
    transition: all 0.15s ease;
}

.nav-tab span {
    font-size: 0.72rem;
    font-weight: 800;
    font-family: var(--font-heading);
}

.nav-tab.active {
    color: #C2410C;
    transform: translateY(-2px);
}

.nav-tab.active svg {
    filter: drop-shadow(0 2px 4px rgba(194, 65, 12, 0.25));
}

/* ==========================================================================
   Modal Dialog
   ========================================================================== */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.open {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 18px;
    width: 100%;
    max-width: 380px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6B7280;
}
