:root {
    --primary: #2c5e2e;
    /* Deep Vine Green */
    --primary-light: #4c8c4e;
    --accent: #d4af37;
    --info: #3498db;

    /* Gold/Terroir */

    /* Modal and Overlay */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-heading: 'Outfit',
        sans-serif;
    --font-body: 'Inter',
        sans-serif;
    --header-height: 60px;

    /* Missing Design Tokens */
    --surface: #f1f3f5;
    --text-secondary: #636e72;
    --border: #e2e8f0;
    --radius: 12px;
    --badge-border: #1d7200;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 80px;
    /* Space for bottom nav/actions if needed */
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--primary);
    font-weight: 700;
}

h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.app-header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.app-header .logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
}

.app-header .user-menu {
    font-size: 0.95rem;
    opacity: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 0.9;
}

.nav-link-admin {
    color: #ffeb3b;
    font-weight: 700;
}

.nav-link-logout {
    color: white;
    opacity: 0.7;
}

/* Components */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: transform 0.1s, box-shadow 0.2s;
    font-family: var(--font-heading);
}

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

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

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-main);
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-edit {
    text-decoration: none;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 94, 46, 0.1);
}

/* Custom Inputs for Mobile */
/* Date Filter Form */
.date-filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-control-sm {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .date-filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Plant Profile Specifics */
.plant-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.plant-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    background: #e2e8f0;
    color: var(--text-muted);
}

.profile-details {
    margin-top: 10px;
    font-weight: 600;
    color: var(--text-main);
}

.profile-details-secondary {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.status-aeroponie {
    background: #e3f2fd;
    color: #1565c0;
}

.status-pepiniere {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-mort_parcelle {
    background: #ffebee;
    color: #c62828;
}

.status-mort_pepiniere {
    background: #fff5f5;
    color: #e53935;
}

.status-vivant {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.status-mort {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 1rem;
}

.full-width {
    width: 100%;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 14px 20px;
        width: 100%;
        display: block;
        margin-bottom: 10px;
    }

    .plant-header {
        flex-direction: column;
        text-align: center;
    }
}

/* Dashboard Specifics */
.dashboard-header {
    margin-bottom: 30px;
}

.subtitle {
    color: var(--text-muted);
}

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

.stat-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 160px;
}

.stat-value {
    font-size: 3rem;
    margin-bottom: 0;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 600;
}

.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-donut {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #eee;
    margin-bottom: 10px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    font-size: 0.75rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.list-item-border {
    display: flex;
    justify-content: space-between;
    padding: 12px 10px;
    border-bottom: 1px solid #f1f1f1;
}

.filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.filters-group {
    display: flex;
    gap: 10px;
}

/* Advanced Filter Accordion */
.filter-accordion {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.filter-accordion summary {
    padding: 15px 20px;
    font-weight: 600;
    cursor: pointer;
    background: #f8f9fa;
    border-bottom: 1px solid #ebebeb;
    display: flex;
    align-items: center;
    list-style: none;
    /* Hide default arrow in some browsers */
}

/* Custom arrow for summary */
.filter-accordion summary::-webkit-details-marker {
    display: none;
}

.filter-accordion summary::after {
    content: "▼";
    margin-left: auto;
    font-size: 0.8em;
    color: #666;
    transition: transform 0.2s ease-in-out;
}

.filter-accordion[open] summary::after {
    transform: rotate(180deg);
}

.filter-content {
    padding: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.table-card {
    overflow-x: auto;
    padding: 0;
    max-height: 75vh;
    overflow-y: auto;
    border-bottom: 3px solid var(--primary);
    /* Visual cue for scrolling */
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table-header {
    padding: 15px 20px;
    font-weight: 600;
}

.data-table thead tr {
    border-bottom: 2px solid #f1f1f1;
    background-color: var(--primary-light);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-row {
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
}

.table-cell {
    padding: 15px 20px;
}

/* Admin Specifics */
.admin-table-container {
    overflow-x: auto;
    padding: 0;
}

.admin-badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: inline-block;
}

.admin-badge-admin {
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 700;
}

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

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
    line-height: 1.2;
}

.gap-small {
    gap: 5px;
}

/* Edit Form Specifics */
.edit-card-container {
    max-width: 600px;
    margin: 20px auto;
}

.form-title {
    color: var(--primary);
    text-align: center;
    margin-bottom: 20px;
}

.rfid-display {
    background: #f1f1f1;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}

.form-row {
    display: flex;
    gap: 15px;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

.form-section-title {
    font-size: 1.1rem;
    margin-top: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    color: var(--primary);
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Final Utilities & Fixes */
.logo-link {
    color: white;
    text-decoration: none;
}

.stat-value-primary {
    color: var(--primary);
    margin-bottom: 0;
    font-size: 3rem;
}

.stat-value-accent {
    color: var(--accent);
    margin-bottom: 0;
    font-size: 3rem;
}

.stat-value-info {
    color: #3498db;
    margin-bottom: 0;
    font-size: 3rem;
}

/* Specific Stat Card Colors */
.stat-card-qg { border-left: 4px solid #673ab7 !important; }
.stat-value-qg { color: #673ab7; }

.stat-card-pepiniere { border-left: 4px solid var(--primary) !important; }

.stat-card-parcelle { border-left: 4px solid var(--accent) !important; }

.stat-card-nursery { border-left: 4px solid #009688 !important; }
.stat-value-nursery { color: #009688; }

.stat-card-global-tr { border-left: 4px solid var(--info) !important; }


.filter-actions-dashboard {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.btn-filter-apply {
    flex: 1;
}

.legend-item {
    font-weight: bold;
}

.rfid-detected-box {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.rfid-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.rfid-value {
    font-size: 1.5rem;
    color: #1565c0;
    font-weight: bold;
}

.list-none {
    list-style: none;
    padding: 0;
}

.text-primary {
    color: var(--primary);
}

.sort-link {
    color: white;
    text-decoration: none;
}

.table-empty {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}

.font-bold {
    font-weight: 600;
}

/* History Images */
.history-thumb {
    max-width: 320px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    margin-bottom: 10px;
}

/* Lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Profile Measurements */
.profile-measurements {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}



.badge-mesure {
    background: #e1f5fe;
    color: #0277bd;
    border: 1px solid #b3e5fc;
}

.badge-link {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--badge-border);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.badge-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Passports Gallery Improvements */
.gallery-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(45, 45, 45, 0.5);
    color: white;
    border: none;
    font-size: 2.5rem;
    padding: 15px 12px;
    cursor: pointer;
    z-index: 1010;
    transition: all 0.2s;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.gallery-arrow:active {
    background: rgba(255, 255, 255, 0.2);
}

.gallery-arrow-prev {
    left: 15px;
}

.gallery-arrow-next {
    right: 15px;
}

.gallery-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.gallery-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    user-select: none;
    -webkit-user-drag: none;
}

/* Accordion */
.accordion-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    overflow: hidden;
}

.accordion-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.accordion-header:hover {
    background: var(--surface);
}

.accordion-header h3 {
    margin: 0;
    font-size: 1rem;
}

.accordion-icon {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.accordion-body {
    padding: 0 20px 20px;
}

.form-section-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 16px 0 8px;
}


.auth-wrapper {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.auth-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.dev-branding {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.8;
}

.dev-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.dev-logo {
    height: 30px;
    width: auto;
    filter: grayscale(100%);
    transition: filter 0.3s;
}

.dev-logo:hover {
    filter: grayscale(0%);
}

/* Mobile Layout Fixes (< 450px) */
@media (max-width: 450px) {

    /* Header Stack */
    .app-header {
        flex-direction: column;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .app-header .logo {
        margin-right: 0;
        margin-bottom: 5px;
    }

    .app-header .user-menu {
        width: 100%;
        justify-content: center;
        gap: 15px;
    }

    /* Profile Badges Layout */
    .profile-measurements {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
    }


}

/* Lightbox Enhancements */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-img {
    transition: transform 0.1s;
    /* Smooth zoom */
    transform-origin: center center;
}

/* Label Printing Configuration Layout */
.label-config-row {
    display: flex;
    gap: 15px;
    margin-bottom: 1rem;
    flex-wrap: nowrap;
}

.label-format-col {
    flex: 0 0 65%;
}

.label-speed-col {
    flex: 1;
}

@media (max-width: 767px) {
    .label-config-row {
        flex-direction: column;
        gap: 0;
    }

    .label-format-col,
    .label-speed-col {
        flex: 1 1 100%;
        width: 100%;
    }
}
/* Plant Profile / Header classes */
.q-mark {
    color: #e53935;
    font-weight: bold;
}

.profile-owner {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--primary);
    margin-bottom: 5px;
}

.gps-link {
    color: var(--primary);
    text-decoration: underline;
}

.badge-active {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.badge-passport {
    background-color: #607d8b !important;
    color: white !important;
    border-color: #455a64 !important;
}

/* Profile UI Extensions */
.mb-15 { margin-bottom: 15px; }
.mt-10 { margin-top: 10px; }
.fw-600 { font-weight: 600; }
.flex-item-center { display: flex; align-items: center; }
.gap-10 { gap: 10px; }
.gap-8 { gap: 8px; }
.cursor-pointer { cursor: pointer; }
.checkbox-large { width: 20px; height: 20px; }
.hr-separator {
    margin: 15px 0;
    border: 0;
    height: 1px;
    border-top: 1px solid rgba(0,0,0,0.1);
}
.hidden-initially { display: none; }
.m-0 { margin: 0; }
.w-80 { width: 80px; }

/* Auth and General utilities */
.mb-20 { margin-bottom: 20px; }
.text-left { text-align: left; }
.alert-setup {
    margin-bottom: 20px;
    background: #e3f2fd;
    color: #0d47a1;
    padding: 10px;
    border-radius: 4px;
}

/* Admin UI extensions */
.alert-success-admin {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #a5d6a7;
}
.alert-error-admin {
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid #ef9a9a;
}
.text-reset-pending {
    color: #c62828;
    font-size: 0.8em;
    display: block;
}

/* Admin Specific Utilities */
.text-muted-small {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}
.accordion-inner {
    background: #f8f9fa;
    border: 1px solid #ddd;
}
.summary-gray { background: #e9ecef; }
.batch-section-title {
    margin-top: 20px;
    color: var(--primary);
    font-weight: bold;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}
.batch-gps-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.mt-30 { margin-top: 30px; }
.flex-1-important { flex: 1 !important; }
.label-texts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}
@media (min-width: 1024px) {
    .label-texts-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
.btn-batch-create {
    background-color: #2e7d32 !important;
    border-color: #2e7d32 !important;
}
.modal-counter {
    color: white;
    font-size: 18px;
    font-weight: bold;
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1020;
}

/* Confirmation & Table styles */
.fs-1-1 { font-size: 1.1em; }
.mt-25 { margin-top: 25px; }
.text-danger-bold { color: #e53e3e; font-weight: bold; }
.table-bordered { margin-top: 10px; border: 1px solid #ddd; width: 100%; border-collapse: collapse; }
.table-bordered th { background: #f8f9fa; padding: 10px; border: 1px solid #ddd; }
.table-bordered td { padding: 10px; border: 1px solid #ddd; }
.alert-passport {
    margin-top: 15px;
    padding: 10px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    color: #0d47a1;
}
.alert-warning-irreversible {
    margin-top: 20px;
    padding: 15px;
    background: #fff5f5;
    border: 1px solid #fc8181;
    border-radius: 8px;
    color: #c53030;
}
.btn-success {
    background-color: #2e7d32;
    color: white;
}

/* Preview & Label classes */
.flex-preview { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.flex-1-min300 { flex: 1; min-width: 300px; }
.text-error-bold-mt { color: red; font-weight: bold; margin-top: 20px; }
.preview-relative { position: relative; display: inline-block; max-width: 100%; margin-top: 15px; }
.preview-image { max-height: 75vh; width: auto; max-width: 100%; display: block; position: relative; z-index: 10; mix-blend-mode: multiply; }
.overlay-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.btn-download { margin-top: 10px; width: 100%; font-size: 1.1em; padding: 15px; }
.print-instructions { margin-top: 20px; font-size: 0.85em; color: #555; background: #f9f9f9; padding: 15px; border-radius: 5px; border: 1px solid #ddd; }
.print-instructions ol { margin-top: 10px; padding-left: 20px; }
.legend-item {
    font-weight: 600;
    display: inline-block;
}
/* Dashboard Analytics & Campaign Selector */
.stats-section-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 15px 0 5px 0;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

.stats-section-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.campaign-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.campaign-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.campaign-select {
    width: auto !important;
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
    min-width: 90px;
    border-color: var(--primary) !important;
}

.stats-explanation {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: -5px 0 10px 15px;
    font-style: italic;
}
/* Custom Utilities & Components for RBAC and ZPL */
.display-none { display: none !important; }
.flex-1 { flex: 1; }
.min-w-300 { min-width: 300px; }
.text-sm { font-size: 0.9em; }
.text-muted-sm { font-size: 0.9em; color: var(--text-muted); }
.mb-15 { margin-bottom: 15px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mt-10 { margin-top: 10px !important; }
.mt-15 { margin-top: 15px !important; }
.m-0 { margin: 0 !important; }
.p-15 { padding: 15px !important; }
.w-100 { width: 100% !important; }
.font-bold { font-weight: bold !important; }
.justify-center { justify-content: center !important; }
.align-center { align-items: center !important; }
.gap-10 { gap: 10px !important; }
.ml-10 { margin-left: 10px !important; }
.ml-auto { margin-left: auto !important; }

/* Status Notifications */
.status-banner {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid transparent;
}
.status-banner-error {
    background-color: #ffebee;
    color: #c62828;
    border-color: #ef9a9a;
}
.status-banner-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

/* Accordion Helpers */
.accordion-header-flex {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.accordion-body { padding: 20px; }

/* History Components */
.history-meta {
    font-size: 0.8em;
    color: #666;
    display: block;
}
.history-comment { margin: 0; }

.history-unit-label { font-weight: normal; color: #555; }

/* Admin Logs & ZPL Editor */
.admin-logs-area {
    font-family: monospace;
    white-space: pre;
    background-color: #f8f9fa;
    resize: vertical;
    margin-top: 10px;
    font-size: 0.9em;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.zpl-editor-box {
    background: #fff;
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 0.8em;
}

.label-status-msg {
    text-align: center;
    color: green;
    font-weight: bold;
    margin-top: 10px;
    display: block;
}

/* Card Variants */
.card-border-primary { border-top: 4px solid var(--primary); }
.card-border-danger { border-top: 4px solid var(--danger); }

/* Badge Variants */
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-primary { background: var(--primary); color: white; }
.text-lg { font-size: 1.1em; }
.p-10 { padding: 10px !important; }
.border-top { border-top: 1px solid #ccc; }
.flex { display: flex !important; }
.gap-20 { gap: 20px !important; }
.cursor-pointer { cursor: pointer !important; }
.checkbox-lg { width: 22px; height: 22px; }
.align-baseline { align-items: baseline !important; }
.tfa-input { text-align: center; letter-spacing: 5px; font-size: 1.5rem; font-weight: bold; }
.btn-inline { display: inline-block !important; width: auto !important; }
.p-12-25 { padding: 12px 25px !important; }
.text-danger { color: var(--danger) !important; }

/* Operations PWA Options */
.ops-grid { display: flex; flex-direction: column; gap: 20px; padding: 15px; }
.btn-ops { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 15px; border-radius: 12px; height: 120px; transition: transform 0.2s; text-decoration: none; }
.btn-ops:active { transform: scale(0.98); }
.btn-ops h2 { margin: 0 0 10px 0; color: white !important; font-size: 1.5rem; }
.btn-ops span { color: rgba(255,255,255,0.8) !important; }
.nav-link-ops { font-size: 1.4rem; padding: 5px 10px; }

/* Scanner Layout */
.scanner-container { display: flex; flex-direction: column; height: 80vh; }
.scanner-top { flex: 1; min-height: 40vh; background: #000; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.scanner-bottom { flex: 1; min-height: 40vh; background: #f4f6f8; overflow-y: auto; padding: 10px; border-top: 2px solid #ddd; }
.scan-item { padding: 15px; background: white; border-radius: 8px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); font-weight: bold; border-left: 5px solid #ccc; }
.scan-item.pending { border-left-color: var(--danger); }
.scan-item.synced { border-left-color: var(--primary); }
.scan-item-meta { font-size: 0.8rem; color: #666; font-weight: normal; }
#reader { width: 100%; }






/* Header Controls */
.header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background-color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, background-color 0.2s;
    border: none;
}

.header-icon-ops {
    padding-bottom: 6px;
}

.header-icon-circle:hover {
    transform: scale(1.1);
    background-color: #f0f0f0;
}

/* Suivi Vegetatif History Edit */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.btn-edit-inline {
    background: var(--surface);
    color: var(--primary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.btn-edit-inline:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}
