/* 
   FARPOV Design System - Professional & Exquisite 
   Based on Pico.css with custom refinements
*/

:root {
    /* 1. Refined Color Palette (Indigo Theme) */
    --pico-primary: #4F46E5; /* Indigo 600 */
    --pico-primary-background: #4F46E5;
    --pico-primary-underline: rgba(79, 70, 229, 0.5);
    --pico-primary-hover: #4338CA; /* Indigo 700 */
    --pico-primary-focus: rgba(79, 70, 229, 0.25);
    --pico-primary-inverse: #ffffff;

    /* Neutral Scale (Slate) */
    --pico-color: #334155; /* Slate 700 */
    --pico-background-color: #F8FAFC; /* Slate 50 - softer app bg */
    --pico-card-background-color: #FFFFFF;
    --pico-muted-color: #64748B; /* Slate 500 */
    --pico-muted-border-color: #E2E8F0; /* Slate 200 */
    --pico-border-color: #CBD5E1; /* Slate 300 */

    /* 2. Typography */
    --pico-font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --pico-line-height: 1.6;
    --pico-font-weight: 400;
    --pico-font-size: 100%;

    /* 3. Spacing & Radius */
    --pico-border-radius: 0.5rem; /* 8px - Modern standard */
    --pico-form-element-spacing-vertical: 0.6rem;
    --pico-form-element-spacing-horizontal: 1rem;

    /* 4. Shadows (Custom Depth) */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --pico-box-shadow: var(--shadow-sm);
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
    :root {
        --pico-primary: #6366F1; /* Indigo 500 */
        --pico-primary-background: #6366F1;
        --pico-primary-hover: #818CF8; /* Indigo 400 */
        
        --pico-color: #E2E8F0; /* Slate 200 */
        --pico-background-color: #0F172A; /* Slate 900 */
        --pico-card-background-color: #1E293B; /* Slate 800 */
        --pico-muted-color: #94A3B8; /* Slate 400 */
        --pico-muted-border-color: #334155; /* Slate 700 */
        --pico-border-color: #475569; /* Slate 600 */
        
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    }
}

/* Global Reset & Typography */
html, body {
    width: 100%;
    height: 100%;
    font-family: var(--pico-font-family);
    -webkit-font-smoothing: antialiased; /* Crisp text on Mac */
    -moz-osx-font-smoothing: grayscale;
}

/* Button Refinements (More modern, flat) */
button {
    font-weight: 500;
    border-radius: var(--pico-border-radius);
    transition: all 0.2s ease-in-out;
}

button.outline {
    border-width: 1px;
}

/* Input Refinements */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    border-radius: var(--pico-border-radius);
    border: 1px solid var(--pico-muted-border-color);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
    border-color: var(--pico-primary);
    box-shadow: 0 0 0 3px var(--pico-primary-focus);
}

.farpov_top_container {
    padding-top: var(--pico-form-element-spacing-vertical)
}

/* FooterRecord */

.farpov_footer_record_container {
    width: 100%;
    margin-top: 1rem;
}

.farpov_footer_record_row {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}


/* HeaderNav */

.farpov_header_nav_container {
    margin: 0 auto;
    padding: 0;
    width: 100%;
    background: var(--pico-background-color);
    /* Remove thick primary border, use subtle divider */
    border: none; 
    border-bottom: 1px solid var(--pico-muted-border-color);
    border-radius: 0; /* Full width feel */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--pico-spacing);
    /* Add glassmorphism if supported */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.10), rgba(255, 255, 255, 0.85));
    min-height: 96px;
}

/* Dark mode adjustment for header bg */
@media (prefers-color-scheme: dark) {
    .farpov_header_nav_container {
        background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(15, 23, 42, 0.85)); /* Slate 900 with opacity */
    }
}
.farpov_header_nav_container.container {
    padding: 0;
}

.farpov_header_nav_icon_wrap {
    margin: 0;
    padding: calc(var(--pico-form-element-spacing-vertical) * 2) var(--pico-form-element-spacing-horizontal);
    cursor: pointer;
}

.farpov_header_nav_icon_wrap svg {
    color: var(--pico-primary);
}

.farpov_header_nav_title {
    font-size: 2em;
    font-weight: bold;
    line-height: 1.1;
    flex: 1 1 auto;
    text-align: left;
    padding-left: 0.75rem;
}

@media (max-width: 1023.98px) {
    .farpov_header_nav_container .farpov_header_nav_home_button {
        display: none;
    }
}

/* DrawerNav - See "Refined Sidebar Styles" below for updated definitions */
/* Consolidated into the professional layout section */

/* LoginPage */

.farpov_login_page_container {
    max-width: 510px;
}

.farpov_login_screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem) var(--pico-spacing);
    background: radial-gradient(1200px circle at 20% 10%, rgba(37, 99, 235, 0.22), transparent 55%),
        radial-gradient(900px circle at 80% 20%, rgba(16, 185, 129, 0.18), transparent 50%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), var(--pico-background-color));
}

.farpov_login_card {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 1.25rem;
    border: 1px solid var(--pico-muted-border-color);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.farpov_login_brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.farpov_login_brand .farpov_brand_icon {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 1.05rem;
    position: relative;
}

.farpov_login_brand .farpov_brand_title {
    font-size: 1.5rem;
}

.farpov_login_brand .farpov_brand_subtitle {
    font-size: 0.9rem;
}

.farpov_login_heading h2 {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.1;
}

.farpov_login_heading p {
    margin: 0.5rem 0 1.25rem 0;
    color: var(--pico-muted-color);
}

.farpov_login_error {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--pico-border-radius);
    border: 1px solid rgba(231, 76, 60, 0.35);
    background: rgba(231, 76, 60, 0.12);
    color: #c0392b;
}

.farpov_login_form label {
    margin-bottom: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}

.farpov_brand_ai_badge {
    position: absolute;
    right: -0.3rem;
    bottom: -0.3rem;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
    color: white;
}

.farpov_brand_ai_text {
    font-weight: 800;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    line-height: 1;
}

.farpov_login_password_row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.farpov_login_password_row input {
    flex: 1 1 auto;
    margin: 0;
}

.farpov_login_toggle_password {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: 0.6rem 0.75rem;
    border-radius: var(--pico-border-radius);
}

.farpov_login_submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

.farpov_login_footer {
    margin-top: 1.75rem;
    opacity: 0.85;
}

@media (prefers-color-scheme: dark) {
    .farpov_login_screen {
        background: radial-gradient(1200px circle at 20% 10%, rgba(37, 99, 235, 0.28), transparent 55%),
            radial-gradient(900px circle at 80% 20%, rgba(16, 185, 129, 0.22), transparent 50%),
            linear-gradient(180deg, rgba(2, 6, 23, 0.86), rgba(15, 23, 42, 0.86));
    }
    .farpov_login_card {
        background: rgba(15, 23, 42, 0.72);
        border: 1px solid rgba(148, 163, 184, 0.28);
        box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    }
    .farpov_login_error {
        background: rgba(231, 76, 60, 0.14);
        border: 1px solid rgba(231, 76, 60, 0.38);
        color: rgba(252, 165, 165, 0.95);
    }
}

/* PhotoGrid */

.farpov_photo_grid_header {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: var(--pico-spacing);
    flex-direction: column;
}

.farpov_photo_grid_header input, .farpov_photo_grid_header select {
    flex: 1 1 auto;
    margin: 0;
}

.farpov_photo_grid_header button {
    flex: 0 0 auto;
    width: 100%;
}

.farpov_photo_grid_grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--pico-spacing);
}

.farpov_photo_grid_grid ._ph_ {
    position: relative;
    aspect-ratio: 4 / 3;
    background-color: var(--pico-secondary-background);
    border-radius: var(--pico-border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--pico-muted-border-color);
}

.farpov_photo_grid_grid ._ph_:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--pico-primary);
}

.farpov_photo_grid_grid ._ph_ ._img_ {
    aspect-ratio: 4 / 3;
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.farpov_photo_grid_grid ._ph_ ._img_>img {
    width: 100%;
    height: 100%;
    /* object-fit: contain; */
    object-fit: cover;
}

.farpov_photo_grid_grid ._ph_ ._info_ {
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 2;
    padding: var(--pico-spacing);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    opacity: 0;
    transition: opacity 0.15s ease;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 65%);
}

.farpov_photo_grid_grid ._ph_:hover ._info_ {
    opacity: 1;
}

.farpov_photo_grid_grid ._ph_ ._info_ div {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.15;
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.65rem;
    padding: 0.35rem 0.55rem;
    width: fit-content;
    max-width: 100%;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

@media (hover: none) {
    .farpov_photo_grid_grid ._ph_ ._info_ {
        opacity: 0;
    }

    .farpov_photo_grid_grid ._ph_ .photo_overlay_actions {
        opacity: 0;
        pointer-events: none;
    }

    .farpov_photo_grid_grid ._ph_ .action_btn {
        transform: translateY(10px);
    }

    .farpov_photo_grid_grid ._ph_.ph_active ._info_ {
        opacity: 1;
    }

    .farpov_photo_grid_grid ._ph_.ph_active ._info_ div:nth-child(2) {
        display: none;
    }

    .farpov_photo_grid_grid ._ph_.ph_expanded ._info_ div:nth-child(2) {
        display: block;
    }

    .farpov_photo_grid_grid ._ph_.ph_expanded .photo_overlay_actions {
        opacity: 1;
        pointer-events: auto;
        background: rgba(0, 0, 0, 0.18);
    }

    .farpov_photo_grid_grid ._ph_.ph_expanded .action_btn {
        transform: translateY(0);
    }
}

@media screen and (min-width: 576px) {
    /* Width managed by container */
}

@media screen and (min-width: 768px) {
    .farpov_photo_grid_grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .farpov_photo_grid_header {
        flex-direction: row;
    }
    .farpov_photo_grid_header button {
        width: fit-content;
    }
}

@media screen and (min-width: 1280px) {
    .farpov_photo_grid_grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (min-width: 1536px) {
    .farpov_photo_grid_grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Compare Photo */

.farpov_cmp_photo {
    width: 100%;
    height: 100%;
    cursor: crosshair;
    position: relative; /* Create stacking context */
    isolation: isolate;
    background-color: var(--pico-background-color); /* Light background for photo viewing */
    overflow: hidden; /* Prevent content from expanding page */
}

.farpov_cmp_photo>*{
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Ensure HeaderNav has appropriate style in light mode compare */
.farpov_cmp_photo .farpov_header_nav_container {
    background: var(--pico-background-color);
    border-color: var(--pico-muted-border-color);
    color: var(--pico-color);
    flex: 0 0 auto;
    pointer-events: auto;
    cursor: auto;
}

.farpov_cmp_photo .farpov_header_nav_icon_wrap svg {
    color: var(--pico-color);
}

.farpov_cmp_ph_canvas_wrap {
    pointer-events: none;
    touch-action: none;
    z-index: 1; /* Positive z-index to ensure visibility */
}

.farpov_cmp_ph_canvas_wrap canvas {
    width: 100%;
    height: 100%;
}

.farpov_cmp_ph_overlay {
    pointer-events: none;
    touch-action: none;
    background: transparent;
    z-index: 10; /* Overlay above canvas */
    display: flex;
    flex-direction: column;
    /* Remove padding to let image fill the screen behind toolbar */
    padding-bottom: 0; 
    overflow: hidden; /* Ensure overlay doesn't overflow */
}

.farpov_cmp_ph_safezone {
    pointer-events: none;
    touch-action: none;
    flex: 1 1 auto;
    /* Add padding to create a frame around the photo so it's not edge-to-edge */
    padding: 2rem; 
    margin: 0;
    width: 100%; /* Ensure it takes full width */
    position: relative;
    min-height: 0;
    overflow: hidden;
    /* Create a stacking context and ensure it's above other elements if needed */
    z-index: 1; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.farpov_cmp_canvas {
    display: block;
    /* Let the canvas fill the safezone (minus padding) */
    width: 100%;
    height: 100%;
    /* Ensure object fit behavior if we were using img, but for canvas we handle drawing. */
    /* Add a subtle shadow to separate from background */
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.1));
    /* Enable interactions */
    pointer-events: auto;
}

.farpov_cmp_ph_panel {
    pointer-events: auto;
    cursor: auto;
    flex: 0 0 auto;
    padding: var(--pico-spacing);
    background: var(--pico-background-color);
    border: var(--pico-border-width) solid var(--pico-primary);
    border-radius: var(--pico-border-radius);
    display: grid;
    justify-content: space-around;
    align-content: space-around;
    gap: var(--pico-spacing);
}

.farpov_cmp_ph_panel button {
    pointer-events: auto;
}

@media screen and (max-width: 767px) {
    .farpov_cmp_ph_panel {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 768px) {
    .farpov_cmp_ph_panel {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (min-width: 1024px) {
    .farpov_cmp_ph_panel {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (min-width: 1280px) {
    .farpov_cmp_ph_panel {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media screen and (min-width: 1536px) {
    .farpov_cmp_ph_panel {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* --- Layout Redesign (Professional UI) --- */

.farpov_main_layout {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: var(--pico-background-color);
}

.farpov_sidebar {
    display: none; /* Hidden by default (mobile) */
    width: 260px;
    flex-shrink: 0;
    border-right: var(--pico-border-width) solid var(--pico-muted-border-color);
    background-color: var(--pico-card-background-color);
    overflow-y: auto;
    flex-direction: column;
}

.farpov_main_content_wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.farpov_main_content {
    flex: 1;
    overflow-y: auto;
    padding-top: var(--pico-block-spacing-vertical);
    padding-bottom: var(--pico-block-spacing-vertical);
    width: 100%;
    /* Ensure content doesn't overflow horizontally */
    box-sizing: border-box;
}

.farpov_main_content.full-screen {
    padding: 0;
    max-width: none;
    height: 100%;
    overflow: hidden; /* Canvas usually handles scroll or is fixed */
}

/* Refined Sidebar Styles */
.farpov_drawer_nav_content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 0 var(--pico-spacing) 0;
}

.farpov_nav_group_title {
    padding: 1rem var(--pico-spacing) 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--pico-muted-color);
    font-weight: bold;
}

.farpov_drawer_nav_locations ul {
    padding: 0;
    margin: 0;
}

.farpov_drawer_nav_locations li {
    padding: 0.6rem var(--pico-spacing);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--pico-color);
    transition: all 0.2s;
    border: none !important;
    margin: 0 0.5rem;
    border-radius: var(--pico-border-radius);
}

.farpov_drawer_nav_locations li:hover {
    background-color: var(--pico-secondary-background);
    text-decoration: none;
    color: var(--pico-primary);
}

.farpov_drawer_nav_locations li.active {
    background-color: var(--pico-primary-background);
    color: var(--pico-primary-inverse); 
}
.farpov_drawer_nav_locations li.active svg {
    color: var(--pico-primary-inverse);
}

.farpov_drawer_nav_locations li svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--pico-muted-color);
}

.farpov_drawer_nav_locations li:hover svg {
    color: var(--pico-primary);
}

.farpov_drawer_nav_locations li span {
    pointer-events: none;
}

.farpov_nav_item_badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #0b1220;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.65);
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    line-height: 1;
}

.farpov_drawer_nav_locations li.active .farpov_nav_item_badge {
    color: var(--pico-primary-inverse);
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.28);
}

/* User Info Header in Sidebar */
.farpov_drawer_nav_user_info {
    padding: 0 var(--pico-spacing);
    margin-bottom: var(--pico-spacing);
    border-bottom: var(--pico-border-width) solid var(--pico-muted-border-color);
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 96px;
    box-sizing: border-box;
}

.farpov_drawer_nav_user_info_item_title {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    margin-right: auto;
}

.farpov_drawer_nav_user_info_item_title > h4 {
    flex: 1 1 auto;
    text-align: left !important;
    display: block;
    width: 100%;
}

.farpov_drawer_footer_user {
    margin-top: auto;
    padding: var(--pico-spacing);
    border-top: var(--pico-border-width) solid var(--pico-muted-border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.farpov_drawer_footer_user .user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.farpov_drawer_footer_user .user-info {
    display: flex;
    flex-direction: column;
}
.farpov_drawer_footer_user .user-info .username {
    font-weight: bold;
    font-size: 0.9rem;
}
.farpov_drawer_footer_user .user-info .role {
    font-size: 0.75rem;
    color: var(--pico-muted-color);
}

/* Desktop Responsiveness */
@media (min-width: 1024px) {
    .farpov_sidebar {
        display: flex;
    }
    
    /* Hide Menu button in Header on desktop */
    .farpov_header_nav_container .farpov_header_nav_menu_button {
        display: none;
    }
    
    /* Adjust Header to look better with sidebar */
    .farpov_header_nav_container {
        border: none;
        border-bottom: var(--pico-border-width) solid var(--pico-muted-border-color);
        border-radius: 0;
        padding: 0 var(--pico-spacing);
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
    
    .farpov_header_nav_container.container {
        max-width: 100%; /* Full width in desktop mode inside the content wrapper */
    }
}

/* --- Layout Redesign (Professional UI) --- */

.farpov_main_layout {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: var(--pico-background-color);
}

.farpov_sidebar {
    display: none; /* Hidden by default (mobile) */
    width: 260px;
    flex-shrink: 0;
    border-right: var(--pico-border-width) solid var(--pico-muted-border-color);
    background-color: var(--pico-card-background-color);
    overflow-y: auto;
    flex-direction: column;
}

.farpov_main_content_wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.farpov_main_content {
    flex: 1;
    overflow-y: auto;
    padding-top: var(--pico-block-spacing-vertical);
    padding-bottom: var(--pico-block-spacing-vertical);
    width: 100%;
    /* Ensure content doesn't overflow horizontally */
    box-sizing: border-box;
}

/* Refined Sidebar Styles */
.farpov_drawer_nav_content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 0 var(--pico-spacing) 0;
}

.farpov_nav_group_title {
    padding: 1rem var(--pico-spacing) 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--pico-muted-color);
    font-weight: bold;
}

.farpov_drawer_nav_locations ul {
    padding: 0;
    margin: 0;
}

.farpov_drawer_nav_locations li {
    padding: 0.6rem var(--pico-spacing);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--pico-color);
    transition: all 0.2s;
    border: none !important;
    margin: 0 0.5rem;
    border-radius: var(--pico-border-radius);
}

.farpov_drawer_nav_locations li:hover {
    background-color: var(--pico-secondary-background);
    text-decoration: none;
    color: var(--pico-primary);
}

.farpov_drawer_nav_locations li.active {
    background-color: var(--pico-primary-background);
    color: var(--pico-primary-inverse); 
}
.farpov_drawer_nav_locations li.active svg {
    color: var(--pico-primary-inverse);
}

.farpov_drawer_nav_locations li svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--pico-muted-color);
}

.farpov_drawer_nav_locations li:hover svg {
    color: var(--pico-primary);
}

/* User Info Header in Sidebar */
.farpov_drawer_nav_user_info {
    padding: 0 var(--pico-spacing);
    margin-bottom: var(--pico-spacing);
    border-bottom: var(--pico-border-width) solid var(--pico-muted-border-color);
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 96px;
    box-sizing: border-box;
}

.farpov_drawer_nav_user_info {
    gap: 0.9rem;
}

.farpov_brand_icon {
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pico-primary);
    color: var(--pico-primary-inverse);
    border-radius: 0.9rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.farpov_brand_icon svg {
    color: inherit;
}

.farpov_brand_text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
}

.farpov_brand_title {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
    line-height: 1;
}

.farpov_brand_subtitle {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    line-height: 1;
    color: var(--pico-muted-color);
}

.farpov_drawer_nav_content {
    text-align: left !important;
}

.farpov_drawer_footer_user {
    margin-top: auto;
    padding: var(--pico-spacing);
    border-top: var(--pico-border-width) solid var(--pico-muted-border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.farpov_drawer_footer_user .user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--pico-primary-background);
    color: var(--pico-primary-inverse);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.farpov_drawer_footer_user .user-info {
    display: flex;
    flex-direction: column;
}
.farpov_drawer_footer_user .user-info .username {
    font-weight: bold;
    font-size: 0.9rem;
}
.farpov_drawer_footer_user .user-info .role {
    font-size: 0.75rem;
    color: var(--pico-muted-color);
}

/* Desktop Responsiveness */
@media (min-width: 1024px) {
    .farpov_sidebar {
        display: flex;
    }
    
    /* Hide Menu button in Header on desktop */
    .farpov_header_nav_container_inner .farpov_header_nav_icon_wrap:last-child {
        display: none;
    }
    
    /* Adjust Header to look better with sidebar */
    .farpov_header_nav_container_inner {
        border: none;
        border-bottom: var(--pico-border-width) solid var(--pico-muted-border-color);
        border-radius: 0;
        background: var(--pico-background-color);
        padding: 0.5rem var(--pico-spacing);
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
    
    .farpov_header_nav_container_inner.container {
        max-width: 100%; /* Full width in desktop mode inside the content wrapper */
    }
}

/* --- Design System Components --- */

/* Page Header */
.farpov_page_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.farpov_page_title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--pico-color);
}

.farpov_page_subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
    color: var(--pico-muted-color);
}

.farpov_page_actions {
    display: flex;
    gap: 0.75rem;
}

.farpov_page_actions button {
    margin-bottom: 0;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    width: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Section */
.farpov_section {
    margin-bottom: 2.5rem;
}

.farpov_section_header {
    margin-bottom: 1rem;
}

.farpov_section_title {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--pico-color);
    font-weight: 600;
}

.farpov_section_desc {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
    margin: 0;
}

/* Data Grid */
.farpov_data_grid {
    width: 100%;
    overflow-x: auto;
    background: var(--pico-card-background-color);
    border: var(--pico-border-width) solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.farpov_data_grid table {
    margin-bottom: 0;
}

.farpov_cameras_grid table {
    width: 100%;
    table-layout: fixed;
}

.farpov_data_grid th {
    background: var(--pico-secondary-background);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.farpov_data_grid td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.farpov_data_grid tr:last-child td {
    border-bottom: none;
}

.farpov_data_grid_empty {
    text-align: center;
    padding: 3rem !important;
    color: var(--pico-muted-color);
}
.farpov_data_grid_empty svg {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.farpov_data_grid_loading {
    text-align: center;
    padding: 2rem !important;
}

/* Card - Professional Style */
.farpov_card {
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color); /* Subtle border */
    border-radius: var(--pico-border-radius); /* 12px or 8px as defined */
    padding: 1.5rem; /* More breathing room */
    box-shadow: var(--shadow-sm); /* Soft shadow */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.farpov_card:hover {
    box-shadow: var(--shadow-md); /* Lift effect */
    /* transform: translateY(-2px); Optional subtle lift */
}

.farpov_sub_accounts_cards {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
}

.farpov_sub_account_card {
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.farpov_sub_account_card_title {
    font-weight: 700;
    color: var(--pico-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.farpov_sub_account_kv {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0.5rem;
    align-items: start;
    margin-top: 0.75rem;
}

.farpov_sub_account_kv .k {
    color: var(--pico-muted-color);
    font-size: 0.85rem;
}

.farpov_sub_account_kv .v {
    color: var(--pico-color);
    font-size: 0.9rem;
    word-break: break-word;
}

.farpov_sub_account_card_actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

@media screen and (max-width: 768px) {
    .farpov_sub_accounts_table {
        display: none;
    }

    .farpov_sub_accounts_cards {
        display: flex;
    }
}

/* Action Toolbar (for Photo Manager etc) */
.farpov_toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background: var(--pico-secondary-background);
    padding: 0.75rem 1rem;
    border-radius: var(--pico-border-radius);
    flex-wrap: wrap;
    gap: 1rem;
}

.farpov_toolbar_group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Form refinements */
.farpov_form_group {
    margin-bottom: 1.25rem;
}

.farpov_form_group.horizontal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.farpov_form_group.horizontal label {
    margin-bottom: 0;
    flex: 0 0 auto;
    width: 30%;
    min-width: 120px;
}

.farpov_form_group.horizontal input, 
.farpov_form_group.horizontal select {
    margin-bottom: 0;
    flex: 1;
}

.farpov_form_group label {
    font-weight: 500;
    margin-bottom: 0.4rem;
    display: block;
    color: var(--pico-color);
}
.farpov_form_group input, 
.farpov_form_group select {
    margin-bottom: 0;
}
.farpov_form_hint {
    font-size: 0.8rem;
    color: var(--pico-muted-color);
    margin-top: 0.4rem;
}

/* Status Badge */
.farpov_badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}
.farpov_badge.success {
    background-color: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}
.farpov_badge.warning {
    background-color: rgba(241, 196, 15, 0.15);
    color: #d35400;
}
.farpov_badge.danger {
    background-color: rgba(231, 76, 60, 0.14);
    color: #c0392b;
}
.farpov_badge.neutral {
    background-color: var(--pico-secondary-background);
    color: #ffffff;
    border: 1px solid var(--pico-muted-border-color);
}

/* --- Dashboard v3 (Professional) --- */

.farpov_dashboard_v3 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 1. Stats Overview Row */
.farpov_stats_row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.farpov_stat_box {
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.farpov_stat_box::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--pico-primary);
    opacity: 0.5;
}

.farpov_stat_box.accent-success::after { background-color: #2ecc71; }
.farpov_stat_box.accent-warning::after { background-color: #f1c40f; }
.farpov_stat_box.accent-info::after { background-color: #3498db; }

.farpov_stat_header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--pico-muted-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.farpov_stat_value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--pico-color);
    line-height: 1.2;
}

.farpov_stat_sub {
    font-size: 0.8rem;
    color: var(--pico-muted-color);
    margin-top: 0.25rem;
}

/* 2. Section Headers with Filters */
.farpov_section_header_v3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding-bottom: 0.5rem;
}

.farpov_section_title_v3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pico-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

/* 3. Camera Cards v3 */
.farpov_camera_grid_v3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.farpov_camera_card_v3 {
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.farpov_camera_card_v3:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--pico-primary);
}

.farpov_cam_preview_wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    background-color: #000;
    overflow: hidden;
    cursor: pointer;
}

.farpov_cam_preview_wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.farpov_camera_card_v3:hover .farpov_cam_preview_wrap img {
    transform: scale(1.05);
}

.farpov_cam_overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1rem 0.75rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

.farpov_cam_status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.status_indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status_indicator.on { background-color: #2ecc71; box-shadow: 0 0 6px #2ecc71; }
.status_indicator.off { background-color: #e74c3c; }

.farpov_cam_meta {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.farpov_cam_header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.farpov_cam_title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: var(--pico-color);
}

.farpov_cam_actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--pico-muted-border-color);
}

.farpov_cam_btn {
    flex: 1;
    padding: 0.4rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid var(--pico-muted-border-color);
    background: transparent;
    color: var(--pico-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
}

.farpov_cam_btn:hover {
    background-color: var(--pico-secondary-background);
    border-color: var(--pico-primary);
    color: var(--pico-primary);
}

.farpov_cam_btn.primary {
    background-color: var(--pico-primary);
    border-color: var(--pico-primary);
    color: var(--pico-primary-inverse);
}
.farpov_cam_btn.primary:hover {
    background-color: var(--pico-primary-hover);
}

.farpov_pin_badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--pico-primary);
    color: white;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

/* Empty State Illustration */
.farpov_empty_dashboard {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--pico-card-background-color);
    border-radius: var(--pico-border-radius);
    border: 1px dashed var(--pico-muted-border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.farpov_empty_icon {
    font-size: 3rem;
    color: var(--pico-muted-color);
    opacity: 0.5;
}

/* --- Compact Stat Cards --- */

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

.farpov_stat_box {
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 0.5rem 0.75rem; /* Further Reduced padding */
    display: flex;
    flex-direction: row; /* Horizontal layout */
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    min-height: auto; /* Remove min-height constraints */
}

.farpov_stat_box::after {
    width: 3px; /* Thinner accent line */
}

.farpov_stat_content_left {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.farpov_stat_header {
    font-size: 0.75rem; /* Smaller label */
    margin-bottom: 0;
    color: var(--pico-muted-color);
    font-weight: 500;
}

.farpov_stat_value {
    font-size: 1.25rem; /* Smaller value */
    font-weight: 700;
}

.farpov_stat_sub {
    font-size: 0.7rem;
    margin-top: 0;
    opacity: 0.8;
}

.farpov_stat_icon_right {
    font-size: 1.5rem;
    color: var(--pico-muted-color);
    opacity: 0.2;
}

@media screen and (max-width: 640px) {
    .farpov_stats_row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .farpov_stat_box {
        padding: 0.55rem 0.6rem;
    }

    .farpov_stat_value {
        font-size: 1.15rem;
    }

    .farpov_stat_icon_right {
        font-size: 1.25rem;
    }
}

/* --- Hardware Status in Camera Card --- */

.farpov_cam_hw_status {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.farpov_hw_tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--pico-muted-color);
    background: var(--pico-secondary-background);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

.farpov_hw_tag svg {
    width: 0.8rem;
    height: 0.8rem;
    opacity: 0.7;
}

.farpov_hw_tag.warning {
    color: #d35400;
    background: rgba(241, 196, 15, 0.15);
}

.farpov_hw_tag.danger {
    color: #c0392b;
    background: rgba(231, 76, 60, 0.15);
}

/* --- Refined Hardware Status Tags (Lighter Theme) --- */

.farpov_hw_tag {
    background-color: var(--pico-card-background-color); /* Use card bg to blend or distinct */
    border: 1px solid var(--pico-muted-border-color); /* Add subtle border */
    color: var(--pico-muted-color); /* Muted text for auxiliary info */
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: normal; /* Remove bold if it was too heavy */
    box-shadow: none; /* Remove any shadow */
}

.farpov_hw_tag svg {
    opacity: 0.8; /* Increase opacity slightly for visibility */
    width: 0.85rem;
    height: 0.85rem;
    color: var(--pico-primary); /* Use primary color for icons to add a pop */
}

/* Hover effect for better interactivity feel */
.farpov_hw_tag:hover {
    border-color: var(--pico-primary);
    color: var(--pico-color);
}

/* --- Refined Action Buttons (Harmonious Colors) --- */

.farpov_cam_actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pico-muted-border-color);
    margin-top: auto;
}

.farpov_cam_btn {
    flex: 1;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid transparent; /* No border by default for cleaner look */
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
    font-weight: 500;
}

/* Secondary Buttons (Settings, Edit) - Soft Gray */
.farpov_cam_btn {
    background-color: var(--pico-secondary-background);
    color: var(--pico-muted-color);
}

.farpov_cam_btn:hover {
    background-color: var(--pico-muted-border-color);
    color: var(--pico-color);
    transform: translateY(-1px);
}

/* Primary Button (View) - Solid Brand Color */
.farpov_cam_btn.primary {
    background-color: var(--pico-primary);
    color: var(--pico-primary-inverse);
    flex: 2; /* Make the primary action wider */
}

.farpov_cam_btn.primary:hover {
    background-color: var(--pico-primary-hover);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* --- Fix Action Buttons Contrast --- */

/* Reset base style for all cam buttons */
.farpov_cam_btn {
    flex: 1;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
    font-weight: 500;
}

/* Secondary Buttons (Settings, Edit) - Outline Style */
/* Using outline ensures good contrast regardless of theme background */
.farpov_cam_btn {
    background-color: transparent; 
    border: 1px solid var(--pico-muted-border-color);
    color: var(--pico-color); /* Use standard text color for icon visibility */
    opacity: 1;
}

.farpov_cam_btn:hover {
    background-color: var(--pico-card-background-color);
    border-color: var(--pico-primary);
    color: var(--pico-primary);
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Primary Button (View) - Solid Brand Color */
/* Must use !important or high specificity to override the above cascade if needed, 
   but since .farpov_cam_btn.primary is more specific, it should work. 
   Let's reinforce it just in case. */
.farpov_cam_btn.primary {
    background-color: var(--pico-primary);
    border: 1px solid var(--pico-primary);
    color: var(--pico-primary-inverse);
    flex: 2;
    opacity: 1;
}

.farpov_cam_btn.primary:hover {
    background-color: var(--pico-primary-hover);
    border-color: var(--pico-primary-hover);
    color: var(--pico-primary-inverse);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

/* --- Fix SVG Icon Color --- */

/* Ensure the SVG itself inherits color or has a specific fill/stroke */
.tinyui_svg_icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

/* Explicitly set icon color in secondary buttons */
.farpov_cam_btn svg.tinyui_svg_icon {
    color: inherit; /* Should inherit from button color */
    stroke: currentColor;
}

/* Force specific color if inheritance fails */
.farpov_cam_btn:not(.primary) {
    color: var(--pico-color) !important; /* Force standard text color */
    border-color: var(--pico-muted-border-color) !important;
}

.farpov_cam_btn:not(.primary):hover {
    color: var(--pico-primary) !important;
    border-color: var(--pico-primary) !important;
}

/* --- Improve Secondary Button Appearance --- */

/* Give secondary buttons a soft background instead of transparent */
.farpov_cam_btn:not(.primary) {
    background-color: var(--pico-secondary-background); /* Use theme's secondary bg (usually light gray) */
    border-color: transparent !important; /* Remove border to make it cleaner */
    color: var(--pico-color) !important; /* Muted text/icon color */
}

/* Hover state: darken slightly and show brand color */
.farpov_cam_btn:not(.primary):hover {
    background-color: var(--pico-muted-border-color); /* Darker gray on hover */
    color: var(--pico-primary) !important; /* Brand color icon on hover */
    transform: translateY(-1px);
}

.farpov_cam_btn {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* --- Photo Grid Overlay Actions --- */
._ph_ ._img_ {
    position: relative;
    overflow: hidden;
}

.photo_overlay_actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 0.75rem;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none; /* Let clicks pass through to image/container unless on button */
    z-index: 10; /* Ensure overlay is above info label (z-index 2) */
}

._ph_:hover .photo_overlay_actions {
    opacity: 1;
    pointer-events: auto;
}

/* --- Action Buttons (Download/Delete) --- */

.action_btn {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    padding: 0;
    background: rgba(255, 255, 255, 0.92);
    color: rgba(17, 24, 39, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transform: translateY(10px);
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: auto; /* CRITICAL: Ensure buttons capture clicks */
    position: relative; /* Ensure z-index works */
    z-index: 30; /* Ensure above overlay and image */
}

.action_btn svg {
    width: 18px;
    height: 18px;
}

.btn_label {
    display: inline-block;
}

._ph_:hover .action_btn {
    transform: translateY(0);
}

/* Specific button styles */
.download_btn {
    background: var(--pico-primary);
    color: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.download_btn:hover {
    background: var(--pico-primary);
    color: white;
    transform: scale(1.05);
}

.delete_btn {
    color: #e53935; /* Red for delete */
}

.delete_btn:hover {
    background: #e53935;
    color: white;
    transform: scale(1.05);
}

/* Animation delay for staggered appearance */
.delete_btn {
    transition-delay: 0.05s;
}

/* --- Photo Checkbox & Selection --- */

.photo_checkbox {
    position: absolute;
    top: auto;        /* Remove top positioning */
    bottom: 8px;      /* Move to bottom */
    left: auto;       /* Remove left positioning */
    right: 8px;       /* Move to right */
    z-index: 20;
    color: white;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    padding: 2px;
    display: flex;
    cursor: pointer;
    transition: all 0.2s ease;
}

._ph_:hover .photo_checkbox,
._ph_.selected .photo_checkbox {
    opacity: 1;
}

/* Hide checkbox by default unless selected or hovered */
.photo_checkbox {
    opacity: 0.6;
}

._ph_.selected .photo_checkbox {
    background: var(--pico-primary);
    color: white;
    opacity: 1;
}

._ph_.selected ._img_ img {
    /* Optional: dim image when selected */
    filter: brightness(0.8);
}

._ph_.selected ._img_ {
    /* Highlight border */
    box-shadow: 0 0 0 3px var(--pico-primary);
}

/* --- Move Photo Checkbox to Bottom Right --- */

.photo_checkbox {
    top: auto;        /* Remove top positioning */
    bottom: 8px;      /* Move to bottom */
    left: auto;       /* Remove left positioning */
    right: 8px;       /* Move to right */
}

/* --- Refined Photo Grid Header Layout --- */

.farpov_photo_grid_header {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Consistent spacing */
    flex-wrap: wrap; /* Allow wrapping on small screens */
    padding: 0.5rem 0;
}

/* 1. Camera Selector */
.farpov_photo_grid_header .farpov_camera_select {
    flex: 0 0 auto;
    min-width: 140px;
    margin-bottom: 0;
}

/* 2. Date Picker */
.farpov_photo_grid_header input[type="datetime-local"] {
    flex: 1; /* Take available space but not too much */
    min-width: 200px;
    margin-bottom: 0;
    height: auto; /* Use standard height */
    padding: 0.4rem 0.75rem;
}

/* 3. Action Buttons Group */
.farpov_photo_grid_header button {
    margin-bottom: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    height: 100%; /* Match input height if possible */
}

/* Primary Action: Goto */
.farpov_photo_grid_header button.primary {
    /* Pico defaults are fine */
}

/* Secondary Actions: Select All, Range, etc. */
.farpov_photo_grid_header button.outline.secondary {
    border-color: var(--pico-muted-border-color);
    color: var(--pico-muted-color);
}

.farpov_photo_grid_header button.outline.secondary:hover {
    border-color: var(--pico-primary);
    color: var(--pico-primary);
    background-color: var(--pico-card-background-color);
}

/* Batch Action Group (Right Aligned) */
.batch-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto; /* Push to right */
    padding-left: 0.5rem;
    border-left: 1px solid var(--pico-muted-border-color); /* Separator */
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .batch-actions-group {
        margin-left: 0;
        border-left: none;
        width: 100%;
        justify-content: space-between;
        margin-top: 0.5rem;
    }
}

/* --- Refined Header Layout (V2) --- */

.farpov_photo_grid_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Left Group: Filters */
.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0; /* Allow shrinking below content size */
    flex-wrap: wrap; /* Allow wrapping on very small screens */
}

/* Date + Button Group */
.date-input-group {
    display: flex;
    flex: 1;
    max-width: 400px; /* Don't stretch too wide */
    margin-bottom: 0 !important;
}

.date-input-group input {
    margin-bottom: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.date-input-group button {
    margin-bottom: 0 !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    white-space: nowrap;
}

/* Right Group: Tools */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Button Groups (Pico-like grouping) */
.tools-group, .actions-group {
    display: inline-flex;
    margin-bottom: 0 !important;
}

.tools-group button, .actions-group button {
    margin-bottom: 0 !important;
    padding: 0.4rem 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Connect grouped buttons visually */
.tools-group button:not(:first-child),
.actions-group button:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px; /* Overlap borders */
}

.tools-group button:not(:last-child),
.actions-group button:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Hide text on small screens for tools */
@media (max-width: 600px) {
    .btn-text {
        display: none;
    }
}

/* --- Fix Header Group Styling --- */

/* Fix Input Group Heights & Borders */
.date-input-group input,
.date-input-group button,
.tools-group button,
.actions-group button {
    height: 100% !important; /* Ensure same height */
    min-height: 40px; /* Standardize min height */
}

/* Ensure Goto button is primary color (not dark contrast) if class removed */
.date-input-group button {
    background-color: var(--pico-primary);
    border-color: var(--pico-primary);
    color: var(--pico-primary-inverse);
}

.date-input-group button:hover {
    background-color: var(--pico-primary-hover);
    border-color: var(--pico-primary-hover);
}

/* Add margin between groups in header-right */
.header-right {
    gap: 0.5rem; /* Smaller gap between groups */
}

/* Fix vertical alignment */
.farpov_photo_grid_header {
    align-items: stretch; /* Stretch items to match height */
}

/* Make sure camera select also matches height */
.farpov_camera_select select {
    height: 100% !important;
    min-height: 40px;
    margin-bottom: 0 !important;
}


/* --- Fix Overlap in Header --- */

/* Ensure header groups don't overlap by allowing wrapping and spacing */
.farpov_photo_grid_header {
    flex-wrap: wrap; /* Ensure items wrap if not enough space */
    gap: 1rem;       /* Minimum gap between items */
}

/* Give header-right explicit gap logic */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;       /* Space between Tools Group and Actions Group */
    flex-wrap: wrap; /* Allow tools and actions to wrap */
    margin-left: auto; /* Push to right, but allow shrinking */
}

/* Ensure groups don't collapse */
.tools-group, .actions-group {
    flex-shrink: 0; /* Prevent shrinking */
    white-space: nowrap;
}

/* Adjust for small screens */
@media (max-width: 768px) {
    .farpov_photo_grid_header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-left, .header-right {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap; /* Allow wrapping */
    }
    
    .header-right {
        margin-left: 0;
        margin-top: 0.5rem;
        gap: 0.5rem;
    }

    .tools-group, .actions-group {
        flex-shrink: 1;
        white-space: normal;
        flex-wrap: wrap;
        width: 100%;
        justify-content: space-between;
    }

    .tools-group button, .actions-group button {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* --- Fix Wrapping Alignment --- */

/* When items wrap, ensure they align nicely */
.header-right {
    justify-content: flex-end; /* Align to right by default */
    align-items: center;       /* Center vertically */
}

/* If wrapped, maybe center or keep right aligned? 
   The issue in screenshot is the second row is below the first row of buttons.
   It looks like the container width is constrained.
*/

/* Force items to stay on same line if possible, or wrap whole block */
.header-right {
    flex-wrap: nowrap; /* Try to keep on one line first */
}

/* If screen is too small, then wrap whole header-right below header-left */
@media (max-width: 992px) {
    .farpov_photo_grid_header {
        justify-content: space-between;
    }
    
    .header-right {
        margin-left: auto;
    }
}

/* If still wrapping inside header-right (like in screenshot) */
/* It seems the 'tools-group' and 'actions-group' are wrapping. 
   Let's align them to the top or center to avoid the 'staircase' effect if they wrap.
*/
.header-right {
    align-items: center; 
}

/* Fix specific issue: The 'actions-group' (Download/Delete) wrapped to next line 
   but is aligned to the left of the flex container, or space is weird.
*/

/* Let's try to keep them together if space permits, or stack vertically aligned to right */
.header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Add margin top to wrapped items for spacing */
.actions-group {
    margin-top: 0; 
}

/* If wrapped, add some top margin */
@media (max-width: 1200px) {
    /* If we detect wrapping might happen, we can adjust */
}

/* Force height consistency again */
.header-right button {
    height: 40px !important;
}

/* Make sure the container has enough width */
/* The issue might be the flex container is too narrow. */


/* --- Professional Compare Photo Toolbar --- */

.farpov_cmp_toolbar_container {
    pointer-events: none;
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 20; /* Ensure toolbar is above everything */
}

.farpov_cmp_toolbar {
    pointer-events: auto;
    background: rgba(30, 30, 30, 0.85); /* Dark semi-transparent bg */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px; /* Pill shape */
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.farpov_toolbar_group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.farpov_toolbar_divider {
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 0 0.25rem;
}

.farpov_cmp_btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    position: relative;
}

.farpov_cmp_btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.farpov_cmp_btn span {
    font-size: 0.6rem;
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: var(--pico-primary);
    color: white;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.farpov_cmp_btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
}

.farpov_cmp_btn.active {
    background-color: var(--pico-primary);
    color: white;
    box-shadow: 0 0 15px rgba(var(--pico-primary-rgb), 0.5);
}

.farpov_cmp_btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Ensure HeaderNav works in overlay */
.farpov_cmp_ph_overlay .farpov_header_nav_container {
    width: 100%;
    pointer-events: auto;
    /* Remove specific background here as we style the inner container above */
    background: transparent; 
}

/* Adjust safezone to account for header */
.farpov_cmp_ph_safezone {
    flex: 1;
}

/* --- Compare Photo Page Redesign (Light Theme) --- */

/* Timeline Styles */
.farpov_timeline_container {
    position: relative; /* Changed from absolute */
    bottom: auto;
    height: auto;
    max-height: 45vh;
    min-height: 190px; /* Ensure minimum height for usability */
    background: var(--pico-background-color);
    border-top: 1px solid var(--pico-muted-border-color);
    z-index: 30;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    flex-shrink: 0; /* Prevent shrinking */
    color: var(--pico-color);
}

.farpov_timeline_scroll {
    flex: 1;
    min-height: 135px;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    padding: 1rem;
    gap: 2rem;
    align-items: flex-end; /* Align items to bottom */
}

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

.farpov_timeline_date {
    color: var(--pico-muted-color);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    padding-left: 0.25rem;
}

.farpov_timeline_items {
    display: flex;
    gap: 0.75rem;
    direction: ltr;
    unicode-bidi: isolate;
}

.farpov_timeline_item {
    width: 140px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    transition: transform 0.2s;
    cursor: pointer;
}

.farpov_timeline_item:hover {
    transform: translateY(-5px);
}

.farpov_timeline_thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    background: var(--pico-secondary-background);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.farpov_timeline_item.focused .farpov_timeline_thumb {
    border-color: var(--pico-primary);
    box-shadow: 0 0 0 2px var(--pico-primary-focus);
}

.farpov_timeline_item.selected-left .farpov_timeline_thumb {
    border-color: rgba(52, 152, 219, 0.95);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

.farpov_timeline_item.selected-right .farpov_timeline_thumb {
    border-color: rgba(231, 76, 60, 0.95);
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.22);
}

.farpov_timeline_item.selected-left.selected-right .farpov_timeline_thumb {
    border-color: transparent;
    box-shadow:
        0 0 0 2px rgba(52, 152, 219, 0.7),
        0 0 0 4px rgba(231, 76, 60, 0.7);
}

.farpov_timeline_thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.farpov_timeline_side_badges {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    display: flex;
    justify-content: space-between;
    gap: 6px;
    pointer-events: none;
    z-index: 4;
}

.farpov_timeline_side_badge {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.farpov_timeline_side_badge.left {
    background: rgba(52, 152, 219, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.farpov_timeline_side_badge.right {
    background: rgba(231, 76, 60, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.farpov_timeline_time {
    font-size: 0.75rem;
    color: var(--pico-muted-color);
    text-align: center;
}

/* Hover Actions on Timeline Item */
.farpov_timeline_actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 1.5rem; /* Exclude time label */
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 6px;
    z-index: 3;
}

.farpov_timeline_item:hover .farpov_timeline_actions {
    opacity: 1;
}

.timeline_action_btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline_action_btn.left {
    background: #3498db; /* Blue for Left/1 */
}

.timeline_action_btn.right {
    background: #e74c3c; /* Red for Right/2 */
}

.timeline_action_btn.active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 2px 4px rgba(0, 0, 0, 0.18);
}

.timeline_action_btn:hover {
    transform: scale(1.1);
}

/* Compare Header Redesign */
.farpov_cmp_header {
    position: relative; /* Changed from absolute */
    height: 60px;
    background: var(--pico-background-color);
    border-bottom: 1px solid var(--pico-muted-border-color);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    color: var(--pico-color);
    flex-shrink: 0; /* Prevent shrinking */
}

/* Adjust Safezone */
.farpov_cmp_ph_safezone_v2 {
    position: relative; /* Changed from absolute */
    top: auto;
    bottom: auto;
    flex: 1; /* Take remaining space */
    background: var(--pico-secondary-background); /* Slight contrast */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 10;
    overflow: hidden;
}

/* Responsive Adjustments for Timeline */
@media screen and (max-width: 768px) {
    .farpov_timeline_container {
        /* height: auto; Inherited from base rule, removed fixed 160px */
        min-height: 170px; /* Smaller min-height for mobile */
    }
    
    .farpov_timeline_scroll {
        min-height: 105px; /* Ensure space for smaller thumbnails on mobile */
    }
    
    .farpov_timeline_item {
        width: 100px;
    }
    
    .farpov_cmp_ph_safezone_v2 {
        padding: 0.5rem;
    }
    
    .farpov_cmp_header {
        height: 50px;
        padding: 0 0.5rem;
    }
    
    .farpov_cmp_title {
        font-size: 0.9rem;
    }
}

.farpov_cmp_back_btn {
    background: transparent;
    border: none;
    color: var(--pico-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    font-size: inherit;
    cursor: pointer;
}
.farpov_cmp_back_btn:hover {
    color: var(--pico-primary);
}

.farpov_cmp_title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.farpov_cmp_spacer {
    width: 100px;
}

.farpov_cmp_modes {
    display: flex;
    gap: 0.5rem;
    background: var(--pico-secondary-background);
    padding: 0.25rem;
    border-radius: 6px;
    border: 1px solid var(--pico-muted-border-color);
}

.farpov_cmp_mode_btn {
    background: transparent;
    border: none;
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.farpov_cmp_mode_btn.active {
    background: var(--pico-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.farpov_cmp_mode_btn:hover:not(.active) {
    background: var(--pico-card-background-color);
    color: var(--pico-primary);
}

@media screen and (max-width: 768px) {
    .farpov_cmp_spacer {
        display: none;
    }
    
    .farpov_cmp_mode_btn {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Mobile Optimizations for Header Nav */
@media (max-width: 767px) {
    .farpov_header_nav_container {
        min-height: 60px;
    }
    
    .farpov_header_nav_icon_wrap {
        padding: var(--pico-form-element-spacing-vertical) var(--pico-form-element-spacing-horizontal);
    }
    
    .farpov_header_nav_title {
        font-size: 1.25rem;
        line-height: 1.2;
    }
    
    /* Ensure Sidebar Header also compact on mobile if displayed */
    .farpov_drawer_nav_user_info {
        min-height: auto;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* --- Mobile Card View for Camera Management (DataGrid) --- */
@media (max-width: 768px) {
    .farpov_cameras_grid table, 
    .farpov_cameras_grid thead, 
    .farpov_cameras_grid tbody, 
    .farpov_cameras_grid th, 
    .farpov_cameras_grid td, 
    .farpov_cameras_grid tr { 
        display: block; 
    }

    .farpov_cameras_grid thead { 
        display: none; 
    }

    .farpov_cameras_grid tr { 
        margin-bottom: 1rem; 
        border: 1px solid var(--pico-muted-border-color);
        border-radius: var(--pico-border-radius);
        background: var(--pico-card-background-color);
        box-shadow: var(--shadow-sm);
        padding: 0.75rem;
    }

    .farpov_cameras_grid td { 
        /* Behave like a "row" */
        border: none;
        border-bottom: 1px solid var(--pico-muted-border-color); 
        position: relative;
        padding: 0.5rem 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right !important; /* Override inline styles */
        width: 100% !important; /* Override inline styles */
        min-height: 2.5rem;
    }
    
    .farpov_cameras_grid td:last-child {
        border-bottom: none;
    }

    .farpov_cameras_grid td::before { 
        /* Now like a table header */
        content: attr(data-label);
        font-weight: 600;
        color: var(--pico-muted-color);
        text-align: left;
        margin-right: auto; /* Push content to right */
        font-size: 0.85rem;
    }
    
    /* ID is usually not critical for mobile cards */
    .farpov_cameras_grid td[data-label="ID"] {
        display: none; 
    }
    
    /* Make actions row stand out */
    .farpov_cameras_grid td:last-child {
        margin-top: 0.25rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--pico-muted-border-color);
        justify-content: flex-end;
        gap: 0.5rem;
    }
    
    .farpov_cameras_grid td:last-child::before {
        display: none; /* Hide "Actions" label */
    }
    
    /* Adjust buttons in actions to be larger touch targets if needed */
    .farpov_cameras_grid td:last-child button {
        padding: 0.4rem 0.8rem !important;
    }
}

/* --- Mobile Card View for Storage (OSS) Management (DataGrid) --- */
@media (max-width: 768px) {
    .farpov_oss_grid table, 
    .farpov_oss_grid thead, 
    .farpov_oss_grid tbody, 
    .farpov_oss_grid th, 
    .farpov_oss_grid td, 
    .farpov_oss_grid tr { 
        display: block; 
    }

    .farpov_oss_grid thead { 
        display: none; 
    }

    .farpov_oss_grid tr { 
        margin-bottom: 1rem; 
        border: 1px solid var(--pico-muted-border-color);
        border-radius: var(--pico-border-radius);
        background: var(--pico-card-background-color);
        box-shadow: var(--shadow-sm);
        padding: 0.75rem;
    }

    .farpov_oss_grid td { 
        /* Behave like a "row" */
        border: none;
        border-bottom: 1px solid var(--pico-muted-border-color); 
        position: relative;
        padding: 0.5rem 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right !important; /* Override inline styles */
        width: 100% !important; /* Override inline styles */
        min-height: 2.5rem;
    }
    
    .farpov_oss_grid td:last-child {
        border-bottom: none;
    }

    .farpov_oss_grid td::before { 
        /* Now like a table header */
        content: attr(data-label);
        font-weight: 600;
        color: var(--pico-muted-color);
        text-align: left;
        margin-right: auto; /* Push content to right */
        font-size: 0.85rem;
        min-width: 80px; /* Ensure labels align somewhat */
    }
    
    /* ID is usually not critical for mobile cards */
    .farpov_oss_grid td[data-label="ID"] {
        display: none; 
    }
    
    /* Make actions row stand out */
    .farpov_oss_grid td:last-child {
        margin-top: 0.25rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--pico-muted-border-color);
        justify-content: flex-end;
        gap: 0.5rem;
    }
    
    .farpov_oss_grid td:last-child::before {
        display: none; /* Hide "Actions" label */
    }
    
    /* Adjust buttons in actions to be larger touch targets if needed */
    .farpov_oss_grid td:last-child button {
        padding: 0.4rem 0.8rem !important;
    }
}
