* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
}

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --success-color: #4CAF50;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.role-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.role-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.role-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #45a049;
}

.error-message {
    color: var(--danger-color);
    margin-top: 1rem;
    text-align: center;
}

.demo-credentials {
    margin-top: 1.5rem;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 6px;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-left h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-left: 1rem;
}

.navbar-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-export,
.btn-logout,
.btn-back,
.btn-download,
.btn-camera {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
    display: inline-block;
}

.btn-export {
    background: var(--secondary-color);
    color: white;
}

.btn-logout {
    background: var(--danger-color);
    color: white;
}

.btn-back {
    background: #666;
    color: white;
}

.btn-download {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.btn-download:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.4);
    transform: translateY(-1px);
}

.btn-camera {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.btn-camera:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
    transform: translateY(-1px);
}

/* Dashboard */
.dashboard-content {
    padding: 2rem;
}

/* Analytics Section */
.analytics-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.range-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-selector label {
    font-weight: 600;
    color: #666;
}

.range-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.95rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.metric-card.large {
    grid-column: span 2;
}

.metric-trend {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-start;
}

.btn-trend {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-trend:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.metric-trend-panel {
    display: none;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #ddd;
    font-size: 0.8rem;
    color: #666;
}

.metric-trend-panel.open {
    display: block;
}

.trend-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.trend-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 64px;
}

.trend-bar {
    width: 10px;
    border-radius: 6px;
    background: linear-gradient(180deg, #42A5F5, #1E88E5);
    height: var(--h, 32px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.trend-bars .trend-line-svg {
    width: 100%;
    height: 100%;
}

/* Big combined trend chart */
.big-trend-card {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    /* Keep chart lines inside card */
}

.big-trend-card h4 {
    margin-bottom: 0.5rem;
}

.big-trend-chart {
    margin-top: 0.25rem;
    height: 90px;
    overflow: hidden;
    /* Clip any SVG overflow */
}

.big-trend-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #666;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-item::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 4px;
    border-radius: 999px;
    background: #ccc;
}

.legend-stores::before {
    background: #42A5F5;
}

.legend-visibility::before,
.legend-iqi::before {
    background: #4CAF50;
}

.legend-validity::before {
    background: #FF4081;
}

.legend-products::before {
    background: #FFC107;
}

/* Trend modal for large line chart */
.trend-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.trend-modal.open {
    display: flex;
}

.trend-modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.trend-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.trend-modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.trend-modal-subtitle {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #777;
}

.trend-modal-chart {
    margin-top: 1rem;
    height: 300px;
    position: relative;
    /* For absolute tooltip positioning */
}

.chart-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
    white-space: nowrap;
    transform: translate(-50%, -100%);
    margin-top: -8px;
}

.metric-card h4 {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 0.95rem;
    font-weight: 600;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0.5rem 0;
    line-height: 1;
}

.metric-detail {
    font-size: 1.1rem;
    color: #333;
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    min-height: 60px;
}

.metric-info {
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.5rem;
}

.dashboard-header {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.search-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn-search,
.btn-clear {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-search {
    background: var(--primary-color);
    color: white;
}

.btn-clear {
    background: #999;
    color: white;
}

.table-container {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    position: relative;
}

.events-table {
    width: 100%;
    border-collapse: collapse;
}

.events-table th {
    background: #f5f5f5;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.events-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.iqi-cell {
    font-weight: 600;
    color: var(--primary-color);
}

.detected-cell {
    color: var(--success-color);
    font-weight: 600;
}

.unclassified-cell {
    color: var(--danger-color);
    font-weight: 600;
}

.flag-icon {
    font-size: 1.5rem;
}

.flag-good {
    filter: hue-rotate(120deg);
}

.flag-warning {
    filter: hue-rotate(0deg);
}

.btn-view {
    background: var(--secondary-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-view:hover {
    background: #1976D2;
}

/* Availability Badge */
.availability-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    display: inline-block;
}

.availability-yes {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.availability-no {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Camera Page */
.camera-page {
    overscroll-behavior: contain;
    /* Prevent pull-to-refresh */
}

.camera-content {
    padding: 2rem;
}

.camera-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.camera-view {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.fullscreen-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    z-index: 10;
    font-size: 1.5rem;
    transition: all 0.3s;
    pointer-events: auto;
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

/* Fullscreen mode */
.camera-view:fullscreen {
    border-radius: 0;
}

.camera-view:-webkit-full-screen {
    border-radius: 0;
}

.camera-view:fullscreen #camera,
.camera-view:-webkit-full-screen #camera {
    height: 100vh;
    width: 100vw;
}

#camera {
    width: 100%;
    display: block;
}

.iqi-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.iqi-indicator {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 1rem;
    border-radius: 8px;
    color: white;
    min-width: 150px;
}

.iqi-label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.iqi-score {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.5rem;
}

.iqi-bar {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.iqi-fill {
    height: 100%;
    background: linear-gradient(90deg, #f44336, #ff9800, #4CAF50);
    transition: width 0.3s;
}

.iqi-status {
    font-size: 0.8rem;
    text-align: center;
    font-weight: 500;
}

/* Position feedback styling */
.position-feedback {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
}

.position-score {
    color: #ccc;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.position-status {
    font-weight: 500;
}

.position-status.ready {
    color: #4CAF50;
}

.position-status.not-ready {
    color: #ff9800;
}


/* Enhanced IQI indicator */
.iqi-indicator {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 1rem;
    border-radius: 12px;
    color: white;
    min-width: 160px;
}

.camera-controls {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.btn-capture {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s;
}

.btn-capture:hover:not(:disabled) {
    background: #45a049;
    transform: scale(1.02);
}

/* Smart capture button states */
.btn-capture.btn-ready {
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    border: 2px solid var(--primary-color);
}

.btn-capture.btn-disabled {
    background: #cccccc;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
    border: 2px solid #cccccc;
}

.btn-capture.btn-processing {
    background: #2196F3;
    color: white;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    border: 2px solid #2196F3;
}

/* Pulse animation for ready state */
@keyframes pulse-ready {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    }

    50% {
        box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
    }
}

.btn-capture.pulse-animation {
    animation: pulse-ready 1.5s ease-in-out 3;
}

.capture-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 0.9rem;
}

.capture-info p {
    margin: 0.5rem 0;
}

.gps-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.85rem;
}

.gps-status {
    display: block;
    font-weight: 500;
}

.gps-status small {
    color: #666;
    font-size: 0.8em;
}

.retry-gps-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
}

.retry-gps-btn:active {
    background: #1976D2;
}

/* Permission Error */
.permission-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 400px;
    z-index: 1000;
    text-align: center;
}

.error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.error-icon {
    font-size: 3rem;
    animation: pulse 2s infinite;
}

.error-message {
    color: #333;
}

.error-message strong {
    display: block;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--danger-color);
}

.error-message p {
    margin: 0.5rem 0 1rem 0;
    line-height: 1.6;
    color: #666;
}

.retry-btn,
.help-btn {
    padding: 0.75rem 1.5rem;
    margin: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.retry-btn {
    background: var(--primary-color);
    color: white;
}

.retry-btn:hover {
    background: #45a049;
}

.help-btn {
    background: var(--secondary-color);
    color: white;
}

.help-btn:hover {
    background: #1976D2;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.result-panel {
    grid-column: 1 / -1;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.result-content {
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Individual View */
.individual-content {
    padding: 2rem;
}

.event-detail-header {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.event-detail-header h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.event-meta {
    color: #666;
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.event-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.event-detail-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Captured Image Section */
.captured-image-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.captured-image-section h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
}

.image-container {
    text-align: center;
}

.captured-image {
    max-width: 100%;
    max-height: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.captured-image:hover {
    transform: scale(1.02);
}

.image-hint {
    margin-top: 0.5rem;
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
}

.range-selector {
    margin-bottom: 2rem;
}

.range-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.metric-card.large {
    grid-column: span 2;
}

.metric-card h4 {
    margin-bottom: 1rem;
    color: #666;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
}

.trend-sparkline {
    margin: 1rem 0;
    color: #999;
}

.btn-show-full {
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.data-row-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.data-details {
    margin: 1rem 0;
}

.data-details p {
    margin: 0.5rem 0;
}

.valid-badge {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.invalid-badge {
    background: var(--danger-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.detection-summary {
    margin-top: 1.5rem;
}

.summary-table {
    width: 100%;
    margin-top: 1rem;
}

.summary-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detection-details {
    margin-top: 1.5rem;
}

.detection-details h5 {
    margin-bottom: 1rem;
    color: #333;
}

.detection-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: background 0.2s;
}

.detection-item:hover {
    background: #f9f9f9;
}

.detection-name {
    font-weight: 600;
    color: var(--primary-color);
}

.detection-confidence {
    font-weight: bold;
    color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    background: #e3f2fd;
    border-radius: 12px;
    font-size: 0.9rem;
}

/* Mobile Optimizations */

/* Touch-friendly elements */
@media (hover: none) and (pointer: coarse) {

    /* Remove hover effects on touch devices */
    .btn-primary:hover,
    .btn-capture:hover,
    .btn-view:hover {
        transform: none;
    }

    /* Larger touch targets */
    button,
    .btn-primary,
    .btn-capture,
    .btn-export,
    .btn-logout {
        min-height: 48px;
        padding: 0.75rem 1.5rem;
        font-size: 1.1rem;
    }
}

/* Enhanced Mobile-specific styles */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        /* Prevent iOS zoom on input focus */
        line-height: 1.5;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Improved scrolling */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* Enhanced Navbar mobile */
    .navbar {
        padding: 0.75rem 1rem;
        min-height: 60px;
    }

    .navbar-content {
        flex-direction: row;
        /* Keep horizontal on mobile */
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }

    .navbar-left h2 {
        font-size: 1.25rem;
        margin: 0;
    }

    .subtitle {
        display: none;
        /* Hide subtitle on mobile for space */
    }

    .navbar-right {
        flex-shrink: 0;
        /* Prevent shrinking */
        gap: 0.75rem;
    }

    /* Enhanced mobile buttons */
    .btn-export,
    .btn-logout,
    .btn-back {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        min-height: 44px;
        /* Better touch target */
        min-width: 80px;
        border-radius: 8px;
        font-weight: 500;
        transition: all 0.3s ease;
        text-align: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-logout {
        background: var(--danger-color);
        color: white;
        border: 2px solid var(--danger-color);
    }

    .btn-logout:hover,
    .btn-logout:focus {
        background: #d32f2f;
        border-color: #d32f2f;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
    }

    .btn-logout:active {
        transform: scale(0.95);
    }

    /* Force mobile button styling */
    @media (max-width: 768px) {
        .navbar .btn-logout {
            background: var(--danger-color) !important;
            color: white !important;
            border: 2px solid var(--danger-color) !important;
            min-height: 44px !important;
            padding: 0.75rem 1rem !important;
            font-size: 0.9rem !important;
            font-weight: 500 !important;
            border-radius: 8px !important;
            text-decoration: none !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
        }
    }

    .btn-back {
        background: #666;
        color: white;
        border: 2px solid #666;
    }

    .btn-back:hover,
    .btn-back:focus {
        background: #555;
        border-color: #555;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(102, 102, 102, 0.3);
    }

    .btn-back:active {
        transform: scale(0.95);
    }

    /* Camera mobile */
    .camera-content {
        padding: 0;
        display: flex;
        flex-direction: column;
        height: calc(100vh - 70px);
    }

    .camera-container {
        grid-template-columns: 1fr;
        gap: 0;
        margin: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .camera-view {
        border-radius: 0;
        height: 50vh;
        min-height: 300px;
        max-height: none;
    }

    #camera {
        height: 100%;
        width: 100%;
        object-fit: cover;
    }


    .iqi-indicator {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.75rem 1rem;
        min-width: 130px;
        background: transparent !important;
        backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Mobile position feedback */
    .position-feedback {
        margin-top: 0.5rem;
        padding: 0.4rem;
        font-size: 0.7rem;
    }

    .position-score {
        font-size: 0.65rem;
    }

    .iqi-score {
        font-size: 1.75rem;
        font-weight: bold;
    }

    .iqi-label {
        font-size: 0.8rem;
    }

    .camera-controls {
        padding: 1.5rem 1rem;
        background: white;
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .btn-capture {
        font-size: 1.3rem;
        padding: 1.25rem;
        min-height: 60px;
        font-weight: 600;
        margin-top: 1rem;
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
        border-radius: 12px;
        /* Enhanced touch feedback */
        transition: all 0.2s ease;
        user-select: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .btn-capture:active:not(:disabled) {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
    }

    /* Mobile button states */
    .btn-capture.btn-ready {
        background: var(--primary-color) !important;
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4) !important;
    }

    .btn-capture.btn-disabled {
        background: #cccccc !important;
        color: #666 !important;
        cursor: not-allowed !important;
    }

    .btn-capture.btn-processing {
        background: #2196F3 !important;
        color: white !important;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-group label {
        font-size: 1rem;
        font-weight: 600;
    }

    .form-group input,
    .form-group select {
        font-size: 16px;
        /* Prevent iOS zoom */
        padding: 1rem;
        border: 2px solid var(--border-color);
        border-radius: 8px;
        background: #f9f9f9;
    }

    .gps-info {
        margin-top: 0.75rem;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Dashboard mobile */
    .dashboard-content {
        padding: 0.5rem;
    }

    .analytics-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    .section-header h3 {
        font-size: 1.25rem;
    }

    .range-selector {
        width: 100%;
    }

    .range-selector select {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        border: 2px solid var(--border-color);
        border-radius: 8px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .metric-card.large {
        grid-column: span 1;
    }

    .metric-value {
        font-size: 2rem;
    }

    .dashboard-header {
        padding: 1rem;
    }

    .search-controls {
        flex-direction: column;
        width: 100%;
    }

    .search-controls .form-group {
        width: 100%;
    }

    .btn-search,
    .btn-clear {
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Enhanced Table mobile */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        border-radius: 8px;
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    }

    .events-table {
        min-width: 800px;
        font-size: 0.85rem;
    }

    .events-table th,
    .events-table td {
        padding: 0.75rem 0.5rem;
        /* Increased padding for better touch */
        white-space: nowrap;
    }

    .events-table th {
        background: #f8f9fa;
        font-weight: 600;
        border-bottom: 2px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 10;
    }

    /* Better touch targets in table */
    .btn-view {
        min-height: 40px;
        min-width: 60px;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Enhanced Login mobile */
    .login-container {
        margin: 1rem;
        padding: 1.5rem;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    }

    .login-header h1 {
        font-size: 2rem;
    }

    .role-btn {
        padding: 0.875rem;
        font-size: 1rem;
        min-height: 50px;
        /* Better touch target */
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .role-btn:active {
        transform: scale(0.98);
    }

    /* Enhanced form inputs */
    .form-group input,
    .form-group select {
        min-height: 48px;
        /* Better touch targets */
        padding: 1rem;
        border-radius: 8px;
        border: 2px solid var(--border-color);
        transition: border-color 0.3s ease;
    }

    .form-group input:focus,
    .form-group select:focus {
        border-color: var(--primary-color);
        outline: none;
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    }

    /* Individual view mobile */
    .individual-content {
        padding: 0.5rem;
    }

    .event-detail-header {
        padding: 1rem;
    }

    .event-detail-header h3 {
        font-size: 1.1rem;
    }

    .event-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .event-detail-container {
        padding: 1rem;
    }

    .captured-image-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .captured-image {
        max-height: 400px;
    }

    /* Result panel mobile */
    .result-panel {
        padding: 1rem;
    }

    .result-content {
        padding: 1rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem 0.75rem;
    }

    .navbar-content {
        gap: 0.5rem;
    }

    .navbar-left h2 {
        font-size: 1.1rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    /* Compact mobile buttons */
    .btn-export,
    .btn-logout,
    .btn-back {
        font-size: 0.8rem !important;
        padding: 0.6rem 0.8rem !important;
        min-height: 40px !important;
        min-width: 70px !important;
        border-radius: 6px !important;
    }

    /* Specific logout button override for small screens */
    .navbar .btn-logout {
        background: #f44336 !important;
        color: white !important;
        border: 1px solid #f44336 !important;
        font-weight: 600 !important;
    }

    .navbar-right {
        gap: 0.5rem;
    }

    .login-header h1 {
        font-size: 1.75rem;
    }

    .demo-credentials {
        font-size: 0.75rem;
        padding: 0.75rem;
    }

    #camera {
        height: 50vh;
    }

    .camera-view {
        max-height: 50vh;
    }

    .iqi-indicator {
        min-width: 100px;
        padding: 0.5rem;
    }

    .iqi-label {
        font-size: 0.75rem;
    }

    .iqi-score {
        font-size: 1.25rem;
    }

}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #camera {
        height: 85vh;
    }

    .camera-view {
        max-height: 85vh;
    }

    .camera-controls {
        padding: 0.75rem;
    }

    .capture-info {
        display: none;
        /* Hide on landscape to save space */
    }
}

/* iOS Safe Area */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .navbar {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
}

/* Preview Panel */
.preview-panel {
    grid-column: 1 / -1;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin: 2rem auto;
    max-width: 800px;
    text-align: center;
}

.preview-image {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.preview-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-approve,
.btn-retake {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 180px;
    min-height: 56px;
}

.btn-approve {
    background: var(--success-color);
    color: white;
}

.btn-approve:hover {
    background: #45a049;
    transform: scale(1.02);
}

.btn-approve:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.btn-retake {
    background: #ff9800;
    color: white;
}

.btn-retake:hover {
    background: #e68900;
    transform: scale(1.02);
}

.btn-retake:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

/* Result Image */
.result-image {
    max-width: 100%;
    max-height: 50vh;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: none;
}

/* Camera Instructions */
.camera-instructions {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

.instruction-box {
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    text-align: center;
    backdrop-filter: blur(5px);
}

.instruction-box p {
    margin: 0;
    font-weight: 500;
}

/* Thumbnail Images in Dashboard */
.thumbnail-img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid var(--border-color);
}

.thumbnail-img:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.location-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
}

.camera-navbar .navbar-content {
    padding: 0.25rem 1rem;
    /* Reduced from default */
}

.camera-navbar,
.camera-navbar .navbar-content,
.camera-navbar .navbar-left,
.camera-navbar .navbar-right {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
}

.camera-navbar .navbar-right {
    margin-left: auto;
}

.camera-navbar {
    background: transparent !important;
    /* Change from sticky to fixed for consistent appearance */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    /* Use same sticky behavior as normal navbar so layout is simpler */
    min-height: 32px !important;
    /* Even smaller */
    padding: 0.125rem 1rem !important;
}

.camera-navbar .navbar-left h2 {
    font-size: 1.1rem !important;
    margin: 0 !important;
}

.camera-navbar .btn-back,
.camera-navbar .btn-logout {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.8rem !important;
    min-height: 32px !important;
}

/* Make camera control buttons transparent */
.btn-flash-toggle,
.btn-approve-fullscreen,
.btn-retake-fullscreen {
    background: transparent !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    color: white !important;
}

.btn-flash-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1);
}

.btn-capture-fullscreen:disabled {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Salesman Activity Page */
.salesman-activity-page {
    background-color: #f8f9fa;
}

.activity-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    text-align: center;
}

.welcome-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.welcome-section p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Quick Stats */
.quick-stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-single {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.stat-card-large {
    background: white;
    padding: 2.5rem 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-left: 6px solid #4CAF50;
    max-width: 400px;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card-large:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.stat-card-large .stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 0.5rem;
}

.stat-card-large .stat-label {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
}

/* Clean Stats Grid */
.stats-grid-clean {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card-clean {
    background: white;
    padding: 1.75rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border-top: 4px solid #e0e0e0;
}

.stat-card-clean.today {
    border-top-color: #4CAF50;
}

.stat-card-clean.week {
    border-top-color: #2196F3;
}

.stat-card-clean.total {
    border-top-color: #FF9800;
}

.stat-card-clean:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.stat-card-clean .stat-number {
    font-size: 2.25rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.stat-card-clean .stat-label {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 2rem;
}

.action-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.action-card h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.action-card p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-card.today {
    border-left: 4px solid #4CAF50;
}

.stat-card.week {
    border-left: 4px solid #2196F3;
}

.stat-card.locations {
    border-left: 4px solid #FF9800;
}

.stat-card.success {
    border-left: 4px solid #9C27B0;
}


.stat-number {
    font-size: 2.2rem;
    font-weight: bold;
    color: #333;
    transition: transform 0.3s;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
    font-weight: 600;
}

.stat-help {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Performance Section */
.performance-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.performance-section h4 {
    margin: 0 0 1.5rem 0;
    color: #333;
    font-size: 1.3rem;
}

.performance-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.performance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.perf-label {
    font-weight: 500;
    color: #666;
}

.perf-value {
    font-weight: bold;
    font-size: 1.2rem;
}

.perf-value.products {
    color: #4CAF50;
}

.perf-value.quality {
    color: #2196F3;
}

.perf-value.visits {
    color: #FF9800;
}

/* Locations Section */
.locations-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.location-count,
.activity-count {
    color: #666;
    font-size: 0.9rem;
    background: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.locations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.location-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: background 0.2s;
}

.location-card:hover {
    background: #e9ecef;
}

.location-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.location-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.location-time {
    color: #2196F3;
}

.location-products {
    color: #4CAF50;
}

.location-quality {
    color: #FF9800;
}

.status-success,
.status-empty {
    font-size: 1.5rem;
}

/* Recent Activity */
.recent-activity-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #4CAF50;
}

.activity-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
}

.time-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
}

.time-text {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.activity-content {
    flex: 1;
}

.activity-location {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.activity-details {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #666;
}

.detail-products {
    color: #4CAF50;
}

.detail-iqi {
    color: #2196F3;
}

.detail-date {
    color: #999;
}

.btn-view-small {
    background: #2196F3;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.btn-view-small:hover {
    background: #1976D2;
}

/* Action Section */
.action-section {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary-large {
    display: inline-block;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
    padding: 1.25rem 2.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
    transition: all 0.3s;
}

.btn-primary-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.action-hint {
    margin: 1rem 0 0 0;
    color: #666;
    font-style: italic;
}

/* Camera Button in Navbar */
.btn-camera {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-flash-toggle {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: none;
    padding: 0.35rem;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
}

.btn-flash-toggle .flash-icon {
    width: 1.3rem;
    height: 1.3rem;
    display: block;
    background: white;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M13 2L3 14h9l-1 8 10-12h-9z'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M13 2L3 14h9l-1 8 10-12h-9z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.btn-flash-toggle.flash-on {
    background: rgba(255, 235, 59, 0.25);
    border-color: rgba(255, 235, 59, 0.6);
}

.btn-flash-toggle.flash-on .flash-icon {
    background: #ffeb3b;
}

.btn-flash-toggle:hover {
    transform: scale(1.05);
}

.camera-action-row {
    margin-top: 0.5rem;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.camera-action-row .btn-flash-toggle {
    justify-self: center;
}

.camera-action-row .btn-capture-fullscreen {
    justify-self: center;
    padding: 0;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-capture-fullscreen .camera-icon {
    width: 1.8rem;
    height: 1.8rem;
    display: block;
    background: white;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 3l-1.8 2H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-3.2L15 3H9zm3 5a5 5 0 1 1 0 10 5 5 0 0 1 0-10zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 3l-1.8 2H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-3.2L15 3H9zm3 5a5 5 0 1 1 0 10 5 5 0 0 1 0-10zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.camera-action-row .btn-capture-fullscreen.btn-ready {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.6);
}

.camera-action-row .btn-capture-fullscreen.btn-disabled,
.camera-action-row .btn-capture-fullscreen:disabled {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.4);
    opacity: 0.7;
}

.camera-action-row .btn-capture-fullscreen.btn-processing {
    background: #2196F3;
    border: 2px solid #2196F3;
    box-shadow: 0 4px 14px rgba(33, 150, 243, 0.6);
}

/* Fullscreen Camera Layout */
.camera-content-fullscreen {
    position: relative;
    height: 100vh;
    /* Full height since header is fixed */
    overflow: hidden;
    background: #000;
    /* Prevent any white gaps */
}

.camera-view-fullscreen {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.camera-view-fullscreen video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

#selfieContainer video,
.camera-view-fullscreen #selfieVideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scaleX(-1);
    /* Mirror for selfie */
}

/* Top Controls Overlay */
.camera-top-controls {
    position: absolute;
    top: 2.5rem;
    /* Much more space from top */
    left: 1rem;
    /* Move to left to avoid overlap */
    z-index: 100;
}

.iqi-indicator-compact {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: white;
    min-width: 120px;
    text-align: center;
}

.iqi-indicator-compact .iqi-score {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.iqi-bar-compact {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin: 0.25rem 0;
}

.iqi-bar-compact .iqi-fill {
    height: 100%;
    background: linear-gradient(90deg, #f44336, #ff9800, #4CAF50);
    transition: width 0.3s;
}

.iqi-status-compact {
    font-size: 0.7rem;
    opacity: 0.9;
}

/* Position feedback in compact layout */
.iqi-indicator-compact .position-feedback {
    margin-top: 0.5rem;
    padding: 0.25rem;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 4px;
    font-size: 0.6rem;
}

.iqi-indicator-compact .position-score {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.125rem;
    font-weight: 500;
}

.iqi-indicator-compact .position-status {
    font-weight: 400;
}

.iqi-indicator-compact .position-status.ready {
    color: #4CAF50;
}

.iqi-indicator-compact .position-status.not-ready {
    color: #ff9800;
}

/* Bottom Controls Overlay */
.camera-bottom-controls {
    position: absolute;
    bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    /* Reduced gap */
    z-index: 100;
    width: 95%;
    max-width: 360px;
    /* Slightly narrower for small screens */
}

.location-input-compact {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.location-input-compact input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 8px;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.location-input-compact input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.retry-gps-btn-compact {
    padding: 0.75rem 1rem;
    background: rgba(33, 150, 243, 0.8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.btn-capture-fullscreen {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    /* Reduced padding */
    border-radius: 50px;
    font-size: 1rem;
    /* Reduced font size */
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4);
    transition: all 0.3s;
    min-width: 140px;
    /* Reduced from 160px */
}

.btn-capture-fullscreen:hover:not(:disabled) {
    background: #45a049;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.btn-capture-fullscreen:disabled {
    background: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    cursor: not-allowed;
}

/* Fullscreen Preview Panel */
.preview-panel-fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-content {
    text-align: center;
    max-width: 90%;
    max-height: 90%;
}

.preview-image-fullscreen {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.preview-actions-fullscreen {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-approve-fullscreen,
.btn-retake-fullscreen {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 100px;
}

.btn-approve-fullscreen {
    background: var(--primary-color);
    color: white;
}

.btn-retake-fullscreen {
    background: #666;
    color: white;
}

/* Fullscreen Result Panel */
.result-panel-fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.result-content-fullscreen {
    text-align: center;
    color: white;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

.result-content-fullscreen h4 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.result-summary,
.detections-list {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.25rem;
    text-align: left;
    margin-bottom: 1rem;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
}

.result-summary p,
.result-summary h5,
.detections-list h5 {
    margin: 0.25rem 0;
}

.result-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.result-meta small {
    color: rgba(255, 255, 255, 0.6);
}

.de.transaction-form {
    max-width: 640px;
    margin: 0 auto;
}

.transaction-form .form-group {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.transaction-form .form-group>label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.transaction-form small {
    font-size: 0.8rem;
}

.transaction-form .form-section-title {
    margin: 1.25rem 0 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
}

.detections-list h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.detections-scroll {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detection-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.95rem;
}

.detection-item strong {
    color: #4CAF50;
}

.detection-empty {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.result-image-fullscreen {
    max-width: 100%;
    max-height: 50vh;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.btn-primary-fullscreen {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
}

.btn-secondary-fullscreen {
    background: #666;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary-fullscreen:hover {
    background: #555;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    font-weight: bold;
    color: #999;
}

.empty-state p {
    margin: 0;
    font-style: italic;
}

/* Simplified Activity Summary */
.activity-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.location-quick {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #4CAF50;
}

.location-quick .location-name {
    font-weight: 600;
    color: #333;
}

.location-quick .location-time {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.location-quick .location-status {
    text-align: right;
    font-size: 0.85rem;
}

.location-quick .status-success {
    color: #4CAF50;
    font-weight: 500;
}

.location-quick .status-empty {
    color: #666;
    font-weight: 500;
}

/* Mobile styles for salesman activity page */
@media (max-width: 768px) {
    .activity-content {
        padding: 1rem;
    }

    .welcome-section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .welcome-section h3 {
        font-size: 1.4rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card-large {
        padding: 2rem 1.5rem;
        max-width: none;
    }

    .stat-card-large .stat-number {
        font-size: 2.5rem;
    }

    .stat-card-large .stat-label {
        font-size: 1rem;
    }

    .stats-grid-clean {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card-clean {
        padding: 1.5rem 1rem;
    }

    .stat-card-clean .stat-number {
        font-size: 2rem;
    }

    .action-card {
        padding: 1.25rem 1.5rem;
    }

    .action-card h4 {
        font-size: 1.1rem;
    }

    .action-card p {
        font-size: 0.9rem;
    }

    .stat-card {
        padding: 1rem;
        text-align: center;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .performance-section,
    .locations-section,
    .recent-activity-section,
    .action-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .location-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .location-meta {
        flex-direction: column;
        gap: 0.25rem;
    }

    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .activity-details {
        flex-direction: column;
        gap: 0.25rem;
    }

    .btn-primary-large {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .location-quick {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.25rem;
    }

    .location-quick .location-time,
    .location-quick .location-status {
        text-align: center;
    }

    .performance-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .btn-camera {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Mobile styles for new elements */
@media (max-width: 768px) {
    .preview-panel {
        margin: 1rem;
        padding: 1rem;
    }

    .preview-image {
        max-height: 50vh;
    }

    .preview-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-approve,
    .btn-retake {
        width: 100%;
        padding: 1.25rem;
        font-size: 1.2rem;
    }

    .thumbnail-img {
        width: 60px;
        height: 45px;
    }

    .instruction-box {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }

    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }

    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 40px;
    }

    .camera-navbar .navbar-left h2 {
        font-size: 1.2rem;
    }

    /* Ensure consistent button styling */
    .camera-navbar .btn-logout {
        min-height: 35px;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .camera-navbar .btn-back {
        min-height: 35px;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .camera-navbar .navbar-content {
        padding: 0.5rem 1rem;
    }

    .camera-navbar h2 {
        font-size: 1.1rem;
    }

    /* Mobile activity page navigation */
    .navbar .btn-camera {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        min-height: 40px;
    }

    /* Mobile fullscreen camera adjustments */
    .camera-content-fullscreen {
        height: 100vh;
        /* Full height since header is fixed */
    }

    .camera-top-controls {
        top: 1.5rem;
        /* Move down more on mobile */
        left: 0.5rem;
        /* Move to left on mobile too */
    }

    .iqi-indicator-compact {
        padding: 0.5rem 0.75rem;
        min-width: 100px;
    }

    .iqi-indicator-compact .iqi-score {
        font-size: 1.25rem;
    }

    .camera-bottom-controls {
        bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
        /* Much higher mobile spacing */
        gap: 0.75rem;
        /* Good mobile gap */
        width: 95%;
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 0.5rem);
    }

    .btn-capture-fullscreen {
        padding: 0.875rem 1.5rem;
        /* Reduced padding */
        font-size: 1rem;
        /* Reduced font size */
        min-width: 130px;
        /* Reduced for mobile */
    }

    .location-input-compact input {
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }

    .retry-gps-btn-compact {
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
    }

    .preview-actions-fullscreen {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-approve-fullscreen,
    .btn-retake-fullscreen {
        width: 100%;
        padding: 0.875rem 1rem;
    }
}

/* Extra small screens - prevent navbar overlap */
@media (max-width: 480px) {
    .camera-content-fullscreen {
        height: 100vh;
        /* Full height since header is fixed */
    }

    .camera-navbar .btn-logout,
    .camera-navbar .btn-back {
        min-height: 32px;
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .camera-navbar h2 {
        font-size: 1rem;
    }

    .camera-top-controls {
        top: 1.25rem;
        /* Move down more on small screens */
        left: 0.5rem;
        /* Move to left on small screens too */
    }

    .camera-bottom-controls {
        bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
        /* Higher spacing for small screens */
        gap: 0.75rem;
        /* Keep good gap for touch */
        padding-bottom: max(env(safe-area-inset-bottom, 0px), 0.5rem);
    }
}

/* Final override: fullscreen camera video must fill entire view */
.camera-view-fullscreen #camera {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Shift view slightly upwards so bottom area is cropped more */
    object-position: center 20%;
}

.location-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 200;
}

.location-overlay.visible {
    display: flex;
}

.location-overlay-card {
    background: #111;
    color: white;
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.location-overlay-card h3 {
    margin-bottom: 0.75rem;
}

.location-overlay-card p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #ddd;
    margin-bottom: 1.5rem;
}

.btn-enable-gps {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.35);
    transition: transform 0.2s ease;
}

.btn-enable-gps:active {
    transform: scale(0.98);
}

/* (camera-page flex layout removed to restore fixed fullscreen behavior) */

/* Mobile logo size optimization */
@media (max-width: 768px) {
    img[alt="Company Logo"] {
        height: 20px !important;
        margin-right: 8px !important;
    }

    /* Smaller navbar text on mobile */
    .navbar-left h2 {
        font-size: 1.1rem !important;
    }

    .subtitle {
        display: none !important;
    }

    /* Reduce login header font size */
    .login-header h1 {
        font-size: 1.8rem !important;
    }

    /* Better mobile padding */
    .navbar {
        padding: 0.5rem 1rem !important;
    }

    /* Hide logo on camera page for cleaner look */
    .camera-page img[alt="Company Logo"] {
        display: none !important;
    }
}

/* Extra mobile optimizations for small screens */
@media (max-width: 480px) {
    img[alt="Company Logo"] {
        height: 18px !important;
        margin-right: 6px !important;
    }

    .navbar-left h2 {
        font-size: 1rem !important;
    }

    .login-header h1 {
        font-size: 1.5rem !important;
    }

    .navbar-content {
        flex-direction: column !important;
        gap: 0.25rem !important;
        align-items: flex-start !important;
    }

    .navbar-right {
        align-self: stretch !important;
        justify-content: space-between !important;
    }

    .btn-logout,
    .btn-back,
    .btn-camera {
        font-size: 0.75rem !important;
        padding: 0.4rem 0.6rem !important;
        min-height: 32px !important;
    }
}

/* ===========================================
   DESKTOP / PC OPTIMIZATIONS FOR CAMERA PAGE
   =========================================== */

@media (min-width: 1024px) {

    /* Camera page desktop layout */
    .camera-page {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
        min-height: 100vh;
    }

    .camera-page .camera-navbar {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    }

    .camera-content-fullscreen {
        height: calc(100vh - 70px);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        background: transparent;
    }

    .camera-view-fullscreen {
        max-width: 800px;
        max-height: 600px;
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
        position: relative;
    }

    .camera-view-fullscreen #camera {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        border-radius: 20px;
    }

    /* Desktop top controls */
    .camera-top-controls {
        top: 1.5rem;
        left: 1.5rem;
    }

    .iqi-indicator-compact {
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(15px) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 16px;
        padding: 1rem 1.5rem;
        min-width: 140px;
    }

    .iqi-indicator-compact .iqi-score {
        font-size: 2rem;
    }

    .iqi-bar-compact {
        height: 6px;
        border-radius: 3px;
    }

    .iqi-status-compact {
        font-size: 0.8rem;
    }

    /* Desktop bottom controls */
    .camera-bottom-controls {
        bottom: 2rem;
        max-width: 500px;
        gap: 1rem;
    }

    .location-input-compact {
        gap: 0.75rem;
    }

    .location-input-compact input {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        border-radius: 12px;
        background: rgba(0, 0, 0, 0.7);
        border: 2px solid rgba(255, 255, 255, 0.25);
        transition: all 0.3s ease;
    }

    .location-input-compact input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
        outline: none;
    }

    .retry-gps-btn-compact {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        border-radius: 12px;
        transition: all 0.3s ease;
    }

    .retry-gps-btn-compact:hover {
        background: rgba(33, 150, 243, 1);
        transform: translateY(-2px);
    }

    /* Desktop camera action row */
    .camera-action-row {
        gap: 1.5rem;
    }

    .btn-flash-toggle {
        width: 3.5rem;
        height: 3.5rem;
        border-radius: 50%;
        transition: all 0.3s ease;
    }

    .btn-flash-toggle:hover {
        transform: scale(1.1);
        background: rgba(255, 255, 255, 0.2) !important;
    }

    .btn-capture-fullscreen {
        padding: 1.25rem 2.5rem;
        font-size: 1.1rem;
        min-width: 180px;
        border-radius: 60px;
        transition: all 0.3s ease;
    }

    .btn-capture-fullscreen:hover:not(:disabled) {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 10px 30px rgba(76, 175, 80, 0.5);
    }

    /* Desktop capture button with camera icon */
    .btn-capture-fullscreen .camera-icon {
        display: inline-block;
        width: 24px;
        height: 24px;
        background: white;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 15.2A3.2 3.2 0 1 0 12 8.8a3.2 3.2 0 0 0 0 6.4z'/%3E%3Cpath d='M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z'/%3E%3C/svg%3E") center / contain no-repeat;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 15.2A3.2 3.2 0 1 0 12 8.8a3.2 3.2 0 0 0 0 6.4z'/%3E%3Cpath d='M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z'/%3E%3C/svg%3E") center / contain no-repeat;
    }

    /* Desktop preview panel */
    .preview-panel-fullscreen {
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(20px);
    }

    .preview-content {
        max-width: 700px;
        padding: 2rem;
    }

    .preview-image-fullscreen {
        max-height: 60vh;
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
        margin-bottom: 2rem;
    }

    .preview-actions-fullscreen {
        gap: 1.5rem;
    }

    .btn-approve-fullscreen,
    .btn-retake-fullscreen {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
        border-radius: 12px;
        min-width: 140px;
        transition: all 0.3s ease;
    }

    .btn-approve-fullscreen {
        background: var(--primary-color) !important;
        border: 2px solid var(--primary-color) !important;
    }

    .btn-approve-fullscreen:hover {
        background: #45a049 !important;
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
    }

    .btn-retake-fullscreen {
        background: rgba(102, 102, 102, 0.9) !important;
        border: 2px solid #666 !important;
    }

    .btn-retake-fullscreen:hover {
        background: #555 !important;
        transform: translateY(-2px);
    }

    /* Desktop result panel */
    .result-panel-fullscreen {
        background: rgba(0, 0, 0, 0.92);
        backdrop-filter: blur(20px);
    }

    .result-content-fullscreen {
        max-width: 700px;
        padding: 2rem;
    }

    .result-image-fullscreen {
        max-height: 45vh;
        border-radius: 16px;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
        margin-bottom: 1.5rem;
    }

    .result-summary,
    .detections-list {
        padding: 1.5rem;
        border-radius: 20px;
        margin-bottom: 1.25rem;
    }

    .btn-primary-fullscreen,
    .btn-secondary-fullscreen {
        padding: 1rem 2rem;
        font-size: 1.05rem;
        border-radius: 12px;
        margin: 0.5rem;
        transition: all 0.3s ease;
    }

    .btn-primary-fullscreen:hover {
        background: #45a049;
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
    }

    .btn-secondary-fullscreen:hover {
        background: #444;
        transform: translateY(-2px);
    }

    /* Desktop location overlay */
    .location-overlay-card {
        max-width: 500px;
        padding: 2.5rem;
        border-radius: 24px;
    }

    .location-overlay-card h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .location-overlay-card p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .btn-enable-gps {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        transition: all 0.3s ease;
    }

    .btn-enable-gps:hover {
        transform: translateY(-2px);
        box-shadow: 0 15px 30px rgba(76, 175, 80, 0.5);
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1023px) {
    .camera-page {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }

    .camera-content-fullscreen {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1.5rem;
    }

    .camera-view-fullscreen {
        max-width: 600px;
        border-radius: 16px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    }

    .camera-view-fullscreen #camera {
        border-radius: 16px;
    }

    .camera-bottom-controls {
        max-width: 450px;
    }
}