* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent swipe-back gesture on tablets/mobile */
html, body {
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
}

html {
    touch-action: pan-y;
}

:root {
    --win11-blue: #0067c0;
    --win11-blue-light: #4cc2ff;
    --win11-accent: #005a9e;
    --win11-green: #107c10;
    --win11-bg: #f3f3f3;
    --win11-surface: #ffffff;
    --win11-surface-alt: #f9f9f9;
    --win11-border: #e5e5e5;
    --win11-text: #000000;
    --win11-text-secondary: #605e5c;
    --mica-bg: rgba(243, 243, 243, 0.5);
    --acrylic-bg: rgba(252, 252, 252, 0.85);
    --radius-small: 4px;
    --radius-medium: 8px;
    --radius-large: 12px;
    --shadow-flyout: 0 8px 16px rgba(0, 0, 0, 0.14);
    --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
    background: var(--win11-bg);
    color: var(--win11-text);
    line-height: 1.5;
}

.page-bg {
    background: #f3f3f3;
}

.page-bg-alt {
    background: #f5f7fa;
}

.navbar-logo {
    height: 32px;
}

.navbar {
    background: var(--acrylic-bg);
    backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--win11-border);
    padding: 0 16px;
    padding-top: env(safe-area-inset-top, 0);
    height: 48px;
    min-height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.logo {
    display: block;
    margin: 0 auto 12px auto;
    max-width: 300px;
    height: auto;
}

.navbar-menu {
    display: flex;
    gap: 4px;
}

.nav-item,
.menu-item {
    padding: 6px 12px;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 13px;
    color: var(--win11-text);
    transition: all 0.1s;
    border: none;
    background: transparent;
}

.nav-item:hover,
.menu-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.nav-item:active,
.menu-item:active {
    background: rgba(0, 0, 0, 0.08);
    transform: scale(0.98);
}

.nav-item.active {
    background: rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

.menu-bar {
    display: flex;
    gap: 4px;
}

.dropdown-menu {
    position: absolute;
    top: 52px;
    left: 0;
    background: var(--acrylic-bg);
    backdrop-filter: blur(30px);
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-flyout);
    min-width: 200px;
    padding: 4px;
    z-index: 1000;
}

.menu-dropdown-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--radius-small);
    transition: all 0.1s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
}

.user-role {
    font-size: 11px;
    color: var(--win11-text-secondary);
}

.container {
    max-width: 1600px;
    margin: 24px auto;
    padding: 0 24px;
}

.window {
    background: var(--win11-surface);
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
}

.title-bar {
    background: var(--win11-surface);
    border-bottom: 1px solid var(--win11-border);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
}

.title-bar-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-body {
    padding: 20px;
}

.content-area {
    background: var(--win11-surface-alt);
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-medium);
    padding: 16px;
}

.welcome-card {
    background: linear-gradient(135deg, var(--win11-blue) 0%, var(--win11-blue-light) 100%);
    color: white;
    border-radius: var(--radius-large);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.welcome-card h1,
.welcome-card h2 {
    margin-bottom: 8px;
    font-weight: 600;
}

/* Weather Widget */
.weather-widget {
    text-align: right;
    min-width: 140px;
}

.weather-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.weather-icon {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.weather-details {
    color: white;
    line-height: 1.3;
}

.weather-temp {
    font-size: 22px;
    font-weight: 700;
}

.weather-city {
    font-size: 13px;
    opacity: 0.9;
}

.weather-desc {
    font-size: 12px;
    opacity: 0.8;
    text-transform: capitalize;
}

/* Task Alert in Welcome Card */
.task-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
    color: #333;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-alert:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.task-alert-icon {
    font-size: 18px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-small);
    font-size: 14px;
    transition: all 0.1s;
    background: var(--win11-surface);
    font-family: inherit;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #c6c6c6;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--win11-blue);
    box-shadow: 0 0 0 2px rgba(0, 103, 192, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    white-space: pre-wrap;
    tab-size: 4;
    font-family: inherit;
}

fieldset {
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-medium);
    padding: 16px;
    margin-bottom: 16px;
}

legend {
    padding: 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.btn {
    padding: 8px 16px;
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-small);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.1s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--win11-surface);
    color: var(--win11-text);
}

.btn:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: #c6c6c6;
}

.btn:active {
    background: rgba(0, 0, 0, 0.06);
    transform: scale(0.98);
}

.btn-primary {
    background: var(--win11-blue);
    color: white;
    border-color: var(--win11-blue);
}

.btn-primary:hover {
    background: #005a9e;
}

.btn-secondary {
    background: var(--win11-surface);
}

.btn-danger {
    background: #c42b1c;
    color: white;
    border-color: #c42b1c;
}

.btn-danger:hover {
    background: #a52315;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-logout {
    padding: 6px 12px;
    background: var(--win11-surface);
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.1s;
}

.btn-logout:hover {
    background: rgba(0, 0, 0, 0.03);
}

.button-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--win11-surface);
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-medium);
    padding: 16px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--win11-text-secondary);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.action-card {
    background: var(--win11-surface);
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-medium);
    padding: 12px 14px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all 0.15s;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--win11-blue);
}

.action-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.action-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.action-desc {
    font-size: 11px;
    color: var(--win11-text-secondary);
}

/* Pest Control Warning Badge */
.pest-control-warning {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    animation: pulse-warning 2s infinite;
}

.pest-control-warning .warning-icon {
    font-size: 12px;
}

.pest-control-warning .warning-text {
    white-space: nowrap;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.mismatch-warning {
    margin-bottom: 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff9800 0%, #e65100 100%);
    box-shadow: 0 2px 8px rgba(230, 81, 0, 0.3);
    animation: pulse-warning 2s infinite;
}

.mismatch-warning-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: white;
}

.mismatch-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.mismatch-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    font-size: 13px;
}

.mismatch-text strong {
    font-size: 14px;
}

.mismatch-dismiss {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
}

.mismatch-dismiss:hover {
    opacity: 1;
}

.error-message,
.success-message,
.info-message {
    padding: 12px 16px;
    border-radius: var(--radius-small);
    margin-bottom: 16px;
    font-size: 13px;
    display: none;
    align-items: center;
    gap: 8px;
    border-left: 4px solid;
}

.error-message {
    background: #fde7e9;
    color: #a80000;
    border-left-color: #c42b1c;
}

.success-message {
    background: #dff6dd;
    color: #107c10;
    border-left-color: #107c10;
}

.error-message.show,
.success-message.show {
    display: flex;
}

.status-bar {
    background: var(--win11-surface-alt);
    border-top: 1px solid var(--win11-border);
    padding: 8px 12px;
    font-size: 12px;
    display: flex;
    gap: 12px;
    color: var(--win11-text-secondary);
}

.status-section {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sync-status {
    padding: 12px 16px;
    border-radius: var(--radius-medium);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.sync-status.info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    color: #1565c0;
}

.sync-status.success {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.sync-status.error {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--win11-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-window {
    text-align: center;
}

.loading-text {
    font-size: 14px;
    margin-top: 16px;
    color: var(--win11-text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--win11-border);
    border-top-color: var(--win11-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .navbar-menu {
        display: flex;
        gap: 5px;
        order: 3;
        width: 100%;
        justify-content: center;
        padding: 8px 0;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .navbar-menu .nav-item {
        font-size: 12px;
        padding: 6px 12px;
    }

    .container {
        margin: 16px auto;
        padding: 0 12px;
    }

    .stats-grid,
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .button-row {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

.camera-preview {
    width: 100%;
    max-width: 500px;
    background: #000;
    border-radius: 8px;
    display: none;
    margin: 15px 0;
}

.camera-preview.active {
    display: block;
}

.pages-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 100px;
    padding: 15px;
    background: var(--win11-bg-secondary);
    border-radius: 8px;
    margin: 15px 0;
}

.pages-preview .empty-text {
    color: #999;
    margin: auto;
}

.page-item {
    position: relative;
}

.page-thumb {
    width: 80px;
    height: 103px;
    object-fit: cover;
    border: 2px solid var(--win11-accent);
    border-radius: 4px;
    cursor: pointer;
}

.page-thumb:hover {
    opacity: 0.8;
}

.page-item .remove-page {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #d13438;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.filter-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.btn-success {
    background: #107c10;
}

.btn-success:hover {
    background: #0e6b0e;
}

.btn-danger {
    background: #d13438;
}

.btn-danger:hover {
    background: #b52b2f;
}

.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    min-width: 150px;
}

.context-menu.show {
    display: block;
}

.context-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-menu-item:hover {
    background: #f5f5f5;
}

.context-menu-item:first-child {
    border-radius: 8px 8px 0 0;
}

.context-menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

.data-table tr[draggable="true"] {
    cursor: grab;
}

.data-table tr.dragging {
    opacity: 0.5;
}

.action-btns {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.btn-icon {
    padding: 5px 10px;
    border: 1px solid #e5e5e5;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-icon:hover {
    background: #f0f0f0;
}

/* Hide action buttons based on role permissions */
body[data-can-edit="false"] .btn-icon[title="Edit"] { display: none !important; }
body[data-can-delete="false"] .btn-icon[title="Delete"] { display: none !important; }
body[data-can-create="false"] .btn-icon[title="Add"],
body[data-can-create="false"] .nav-item[data-action="add"] { display: none !important; }

.split-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.split-container:has(.form-panel:not(.hidden)) {
    grid-template-columns: 1fr 400px;
}

.table-container {
    background: var(--win11-surface);
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-medium);
    overflow: hidden;
}

.table-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--win11-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-weight: 600;
    font-size: 14px;
}

.search-box {
    padding: 6px 12px;
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-small);
    font-size: 13px;
    width: 200px;
}

.search-box:focus {
    outline: none;
    border-color: var(--win11-blue);
}

.table-wrapper {
    overflow-x: auto;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-wrapper thead {
    background: var(--win11-surface-alt);
    position: sticky;
    top: 0;
}

.table-wrapper th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--win11-border);
    white-space: nowrap;
}

.table-wrapper th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.table-wrapper th.sortable:hover {
    background: #e8e8e8;
}

.sort-icon {
    font-size: 10px;
    margin-left: 4px;
    color: #666;
}

.table-wrapper td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--win11-border);
}

.table-wrapper tbody tr {
    transition: all 0.1s;
    cursor: pointer;
}

.table-wrapper tbody tr:hover {
    background: rgba(0, 103, 192, 0.05);
}

.table-wrapper tbody tr.selected {
    background: rgba(0, 103, 192, 0.1);
    border-left: 3px solid var(--win11-blue);
}

.form-panel {
    background: var(--win11-surface);
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-medium);
    height: fit-content;
    position: sticky;
    top: 70px;
}

.form-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--win11-border);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-panel-body {
    padding: 16px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--win11-text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.badge-active {
    background: #dff6dd;
    color: #107c10;
}

.badge-inactive {
    background: #fde7e9;
    color: #c42b1c;
}

@media (max-width: 1024px) {
    .split-container {
        grid-template-columns: 1fr;
    }

    .form-panel {
        position: static;
        order: -1;
    }
}

.drop-zone {
    border: 2px dashed #0067c0;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9fa;
    margin-bottom: 15px;
}

.drop-zone:hover {
    background: #e8f4ff;
    border-color: #005a9e;
}

.drop-zone.drag-over {
    background: #d4edff;
    border-color: #0067c0;
    border-style: solid;
}

.drop-zone-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.drop-zone-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.drop-zone-hint {
    font-size: 12px;
    color: #666;
}

.files-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.file-item-icon {
    font-size: 24px;
}

.file-item-info {
    flex: 1;
    overflow: hidden;
}

.file-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    font-size: 12px;
    color: #666;
}

.file-item-remove {
    background: #d13438;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item-remove:hover {
    background: #b52b2f;
}

.filter-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.filter-title {
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.login-page {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="%23f3f3f3"/><circle cx="50" cy="50" r="40" fill="%23ffffff" opacity="0.05"/></svg>') repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: rgba(252, 252, 252, 0.85);
    backdrop-filter: blur(30px) saturate(125%);
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    max-width: 360px;
    width: 100%;
    padding: 32px;
}

.logo-section {
    text-align: center;
    margin-bottom: 24px;
}

.app-name {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin-bottom: 4px;
}

.app-subtitle {
    font-size: 13px;
    color: #605e5c;
}

.btn-login {
    width: 100%;
    padding: 10px;
    background: #0067c0;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s;
    margin-top: 8px;
}

.btn-login:hover {
    background: #005a9e;
}

.btn-login:active {
    transform: scale(0.98);
}

.btn-login:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.divider {
    text-align: center;
    margin: 20px 0;
    color: #c6c6c6;
    font-size: 12px;
}

.footer-text {
    text-align: center;
    margin-top: 16px;
    color: #605e5c;
    font-size: 11px;
}

.announcement-card {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    border-radius: var(--radius-medium);
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.announcement-icon {
    font-size: 20px;
}

.announcement-title {
    font-weight: 600;
    font-size: 14px;
    color: #856404;
    flex: 1;
}

.btn-edit-announcement {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ffc107;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.1s;
}

.btn-edit-announcement:hover {
    background: rgba(255, 255, 255, 0.9);
}

.announcement-content {
    font-size: 14px;
    color: #664d03;
    line-height: 1.5;
    white-space: pre-wrap;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--win11-surface);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-flyout);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--win11-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--win11-text-secondary);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--win11-text);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--win11-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* New Delivery Ticket anchors to the bottom of the viewport (instead of
   centered) so the Today's Generated Orders table above stays visible through
   the dimmed overlay while the form is open, for reference against the order. */
#ticketModal {
    align-items: flex-end;
}

/* The product rows pack Product/Qty/Ranch/Lot/5 Container options/Pallet Type
   into one row -- letting it wrap keeps everything readable instead of
   squishing when it doesn't all fit on one line. */
#ticketModal .form-row {
    flex-wrap: wrap;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-small);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.1s;
    background: var(--win11-surface);
}

.form-control:focus {
    outline: none;
    border-color: var(--win11-blue);
    box-shadow: 0 0 0 2px rgba(0, 103, 192, 0.2);
}

.badge-admin {
    background: #d13438;
    color: white;
}

.badge-manager {
    background: #0067c0;
    color: white;
}

.badge-user {
    background: #107c10;
    color: white;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 20px;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

.driver-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.driver-panel-header {
    background: #2e7d32;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.driver-panel-title {
    font-weight: 600;
    font-size: 16px;
}

.driver-count {
    background: white;
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.welcome-weather-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.welcome-weather-facility {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding-right: 4px;
}

.welcome-weather-widget {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 10px 20px;
    border-radius: 16px;
    white-space: nowrap;
}

.welcome-rain-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 12px;
}

.welcome-rain-alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.welcome-weather-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.welcome-weather-icon {
    font-size: 20px;
    line-height: 1;
}

.welcome-weather-value {
    color: white;
    font-weight: 700;
    font-size: 17px;
}

.welcome-weather-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .welcome-weather-wrap {
        align-items: flex-start;
        width: 100%;
    }

    .welcome-weather-widget {
        gap: 10px;
        padding: 8px 14px;
    }

    .welcome-weather-icon {
        font-size: 16px;
    }

    .welcome-weather-value {
        font-size: 14px;
    }
}

.checkin-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
}

.checkin-toggle-container.checkin-disabled {
    background: rgba(244, 67, 54, 0.3);
}

.checkin-toggle-label {
    font-size: 11px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: 0.3s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: rgba(255, 255, 255, 0.5);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(18px);
}

.toggle-switch input:not(:checked)+.toggle-slider {
    background-color: #f44336;
}

.driver-date-filter {
    padding: 10px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.driver-date-filter input[type="date"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.driver-list {
    max-height: 500px;
    overflow-y: auto;
}

.driver-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.driver-item:hover {
    background: #f5f5f5;
}

.driver-item.new {
    animation: highlight 2s ease-out;
}

@keyframes highlight {
    0% {
        background: #c8e6c9;
    }

    100% {
        background: transparent;
    }
}

.driver-number {
    background: #2e7d32;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.driver-info {
    flex: 1;
    min-width: 0;
}

.driver-name {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.driver-details {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.driver-time {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    margin-bottom: 2px;
}

.driver-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.driver-empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.qr-section {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.qr-btn {
    background: #1565c0;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qr-btn:hover {
    background: #0d47a1;
}

.qr-modal-content {
    text-align: center;
    padding: 20px;
}

.qr-code {
    margin: 20px auto;
    padding: 15px;
    background: white;
    display: inline-block;
    border-radius: 8px;
}

.qr-url {
    font-size: 12px;
    color: #666;
    word-break: break-all;
    margin-top: 10px;
}

.menu-divider {
    margin: 2px 0;
    border: 1px solid #e0e0e0;
    border-style: solid none none;
}

.modal-sm {
    max-width: 500px;
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

.form-group-small {
    flex: 0 0 80px !important;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

.modal-md {
    max-width: 500px;
}

.settings-page {
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.settings-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.settings-card-header {
    background: #f5f5f5;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-card-icon {
    font-size: 20px;
}

.settings-card-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.settings-card-body {
    padding: 20px;
}

.settings-card-desc {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.settings-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-info {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
}

.settings-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.settings-info-row:last-child {
    border-bottom: none;
}

.settings-info-label {
    color: #666;
    font-size: 14px;
}

.settings-info-value {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.modal-lg {
    max-width: 1100px;
}

.door-status-container {
    padding: 10px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
}

.door-status-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.door-status-panel {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.door-indicator {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    cursor: default;
    transition: all 0.3s ease;
}

.door-available {
    background: #4caf50;
    color: white;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.door-occupied {
    background: #f44336;
    color: white;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.driver-item.status-waiting {
    background: #ffffff;
    border-left: 4px solid #9e9e9e;
}

.driver-item.status-loading {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
}

.driver-item.status-completed {
    background: #e3f2fd;
    border-left: 4px solid #1976d2;
}

.driver-item.status-wash {
    background: #ffebee;
    border-left: 4px solid #d32f2f;
}

.driver-item.status-waiting-product {
    background: #fff9c4;
    border-left: 4px solid #f57f17;
}

.driver-status-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    margin-left: auto;
    min-width: 90px;
    text-align: right;
}

.door-badge {
    background: #ffc107;
    color: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.seal-badge {
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.loading-badge {
    background: #ff5722;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.loaded-badge {
    background: #1976d2;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.wash-badge {
    background: #d32f2f;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.waiting-badge {
    background: #9e9e9e;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
}

.waiting-product-badge {
    background: #fbc02d;
    color: #333;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
}

.visitor-indicator-container {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #e3f2fd;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
    margin-right: 10px;
}

.visitor-indicator-container:hover {
    background: #bbdefb;
    transform: scale(1.05);
}

.visitor-indicator-container.has-visitors {
    background: #fff3e0;
    border: 2px solid #ff9800;
}

.visitor-icon {
    font-size: 18px;
}

.visitor-badge {
    background: #1565c0;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.visitor-indicator-container.has-visitors .visitor-badge {
    background: #ff9800;
    animation: pulse-visitor 2s infinite;
}

@keyframes pulse-visitor {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.visitor-indicator-container.new-visitor {
    animation: new-visitor-alert 0.5s ease infinite;
    background: #ff5722 !important;
    border: 2px solid #ff5722 !important;
}

.visitor-indicator-container.new-visitor .visitor-badge {
    background: white !important;
    color: #ff5722 !important;
}

@keyframes new-visitor-alert {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.7);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 87, 34, 0);
    }
}

.chat-bell-container {
    position: relative;
    margin-right: 20px;
}

.chat-bell {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    position: relative;
    padding: 8px;
    transition: transform 0.2s;
}

.chat-bell:hover {
    transform: scale(1.1);
}

.chat-bell.has-new {
    animation: bell-ring 0.5s ease;
}

@keyframes bell-ring {

    0%,
    100% {
        transform: rotate(0);
    }

    20%,
    60% {
        transform: rotate(15deg);
    }

    40%,
    80% {
        transform: rotate(-15deg);
    }
}

.chat-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #f44336;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.chat-badge.hidden {
    display: none;
}

.chat-panel {
    position: fixed;
    top: 60px;
    right: 10px;
    width: 320px;
    height: 420px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.chat-panel.hidden {
    display: none;
}

.chat-panel-header {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chat-panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
}

.chat-panel-close:hover {
    opacity: 0.8;
}

.chat-panel .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-empty {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 14px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
}

.chat-message-me {
    background: #2e7d32;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message-other {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 10px;
}

.chat-message-user {
    font-weight: 600;
    font-size: 11px;
}

.chat-message-me .chat-message-user {
    color: rgba(255, 255, 255, 0.8);
}

.chat-message-other .chat-message-user {
    color: #2e7d32;
}

.chat-message-time {
    font-size: 10px;
    opacity: 0.7;
}

.chat-message-text {
    word-wrap: break-word;
    line-height: 1.4;
}

.chat-panel .chat-input-area {
    display: flex;
    padding: 12px;
    background: white;
    border-top: 1px solid #eee;
    gap: 10px;
}

.chat-panel .chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-panel .chat-input-area input:focus {
    border-color: #2e7d32;
}

.btn-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #2e7d32;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-send:hover {
    background: #1b5e20;
}

.facilities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
}

@media (max-width: 1200px) {
    .facilities-grid {
        grid-template-columns: 1fr;
    }
}

.facility-panel {
    position: relative;
}

.facility-panel.read-only {
    opacity: 0.85;
}

.facility-panel.read-only::before {
    content: '🔒 Read Only';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    z-index: 10;
}

.facility-panel .driver-list {
    max-height: 350px;
}

.facility-okeechobee {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
}

.facility-georgia {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
}

.facility-michigan {
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
}

.facility-newyork {
    background: linear-gradient(135deg, #e65100 0%, #bf360c 100%);
}

.facility-panel[data-facility="Okeechobee Cooling"] .driver-number {
    background: #2e7d32;
}

.facility-panel[data-facility="Georgia Cooling"] .driver-number {
    background: #1565c0;
}

.facility-panel[data-facility="Michigan Cooling"] .driver-number {
    background: #7b1fa2;
}

.facility-panel[data-facility="New York Cooling"] .driver-number {
    background: #e65100;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 24px;
    align-items: start;
}

.main-content-area {
    width: 100%;
}

.actions-grid-3col {
    grid-template-columns: repeat(3, 1fr) !important;
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .actions-grid-3col {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .actions-grid-3col {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 500px) {
    .actions-grid-3col {
        grid-template-columns: 1fr !important;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }
}

.single-facility-container {
    width: 100%;
}

.single-facility-container .driver-panel {
    width: 100%;
}

.single-facility-container .driver-list {
    max-height: 500px;
}

@media (max-width: 900px) {
    .facilities-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 8px;
        margin: 8px auto;
    }

    .navbar {
        height: auto;
        min-height: 48px;
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }

    .navbar-brand {
        order: 1;
    }

    .navbar-logo {
        height: 28px;
    }

    .navbar-menu {
        display: flex;
        gap: 5px;
        order: 3;
        width: 100%;
        justify-content: center;
        padding: 6px 0;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .navbar-menu .nav-item {
        font-size: 11px;
        padding: 5px 10px;
    }

    .user-section {
        order: 2;
        gap: 8px;
    }

    .user-info {
        display: none;
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 12px;
    }

    .chat-bell-container,
    .visitor-indicator-container {
        order: 2;
    }

    .chat-panel {
        width: 100% !important;
        max-width: 100% !important;
        right: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 70vh;
    }

    .welcome-card {
        padding: 16px;
        border-radius: 12px;
    }

    .welcome-card h1 {
        font-size: 18px;
    }

    .welcome-card p {
        font-size: 13px;
    }

    .weather-widget {
        min-width: auto;
    }

    .weather-icon {
        width: 40px;
        height: 40px;
    }

    .weather-temp {
        font-size: 16px;
    }

    .weather-city,
    .weather-desc {
        font-size: 11px;
    }

    .section-title {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .action-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .action-card {
        padding: 10px;
        min-height: auto;
    }

    .action-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .action-title {
        font-size: 12px;
    }

    .action-desc {
        font-size: 10px;
        display: none;
    }

    .driver-panel {
        border-radius: 12px;
    }

    .driver-panel-header {
        padding: 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .driver-panel-title {
        font-size: 14px;
        flex: 1;
        min-width: 120px;
    }

    .driver-count {
        padding: 4px 10px;
        font-size: 12px;
    }

    .checkin-toggle-container {
        padding: 3px 8px;
        gap: 6px;
    }

    .checkin-toggle-label {
        font-size: 10px;
    }

    .toggle-switch {
        width: 36px;
        height: 20px;
    }

    .toggle-slider:before {
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
    }

    .toggle-switch input:checked+.toggle-slider:before {
        transform: translateX(16px);
    }

    .door-status-container {
        padding: 8px 12px;
    }

    .door-indicator {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .driver-item {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .driver-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .driver-info {
        flex: 1;
        min-width: calc(100% - 80px);
    }

    .driver-name-normal {
        font-size: 13px;
    }

    .driver-phone {
        font-size: 11px;
    }

    .driver-details {
        font-size: 11px;
    }

    .driver-status-info {
        min-width: 80px;
        gap: 2px;
    }

    .driver-time {
        font-size: 10px;
    }

    .loading-badge,
    .door-badge,
    .seal-badge,
    .loaded-badge,
    .wash-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .form-group label {
        font-size: 12px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 14px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .button-row {
        flex-direction: column;
        gap: 8px;
    }

    .button-row .btn {
        width: 100%;
    }

    .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .form-row .form-group {
        width: 100% !important;
        flex: none !important;
    }

    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-lg {
        max-width: 95% !important;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .status-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
        font-size: 11px;
    }

    .status-section {
        font-size: 11px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }

    .panel,
    .card {
        padding: 12px;
        border-radius: 12px;
    }

    .panel-header {
        padding: 12px;
    }

    .search-container input,
    .search-box {
        padding: 10px 12px;
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .sampling-container {
        flex-direction: column;
    }

    .sampling-sidebar {
        width: 100%;
        max-width: 100%;
        order: 2;
    }

    .sampling-map-container {
        width: 100%;
        height: 300px;
        min-height: 300px;
        order: 1;
    }

    #map {
        height: 300px !important;
    }

    .sampling-controls {
        padding: 12px;
    }

    .sampling-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-box {
        padding: 10px 8px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 10px;
    }

    .sampling-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .sampling-buttons .btn {
        flex: 1;
        min-width: calc(50% - 4px);
        padding: 12px 8px;
        font-size: 13px;
    }

    .weather-info {
        flex-wrap: wrap;
        gap: 6px;
    }

    .weather-item {
        font-size: 11px;
    }

    .coords-list {
        max-height: 150px;
    }

    .coord-item {
        font-size: 11px;
        padding: 6px 8px;
    }
}

@media (max-width: 600px) {
    .pest-control-container {
        flex-direction: column;
    }

    .scanner-panel {
        width: 100%;
        max-width: 100%;
    }

    .scanner-input {
        font-size: 16px;
        padding: 14px;
    }

    .device-card {
        padding: 12px;
    }

    .inspection-form {
        padding: 12px;
    }

    .yes-no-buttons {
        flex-direction: row;
    }

    .yes-no-btn {
        flex: 1;
        padding: 12px;
        font-size: 14px;
    }

    .history-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .history-tab {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .facilities-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .facility-panel {
        border-radius: 12px;
    }

    .facility-panel .driver-panel-header {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .samplings-container {
        flex-direction: column;
    }

    .samplings-list {
        width: 100%;
        max-width: 100%;
        max-height: 200px;
        order: 2;
    }

    .samplings-map {
        width: 100%;
        height: 250px;
        order: 1;
    }

    .sampling-card {
        padding: 10px 12px;
    }

    .sampling-name {
        font-size: 14px;
    }

    .sampling-stats {
        gap: 8px;
    }

    .sampling-stat {
        font-size: 11px;
    }

    .detail-panel {
        padding: 12px;
    }

    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .detail-item {
        padding: 8px;
    }

    .detail-value {
        font-size: 16px;
    }

    .detail-label {
        font-size: 10px;
    }
}

@media (max-width: 600px) {
    .filters-row {
        flex-direction: column;
        gap: 8px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group input,
    .filter-group select {
        width: 100%;
    }

    .data-card {
        padding: 10px;
    }

    .data-card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .data-card-title {
        font-size: 14px;
    }

    .data-card-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .action-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (pointer: coarse) {

    .btn,
    .action-btn,
    .nav-item,
    button {
        min-height: 44px;
    }

    .form-group input:not([type="radio"]):not([type="checkbox"]),
    .form-group select,
    .form-group textarea {
        min-height: 44px;
    }

    .driver-item,
    .sampling-card,
    .data-card {
        min-height: 48px;
    }

    .toggle-switch {
        min-width: 44px;
        min-height: 24px;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .sampling-container {
        flex-direction: row;
    }

    .sampling-sidebar {
        width: 40%;
        max-height: 100vh;
        overflow-y: auto;
    }

    .sampling-map-container {
        width: 60%;
        height: 100vh;
    }

    #map {
        height: 100% !important;
    }

    .modal-content {
        max-height: 95vh;
    }
}

@media (prefers-color-scheme: dark) {}

/* ===== INVENTORY PAGE ===== */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px 0;
}

.inventory-card {
    background: white;
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.inventory-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-flyout);
}

.inventory-card.low-stock {
    border-left: 4px solid #ff9800;
}

.inventory-card-header {
    background: #2e7d32;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inventory-card-title {
    font-weight: 600;
    font-size: 16px;
}

.inventory-card-body {
    padding: 16px;
}

.inventory-desc {
    color: var(--win11-text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
}

.inventory-stock {
    font-size: 36px;
    font-weight: bold;
    color: #2e7d32;
    text-align: center;
    margin: 12px 0;
}

.inventory-stock-detail {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
    color: var(--win11-text-secondary);
    margin-bottom: 12px;
}

.inventory-stock-detail span {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

.inventory-prices {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--win11-text-secondary);
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

/* ==================== TASK CALENDAR PAGE ==================== */
.calendar-page-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 16px;
    min-height: calc(100vh - 180px);
}

.calendar-section {
    background: var(--win11-surface);
    border-radius: var(--radius-large);
    border: 1px solid var(--win11-border);
    padding: 16px;
}

.calendar-container {
    width: 100%;
    max-width: 350px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-nav button {
    background: var(--win11-surface-alt);
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-small);
    padding: 4px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}

.calendar-nav button:hover {
    background: var(--win11-blue);
    color: white;
    border-color: var(--win11-blue);
}

.calendar-month {
    font-size: 14px;
    font-weight: 600;
    min-width: 130px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 10px;
    color: var(--win11-text-secondary);
    padding: 4px 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 12px;
    position: relative;
    transition: all 0.15s;
    background: var(--win11-surface-alt);
    border: 1px solid transparent;
    max-width: 45px;
    max-height: 45px;
}

.calendar-day:hover {
    background: #e3f2fd;
    border-color: var(--win11-blue);
}

.calendar-day.other-month {
    color: #ccc;
    background: transparent;
}

.calendar-day.today {
    background: var(--win11-blue);
    color: white;
    font-weight: 600;
}

.calendar-day.selected {
    border: 2px solid var(--win11-blue);
    background: #e3f2fd;
}

.calendar-day.today.selected {
    background: var(--win11-blue);
    color: white;
}

.calendar-day.has-tasks::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    background: var(--win11-green);
    border-radius: 50%;
}

.calendar-day.today.has-tasks::after {
    background: white;
}

.task-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--win11-green);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.calendar-day.today .task-count {
    background: white;
    color: var(--win11-blue);
}

/* Tasks Side Panel */
.tasks-side-panel {
    background: var(--win11-surface);
    border-radius: var(--radius-large);
    border: 1px solid var(--win11-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tasks-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--win11-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--win11-surface-alt);
}

.tasks-panel-header strong {
    font-size: 14px;
}

.tasks-panel-header span {
    font-size: 12px;
    color: var(--win11-text-secondary);
}

.tasks-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Task Items */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--win11-surface-alt);
    border-radius: var(--radius-medium);
    margin-bottom: 8px;
    border-left: 3px solid var(--win11-border);
    transition: all 0.15s;
}

.task-item:hover {
    box-shadow: var(--shadow-card);
}

.task-item.priority-high {
    border-left-color: #ff9800;
}

.task-item.priority-urgent {
    border-left-color: #f44336;
    background: #fff8f7;
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-title {
    text-decoration: line-through;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--win11-green);
}

.task-info {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
}

.task-meta {
    font-size: 11px;
    color: var(--win11-text-secondary);
}

.task-actions {
    display: flex;
    gap: 4px;
}

.task-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 12px;
    border-radius: var(--radius-small);
    transition: background 0.15s;
}

.task-btn:hover {
    background: var(--win11-border);
}

/* Responsive */
@media (max-width: 900px) {
    .calendar-page-container {
        grid-template-columns: 1fr;
    }

    .tasks-side-panel {
        min-height: 300px;
    }
}

@media (max-width: 600px) {
    .calendar-section {
        padding: 12px;
    }

    .calendar-day {
        font-size: 12px;
    }

    .calendar-month {
        font-size: 16px;
        min-width: 140px;
    }

    .calendar-nav button {
        padding: 6px 10px;
    }
}

/* Submenu Styles */
.submenu-list {
    display: flex;
    flex-direction: column;
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #eee;
}

.submenu-item:last-child {
    border-bottom: none;
}

.submenu-item:hover {
    background: #f5f5f5;
}

.submenu-icon {
    font-size: 28px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f5e9;
    border-radius: 10px;
}

.submenu-info {
    flex: 1;
}

.submenu-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 2px;
}

.submenu-desc {
    font-size: 13px;
    color: #666;
}

/* =====================
   Employee Styles
   ===================== */
.employee-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #e0e0e0;
}

.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-inactive {
    background: #ffebee;
    color: #c62828;
}

.btn-icon {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 2px;
}

.btn-edit {
    background: #e3f2fd;
    color: #1565c0;
}

.btn-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-face {
    background: #fff3e0;
    color: #e65100;
}

/* Face capture modal */
#cameraPreviewContainer {
    width: 100% !important;
    height: 300px !important;
    min-height: 300px !important;
    background: #000 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-bottom: 15px !important;
    position: relative !important;
    display: block !important;
}

#faceVideo {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transform: scaleX(-1) !important;
    z-index: 2 !important;
    background: #000 !important;
}

#facePreviewImg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transform: scaleX(-1) !important;
    z-index: 3 !important;
}

#cameraPlaceholder {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    color: #999 !important;
    background: #1a1a1a !important;
    z-index: 1 !important;
}

#cameraPlaceholder.hidden {
    display: none !important;
}

#faceVideo.hidden {
    display: none !important;
}

#facePreviewImg.hidden {
    display: none !important;
}

.face-status {
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.face-status.detecting {
    background: #fff3e0;
    color: #e65100;
}

.face-status.detected {
    background: #e8f5e9;
    color: #2e7d32;
}

.face-status.error {
    background: #ffebee;
    color: #c62828;
}

.face-photo-link {
    color: #1565c0;
    cursor: pointer;
    text-decoration: underline;
}

.face-photo-link:hover {
    color: #0d47a1;
}

/* =====================
   Filter Buttons (Drivers, etc.)
   ===================== */
.btn-filter {
    padding: 8px 16px;
    border: 1px solid var(--win11-border);
    background: var(--win11-surface);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-filter:hover {
    background: var(--win11-hover);
}

.btn-filter.active {
    background: var(--win11-accent);
    color: white;
    border-color: var(--win11-accent);
}

.date-range-info {
    padding: 8px 16px;
    background: var(--win11-hover);
    border-radius: 4px;
    font-size: 13px;
    color: var(--win11-text-secondary);
    align-self: flex-end;
}

/* =====================
   Visitor Status Badges
   ===================== */
.status-in {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-out {
    background: #f5f5f5;
    color: #757575;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.btn-signout {
    background: #ff9800;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-signout:hover {
    background: #f57c00;
}

/* =====================
   Summary Cards (Visitors)
   ===================== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    border: 1px solid var(--win11-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.summary-card.active {
    border-left: 4px solid #2e7d32;
}

.summary-card.completed {
    border-left: 4px solid #757575;
}

.summary-card-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.summary-card-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.summary-card-label {
    font-size: 13px;
    color: #666;
}

/* Summary Cards Payment Variants */
.summary-cards.payments-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.summary-card.cash {
    border-left: 4px solid #2e7d32;
}

.summary-card.card {
    border-left: 4px solid #1565c0;
}

.summary-card.charge {
    border-left: 4px solid #f57c00;
}

.summary-card.total {
    border-left: 4px solid #7b1fa2;
}

/* =====================
   Date Range Bar
   ===================== */
.date-range-bar {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--win11-surface);
    border: 1px solid var(--win11-border);
    border-radius: 8px;
}

.date-range-bar .form-group {
    margin-bottom: 0;
}

/* =====================
   Quick Filters
   ===================== */
.quick-filters {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.quick-filters button {
    padding: 8px 16px;
    border: 1px solid var(--win11-border);
    background: var(--win11-surface);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.quick-filters button:hover {
    background: var(--win11-hover);
}

.quick-filters button.active {
    background: var(--win11-accent);
    color: white;
    border-color: var(--win11-accent);
}

/* =====================
   Payment Badges
   ===================== */
.payment-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.payment-badge.cash {
    background: #e8f5e9;
    color: #2e7d32;
}

.payment-badge.card {
    background: #e3f2fd;
    color: #1565c0;
}

.payment-badge.charge {
    background: #fff3e0;
    color: #f57c00;
}

.payment-badge.none {
    background: #f5f5f5;
    color: #9e9e9e;
}

/* =====================
   Stats Grid (Reports)
   ===================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #2e7d32;
}

.stat-value.purple {
    color: #7b1fa2;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    margin-top: 5px;
}

/* =====================
   Button Variants
   ===================== */
.btn-qr {
    background: #f3e5f5;
    color: #7b1fa2;
}

.btn-print {
    background: #e8f5e9;
    color: #2e7d32;
}

.btn-add-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.btn-remove-stock {
    background: #fff3e0;
    color: #e65100;
}

.btn-maps {
    background: #fff3e0;
    color: #e65100;
}

/* =====================
   Device Type Badge
   ===================== */
.device-type {
    background: #f5f5f5;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
}

/* =====================
   QR Modal
   ===================== */
.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-code {
    display: inline-block;
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 16px;
}

.qr-device-code {
    font-size: 24px;
    font-weight: 700;
    color: #7b1fa2;
    margin-bottom: 8px;
}

.qr-device-location {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.print-info {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
}

/* Print QR Styles */
@media print {
    body * {
        visibility: hidden;
    }
    #printArea, #printArea * {
        visibility: visible;
    }
    #printArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .print-qr-card {
        page-break-inside: avoid;
        margin: 20px;
        padding: 20px;
        border: 2px solid #333;
        border-radius: 8px;
        text-align: center;
    }
}

/* Bulk Print Grid */
.print-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.print-qr-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.print-qr-card .qr-code {
    padding: 10px;
    margin-bottom: 10px;
}

.print-qr-card .device-code {
    font-size: 18px;
    font-weight: 700;
    color: #7b1fa2;
}

.print-qr-card .device-location {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

/* =====================
   Facility Maps
   ===================== */
.maps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.map-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.map-card:hover {
    border-color: #7b1fa2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.map-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.map-card-info {
    padding: 10px;
}

.map-card-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.map-card-facility {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.map-card-actions {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.map-viewer {
    max-width: 100%;
    max-height: 70vh;
    overflow: auto;
}

.map-viewer img {
    max-width: 100%;
    height: auto;
}

/* =====================
   Upload Area
   ===================== */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #7b1fa2;
    background: #f3e5f5;
}

.upload-area.dragover {
    border-color: #7b1fa2;
    background: #f3e5f5;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 14px;
    color: #666;
}

.upload-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.no-maps {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* =====================
   Interactive Map (Pest Control)
   ===================== */
.interactive-map-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 65vh;
    overflow: auto;
}

.interactive-map-container img {
    display: block;
    max-width: none;
}

.device-marker {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 10;
}

.device-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 20;
}

.device-marker.status-inspected {
    background: #4caf50;
}

.device-marker.status-pending {
    background: #ff9800;
}

.device-marker.status-evidence {
    background: #f44336;
    animation: pulse-red 1.5s infinite;
}

.device-marker.status-unplaced {
    background: #9e9e9e;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 0 20px rgba(244, 67, 54, 0.8); }
}

.device-marker-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 8px;
}

.device-marker:hover .device-marker-tooltip {
    opacity: 1;
}

.map-legend {
    display: flex;
    gap: 15px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* =====================
   Placement Mode (Pest Control)
   ===================== */
.placement-mode-bar {
    background: #fff3e0;
    border: 2px solid #ff9800;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    display: none;
}

.placement-mode-bar.active {
    display: flex;
    align-items: center;
    gap: 15px;
}

.placement-mode-bar .placement-info {
    flex: 1;
}

.placement-mode-bar .placement-title {
    font-weight: 600;
    color: #e65100;
}

.placement-mode-bar .placement-hint {
    font-size: 12px;
    color: #666;
}

.unplaced-devices-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 10px;
}

.unplaced-device-item {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unplaced-device-item:last-child {
    border-bottom: none;
}

.unplaced-device-item:hover {
    background: #f5f5f5;
}

.unplaced-device-item.selected {
    background: #fff3e0;
    border-left: 3px solid #ff9800;
}

.map-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.map-controls .btn {
    font-size: 13px;
}

/* =====================
   Time Clock Report
   ===================== */
.employee-name {
    font-weight: 600;
}

#recordsTable {
    table-layout: fixed;
    width: 100%;
}

#recordsTable th:first-child,
#recordsTable td:first-child {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#recordsTable th.tc-th-day,
#recordsTable td.tc-day-cell {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
    padding: 8px 4px !important;
}

#recordsTable th.tc-th-total,
#recordsTable td.tc-total-cell {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    text-align: center;
    padding: 8px 4px !important;
}

.edit-actions {
    display: none;
}

.edit-actions.visible {
    display: table-cell;
}

/* Time Clock Report — weekly pivot table */
.tc-day-cell {
    text-align: center;
    vertical-align: top;
    padding: 8px 4px !important;
}
.tc-day-empty {
    color: #ccc;
    font-size: 16px;
}
.tc-in {
    font-size: 15px;
    color: #2e7d32;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.6;
}
.tc-out {
    font-size: 15px;
    color: #c62828;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.6;
}
.tc-clickable {
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}
.tc-clickable:hover {
    background: rgba(0,0,0,0.06);
}
.tc-total-cell {
    text-align: center;
    vertical-align: middle;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.tc-ot {
    color: #c62828;
}
.hb-num {
    text-align: right;
    white-space: nowrap;
}
.tc-pay {
    color: #1565c0;
    font-size: 14px;
    margin-top: 2px;
}
/* Time Clock — daily totals footer row */
.tc-daily-totals-row {
    border-top: 2px solid #2e7d32;
    background: #f1f8e9;
}
.tc-daily-totals-label {
    font-weight: 700;
    font-size: 12px;
    color: #2e7d32;
    padding: 6px 8px;
    white-space: nowrap;
}
.tc-daily-totals-cell {
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    color: #2e7d32;
    padding: 6px 4px;
}

/* Floating context menu */
.tc-time-menu {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    z-index: 9999;
    overflow: hidden;
    min-width: 140px;
}
.tc-time-menu button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.12s;
}
.tc-time-menu button:hover {
    background: #f5f5f5;
}
.tc-time-menu .tc-menu-delete:hover {
    background: #ffebee;
    color: #c62828;
}

/* Weekly Hours Modal */
.weekly-summary {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.weekly-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
}

.weekly-summary-item .value {
    font-size: 24px;
    font-weight: bold;
    color: #2e7d32;
}

.weekly-summary-item .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.weekly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.weekly-table th,
.weekly-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

.weekly-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.weekly-table tr:hover {
    background: #fafafa;
}

.weekly-table .total-row {
    background: #e8f5e9;
    font-weight: 600;
}

.weekly-table .total-row td {
    border-top: 2px solid #2e7d32;
}

/* =====================
   Weekly Hours Report
   ===================== */
.week-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.week-nav button {
    background: #2e7d32;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.week-nav button:hover {
    background: #1b5e20;
}

.week-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    min-width: 300px;
    text-align: center;
}

.hours-table {
    width: 100%;
    border-collapse: collapse;
}

.hours-table th {
    background: #f5f5f5;
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.hours-table th:first-child {
    text-align: left;
    min-width: 180px;
}

.hours-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.hours-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.hours-table tr:hover {
    background: #f9f9f9;
}

.hours-cell {
    font-weight: 500;
}

.hours-cell.has-hours {
    color: #2e7d32;
    background: #e8f5e9;
    border-radius: 4px;
}

.hours-cell.no-hours {
    color: #999;
}

.total-cell {
    font-weight: 700;
    color: #1565c0;
    background: #e3f2fd;
    border-radius: 4px;
}

.employee-code {
    font-size: 11px;
    color: #666;
    font-weight: normal;
}

.day-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-name {
    font-weight: 600;
}

.day-date {
    font-size: 10px;
    color: #666;
    font-weight: normal;
}

.grand-total-row {
    background: #fff3e0 !important;
}

.grand-total-row td {
    font-weight: 700;
    color: #e65100;
    border-top: 2px solid #ffb74d;
}

.overtime-cell {
    font-weight: 700;
    color: #d32f2f;
    background: #ffebee;
    border-radius: 4px;
}

.hours-breakdown {
    font-size: 11px;
    color: #666;
}

.hours-breakdown .overtime {
    color: #d32f2f;
    font-weight: 600;
}

.summary-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-item {
    text-align: center;
}

.summary-value {
    font-size: 24px;
    font-weight: bold;
}

.summary-value.regular {
    color: #2e7d32;
}

.summary-value.overtime {
    color: #d32f2f;
}

.summary-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

/* =====================
   Square Payments
   ===================== */
.amount-cell {
    font-weight: bold;
    color: #2e7d32;
}

.status-completed {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-pending {
    background: #fff3e0;
    color: #ef6c00;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-failed {
    background: #ffebee;
    color: #c62828;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-approved {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.card-brand {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* =====================
   Evidence (Pest Control)
   ===================== */
.evidence-yes {
    color: #c62828;
    font-weight: bold;
}

.evidence-no {
    color: #2e7d32;
}

/* =====================
   RS Documents (Camera)
   ===================== */
.capture-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.capture-btn {
    flex: 1;
    padding: 15px;
    font-size: 14px;
}

.camera-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.camera-container video {
    width: 100%;
    display: block;
}

.camera-controls {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.7);
    justify-content: center;
}

.camera-controls .btn {
    min-width: 100px;
}

/* =====================
   Inventory (Load Lock / Pallets)
   ===================== */
.stock-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stock-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stock-card-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stock-card-value {
    font-size: 32px;
    font-weight: bold;
}

.stock-card-value.green { color: #2e7d32; }
.stock-card-value.blue { color: #1565c0; }
.stock-card-value.orange { color: #e65100; }
.stock-card-value.red { color: #c62828; }

.low-stock-warning {
    background: #fff3e0;
    color: #e65100;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
}

.low-stock-warning.show {
    display: block;
}

.transaction-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.transaction-in {
    background: #e8f5e9;
    color: #2e7d32;
}

.transaction-out {
    background: #ffebee;
    color: #c62828;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #2e7d32;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Facility Selector */
.facility-selector {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.facility-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.facility-btn {
    padding: 20px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.facility-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.facility-btn:active {
    transform: translateY(0);
}

@media (max-width: 500px) {
    .facility-buttons {
        grid-template-columns: 1fr;
    }
}

/* Pallets */
.quantity-display {
    font-size: 18px;
    font-weight: bold;
    color: #2e7d32;
}

.low-stock {
    color: #c62828;
}

.pallet-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.pallet-info {
    flex: 1;
}

.pallet-type {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.pallet-quantity {
    font-size: 32px;
    font-weight: bold;
    color: #2e7d32;
}

.pallet-actions {
    display: flex;
    gap: 10px;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    padding: 20px 0;
}

.btn-change-qty {
    padding: 10px 20px;
    background: #e3f2fd;
    color: #1565c0;
    border: 2px solid #1565c0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-change-qty:active {
    background: #1565c0;
    color: white;
}

.quantity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.quantity-number {
    font-size: 32px;
    font-weight: bold;
}

/* New Pallet Card Design */
.pallet-card-new {
    background: white;
    border-radius: 12px;
    padding: 15px;
    padding-top: 45px;  /* Espacio para los iconos */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    min-height: 180px;
}

.pallet-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
}

.pallet-btn-icon {
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pallet-btn-icon:hover {
    background: #e0e0e0;
}

.pallet-btn-icon.delete:hover {
    background: #ffebee;
}

.pallet-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 8px;
    max-width: 100%;
    word-wrap: break-word;
}

.pallet-card-qty {
    font-size: 42px;
    font-weight: bold;
    color: #2e7d32;
    line-height: 1;
    margin-bottom: 12px;
}

.pallet-card-qty.low {
    color: #d32f2f;
}

.pallet-card-btn {
    width: 100%;
    padding: 10px 15px;
    background: #e3f2fd;
    color: #1565c0;
    border: 2px solid #1565c0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pallet-card-btn:hover {
    background: #1565c0;
    color: white;
}

.pallet-card-btn:active {
    transform: scale(0.98);
}

.card-updated-at {
    margin-top: 8px;
    padding: 6px 10px;
    background: #fff3e0;
    border-radius: 6px;
    font-size: 11px;
    color: #e65100;
    font-weight: 500;
    text-align: center;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* =====================
   Field Sampling
   ===================== */
.sampling-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 120px);
}

@media (max-width: 900px) {
    .sampling-container {
        grid-template-columns: 1fr;
        height: auto;
    }
}

#map {
    flex: 1;
    min-height: 0;
}

.control-panel {
    background: var(--win11-surface);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.control-header {
    padding: 16px;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.control-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sampling-status {
    padding: 16px;
    border-radius: var(--radius-medium);
    text-align: center;
    font-weight: 600;
    font-size: 18px;
}

.status-idle {
    background: #e3f2fd;
    color: #1565c0;
}

.status-sampling {
    background: #e8f5e9;
    color: #2e7d32;
    animation: pulse 1.5s infinite;
}

.status-completed-sampling {
    background: #fff3e0;
    color: #e65100;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.btn-sampling {
    padding: 20px 32px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-medium);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-start {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
}

.btn-start:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.4);
}

.btn-stop {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    color: white;
}

/* ── Shipping List ── */
.photo-capture-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.photo-slot {
    border: 2px dashed #bdbdbd; border-radius: 10px; min-height: 120px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; position: relative; overflow: hidden; background: #fafafa; transition: border-color .2s;
}
.photo-slot:hover { border-color: #2e7d32; }
.photo-slot.has-photo { border-style: solid; border-color: #2e7d32; }
.photo-slot img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; display: none; }
.photo-slot.has-photo img { display: block; }
.photo-slot .photo-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #9e9e9e; font-size: 12px; padding: 10px; text-align: center; }
.photo-slot.has-photo .photo-placeholder { display: none; }
.photo-slot .photo-icon { font-size: 28px; }
.photo-slot .remove-photo {
    position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.55); color: #fff;
    border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 14px;
    line-height: 22px; text-align: center; cursor: pointer; display: none; z-index: 2;
}
.photo-slot.has-photo .remove-photo { display: block; }
.photo-slot input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.pu-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pu-tag { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; border-radius: 20px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
.photo-thumb-row { display: flex; gap: 6px; align-items: center; }
.photo-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid #e0e0e0; transition: transform .15s; }
.photo-thumb:hover { transform: scale(1.1); }
.photo-viewer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999; align-items: center; justify-content: center; }
.photo-viewer-overlay.active { display: flex; }
.photo-viewer-overlay img { max-width: 95vw; max-height: 90vh; border-radius: 8px; }
.photo-viewer-close { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 32px; cursor: pointer; font-weight: 300; line-height: 1; }
.cam-driver-header { background: #f1f8e9; border: 1px solid #c5e1a5; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: #33691e; }
.sl-email-photo { position: relative; width: 80px; cursor: pointer; border-radius: 8px; overflow: hidden; border: 3px solid #e0e0e0; transition: border-color .15s; }
.sl-email-photo.selected { border-color: #2e7d32; }
.sl-email-photo img { width: 80px; height: 80px; object-fit: cover; display: block; }
.sl-email-check { position: absolute; top: 3px; right: 3px; background: #2e7d32; color: #fff; border-radius: 50%; width: 20px; height: 20px; font-size: 12px; display: none; align-items: center; justify-content: center; font-weight: 700; }
.sl-email-photo.selected .sl-email-check { display: flex; }
.sl-email-label { text-align: center; font-size: 10px; color: #555; padding: 2px 0; background: rgba(255,255,255,0.9); }
@media (max-width: 600px) {
    .photo-slot { min-height: 90px; }
    .photo-slot img { height: 90px; }
}

.btn-stop:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.4);
}

.btn-clear {
    background: linear-gradient(135deg, #757575 0%, #616161 100%);
    color: white;
}

.btn-clear:hover {
    transform: scale(1.02);
}

.btn-sampling:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.coordinates-list {
    flex: 1;
    overflow-y: auto;
    max-height: 200px;
    background: var(--win11-surface-alt);
    border-radius: var(--radius-medium);
    padding: 12px;
}

.coord-item {
    font-family: monospace;
    font-size: 11px;
    padding: 4px 8px;
    margin-bottom: 4px;
    background: white;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
}

.coord-item:last-child {
    background: #e8f5e9;
    font-weight: 600;
}

.gps-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--win11-surface-alt);
    border-radius: var(--radius-medium);
}

.gps-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #9e9e9e;
}

.gps-dot.active {
    background: #4caf50;
    animation: blink 1s infinite;
}

.gps-dot.error {
    background: #f44336;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.weather-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: var(--radius-medium);
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-around;
}

.weather-info.hidden {
    display: none;
}

.weather-item {
    font-size: 13px;
    font-weight: 500;
    color: #1565c0;
}

.button-group {
    display: flex;
    gap: 12px;
}

.button-group .btn-sampling {
    flex: 1;
}

/* =====================
   Field Samplings List
   ===================== */
.samplings-list-container {
    padding: 12px;
    height: calc(100vh - 100px);
}

/* Map Overlay - fullscreen */
.map-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: white;
    display: flex;
    flex-direction: column;
}

.map-overlay.hidden {
    display: none;
}

.map-overlay-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
    flex-shrink: 0;
}

.btn-close-map {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-close-map:hover {
    background: rgba(255,255,255,0.35);
}

.map-overlay-title {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-overlay-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.map-overlay-details {
    padding: 8px 12px;
    background: rgba(255,255,255,0.97);
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .map-overlay-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .map-overlay-details .detail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.list-panel {
    background: var(--win11-surface);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-header {
    padding: 16px;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: white;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-header .btn-new {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-small);
    cursor: pointer;
    font-size: 13px;
}

.list-header .btn-new:hover {
    background: rgba(255,255,255,0.3);
}

.list-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.sampling-card {
    background: var(--win11-surface-alt);
    border-radius: var(--radius-medium);
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.sampling-card:hover {
    background: #e3f2fd;
}

.sampling-card.selected {
    border-color: #1565c0;
    background: #e3f2fd;
}

.sampling-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.sampling-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--win11-text);
}

.sampling-date {
    font-size: 11px;
    color: var(--win11-text-secondary);
}

.sampling-grower {
    font-size: 12px;
    color: #1565c0;
    margin-bottom: 8px;
}

.sampling-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--win11-text-secondary);
}

.sampling-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sampling-stat-value {
    font-weight: 600;
    color: var(--win11-text);
}

.sampling-weather {
    font-size: 11px;
    color: #1565c0;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--win11-border);
}

.empty-list {
    text-align: center;
    padding: 40px 20px;
    color: var(--win11-text-secondary);
}

.empty-list-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.detail-item {
    background: white;
    padding: 6px;
    border-radius: var(--radius-small);
}

.detail-label {
    font-size: 10px;
    color: var(--win11-text-secondary);
    margin-bottom: 2px;
}

.detail-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--win11-text);
}

.btn-export {
    background: #1565c0;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: var(--radius-small);
    cursor: pointer;
    flex: 1;
    font-size: 12px;
}

.btn-export:hover {
    background: #0d47a1;
}

.search-box {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--win11-border);
    border-radius: var(--radius-small);
    margin-bottom: 12px;
    font-size: 14px;
}

/* =====================
   Pest Control Scanner
   ===================== */
.pest-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 120px);
}

@media (max-width: 900px) {
    .pest-container {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.scanner-panel {
    background: var(--win11-surface);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scanner-header {
    padding: 16px;
    background: linear-gradient(135deg, #7b1fa2 0%, #4a148c 100%);
    color: white;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scanner-body {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

.scan-input-area {
    background: #f5f5f5;
    border-radius: var(--radius-medium);
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}

.scan-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.scan-input {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    text-align: center;
    border: 2px solid #7b1fa2;
    border-radius: var(--radius-medium);
    margin-bottom: 12px;
    font-weight: 600;
}

/* =====================
   View Map (Public)
   ===================== */
.view-map-header {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.view-map-header img {
    height: 40px;
}

.header-title {
    flex: 1;
}

.header-title h1 {
    font-size: 18px;
    margin-bottom: 2px;
}

.header-title p {
    font-size: 12px;
    opacity: 0.9;
}

.info-bar {
    background: white;
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.info-label {
    color: #666;
}

.info-value {
    font-weight: 600;
    color: #333;
}

.footer {
    background: white;
    padding: 12px 20px;
    text-align: center;
    font-size: 11px;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

.legend {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 12px;
}

.legend-dot.sample {
    background: #ff9800;
}

.legend-dot.start {
    background: #4caf50;
    border-radius: 4px;
}

.legend-dot.end {
    background: #f44336;
    border-radius: 4px;
}

/* =====================
   Weight Report
   ===================== */
.day-summary-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    padding: 12px;
}

@media (max-width: 900px) {
    .day-summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 500px) {
    .day-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.day-card {
    background: white;
    border: 1px solid var(--win11-border);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
    transition: all 0.2s;
}

.day-card.has-data {
    border-color: #2e7d32;
    background: #f1f8f1;
}

.day-card.total {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    color: white;
    border: none;
}

.day-card .day-name {
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.day-card .day-weight {
    font-size: 15px;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 3px;
}

.day-card.total .day-weight {
    color: white;
    font-size: 17px;
}

.day-card .day-count {
    font-size: 12px;
    color: #666;
}

.day-card.total .day-count {
    color: rgba(255,255,255,0.9);
}

.weight-cell {
    font-weight: 600;
    color: #2e7d32;
    font-size: 15px;
}

/* =====================
   Expense Receipts
   ===================== */
.receipt-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: transform 0.2s;
}

.receipt-thumbnail:hover {
    transform: scale(1.5);
    z-index: 10;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.receipt-thumbnail-pdf {
    font-size: 32px;
    cursor: pointer;
    display: inline-block;
    transition: transform 0.2s;
}

.receipt-thumbnail-pdf:hover {
    transform: scale(1.3);
}

/* ==================== Global Mobile Modal Improvements ==================== */
/* Applies to ALL modals on ALL pages on mobile */
@media (max-width: 768px) {

    /* ----- Fullscreen modal ----- */
    .modal {
        padding: 0;
        align-items: flex-start;
    }
    .modal-content,
    .modal-content.modal-lg,
    .modal-content.modal-md,
    .modal-content.modal-sm {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
    }

    /* ----- Header ----- */
    .modal-header {
        padding: 12px 16px;
    }
    .modal-header h3 {
        font-size: 15px;
    }

    /* ----- Body: scrollable, compact padding ----- */
    .modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    /* ----- Form fields: 44px touch target ----- */
    .modal .form-group {
        margin-bottom: 10px;
    }
    .modal .form-group label {
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 4px;
        color: #444;
    }
    .modal .form-group input,
    .modal .form-group select,
    .modal .form-group textarea {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 16px; /* 16px prevents iOS zoom on focus */
        border-radius: 6px;
    }
    .modal .form-group textarea {
        min-height: 80px;
    }

    /* ----- form-row: stack vertically ----- */
    .modal .form-row {
        flex-direction: column;
        gap: 0;
    }
    .modal .form-row .form-group {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    /* ----- Radio groups: bigger tap area ----- */
    .modal .form-group > div[style*="display: flex"] {
        gap: 16px;
        flex-wrap: wrap;
    }
    .modal .form-group label[style*="display: flex"] {
        min-height: 40px;
        align-items: center;
        gap: 6px;
        font-size: 14px !important;
        font-weight: normal !important;
    }
    .modal .form-group input[type="radio"],
    .modal .form-group input[type="checkbox"] {
        min-height: unset;
        width: 18px;
        height: 18px;
    }

    /* ----- Footer: big buttons side by side ----- */
    .modal-footer {
        padding: 10px 16px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        gap: 8px;
        flex-wrap: nowrap;
    }
    .modal-footer .btn {
        flex: 1;
        min-height: 46px;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ==================== Filter Bars — stack vertically on mobile ==================== */
@media (max-width: 768px) {
    .delivery-tickets-page .filter-bar,
    .warehouse-receiving-page .filter-bar,
    .rs-documents-page .filter-bar,
    .parts-page .filter-bar,
    .equipment-page .filter-bar,
    .maintenance-page .filter-bar {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }
    .delivery-tickets-page .filter-bar .filter-title,
    .rs-documents-page .filter-bar .filter-title {
        display: none;
    }
    .delivery-tickets-page .filter-bar .form-group,
    .warehouse-receiving-page .filter-bar .form-group,
    .rs-documents-page .filter-bar .form-group,
    .parts-page .filter-bar .form-group,
    .equipment-page .filter-bar .form-group,
    .maintenance-page .filter-bar .form-group {
        flex: 1 1 100% !important;
        width: 100% !important;
        margin-bottom: 0 !important;
    }
    .delivery-tickets-page .filter-bar select,
    .delivery-tickets-page .filter-bar input,
    .rs-documents-page .filter-bar select,
    .rs-documents-page .filter-bar input,
    .rs-documents-page .filter-bar button,
    .parts-page .filter-bar select,
    .parts-page .filter-bar input,
    .equipment-page .filter-bar select,
    .equipment-page .filter-bar input,
    .maintenance-page .filter-bar select,
    .maintenance-page .filter-bar input {
        width: 100%;
    }
    /* Quick filter buttons stretch full width */
    .delivery-tickets-page .filter-bar .quick-filters,
    .maintenance-page .filter-bar .quick-filters {
        width: 100%;
        justify-content: stretch;
    }
    .delivery-tickets-page .filter-bar .quick-filters button,
    .maintenance-page .filter-bar .quick-filters button {
        flex: 1;
        padding: 8px 4px;
        font-size: 12px;
    }
}

/* ==================== Tables — horizontal scroll, compact font ==================== */
@media (max-width: 768px) {
    .delivery-tickets-page .table-wrapper,
    .warehouse-receiving-page .table-wrapper,
    .rs-documents-page .table-wrapper,
    .parts-page .table-wrapper,
    .equipment-page .table-wrapper,
    .maintenance-page .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .delivery-tickets-page .table-wrapper th,
    .delivery-tickets-page .table-wrapper td,
    .warehouse-receiving-page .table-wrapper th,
    .warehouse-receiving-page .table-wrapper td,
    .rs-documents-page .table-wrapper th,
    .rs-documents-page .table-wrapper td,
    .parts-page .table-wrapper th,
    .parts-page .table-wrapper td,
    .equipment-page .table-wrapper th,
    .equipment-page .table-wrapper td,
    .maintenance-page .table-wrapper th,
    .maintenance-page .table-wrapper td {
        padding: 8px 8px;
        font-size: 12px;
        white-space: nowrap;
    }
}

/* ====== Delivery Tickets modal — 2-column grid on mobile ====== */
@media (max-width: 768px) {
    /* Stack every field in the Add/Edit Delivery Ticket form full-width on
       phones — the row now mixes selects, radio groups and short inputs
       (Container, Pallet Type) that don't fit two-up without distorting. */
    .delivery-tickets-page #ticketModal .form-row {
        display: flex !important;
        flex-direction: column;
        gap: 12px !important;
    }

    .delivery-tickets-page #ticketModal .form-row .form-group {
        flex: 1 1 100% !important;
        width: 100%;
    }
}

/* ==================== Global Toast Notifications ==================== */
.toast-notification {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-120px);
    min-width: 280px;
    max-width: 480px;
    padding: 12px 16px 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    z-index: 99999;
    opacity: 0;
    transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
    pointer-events: auto;
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast-notification.success { background: #1b8a2f; }
.toast-notification.error   { background: #c0392b; }
.toast-notification.info    { background: #2471a3; }
.toast-notification.warning { background: #d68910; }

.toast-notification .toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    background: rgba(255,255,255,0.25);
}
.toast-notification .toast-msg {
    flex: 1;
}
.toast-notification .toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 18px;
    padding: 0 0 0 6px;
    line-height: 1;
    flex-shrink: 0;
}
.toast-notification .toast-close:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .toast-notification {
        min-width: 0;
        max-width: calc(100% - 32px);
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(-120px);
        font-size: 13px;
    }
    .toast-notification.show {
        transform: translateX(0) translateY(0);
    }
}
}