/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent default pull-to-refresh behavior */
html {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    color: #333;
    line-height: 1.6;
}

/* Color Variables */
:root {
    --primary-color: #00697B;
    --primary-dark: #004d5a;
    --primary-light: #008a9e;
    --secondary-color: #ffffff;
    --accent-color: #000000;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --background-color: #ffffff;
    --card-background: #ffffff;
    --sidebar-width: 250px;
    --sidebar-minimized-width: 70px;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
    /* Prevent the modal background from capturing touch events */
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Remove body scroll lock as it interferes with modal scrolling */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    margin: auto;
    position: relative;
    border: 1px solid var(--border-color);
    color: #000000;
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
    /* Force hardware acceleration */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: scroll-position;
    /* Re-enable touch events for the content */
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    user-select: text;
    /* Ensure content can receive touch events */
    pointer-events: auto;
}

.modal-content h2 {
    color: #000000;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Inventory Modal - Rate field styling */
#inventoryModal .form-group {
    margin-bottom: 1rem;
}

#inventoryModal #inventoryDefaultRate {
    max-width: 150px;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

#inventoryModal label[for="inventoryDefaultRate"] {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

/* Mobile-specific inventory modal fixes */
@media (max-width: 768px) {
    #inventoryModal .form-group {
        margin-bottom: 1.25rem;
        display: block !important;
    }
    
    #inventoryModal #inventoryType {
        width: 100% !important;
        font-size: 1rem;
        display: block;
        margin-bottom: 0;
    }
    
    #inventoryModal #inventoryDefaultRate {
        width: 120px !important;
        max-width: 120px !important;
        font-size: 0.85rem;
        padding: 0.6rem 0.5rem;
        display: block;
        margin-top: 0.5rem;
    }
    
    #inventoryModal label[for="inventoryDefaultRate"] {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
        display: block;
    }
    
    #inventoryModal label[for="inventoryType"] {
        margin-bottom: 0.5rem;
        display: block;
    }
    
    /* Ensure proper spacing between Type and Rate fields */
    #inventoryModal #inventoryType + * {
        margin-top: 1rem;
    }
    
    /* Make sure form-controls don't inherit weird widths */
    #inventoryModal .form-control {
        box-sizing: border-box;
    }
}

/* Mobile-specific field task modal product row fixes */
@media (max-width: 768px) {
    #fieldTaskModal .product-row {
        margin-bottom: 1rem;
    }
    
    #fieldTaskModal .product-row .form-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: flex-end;
    }
    
    #fieldTaskModal .product-row .form-group {
        flex: 1 1 auto;
        margin-bottom: 0;
        min-width: 0;
    }
    
    /* Product select - take up more space */
    #fieldTaskModal .product-row .product-select {
        flex: 2 1 60%;
        min-width: 150px;
        font-size: 0.95rem;
        padding: 0.6rem 0.5rem;
    }
    
    /* Rate input - smaller and more compact */
    #fieldTaskModal .product-row .product-rate {
        flex: 1 1 25%;
        min-width: 80px;
        max-width: 100px;
        font-size: 0.85rem;
        padding: 0.6rem 0.4rem;
    }
    
    /* Delete button - minimal space */
    #fieldTaskModal .product-row .btn-delete {
        flex: 0 0 auto;
        width: 40px;
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }
}

.modal-content h3 {
    color: #000000;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.modal-content h4 {
    color: #000000;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Modern Authentication Page Styles */
.auth-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
}

/* When app is in standalone mode (installed to home screen) */
@media (display-mode: standalone) {
    .auth-page {
        height: 100vh; /* Use regular viewport height in standalone mode */
        padding-bottom: env(safe-area-inset-bottom);
    }
}

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    width: 90%;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Logo Section */
.auth-logo-section {
    padding: 3rem 2rem 2rem 2rem;
    text-align: center;
    background: #ffffff;
}

.precision-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.precision-logo .logo-image {
    width: 160px;
    height: 160px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    object-fit: contain;
}

.precision-text {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.precision-name {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #333;
    letter-spacing: -1px;
}

.precision-plus {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #20B2AA;
}

/* Form Section */
.auth-form-section {
    padding: 0 2rem 3rem 2rem;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0;
}

.auth-header p {
    color: #666;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}

.auth-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 105, 123, 0.3);
}

.auth-tab:hover:not(.active) {
    background: rgba(0, 105, 123, 0.1);
    color: var(--primary-color);
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* Modern Form Inputs */
.auth-form .form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.auth-form input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    background: #ffffff;
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 105, 123, 0.1);
    transform: translateY(-1px);
}

.auth-form input::placeholder {
    color: #999;
    font-weight: 400;
}

/* Modern Auth Buttons */
.auth-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.auth-btn.primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 105, 123, 0.3);
}

.auth-btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 105, 123, 0.4);
}

.auth-btn.primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 105, 123, 0.3);
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1rem;
}

.auth-footer p {
    color: #666;
    font-size: 0.95rem;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Forgot Password Link */
.forgot-password-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Auth Footer Links */
.auth-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.auth-footer-link {
    color: #666;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.auth-footer-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.auth-footer-separator {
    color: #ccc;
    margin: 0 10px;
    font-size: 0.875rem;
}

/* Forgot Password Modal */
.forgot-password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.forgot-password-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.forgot-password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid #e9ecef;
}

.forgot-password-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.75rem;
    font-weight: 700;
}

.close-forgot-password {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.close-forgot-password:hover {
    background: #f8f9fa;
    color: #333;
}

.forgot-password-step {
    padding: 2rem;
}

.forgot-password-description {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.forgot-password-form {
    margin-bottom: 1.5rem;
}

.forgot-password-form .form-group {
    margin-bottom: 1.5rem;
}

.forgot-password-form input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    background: #ffffff;
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.forgot-password-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 105, 123, 0.1);
}

.form-hint {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 0.85rem;
}

.forgot-password-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    margin-top: 1.5rem;
}

.forgot-password-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Success Message */
.forgot-password-success {
    padding: 3rem 2rem;
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1.5rem;
}

.forgot-password-success h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.forgot-password-success p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .forgot-password-container {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .forgot-password-header,
    .forgot-password-step {
        padding: 1.5rem;
    }
    
    .forgot-password-header h2 {
        font-size: 1.5rem;
    }
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #000000;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #000000;
    font-weight: 500;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 105, 123, 0.1);
    background-color: #ffffff;
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: #666666;
    font-weight: 400;
}

/* Checkbox Styling */
.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

.form-group label input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Button Styles */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    text-transform: none;
    margin-bottom: 0;
    white-space: nowrap;
}

.btn:last-child {
    margin-bottom: 0;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 105, 123, 0.3);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 105, 123, 0.4);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #1a1a1a;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    min-height: auto;
}

.btn-dark {
    background: #000000;
    color: white;
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-dark:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Auth Toggle Link */
#authToggle {
    margin-top: 2rem;
    color: #cccccc;
    font-size: 0.95rem;
}

#authToggle a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

#authToggle a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

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

.btn-danger:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

/* App Layout */
#app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--accent-color);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1rem 0.5rem 1rem;
    border-bottom: 1px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    position: relative;
}

.sidebar-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: none; /* Hidden by default, shown only on desktop */
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle i {
    font-size: 1rem;
}

/* Minimized Sidebar Styles */
.sidebar.minimized {
    width: var(--sidebar-minimized-width) !important;
    transition: width 0.3s ease;
}

.sidebar.minimized .sidebar-header h3,
.sidebar.minimized .sidebar-header .logo,
.sidebar.minimized .nav-item span,
.sidebar.minimized .user-info span {
    display: none;
}

.sidebar.minimized .sidebar-header {
    padding: 1.5rem 0.5rem 0.5rem 0.5rem;
    align-items: center;
}

.sidebar.minimized .sidebar-toggle {
    position: static;
    margin: 0 auto;
}

.sidebar.minimized .nav-item {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar.minimized .nav-item i {
    font-size: 1.2rem;
}

.sidebar.minimized .sidebar-footer {
    padding: 0.75rem 0.5rem;
}

.sidebar.minimized .user-info {
    justify-content: center;
}

.sidebar.minimized .user-info button {
    margin: 0;
}

/* Tooltip for minimized nav items */
.nav-item-tooltip {
    position: absolute;
    left: var(--sidebar-minimized-width);
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.nav-item-tooltip::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #333;
}

.sidebar.minimized .nav-item:hover .nav-item-tooltip {
    opacity: 1;
    visibility: visible;
}

.logo {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: contain;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: white !important;
    margin: 0;
    line-height: 1.2;
    text-shadow: none;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease;
    font-size: 0.9rem;
}

.nav-item:hover {
    background-color: #333;
}

.nav-item.active {
    background-color: var(--primary-color);
}

.nav-item i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #333;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logout-btn {
    background: none;
    border: none;
    color: white !important;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.logout-btn i {
    color: white !important;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Main header removed */

.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Page Styles */
.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.page-header h2 {
    margin: 0 !important;
    color: var(--text-color) !important;
    font-size: 1.2rem !important;
    font-weight: 500 !important;
}

/* More specific selector to ensure override */
.page .page-header h2 {
    margin: 0 !important;
    color: var(--text-color) !important;
    font-size: 1.2rem !important;
    font-weight: 500 !important;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

.page-header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h2 {
    margin: 0;
    color: var(--text-color);
}

.dashboard-header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.current-crop-year-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--card-background);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.current-crop-year-label {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.current-crop-year-value {
    color: #000000;
    font-weight: 700;
    font-size: 1rem;
}

.current-crop-year-value.clickable {
    cursor: pointer;
    color: var(--primary-color);
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 3px;
}

.current-crop-year-value.clickable:hover {
    background-color: rgba(0, 150, 150, 0.1);
    transform: scale(1.05);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clickable-card {
    cursor: pointer;
}

.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Progress Widget Styling */
.dashboard-card[data-widget="harvestProgress"] .metric {
    color: #28a745;
    font-size: 2.5rem;
    font-weight: bold;
}

.dashboard-card[data-widget="seedingProgress"] .metric {
    color: #17a2b8;
    font-size: 2.5rem;
    font-weight: bold;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.harvest {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.progress-fill.seeding {
    background: linear-gradient(90deg, #17a2b8, #6f42c1);
}

/* Calendar Styles */
.calendar-content {
    padding: 20px;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.month-year-display {
    font-size: 1.2em;
    font-weight: 600;
    min-width: 150px;
    text-align: center;
}

.calendar-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
}

.legend-color.field-task {
    background-color: #28a745;
}

.legend-color.task {
    background-color: #007bff;
}

.legend-color.service-completed {
    background-color: #6c757d;
}

.legend-color.service-upcoming {
    background-color: #ffc107;
}

.calendar-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #343a40;
    color: white;
}

.calendar-day-header {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
}

.calendar-day {
    min-height: 120px;
    background: white;
    padding: 8px;
    border: 1px solid #e9ecef;
    position: relative;
    display: flex;
    flex-direction: column;
}

.calendar-day.empty {
    background: #f8f9fa;
}

.calendar-day.today {
    background: #e3f2fd;
    border-color: #2196f3;
}

.day-number {
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-event {
    font-size: 0.75em;
    padding: 2px 4px;
    border-radius: 3px;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.2s;
}

.calendar-event:hover {
    opacity: 0.8;
}

.calendar-event.field-task {
    background-color: #28a745;
}

.calendar-event.task {
    background-color: #007bff;
}

.calendar-event.service-completed {
    background-color: #6c757d;
}

.calendar-event.service-upcoming {
    background-color: #ffc107;
    color: #212529;
}

/* Crop Year Settings Modal */
.crop-years-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 1rem 0;
}

.crop-year-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background-color: var(--card-background);
    transition: all 0.3s ease;
}

.crop-year-item:hover {
    background-color: rgba(0, 150, 150, 0.05);
    border-color: var(--primary-color);
}

.crop-year-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crop-year-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

.crop-year-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.status-badge.current {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.clickable-crop-year {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 4px;
    flex: 1;
}

.clickable-crop-year:hover {
    background-color: rgba(0, 150, 150, 0.05);
}

.crop-year-item.current-selected .clickable-crop-year {
    background-color: rgba(0, 150, 150, 0.1);
    border: 1px solid var(--primary-color);
}

.crop-year-item.current-selected .crop-year-name {
    color: var(--primary-color);
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .dashboard-header-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .current-crop-year-header {
        justify-content: center;
        padding: 0.75rem 1rem;
    }
    
    .current-crop-year-label {
        font-size: 0.85rem;
    }
    
    .current-crop-year-value {
        font-size: 0.95rem;
    }
    
    .current-crop-year-value.clickable:hover {
        transform: none;
    }
    
    .crop-year-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .crop-year-actions {
        justify-content: center;
    }
}

/* Crop Year Archiving Options */
.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.checkbox-label:hover {
    background: #f0f0f0;
    border-color: #20b2aa;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
}

.checkbox-label small {
    display: block;
    color: #666;
    font-size: 0.85em;
    margin-top: 4px;
    margin-left: 25px;
}

.checkmark {
    margin-right: 10px;
    margin-top: 2px;
}

/* Calendar Event Details */
.event-details {
    padding: 20px 0;
}

.event-details .detail-row {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.event-details .detail-row:last-child {
    border-bottom: none;
}

.event-details .detail-row strong {
    color: #333;
    min-width: 120px;
    display: inline-block;
}

.event-details ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.event-details li {
    margin-bottom: 4px;
    color: #666;
}

/* Mobile Calendar Styles */
@media (max-width: 768px) {
    .calendar-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .month-year-display {
        font-size: 1.1em;
    }
    
    .calendar-legend {
        flex-direction: column;
        gap: 10px;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .calendar-event {
        font-size: 0.7em;
        padding: 1px 2px;
    }
    
    .calendar-day-header {
        padding: 8px 4px;
        font-size: 0.8em;
    }
}

/* Time Tracker Styles */
.time-tracker-controls {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.clock-section {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.clock-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

#clockOutSection {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#clockOutSection .current-session {
    width: 100%;
    margin-bottom: 1rem;
}

#clockOutSection .btn-large {
    margin-top: 0;
    margin-left: 30px; /* Move the button to the right */
    align-self: center;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.clock-info p {
    color: var(--text-light);
    margin: 0;
    font-size: 1.1rem;
}

.current-session {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.current-session h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

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

.session-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.session-detail label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
}

.session-detail span {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 500;
}

.time-chart-section {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.time-chart-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.time-records-section {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.time-records-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.time-records-table-container {
    overflow-x: auto;
}

#timeRecordsTable {
    width: 100%;
    border-collapse: collapse;
}

#timeRecordsTable th,
#timeRecordsTable td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

#timeRecordsTable th {
    background-color: var(--background-color);
    font-weight: 600;
    color: var(--text-color);
}

#timeRecordsTable td {
    color: var(--text-light);
}

#timeRecordsTable tr:hover {
    background-color: rgba(0, 150, 150, 0.05);
}

/* Mobile Responsive for Time Tracker */
@media (max-width: 768px) {
    .time-tracker-controls {
        padding: 1rem;
    }
    
    .btn-large {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-width: 150px;
    }
    
    .session-info {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .current-session {
        padding: 1rem;
    }
    
    .time-chart-section,
    .time-records-section {
        padding: 1rem;
    }
    
    #timeRecordsTable {
        font-size: 0.9rem;
    }
    
    #timeRecordsTable th,
    #timeRecordsTable td {
        padding: 0.5rem;
    }
}

.dashboard-card h3 {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Dashboard Special Widgets */
.dashboard-special {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-special-widget {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.dashboard-special-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-special-widget .widget-header h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Calendar Widget */
.calendar-widget-content {
    max-height: 300px;
    overflow-y: auto;
}

/* Large Calendar Widget */
.calendar-large .calendar-large-content {
    padding: 12px;
}
.calendar-large .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
}
.calendar-large .calendar-day {
    min-height: 120px;
}

.calendar-month-header h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.calendar-event {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.calendar-event .event-date {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.calendar-event .event-details {
    flex: 1;
    min-width: 0;
}

.calendar-event .event-title {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event .event-type {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.calendar-widget .no-events {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 1rem;
}

/* Upcoming Services Widget */
.upcoming-services-content {
    max-height: 300px;
    overflow-y: auto;
}

.upcoming-services-content .service-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border-left: 3px solid #ff9800;
    transition: all 0.2s ease;
}

.upcoming-services-content .service-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.upcoming-services-content .service-item.past-due {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.upcoming-services-content .service-item.past-due:hover {
    background: #ffe6e6;
}

.upcoming-services-content .service-item:last-child {
    margin-bottom: 0;
}

.service-item .service-date {
    background: #ff9800;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.service-item .service-date.past-due-date {
    background: #dc3545;
}

.service-item .service-details {
    flex: 1;
    min-width: 0;
}

.service-item .service-equipment {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-item .service-description {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-item .service-status {
    background: #4caf50;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    flex-shrink: 0;
}

.service-item .service-status.past-due-status {
    background: #dc3545;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.upcoming-services-widget .no-services {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 1rem;
}

/* Calendar Popup Styles */
.calendar-popup {
    max-width: 800px;
    width: 100%;
}

.calendar-popup .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.calendar-popup .calendar-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.calendar-popup .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.calendar-popup .calendar-day-header {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.calendar-popup .calendar-day {
    background: white;
    min-height: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    position: relative;
}

.calendar-popup .calendar-day.empty {
    background: #f8f9fa;
}

.calendar-popup .calendar-day.today {
    background: #e3f2fd;
    border-color: var(--primary-color);
}

.calendar-popup .calendar-day.has-events {
    background: #fff3e0;
}

.calendar-popup .day-number {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.calendar-popup .day-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calendar-popup .day-event {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.calendar-popup .day-event:hover {
    background: #1976d2;
}

.calendar-popup .day-event .event-type {
    font-weight: 500;
    margin-right: 0.25rem;
}

.calendar-popup .day-event .event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-popup .more-events {
    background: #ff9800;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    text-align: center;
    font-weight: 500;
}

.calendar-popup .calendar-legend {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.calendar-popup .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.calendar-popup .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.calendar-popup .legend-color.field-task {
    background: var(--primary-color);
}

.calendar-popup .legend-color.service {
    background: #ff9800;
}

/* Equipment Services Popup Styles */
.equipment-services-popup {
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.popup-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.equipment-services-content {
    max-height: 60vh;
    overflow-y: auto;
}

.equipment-group {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.equipment-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.equipment-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.service-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.services-list {
    background: white;
}

.services-list .service-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.services-list .service-item:last-child {
    border-bottom: none;
}

.services-list .service-date {
    background: #ff9800;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.services-list .service-details {
    flex: 1;
    min-width: 0;
}

.services-list .service-description {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.services-list .service-status {
    background: #4caf50;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    flex-shrink: 0;
}

.no-services {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.no-services i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

.no-services p {
    font-size: 1.1rem;
    margin: 0;
}


.dashboard-list-widget {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-list-widget h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.list-content {
    max-height: 300px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.list-item-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
}

.list-item-action {
    margin-left: 1rem;
}

.status {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status.completed {
    background-color: #d4edda;
    color: #155724;
}

.status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.status.alert {
    background-color: #f8d7da;
    color: #721c24;
}

.metric-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Dashboard Settings */
.dashboard-settings {
    max-height: 400px;
    overflow-y: auto;
    margin: 1rem 0;
}

.widget-setting {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: background-color 0.2s ease;
}

.widget-setting:hover {
    background-color: var(--card-background);
}

.widget-info {
    margin-left: 1rem;
}

.widget-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.widget-description {
    font-size: 0.9rem;
    color: var(--text-light);
}

.chart-container {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    height: 400px;
}

.chart-container h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

/* Equipment Grid */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.equipment-card {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.equipment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Universal delete button style */
.delete-btn, .btn-delete {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}

.delete-btn:hover, .btn-delete:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* Universal edit button style */
.edit-btn, .btn-edit {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-size: 0.9rem;
}

.edit-btn:hover, .btn-edit:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* Master Admin specific button styles */
.master-admin .btn-edit,
.master-admin .btn-delete,
.master-admin .btn-warning,
.master-admin .btn-success {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 2px;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.master-admin .btn-edit {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
}

.master-admin .btn-edit:hover {
    background: #bbdefb;
    color: #0d47a1;
}

.master-admin .btn-delete {
    background: none;
    color: #6c757d;
    border: none;
}

.master-admin .btn-delete:hover {
    background: #f8f9fa;
    color: #495057;
}

.master-admin .btn-warning {
    background: #fff3e0;
    color: #f57c00;
    border-color: #ffcc02;
}

.master-admin .btn-warning:hover {
    background: #ffcc02;
    color: #e65100;
}

.master-admin .btn-success {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.master-admin .btn-success:hover {
    background: #c8e6c9;
    color: #1b5e20;
}

/* Ensure all action buttons are visible */
.data-table .btn-edit,
.data-table .btn-delete,
.data-table .btn-warning,
.data-table .btn-success {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 2px;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    min-width: 32px;
    min-height: 32px;
}

.data-table .btn-edit {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
}

.data-table .btn-edit:hover {
    background: #bbdefb;
    color: #0d47a1;
}

.data-table .btn-delete {
    background: none;
    color: #6c757d;
    border: none;
}

.data-table .btn-delete:hover {
    background: #f8f9fa;
    color: #495057;
}

.data-table .btn-warning {
    background: #fff3e0;
    color: #f57c00;
    border-color: #ffcc02;
}

.data-table .btn-warning:hover {
    background: #ffcc02;
    color: #e65100;
}

.data-table .btn-success {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.data-table .btn-success:hover {
    background: #c8e6c9;
    color: #1b5e20;
}

/* Enhanced Master Admin Button Styles */
.actions-cell {
    text-align: center;
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.status-toggle-btn {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px !important;
    min-width: 60px !important;
    font-size: 0.8rem !important;
}

.status-toggle-btn i {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.status-text {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}

/* Enhanced button colors for better visibility */
.data-table .btn-edit {
    background: #f5f5f5 !important;
    color: #666666 !important;
    border: 2px solid #cccccc !important;
    padding: 8px 12px !important;
    min-width: 40px !important;
    min-height: 40px !important;
}

.data-table .btn-edit:hover {
    background: #e0e0e0 !important;
    color: #333333 !important;
    border-color: #999999 !important;
}

.data-table .btn-warning {
    background: #fff3e0 !important;
    color: #f57c00 !important;
    border: 2px solid #ffcc02 !important;
}

.data-table .btn-warning:hover {
    background: #ffcc02 !important;
    color: #e65100 !important;
    border-color: #ffb300 !important;
}

.data-table .btn-success {
    background: #e8f5e8 !important;
    color: #2e7d32 !important;
    border: 2px solid #c8e6c9 !important;
}

.data-table .btn-success:hover {
    background: #c8e6c9 !important;
    color: #1b5e20 !important;
    border-color: #a5d6a7 !important;
}

.data-table .btn-delete {
    background: none !important;
    color: #6c757d !important;
    border: none !important;
    padding: 8px 12px !important;
    min-width: 40px !important;
    min-height: 40px !important;
}

.data-table .btn-delete:hover {
    background: #f8f9fa !important;
    color: #495057 !important;
}

/* Enhanced Status Badge Styles */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
}

.status-badge.active {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.status-badge.inactive {
    background: #ffebee;
    color: #d32f2f;
    border-color: #ffcdd2;
}

/* Renewal Date Input Styling */
.renewal-date-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.renewal-date-input {
    padding: 6px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: #333;
    min-width: 140px;
}

.renewal-date-input:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.renewal-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.renewal-status.expired {
    background: #ffebee;
    color: #d32f2f;
}

.renewal-status.warning {
    background: #fff3e0;
    color: #f57c00;
}

.renewal-status.good {
    background: #e8f5e8;
    color: #2e7d32;
}

/* Master Admin Table Layout Fixes */
.organizations-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: white;
}

#organizationsTable {
    width: 100%;
    min-width: 1200px; /* Ensure all columns fit */
    border-collapse: collapse;
    background: white;
}

#organizationsTable th {
    background: var(--primary-color);
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    white-space: nowrap;
}

#organizationsTable td {
    padding: 12px 8px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
    font-size: 0.9rem;
}

#organizationsTable tr:hover {
    background: #f8f9fa;
}

/* Ensure all columns are visible */
#organizationsTable th:nth-child(1),
#organizationsTable td:nth-child(1) {
    width: 40px;
    text-align: center;
}

#organizationsTable th:nth-child(2),
#organizationsTable td:nth-child(2) {
    width: 200px;
    min-width: 180px;
}

#organizationsTable th:nth-child(3),
#organizationsTable td:nth-child(3) {
    width: 120px;
    min-width: 100px;
}

#organizationsTable th:nth-child(4),
#organizationsTable td:nth-child(4) {
    width: 180px;
    min-width: 160px;
}

#organizationsTable th:nth-child(5),
#organizationsTable td:nth-child(5) {
    width: 80px;
    text-align: center;
}

#organizationsTable th:nth-child(6),
#organizationsTable td:nth-child(6) {
    width: 80px;
    text-align: center;
}

#organizationsTable th:nth-child(7),
#organizationsTable td:nth-child(7) {
    width: 100px;
    text-align: center;
}

#organizationsTable th:nth-child(8),
#organizationsTable td:nth-child(8) {
    width: 100px;
    text-align: center;
}

#organizationsTable th:nth-child(9),
#organizationsTable td:nth-child(9) {
    width: 140px;
    text-align: center;
}

#organizationsTable th:nth-child(10),
#organizationsTable td:nth-child(10) {
    width: 100px;
    text-align: center;
}

#organizationsTable th:nth-child(11),
#organizationsTable td:nth-child(11) {
    width: 150px;
    text-align: center;
}

.equipment-card .delete-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.equipment-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.equipment-card .equipment-type {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.equipment-card .equipment-hours {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Fields Controls */
.fields-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fields-controls .search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.fields-controls .search-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.fields-controls .search-container input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
}

.fields-controls .search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.group-by-control {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.group-by-control:hover {
    background: #e9ecef;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #6c757d;
    border-radius: 4px;
    background: white;
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.custom-checkbox i {
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.custom-checkbox.checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.custom-checkbox.checked i {
    opacity: 1;
}

.group-by-control span {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

/* Field Group Styling */
.field-group {
    margin-bottom: 2rem;
}

.field-group-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.field-group-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

/* Fields Grid */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    position: relative;
    z-index: 1;
}

/* Desktop specific grid rules - ensure they override mobile */
@media (min-width: 769px) {
    .fields-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
    
    .equipment-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
    
    .bins-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    }
}

.field-card {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.field-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.field-card .field-variety-acres {
    color: var(--primary-color);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.field-card .field-name {
    color: #000000;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.field-card .field-farm {
    color: #000000;
    font-weight: 400;
    font-size: 0.9rem;
}

/* Field Details Page */
.field-details-page {
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.field-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.field-info h1 {
    color: #000000;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.field-meta {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.field-farm {
    color: #666;
    font-size: 1rem;
}

.field-details-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.expenses-section,
.tasks-section,
.revenue-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.expenses-section h3,
.tasks-section h3,
.revenue-section h3 {
    color: #000000;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.chart-container {
    height: 400px;
    position: relative;
}

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

.revenue-stat {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.revenue-stat h4 {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.revenue-stat p {
    color: #000000;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Bins Grid */
.bins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.bin-card {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.bin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem 0.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.bin-card-header h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.2rem;
}


.bin-card-content {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    cursor: pointer;
}

.bin-card .bin-capacity {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.bin-card .bin-quantity {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.bin-progress {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.bin-progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

/* Data Tables */
.data-table {
    width: 100%;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Inventory Table Specific Styling */
.inventory-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: white;
    width: 100%;
    max-width: 100%;
}

/* Users Table Specific Styling */
.users-table-container {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: white;
}

/* Ensure the users management table stretches to full width */
#usersManagementTable {
    width: 100%;
    table-layout: auto;
}

/* Set specific column widths for better distribution */
#usersManagementTable th:nth-child(1),
#usersManagementTable td:nth-child(1) { width: 50px; } /* Checkbox */

#usersManagementTable th:nth-child(2),
#usersManagementTable td:nth-child(2) { width: 20%; } /* User */

#usersManagementTable th:nth-child(3),
#usersManagementTable td:nth-child(3) { width: 20%; } /* Email */

#usersManagementTable th:nth-child(4),
#usersManagementTable td:nth-child(4) { width: 20%; } /* Organization */

#usersManagementTable th:nth-child(5),
#usersManagementTable td:nth-child(5) { width: 10%; } /* Role */

#usersManagementTable th:nth-child(6),
#usersManagementTable td:nth-child(6) { width: 10%; } /* Status */

#usersManagementTable th:nth-child(7),
#usersManagementTable td:nth-child(7) { width: 10%; } /* Last Login */

#usersManagementTable th:nth-child(8),
#usersManagementTable td:nth-child(8) { width: 10%; } /* Actions */

#inventoryTable {
    width: 100%;
    min-width: 1400px; /* Increased minimum width for better desktop utilization */
    border-collapse: collapse;
    background: white;
    table-layout: auto; /* Allow columns to expand naturally */
}

#usersTable {
    width: 100%;
    min-width: 800px; /* Ensure all columns fit */
    border-collapse: collapse;
    background: white;
}

/* Inventory Table Column Widths - Expanded for Desktop */
#inventoryTable th:nth-child(1) { width: 20%; min-width: 150px; } /* Product */
#inventoryTable th:nth-child(2) { width: 12%; min-width: 100px; } /* Type */
#inventoryTable th:nth-child(3) { width: 16%; min-width: 140px; } /* Purchased Quantity */
#inventoryTable th:nth-child(4) { width: 16%; min-width: 140px; } /* Applied Quantity */
#inventoryTable th:nth-child(5) { width: 14%; min-width: 120px; } /* On Hand */
#inventoryTable th:nth-child(6) { width: 14%; min-width: 120px; } /* Cost Per Purchase Unit */
#inventoryTable th:nth-child(7) { width: 12%; min-width: 100px; } /* Purchase Unit */
#inventoryTable th:nth-child(8) { width: 12%; min-width: 100px; } /* Applied Unit */
#inventoryTable th:nth-child(9) { width: 12%; min-width: 100px; } /* Default Rate */
#inventoryTable th:nth-child(10) { width: 10%; min-width: 80px; } /* Cost */
#inventoryTable th:nth-child(11) { width: 12%; min-width: 100px; } /* Actions */

/* Users Table Column Widths */
#usersTable th:nth-child(1) { width: 120px; } /* Username */
#usersTable th:nth-child(2) { width: 100px; } /* Role */
#usersTable th:nth-child(3) { width: 150px; } /* Access Level */
#usersTable th:nth-child(4) { width: 100px; } /* Hourly Rate */
#usersTable th:nth-child(5) { width: 80px; } /* Status */
#usersTable th:nth-child(6) { width: 100px; } /* Last Login */
#usersTable th:nth-child(7) { width: 120px; } /* Actions */

.data-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

/* Enhanced padding for inventory table specifically */
#inventoryTable th,
#inventoryTable td {
    padding: 1.25rem 1.5rem;
}

/* Action buttons side by side in inventory table */
#inventoryTable td:last-child {
    white-space: nowrap;
}

#inventoryTable .btn-edit,
#inventoryTable .btn-delete {
    display: inline-block;
    margin-right: 0.5rem;
}

#inventoryTable .btn-delete {
    margin-right: 0;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Tasks List */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-item {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 60px;
}

.task-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.task-item.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    border-radius: 50%;
    appearance: none;
    border: 2px solid var(--primary-color);
    background-color: transparent;
    position: relative;
    flex-shrink: 0;
}

.task-checkbox:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.task-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.task-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.task-meta-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.task-creator {
    font-weight: 500;
}

.task-separator {
    color: var(--text-light);
}

.task-due-date {
    font-size: 0.85rem;
}

.task-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-details {
    display: none; /* Hide details in compact view */
}

.task-meta {
    display: none; /* Hide meta in compact view */
}

.task-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.task-details {
    color: var(--text-light);
    font-size: 0.9rem;
}

.task-date {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

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

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Reports */
.report-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.report-content {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: fixed;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Grid layouts removed - handled by specific mobile media queries */

    .form-row {
        grid-template-columns: 1fr;
    }

    .report-filters {
        flex-direction: column;
    }

    .page-header {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .page-header h2 {
        min-width: 200px;
    }

    .page-header .header-actions {
        flex-shrink: 0;
        justify-content: flex-end;
    }

    .page-header .page-header-controls {
        flex-shrink: 0;
        justify-content: flex-end;
    }

    /* Main header mobile styles removed */

    /* Auth Modal Mobile */
    .modal-content {
        padding: 0;
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .auth-header h2 {
        font-size: 2rem;
    }

    .auth-header p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.85rem;
    }

    /* Mobile responsive for modern auth page */
    .auth-page {
        padding-bottom: 4rem; /* Extra space for mobile browser UI */
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-container {
        max-width: 400px;
        margin: 1rem;
        border-radius: 16px;
        min-height: auto;
        max-height: calc(100vh - 4rem);
        max-height: calc(100dvh - 4rem);
        overflow-y: auto;
    }

    .auth-logo-section {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }

    .precision-logo .logo-image {
        width: 120px;
        height: 120px;
    }

    .precision-name {
        font-size: 24px;
    }

    .precision-plus {
        font-size: 24px;
    }

    .auth-form-section {
        padding: 0 1.5rem 3rem 1.5rem; /* Increased bottom padding */
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }

    .auth-header p {
        font-size: 0.9rem;
    }

    .auth-tab {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .auth-form input {
        padding: 14px 18px;
        font-size: 0.95rem;
    }

    .auth-btn {
        padding: 14px 20px;
        font-size: 1rem;
    }
}

/* Extra small screens and landscape mobile */
@media (max-width: 480px) {
    .auth-page {
        padding-bottom: 5rem; /* Even more space for small screens */
        padding-top: 1rem;
    }

    .auth-container {
        margin: 0.5rem;
        max-height: calc(100vh - 5rem);
        max-height: calc(100dvh - 5rem);
    }

    .auth-form-section {
        padding: 0 1rem 4rem 1rem; /* Extra bottom padding for small screens */
    }

    .auth-logo-section {
        padding: 1rem 1rem 0.5rem 1rem;
    }

    .precision-logo .logo-image {
        width: 100px;
        height: 100px;
    }
}

/* Mobile landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .auth-page {
        padding-top: 1rem;
        padding-bottom: 2rem;
    }

    .auth-container {
        max-height: calc(100vh - 2rem);
        max-height: calc(100dvh - 2rem);
    }

    .auth-logo-section {
        padding: 1rem 1.5rem 0.5rem 1.5rem;
    }

    .precision-logo .logo-image {
        width: 80px;
        height: 80px;
    }

    .auth-form-section {
        padding: 0 1.5rem 2rem 1.5rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Field Details */
.field-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.field-details {
    margin-bottom: 2rem;
}

.detail-row {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.field-tasks {
    margin-top: 2rem;
}

.task-record {
    background-color: #f8f9fa;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1rem;
    align-items: center;
}

.task-record .task-date {
    font-weight: 600;
    color: var(--primary-color);
}

.task-record .task-type {
    color: var(--text-color);
}

.task-record .task-cost {
    color: #dc3545;
    font-weight: 600;
}

.task-record .task-revenue {
    color: #28a745;
    font-weight: 600;
}

/* Equipment Details */
.equipment-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.equipment-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.equipment-header-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.equipment-header-actions .btn i {
    margin-right: 0.25rem;
}

.equipment-details {
    margin-bottom: 2rem;
}

.service-records {
    margin-top: 2rem;
}

.service-record {
    background-color: #f8f9fa;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr;
    gap: 1rem;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-record:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.service-record .service-date {
    font-weight: 600;
    color: var(--primary-color);
}

.service-record .service-description {
    color: var(--text-color);
}

.service-record .service-hours {
    color: var(--text-light);
}

.service-record .service-employee {
    color: var(--text-light);
    font-style: italic;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.form-actions .btn-primary {
    order: 1;
}

.form-actions .btn-secondary {
    order: 2;
}

/* Modal Content Enhancements */
.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.modal-content h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.modal-content h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Task Item Enhancements */
.task-item {
    transition: all 0.3s ease;
}

.task-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.task-item.completed {
    background-color: #f8f9fa;
    opacity: 0.7;
}

/* Bin Progress Bar Animation */
.bin-progress-bar {
    transition: width 0.5s ease-in-out;
}

/* Chart Container Responsive */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
    
    .task-record,
    .service-record {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
    
    .field-details-header,
    .equipment-details-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .form-actions .btn-primary {
        order: 1;
    }
    
    .form-actions .btn-secondary {
        order: 2;
    }
}

/* Bin Details Page */
.bin-details-page {
    padding: 0;
}

.bin-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bin-info h1 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.8rem;
}

.bin-meta {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.bin-meta span {
    margin-right: 1rem;
}

.bin-product {
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
}

.bin-details-content {
    display: grid;
    gap: 2rem;
}

.transactions-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.transactions-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-size: 1.3rem;
}

/* Transaction delete button */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.btn-danger {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-danger:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-danger:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.5);
}

/* Product rows */
.product-row {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--card-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.product-row .form-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: nowrap;
}

.product-row .form-group {
    flex: 1;
    min-width: 120px;
}

.product-row .form-group:first-child {
    flex: 2; /* Make product dropdown wider */
}

.product-row .form-group:nth-child(2) {
    flex: 1; /* Rate field */
}

.product-row .form-group:last-child {
    flex: 0 0 auto;
    min-width: 40px;
}

.product-select {
    font-size: 0.85rem; /* Smaller font for dropdown */
    min-width: 200px; /* Ensure minimum width */
}


.transactions-table-container {
    overflow-x: auto;
}

/* Product Details Page */
.product-details-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.product-info-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.product-info-card h2 {
    color: var(--primary-color);
    margin: 0 0 1.5rem 0;
    font-size: 1.8rem;
}

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

.product-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.product-stat .label {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.product-stat .value {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.product-transactions {
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.product-transactions h3 {
    color: var(--text-color);
    margin: 0 0 1.5rem 0;
    font-size: 1.3rem;
}

/* Product Links */
.product-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.product-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Equipment Details Modal */
.upcoming-service {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.upcoming-service h3 {
    color: var(--text-color);
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.service-task {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    border-left: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-task:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.service-task-info {
    flex: 1;
}

.service-task-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.service-task-due {
    color: var(--text-light);
    font-size: 0.9rem;
}

.service-task-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.service-task-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.service-task-status.completed {
    background-color: #d4edda;
    color: #155724;
}

/* Service Task Details Modal */
.service-task-details {
    margin: 1.5rem 0;
}

.service-task-details .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.service-task-details .detail-row:last-child {
    border-bottom: none;
}

.service-task-details .detail-row strong {
    color: var(--text-color);
    font-weight: 600;
}

.service-task-details .detail-row span {
    color: var(--text-light);
}

/* Service Completion Modal */
.service-completion-info {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border-left: 4px solid var(--primary-color);
}

.service-completion-info p {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.service-completion-info strong {
    color: var(--primary-color);
    font-weight: 600;
}

.form-text {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Task Details Modal */
.task-details-content {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.task-details-content .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.task-details-content .detail-row:last-child {
    border-bottom: none;
}

.task-details-content .detail-row strong {
    color: var(--text-color);
    font-weight: 600;
}

.task-details-content .detail-row span {
    color: var(--text-light);
}

.task-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.task-status.completed {
    background-color: #d4edda;
    color: #155724;
}

.task-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.task-delete-btn {
    margin-left: auto;
    padding: 0.5rem;
    font-size: 0.8rem;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.task-employee {
    color: var(--primary-color);
    font-weight: 500;
}

/* Circular Checkbox Labels */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: var(--text-color);
}

.circular-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    border-radius: 50%;
    appearance: none;
    border: 2px solid var(--primary-color);
    background-color: transparent;
    position: relative;
}

.circular-checkbox:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.circular-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    font-weight: 500;
    color: var(--text-color);
}

/* Field Task Rows */
.field-task-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.field-task-row:hover {
    background-color: rgba(0, 150, 150, 0.1);
}

/* Field Task Details Modal */
.field-task-details-content {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.field-task-details-content .detail-row {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.field-task-details-content .detail-row:last-child {
    border-bottom: none;
}

.field-task-details-content .detail-row strong {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.products-list {
    margin-top: 0.5rem;
}

.product-item {
    background: var(--card-background);
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    font-size: 0.9rem;
}

/* Service Record Details */
.service-record-details {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsive Design - Pure CSS Solution */
@media (max-width: 768px) {
    /* Fields controls mobile */
    .fields-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .fields-controls .search-container {
        max-width: none;
    }
    
    .group-by-control {
        justify-content: flex-start;
    }
    
    .field-group-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .field-group-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Reset and scale for mobile */
    html {
        font-size: 12px;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        overflow-x: hidden;
    }
    
    body {
        overflow-x: hidden;
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        padding: 0;
    }
    
    * {
        box-sizing: border-box;
    }
    /* Hide desktop sidebar on mobile */
    .sidebar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        transform: translateX(-100%) !important;
        width: 0 !important;
    }
    
    /* Main content adjustments */
    .main-content {
        margin-left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 0.75rem;
        /* Safe area handling for iPhone and modern mobile devices */
        padding-top: max(80px, env(safe-area-inset-top) + 65px) !important; /* Space for fixed mobile header + safe area */
        padding-bottom: max(90px, env(safe-area-inset-bottom) + 70px) !important; /* Space for bottom nav + safe area */
        box-sizing: border-box;
        overflow-x: hidden;
        min-height: calc(100vh - max(80px, env(safe-area-inset-top) + 65px) - max(90px, env(safe-area-inset-bottom) + 70px));
    }
    
    /* Content container adjustments */
    .content {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
    }
    
    /* Page-specific adjustments to prevent overlap */
    .page {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* Dashboard specific adjustments */
    .dashboard-content {
        padding-top: 0.5rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Equipment list adjustments */
    .equipment-list {
        padding-bottom: 1rem !important;
    }
    
    /* Page adjustments */
    .page {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
    }
    
    /* App container adjustments */
    #app {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Dashboard specific adjustments */
    .dashboard-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .stat-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    /* Mobile-specific scaling for common elements */
    .page-header h2 {
        font-size: 1.2rem !important;
        margin: 0 !important;
    }
    
    .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
        min-height: 40px !important;
    }
    
    .data-table {
        font-size: 0.8rem !important;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.8rem !important;
    }
    
    /* Fields grid mobile layout - 2 cards per row */
    .fields-grid,
    #fields .fields-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        padding: 0 !important;
    }
    
    .field-card {
        width: 100% !important;
        padding: 0.5rem !important;
        margin: 0 !important;
        min-height: auto !important;
    }
    
    .field-card .field-variety-acres {
        font-size: 0.7rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .field-card .field-name {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
        line-height: 1.2 !important;
    }
    
    .field-card .field-farm {
        font-size: 0.8rem !important;
    }
    
    /* Equipment grid mobile layout - 2 cards per row */
    .equipment-grid,
    #equipment .equipment-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        padding: 0 !important;
    }
    
    .equipment-card {
        padding: 0.5rem !important;
        min-height: auto !important;
    }
    
    .equipment-card h3 {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
        line-height: 1.2 !important;
    }
    
    .equipment-card .equipment-type {
        font-size: 0.8rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .equipment-card .equipment-hours {
        font-size: 0.9rem !important;
    }
    
    /* Bins grid mobile layout - 2 cards per row */
    .bins-grid,
    #bins .bins-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        padding: 0 !important;
    }
    
    .bin-card {
        min-height: auto !important;
    }
    
    .bin-card-header {
        padding: 0.5rem 0.75rem 0.25rem 0.75rem !important;
    }
    
    .bin-card-header h3 {
        font-size: 0.9rem !important;
        line-height: 1.2 !important;
    }
    
    .bin-card-content {
        padding: 0.5rem 0.75rem 0.75rem 0.75rem !important;
    }
    
    .bin-card .bin-capacity {
        font-size: 0.8rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .bin-card .bin-quantity {
        font-size: 0.9rem !important;
    }
    
    .bin-progress {
        height: 6px !important;
        margin: 0.25rem 0 !important;
    }
    
    /* Force mobile grid layout - highest specificity */
    .page .fields-grid,
    .page .equipment-grid,
    .page .bins-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    /* Force mobile card sizing - highest specificity */
    .page .field-card,
    .page .equipment-card,
    .page .bin-card {
        padding: 0.5rem !important;
    }
}

/* Extra small mobile screens - single column layout */
@media (max-width: 480px) {
    /* Fields grid - back to single column on very small screens */
    .fields-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    .field-card {
        padding: 0.75rem !important;
    }
    
    .field-card .field-variety-acres {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .field-card .field-name {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .field-card .field-farm {
        font-size: 0.9rem !important;
    }
    
    /* Equipment grid - back to single column on very small screens */
    .equipment-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    .equipment-card {
        padding: 0.75rem !important;
    }
    
    .equipment-card h3 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .equipment-card .equipment-type {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .equipment-card .equipment-hours {
        font-size: 1rem !important;
    }
    
    /* Bins grid - back to single column on very small screens */
    .bins-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    .bin-card-header {
        padding: 0.75rem 1rem 0.5rem 1rem !important;
    }
    
    .bin-card-header h3 {
        font-size: 1rem !important;
    }
    
    .bin-card-content {
        padding: 0.75rem 1rem 1rem 1rem !important;
    }
    
    .bin-card .bin-capacity {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .bin-card .bin-quantity {
        font-size: 1rem !important;
    }
    
    .bin-progress {
        height: 8px !important;
        margin: 0.5rem 0 !important;
    }
    
    /* Inventory table mobile adjustments */
    .inventory-table-container {
        overflow-x: auto !important;
        padding: 0 !important;
    }
    
    /* Fields page mobile layout - prevent header movement */
    #fields {
        position: relative;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    #fieldDetails {
        position: relative;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        background: white;
        min-height: calc(100vh - 60px - 70px);
    }
    
    .field-details-header {
        padding: 1rem;
        background: white;
        border-bottom: 1px solid #eee;
    }
    
    .field-details-content {
        padding: 1rem;
        overflow-x: hidden;
    }
    


/* Transaction History Styling */
.transaction-row.purchase {
    background-color: rgba(40, 167, 69, 0.1);
}

.transaction-row.application {
    background-color: rgba(255, 193, 7, 0.1);
}

.transaction-row.transfer_in {
    background-color: rgba(0, 123, 255, 0.1);
}

.transaction-row.transfer_out {
    background-color: rgba(220, 53, 69, 0.1);
}

.transaction-row.adjustment {
    background-color: rgba(108, 117, 125, 0.1);
}

.usage-history-row {
    cursor: pointer;
}

.usage-history-row:hover {
    background-color: rgba(0, 150, 150, 0.1);
    }
    
    /* Mobile Bottom Navigation */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #1a1a1a;
        border-top: 1px solid #333;
        display: flex;
        justify-content: space-around;
        padding: 0.5rem 0.25rem;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom) + 0.5rem);
        z-index: 1000;
        height: max(60px, env(safe-area-inset-bottom) + 60px);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
        min-height: 65px;
    }

    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.25rem 0.1rem;
        color: #ccc;
        text-decoration: none;
        font-size: 0.6rem;
        min-width: 45px;
        max-width: 50px;
        transition: color 0.3s ease;
        flex: 1;
    }
    
    .mobile-nav-item:hover,
    .mobile-nav-item.active {
        color: var(--primary-color);
    }
    
    .mobile-nav-item i {
        font-size: 1rem;
        margin-bottom: 0.25rem;
        display: block;
    }
    
    .mobile-nav-item span {
        font-size: 0.55rem;
        text-align: center;
        line-height: 1.1;
        margin-top: 0.1rem;
    }
    
    /* Mobile header with logo, search, and add button */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        padding-top: max(0.75rem, env(safe-area-inset-top) + 0.75rem);
        background: #1a1a1a;
        border-bottom: 1px solid #333;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10000;
        height: max(60px, env(safe-area-inset-top) + 60px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        width: 100vw;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    .mobile-header-left {
        display: flex;
        align-items: center;
        flex: 0 0 auto;
        min-width: 50px;
    }
    
    .mobile-header-center {
        display: flex;
        align-items: center;
        flex: 1;
        justify-content: center;
        margin: 0 0.5rem;
        min-width: 0;
    }
    
    .mobile-header-right {
        display: flex;
        align-items: center;
        flex: 0 0 auto;
        min-width: 50px;
    }
    
    /* Hamburger Menu Button */
    .mobile-hamburger {
        background: none;
        border: none;
        color: white;
        font-size: 1.2rem;
        padding: 0.5rem;
        cursor: pointer;
        border-radius: 4px;
        transition: background-color 0.2s;
        z-index: 10001;
        position: relative;
        pointer-events: auto;
    }
    
    .mobile-hamburger:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-hamburger i {
        font-size: 1.1rem;
    }
    
    .mobile-header .logo {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }
    
    .mobile-header h3 {
        color: white;
        margin: 0;
        font-size: 1rem;
        font-weight: 600;
        white-space: nowrap;
    }
    
    /* Mobile Search */
    .mobile-header-search {
        position: relative;
        width: 100%;
    }
    
    .mobile-search-input {
        width: 100%;
        max-width: 250px;
        padding: 0.5rem 0.75rem;
        border: 1px solid #666;
        border-radius: 20px;
        background: #1a1a1a;
        color: #ffffff;
        font-size: 0.85rem;
        outline: none;
        text-align: center;
        box-sizing: border-box;
        font-weight: 500;
    }
    
    .mobile-search-input::placeholder {
        color: #aaa;
        font-weight: 400;
    }
    
    .mobile-search-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(0, 150, 150, 0.3);
        background: #222;
    }
    
    .mobile-search-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-top: 0.25rem;
        max-height: 300px;
        overflow-y: auto;
        z-index: 1001;
        display: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .mobile-search-dropdown.show {
        display: block;
    }
    
    .mobile-search-result {
        padding: 0.75rem;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        transition: background-color 0.2s;
        color: #333;
    }
    
    .mobile-search-result:hover {
        background-color: #f5f5f5;
    }
    
    .mobile-search-result:last-child {
        border-bottom: none;
    }
    
    /* Search dropdown item styles */
    .search-dropdown-item {
        display: flex;
        align-items: center;
        padding: 0.75rem;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        transition: background-color 0.2s;
        color: #333;
    }
    
    .search-dropdown-item:hover {
        background-color: #f5f5f5;
    }
    
    .search-dropdown-item:last-child {
        border-bottom: none;
    }
    
    .search-dropdown-icon {
        width: 40px;
        height: 40px;
        background: var(--primary-color);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }
    
    .search-dropdown-content {
        flex: 1;
        min-width: 0;
    }
    
    .search-dropdown-title {
        font-weight: 600;
        color: #333;
        margin-bottom: 0.25rem;
        font-size: 0.9rem;
    }
    
    .search-dropdown-subtitle {
        color: #666;
        font-size: 0.8rem;
    }
    
    .search-no-results {
        padding: 1rem;
        text-align: center;
        color: #666;
    }
    
    .search-no-results i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        display: block;
        color: #999;
    }
    
    .mobile-search-result-type {
        font-size: 0.7rem;
        color: var(--primary-color);
        font-weight: 600;
        text-transform: uppercase;
    }
    
    .mobile-search-result-title {
        font-size: 0.9rem;
        color: white;
        margin-top: 0.25rem;
    }
    
    /* Hide any remaining old mobile add menu */
    .mobile-add-menu,
    #mobileAddMenu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Mobile Add Button and Menu */
    .mobile-header-btn {
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 150, 150, 0.3);
        flex-shrink: 0;
    }
    
    .mobile-header-btn:hover {
        background: #00b3b3;
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 150, 150, 0.4);
    }
    
    .mobile-header-btn i {
        font-size: 1.2rem;
    }
    
    /* Mobile Add Modal Styles */
    .mobile-add-modal-content {
        background: white;
        border-radius: 8px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        max-width: 260px;
        width: 80vw;
        position: relative;
        animation: slideInFromTop 0.3s ease-out;
    }
    
    @keyframes slideInFromTop {
        from {
            transform: translateY(-20px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    .mobile-add-header {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #eee;
        position: relative;
    }
    
    .mobile-add-header h3 {
        margin: 0;
        color: #333;
        font-size: 0.95rem;
        font-weight: 600;
    }
    
    .mobile-add-close {
        background: none;
        border: none;
        font-size: 1rem;
        color: #666;
        cursor: pointer;
        padding: 0.2rem;
        border-radius: 4px;
        transition: background-color 0.2s;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .mobile-add-close:hover {
        background-color: #f5f5f5;
    }
    
    .mobile-add-options {
        padding: 0.25rem;
    }
    
    .mobile-add-option {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 0.75rem;
        border: none;
        background: none;
        border-radius: 6px;
        cursor: pointer;
        transition: background-color 0.2s;
        text-align: left;
    }
    
    .mobile-add-option:hover {
        background-color: #f8f9fa;
    }
    
    .mobile-add-icon {
        width: 36px;
        height: 36px;
        background: #3F9087;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }
    
    .mobile-add-icon i {
        color: white;
        font-size: 1rem;
    }
    
    .mobile-add-text {
        flex: 1;
    }
    
    .mobile-add-title {
        display: block;
        font-weight: 600;
        color: #333;
        margin-bottom: 0.15rem;
        font-size: 0.9rem;
    }
    
    .mobile-add-desc {
        display: block;
        color: #666;
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    /* Position modal in top right on mobile */
    @media (max-width: 768px) {
        #mobileAddModal.modal {
            align-items: flex-start;
            justify-content: flex-end;
            padding: 1rem;
            z-index: 10000;
        }
        
        #mobileAddModal .modal-content {
            margin: 0;
            transform: none;
            max-width: 260px;
            width: 80vw;
        }
    }
    
    
    /* Hide desktop sidebar on mobile by default */
    .sidebar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        transform: translateX(-100%) !important;
        width: 0 !important;
    }
    
    /* Show sidebar when mobile menu is opened */
    .sidebar.mobile-open {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateX(0) !important;
        width: 280px !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: calc(100vh - 70px) !important; /* Account for mobile bottom nav */
        z-index: 10001 !important;
        background: #1a1a1a !important;
        flex-direction: column !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3) !important;
        overflow-y: auto !important;
        padding-bottom: 20px !important;
    }
    
    /* Sidebar navigation items - no overlay to worry about */
    .sidebar.mobile-open .nav-item,
    .sidebar.mobile-open .sidebar-nav a,
    .sidebar.mobile-open .sidebar-footer,
    .sidebar.mobile-open .sidebar-header,
    .sidebar.mobile-open .sidebar-nav {
        pointer-events: auto !important;
    }
    
}

/* Desktop styles - hide mobile elements */
@media (min-width: 769px) {
    .mobile-header {
        display: none !important;
    }
    
    .mobile-bottom-nav {
        display: none !important;
    }
    
    /* Ensure desktop sidebar is visible */
    .sidebar {
        display: flex !important;
        width: var(--sidebar-width) !important;
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        height: 100vh !important;
        background: #1a1a1a !important;
        flex-direction: column !important;
        transition: width 0.3s ease;
    }
    
    .sidebar-toggle {
        display: block !important;
    }
    
    .sidebar.minimized {
        width: var(--sidebar-minimized-width) !important;
    }
    
    /* Ensure logo styling is correct on desktop */
    .sidebar-header .logo {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        outline: none !important;
    }
    
    .sidebar-header h3 {
        color: white !important;
    }
    
    /* Ensure main content has proper margin */
    .main-content {
        margin-left: var(--sidebar-width) !important;
        padding: 2rem !important;
        padding-bottom: 2rem !important;
        transition: margin-left 0.3s ease;
    }
    
    .sidebar.minimized ~ .main-content {
        margin-left: var(--sidebar-minimized-width) !important;
    }
    
    /* Page headers */
    .page-header {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .page-actions {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
    }
    
    .page-actions .btn {
        flex-shrink: 0;
        font-size: 0.85rem;
        padding: 0.75rem 0.5rem;
    }
    
    /* Cards grid adjustments - removed conflicting mobile overrides */
    
    
    /* Tables responsive */
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Hide less important columns on mobile - EXCEPT for master admin and users table */
    .data-table th:nth-child(n+6),
    .data-table td:nth-child(n+6) {
        display: none;
    }
    
    /* Always show Actions column in bin transactions table */
    #binTransactionsTable th:nth-child(6),
    #binTransactionsTable td:nth-child(6) {
        display: table-cell !important;
    }
    
    /* Inventory table responsive behavior - hide less important columns but keep Actions and Cost Per Unit */
    #inventoryTable th:nth-child(7), /* Purchase Unit */
    #inventoryTable th:nth-child(8), /* Applied Unit */
    #inventoryTable th:nth-child(9), /* Default Rate */
    #inventoryTable td:nth-child(7),
    #inventoryTable td:nth-child(8),
    #inventoryTable td:nth-child(9) {
        display: none;
    }
    
    /* Ensure Cost Per Purchase Unit column is visible on mobile */
    #inventoryTable th:nth-child(6),
    #inventoryTable td:nth-child(6) {
        display: table-cell !important;
    }
    
    /* Ensure Actions column is always visible */
    #inventoryTable th:nth-child(11),
    #inventoryTable td:nth-child(11) {
        display: table-cell !important;
    }
    
    
    /* Force show all Users table columns including Actions */
    #usersTable th,
    #usersTable td {
        display: table-cell !important;
    }
    
/* Force show all columns for master admin tables */
.master-admin .data-table th,
.master-admin .data-table td {
    display: table-cell !important;
}

/* Override ALL responsive rules for master admin */
.master-admin .data-table th:nth-child(n+6),
.master-admin .data-table td:nth-child(n+6) {
    display: table-cell !important;
}

.master-admin .data-table th:nth-child(n+4),
.master-admin .data-table td:nth-child(n+4) {
    display: table-cell !important;
}

/* Force users table to use full width */
.users-table-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

#usersManagementTable,
#usersTable {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

/* Ensure parent containers don't constrain width */
.user-management-content,
#users {
    width: 100% !important;
    max-width: 100% !important;
}

/* Force the users page to use full width */
#users .page-header,
#users .users-table-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Force table to use full available width */
#usersTable {
    width: 100% !important;
    min-width: 100% !important;
    table-layout: fixed !important;
}

/* Override any container constraints */
#users {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#users .page-header {
    width: 100% !important;
    max-width: none !important;
    padding: 1rem 2rem !important;
}

#users .users-table-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 2rem 2rem 2rem !important;
}

/* Set specific column widths for better distribution */
#usersTable th:nth-child(1),
#usersTable td:nth-child(1) { width: 15%; } /* Username */

#usersTable th:nth-child(2),
#usersTable td:nth-child(2) { width: 10%; } /* Role */

#usersTable th:nth-child(3),
#usersTable td:nth-child(3) { width: 20%; } /* Access Level */

#usersTable th:nth-child(4),
#usersTable td:nth-child(4) { width: 12%; } /* Hourly Rate */

#usersTable th:nth-child(5),
#usersTable td:nth-child(5) { width: 12%; } /* Overtime Hours */

#usersTable th:nth-child(6),
#usersTable td:nth-child(6) { width: 8%; } /* Status */

#usersTable th:nth-child(7),
#usersTable td:nth-child(7) { width: 10%; } /* Last Login */

#usersTable th:nth-child(8),
#usersTable td:nth-child(8) { width: 13%; } /* Actions */

/* Force show Actions column in time records table - always visible */
#timeRecordsTable th:nth-child(6),
#timeRecordsTable td:nth-child(6) {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Users management table responsive behavior */
@media (max-width: 768px) {
    .users-table-container {
        overflow-x: auto;
    }
    
    #usersManagementTable {
        min-width: 800px;
        table-layout: auto;
    }
    
    #usersManagementTable th,
    #usersManagementTable td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
}
    
    /* Show essential columns only */
    .data-table th:nth-child(1),
    .data-table th:nth-child(2),
    .data-table th:nth-child(3),
    .data-table th:nth-child(4),
    .data-table th:nth-child(5),
    .data-table td:nth-child(1),
    .data-table td:nth-child(2),
    .data-table td:nth-child(3),
    .data-table td:nth-child(4),
    .data-table td:nth-child(5) {
        display: table-cell;
    }
    
    /* Field tasks table - show more columns */
    #fieldTasksTable th:nth-child(n+7),
    #fieldTasksTable td:nth-child(n+7) {
        display: none;
    }
    
/* Task report table - show all columns */
#taskReportTable th,
#taskReportTable td {
    display: table-cell !important;
}

/* Hidden column class for task report */
#taskReportTable .hidden-column,
#taskReportTable th.hidden-column,
#taskReportTable td.hidden-column {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}
    
    #fieldTasksTable th:nth-child(1),
    #fieldTasksTable th:nth-child(2),
    #fieldTasksTable th:nth-child(3),
    #fieldTasksTable th:nth-child(4),
    #fieldTasksTable th:nth-child(5),
    #fieldTasksTable th:nth-child(6),
    #fieldTasksTable td:nth-child(1),
    #fieldTasksTable td:nth-child(2),
    #fieldTasksTable td:nth-child(3),
    #fieldTasksTable td:nth-child(4),
    #fieldTasksTable td:nth-child(5),
    #fieldTasksTable td:nth-child(6) {
        display: table-cell;
    }
    
    /* Modals responsive */
    .modal {
        margin: 0;
    }
    
    .modal-content {
        padding: 1rem;
        margin: 1rem auto;
        width: 95%;
    }
    
    .modal h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    /* Form adjustments */
    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    /* Product rows mobile - keep inline layout */
    .product-row .form-row {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .product-row .form-group {
        flex: 1;
        min-width: 120px;
    }
    
    /* Scouting product form mobile */
    .product-item .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .product-item .form-group:last-child {
        justify-content: flex-start;
    }
    
    .product-row .form-group:last-child {
        flex: 0 0 auto;
        min-width: auto;
    }
    
    .product-row .form-group {
        margin-bottom: 0.5rem;
    }
    
    /* Task items mobile */
    .task-item {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        min-height: 50px;
    }
    
    .task-content {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }
    
    .task-meta-line {
        font-size: 0.75rem;
    }
    
    .task-title {
        font-size: 0.85rem;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    
    /* Charts responsive */
    .chart-container {
        height: 300px;
        margin: 1rem 0;
    }
    
    /* Field details mobile */
    .field-details-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .field-info h1 {
        font-size: 1.5rem;
    }
    
    .field-meta {
        font-size: 0.9rem;
    }
    
    /* Toggle switches mobile */
    .toggle-switch {
        gap: 1rem;
    }
    
    .toggle-slider {
        width: 45px;
        height: 22px;
    }
    
    .toggle-slider::before {
        width: 18px;
        height: 18px;
    }
    
    .toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
        transform: translateX(23px);
    }
    
    /* Circular checkboxes mobile */
    .circular-checkbox {
        width: 18px;
        height: 18px;
    }
    
    .checkbox-label {
        gap: 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Button adjustments */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Detail rows mobile */
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .detail-row strong {
        margin-bottom: 0.25rem;
    }
    
/* Products list mobile */
.products-list {
    margin-top: 0.75rem;
}

.product-item {
    padding: 0.75rem;
    font-size: 0.85rem;
}

/* Usage History Rows */
.usage-history-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.usage-history-row:hover {
    background-color: rgba(0, 150, 150, 0.1);
}

/* Usage Details Modal */
.usage-details-content {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.usage-details-content .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.usage-details-content .detail-row:last-child {
    border-bottom: none;
}

.usage-details-content .detail-row strong {
    color: var(--text-color);
    font-weight: 600;
}

.usage-details-content .detail-row span {
    color: var(--text-light);
}
}

/* Very small screens */
@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .modal {
        margin: 0;
    }
    
    .modal-content {
        padding: 0.75rem;
        margin: 0.5rem auto;
        width: 98%;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.25rem;
    }
    
    /* Hide even more columns on very small screens - EXCEPT for master admin and users table */
    .data-table th:nth-child(n+4),
    .data-table td:nth-child(n+4) {
        display: none;
    }
    
    /* Always show Actions column in bin transactions table even on small screens */
    #binTransactionsTable th:nth-child(6),
    #binTransactionsTable td:nth-child(6) {
        display: table-cell !important;
    }
    
    /* Inventory table responsive behavior for very small screens - show only essential columns */
    #inventoryTable th:nth-child(4), /* Applied Quantity */
    #inventoryTable th:nth-child(5), /* On Hand */
    #inventoryTable th:nth-child(7), /* Purchase Unit */
    #inventoryTable th:nth-child(8), /* Applied Unit */
    #inventoryTable th:nth-child(9), /* Default Rate */
    #inventoryTable th:nth-child(10), /* Cost */
    #inventoryTable td:nth-child(4),
    #inventoryTable td:nth-child(5),
    #inventoryTable td:nth-child(7),
    #inventoryTable td:nth-child(8),
    #inventoryTable td:nth-child(9),
    #inventoryTable td:nth-child(10) {
        display: none;
    }
    
    /* Ensure Cost Per Purchase Unit column is visible on very small screens too */
    #inventoryTable th:nth-child(6),
    #inventoryTable td:nth-child(6) {
        display: table-cell !important;
    }
    
    /* Ensure Actions column is always visible on very small screens too */
    #inventoryTable th:nth-child(11),
    #inventoryTable td:nth-child(11) {
        display: table-cell !important;
    }
    
    /* Force show Actions column in time records table */
    #timeRecordsTable th:nth-child(6),
    #timeRecordsTable td:nth-child(6) {
        display: table-cell !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    
    /* Force show all Users table columns on very small screens too */
    #usersTable th,
    #usersTable td {
        display: table-cell !important;
    }
    
    /* Force show all columns for master admin tables on very small screens too */
    .master-admin .data-table th,
    .master-admin .data-table td {
        display: table-cell !important;
    }
    
    /* Override ALL responsive rules for master admin on very small screens */
    .master-admin .data-table th:nth-child(n+4),
    .master-admin .data-table td:nth-child(n+4) {
        display: table-cell !important;
    }
    
    .master-admin .data-table th:nth-child(n+6),
    .master-admin .data-table td:nth-child(n+6) {
        display: table-cell !important;
    }
    
    .data-table th:nth-child(1),
    .data-table th:nth-child(2),
    .data-table th:nth-child(3),
    .data-table td:nth-child(1),
    .data-table td:nth-child(2),
    .data-table td:nth-child(3) {
        display: table-cell;
    }
    
    /* Card padding removed - handled by specific mobile media queries */
}

/* Crop Planner */
.crop-planner { background:white; border-radius:12px; padding:1rem; box-shadow:0 2px 8px rgba(0,0,0,.08); }
.cp-controls { display:flex; justify-content:space-between; align-items:center; margin-bottom:1rem; }
.cp-header { font-weight:700; font-size:1.2rem; color:#212529; }
.cp-table-container { overflow-x:auto; }
.cp-table { display:grid; gap:0; min-width:fit-content; }
.cp-table-header { display:contents; }
.cp-table-body { display:contents; }
.cp-field-col { width:200px; min-width:180px; padding:.75rem; background:#f8f9fa; border:1px solid #e9ecef; display:flex; flex-direction:column; gap:.25rem; }
.cp-field-name { font-weight:600; color:#212529; }
.cp-field-acres { color:#6c757d; font-size:.9rem; }
.cp-year-col { width:200px; min-width:180px; padding:.75rem; background:#e9ecef; border:1px solid #dee2e6; text-align:center; }
.cp-year-header { font-weight:700; font-size:1rem; color:#212529; margin-bottom:.5rem; }
.cp-year-dates { color:#6c757d; font-size:.85rem; margin-bottom:.5rem; }
.cp-year-acres { color:#6c757d; font-size:.8rem; }
.cp-crop-card { background:#f8f9fa; border:1px solid #e9ecef; border-radius:8px; padding:.5rem; margin:.25rem 0; cursor:pointer; transition:all .2s ease; min-height:48px; display:flex; align-items:center; justify-content:space-between; }
.cp-crop-card:hover { background:#eef2f6; border-color:#d8dee6; }
.cp-crop-text { font-weight:500; color:#343a40; font-size:.9rem; }
.cp-variety-text { color:#6c757d; font-size:.8rem; margin-left:.25rem; }
.cp-edit-icon { color:#6c757d; font-size:.8rem; }
@media(max-width:768px){ .cp-field-col{ width:150px; min-width:120px; } .cp-year-col{ width:150px; min-width:120px; } }

/* Hide Crop Planner button on small mobile screens */
@media (max-width: 480px) {
    .crop-planner-btn {
        display: none !important;
    }
}

.service-record-details .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.service-record-details .detail-row:last-child {
    border-bottom: none;
}

.service-record-details .detail-row strong {
    color: var(--text-color);
    font-weight: 600;
}

.service-record-details .detail-row span {
    color: var(--text-light);
}

/* Bin Cards - Make them clickable */
.bin-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* MASTER ADMIN OVERRIDE - Force show all columns */
.master-admin .data-table th,
.master-admin .data-table td {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.master-admin .data-table th:nth-child(n+4),
.master-admin .data-table td:nth-child(n+4),
.master-admin .data-table th:nth-child(n+6),
.master-admin .data-table td:nth-child(n+6) {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force table to be wide enough for all columns */
.master-admin .organizations-table-container {
    overflow-x: auto !important;
    width: 100% !important;
    max-width: none !important;
}

.master-admin #organizationsTable {
    width: 100% !important;
    min-width: 1500px !important; /* Increased from 1200px */
    table-layout: auto !important;
}

/* Ensure main content area doesn't constrain the table */
.master-admin .main-content {
    overflow-x: auto !important;
    max-width: none !important;
}

/* Force users table to break out of any width constraints */
.master-admin .users-table-container,
.master-admin #usersManagementTable {
    width: 100% !important;
    max-width: none !important;
    min-width: 100% !important;
}

/* Ensure the page content doesn't constrain the users table */
.master-admin .page-content,
.master-admin .user-management-content {
    width: 100% !important;
    max-width: none !important;
    overflow-x: visible !important;
}

/* Force main content to not constrain users page */
.main-content {
    width: 100% !important;
    max-width: none !important;
}

/* Override any page container constraints */
.page {
    width: 100% !important;
    max-width: none !important;
}

/* ULTRA SPECIFIC OVERRIDE - Force show ALL columns */
.master-admin .organizations-table-container .data-table tbody tr td:nth-child(n+6),
.master-admin .organizations-table-container .data-table thead tr th:nth-child(n+6) {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
}

/* Override any media query rules */
@media (max-width: 768px) {
    .master-admin .data-table th:nth-child(n+6),
    .master-admin .data-table td:nth-child(n+6) {
        display: table-cell !important;
    }
}

@media (max-width: 480px) {
    .master-admin .data-table th:nth-child(n+4),
    .master-admin .data-table td:nth-child(n+4) {
        display: table-cell !important;
    }
    
    .master-admin .data-table th:nth-child(n+6),
    .master-admin .data-table td:nth-child(n+6) {
        display: table-cell !important;
    }
    
    /* Task report table - show all columns on very small screens */
    #taskReportTable th,
    #taskReportTable td {
        display: table-cell !important;
    }
    
    /* Hidden column class for task report on small screens */
    #taskReportTable .hidden-column,
    #taskReportTable th.hidden-column,
    #taskReportTable td.hidden-column {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Harvest Calculation Modal Styles */
.harvest-calculation-details,
.overflow-calculation-details {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.calculation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.calculation-row:last-child {
    border-bottom: none;
}

.calculation-row.total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    border-top: 2px solid var(--primary-color);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.calculation-row.overflow {
    background: #fff3cd;
    margin: 0.25rem 0;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
}

.calculation-row .label {
    font-weight: 600;
    color: var(--text-color);
}

.calculation-row .value {
    font-weight: 500;
    color: var(--primary-color);
}

.calculation-row.overflow .label,
.calculation-row.overflow .value {
    color: #856404;
}

/* Employee Filter Styles */
.employee-filter-container {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.employee-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

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

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

.filter-btn.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

.filter-btn.btn-outline-primary:hover,
.filter-btn.btn-outline-primary.active {
    background-color: var(--primary-color);
    color: white;
}

/* Mobile Responsive for Employee Filters */
@media (max-width: 768px) {
    .employee-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        text-align: center;
        margin-bottom: 0.5rem;
    }
}

/* Master Account Styles */
.master-content {
    padding: 2rem;
}

.master-section {
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.section-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.section-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.3rem;
}

.organizations-table-container {
    padding: 0 1.5rem 1.5rem 1.5rem;
    overflow-x: auto;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.inactive {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.organization-details {
    padding: 1.5rem;
}

.detail-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.detail-section p {
    margin: 0.5rem 0;
    color: var(--text-light);
}

.users-list {
    max-height: 300px;
    overflow-y: auto;
}

.user-item {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.user-item:hover {
    background-color: rgba(0, 150, 150, 0.05);
    border-color: var(--primary-color);
}

.user-item:last-child {
    margin-bottom: 0;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.user-status {
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-status.active {
    background-color: #d4edda;
    color: #155724;
}

.user-status.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.user-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-details small {
    color: var(--text-light);
    font-size: 0.8rem;
}

.settings-container {
    padding: 2rem;
}

.settings-section {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.settings-section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

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

.stat-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: bold;
}

.stat-card p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Master Account Sidebar */
.master-header {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border-bottom: 2px solid #ffd700;
}

.sidebar-header .logo i.fa-crown {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.master-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    margin-top: 0.5rem;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.master-badge i {
    margin-right: 0.5rem;
}

.nav-count {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: auto;
}

.master-status {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.master-status i {
    color: #90ee90;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Task Filter Styles */
.btn-filter {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    transition: background-color 0.3s ease;
}

.btn-filter:hover {
    background: #5a6268;
}

.btn-filter.active {
    background: #007bff;
}

/* PWA Install Banner Styles */
.pwa-install-banner {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    background: #f8f9fa;
    color: #333;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    animation: slideUpFadeIn 0.4s ease-out;
    border: 1px solid #e9ecef;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Native iOS-style popup */
.pwa-install-banner.native-style {
    width: 280px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: none;
    position: relative;
    padding: 20px;
    text-align: center;
}

/* Speech bubble tail */
.pwa-install-banner.native-style::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #f8f9fa;
}

/* App icon container */
.pwa-app-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px auto;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

/* Precision+ logo styling */
.pwa-app-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* App icon placeholder if no logo */
.pwa-app-icon .icon-placeholder {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

/* Instructions text */
.pwa-instructions {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 15px;
}

.pwa-instructions strong {
    font-weight: 600;
}

/* Share icon image - your custom icon */
.pwa-share-icon-img {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
    border-radius: 6px;
}

/* Close button for native style */
.pwa-native-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-native-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
}

.pwa-install-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.pwa-install-text {
    flex: 1;
}

.pwa-install-text h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 3px 0;
    color: white;
}

.pwa-install-text p {
    font-size: 13px;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-install-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #007bff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-install-btn:hover {
    background: white;
    color: #0056b3;
    transform: translateY(-1px);
}

.pwa-install-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-install-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.pwa-install-debug {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-install-debug:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* iOS Safari specific styles */
@supports (-webkit-touch-callout: none) {
    .pwa-install-banner {
        bottom: calc(30px + env(safe-area-inset-bottom));
    }
    
    .pwa-install-banner.native-style {
        bottom: calc(40px + env(safe-area-inset-bottom));
        position: fixed !important;
    }
}

/* Mobile responsiveness */
@media (max-width: 375px) {
    .pwa-install-banner.native-style {
        width: 260px;
        padding: 18px;
    }
    
    .pwa-app-icon {
        width: 55px;
        height: 55px;
    }
    
    .pwa-app-icon img {
        width: 44px;
        height: 44px;
    }
    
    .pwa-app-icon .icon-placeholder {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
}


.task-filter-dropdown {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.task-filter-dropdown select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
}

/* Enhanced Master Admin Styles */
.bulk-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.bulk-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

.selected-count {
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 1rem;
}

.org-row.disabled-row {
    background-color: #f8f9fa;
    opacity: 0.7;
}

.org-row.disabled-row td {
    color: #6c757d;
}

.lock-icon {
    color: #dc3545;
    margin-left: 0.5rem;
}

.status-badge.locked {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    margin-left: 0.5rem;
}

.user-row.locked-out {
    background-color: #f8f9fa;
    opacity: 0.7;
}

.user-row.locked-out td {
    color: #6c757d;
}

.user-row.disabled-user {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
    opacity: 0.8;
}

.user-row.disabled-user td {
    color: #6c757d;
}

.user-row.disabled-user .status-badge.inactive {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.lock-icon {
    margin-left: 0.5rem;
    color: var(--text-light);
    font-size: 0.8rem;
}

.user-checkbox {
    margin-right: 0.5rem;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Reports Page Styles */
.reports-content {
    padding: 1rem;
}

.report-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.renewal-summary {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.renewal-summary h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.summary-stat {
    text-align: center;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.summary-stat .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.summary-stat .stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.renewal-categories {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.renewal-category {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--border-color);
}

.renewal-category.expired {
    border-left-color: #dc3545;
}

.renewal-category.critical {
    border-left-color: #fd7e14;
}

.renewal-category.warning {
    border-left-color: #ffc107;
}

.renewal-category.notice {
    border-left-color: #17a2b8;
}

.renewal-category.info {
    border-left-color: #007bff;
}

.renewal-category.good {
    border-left-color: #28a745;
}

.renewal-category.neutral {
    border-left-color: #6c757d;
}

.renewal-category.missing {
    border-left-color: #6c757d;
    opacity: 0.7;
}

.renewal-category h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.renewal-category .count {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: normal;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.no-data i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
    color: #28a745;
}

.category-table-container {
    overflow-x: auto;
}

.days-until {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.days-until.expired {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.days-until.critical {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.days-until.warning {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.days-until.good {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.days-until.missing {
    background-color: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
}

/* Mobile Responsive for Reports */
@media (max-width: 768px) {
    .summary-stats {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .summary-stat {
        padding: 0.75rem;
    }
    
    .summary-stat .stat-number {
        font-size: 1.5rem;
    }
    
    .summary-stat .stat-label {
        font-size: 0.7rem;
    }
    
    .renewal-category {
        padding: 1rem;
    }
    
    .report-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

.user-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.user-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.overview-card {
    background: linear-gradient(135deg, var(--card-background), #f8f9fa);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-header i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-right: 1rem;
}

.card-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.3rem;
}

.card-stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.card-stats .stat {
    text-align: center;
}

.card-stats .stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.card-stats .stat-number.active {
    color: #28a745;
}

.card-stats .stat-number.inactive {
    color: #dc3545;
}

.card-stats .stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.recent-activity {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.recent-activity h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.activity-item:hover {
    background-color: rgba(0, 150, 150, 0.05);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), #004d5a);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Renewal Date Styles */
.renewal-date-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 120px;
}

.renewal-date-input {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8rem;
    background-color: var(--card-background);
    color: var(--text-color);
}

.renewal-date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 150, 150, 0.2);
}

.renewal-status {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.renewal-status.expired {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.renewal-status.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.renewal-status.notice {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.renewal-status.good {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Mobile Responsive for Master Account */
@media (max-width: 768px) {
    .master-content {
        padding: 1rem;
    }
    
    .organizations-table-container {
        padding: 0 1rem 1rem 1rem;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .user-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h4 {
        font-size: 1.5rem;
    }
    
    .bulk-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .user-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .activity-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .renewal-date-container {
        min-width: 100px;
    }
    
    .renewal-date-input {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .renewal-status {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }
}

/* Field Task Cards */
.field-tasks-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.field-task-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.field-task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.field-task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.field-task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.field-task-type {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-task-date {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 700;
}

.field-task-main-info {
    margin-bottom: 1rem;
}

.field-task-equipment {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.field-task-equipment i {
    color: var(--primary-color);
    margin-right: 0.5rem;
    width: 16px;
}

.field-task-implement {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.field-task-implement i {
    color: var(--text-light);
    margin-right: 0.5rem;
    width: 16px;
}

.field-task-employee {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.field-task-employee i {
    color: var(--text-light);
    margin-right: 0.5rem;
    width: 16px;
}

.field-task-products {
    margin-bottom: 1rem;
}

.field-task-products-title {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.field-task-product-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.field-task-product {
    background: #f8f9fa;
    color: var(--text-color);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid #e9ecef;
}

.field-task-costs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    gap: 1rem;
}

.field-task-cost-per-acre {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.field-task-cost-per-acre-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.field-task-cost-per-acre-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.field-task-total-cost {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.field-task-total-cost-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.field-task-total-cost-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}


.no-field-tasks {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.no-field-tasks i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #e9ecef;
}

.no-field-tasks p {
    font-size: 1.1rem;
    margin: 0;
}

/* Mobile Responsiveness for Field Task Cards */
@media (max-width: 768px) {
    .field-tasks-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .field-task-card {
        padding: 1rem;
    }
    
    .field-task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    
    .field-task-costs {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }
    
    .field-task-cost-per-acre,
    .field-task-total-cost {
        flex: 1;
    }
}

/* Scouting Page Styles */
.scouting-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 105, 123, 0.25);
}

#customDateRange {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: end;
    min-width: 300px;
}

#customDateRange .filter-group {
    min-width: 120px;
}

/* Scouting Report Styles */
.scouting-report {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.scouting-report h3 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.scouting-report h4 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #e9ecef;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.report-breakdowns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.breakdown-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

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

.report-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.report-stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    color: #495057;
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

.recent-reports {
    margin-top: 2rem;
}

.reports-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.reports-table {
    width: 100%;
    border-collapse: collapse;
}

.reports-table th {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.reports-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.reports-table tbody tr:hover {
    background: #f8f9fa;
}

.reports-table tbody tr:last-child td {
    border-bottom: none;
}

/* P&L Report Styles */
.pl-report-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pl-report-table th {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
    vertical-align: middle;
}

.pl-report-table th.text-right {
    text-align: right;
}

.pl-report-table td {
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    text-align: left;
}

.pl-report-table td.text-right {
    text-align: right;
}

.pl-report-table tbody tr:hover {
    background: #f8f9fa;
}

.pl-report-table tbody tr.total-row {
    background: #e8f4fd;
    font-weight: 600;
}

.pl-report-table tbody tr.total-row td {
    border-top: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.pl-report-table .profit {
    color: #28a745;
    font-weight: 600;
}

.pl-report-table .loss {
    color: #dc3545;
    font-weight: 600;
}

/* Multiple GPS Locations Styling */
.locations-container {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    background: #f8f9fa;
}

.locations-list {
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.location-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.location-coords {
    font-family: monospace;
    font-size: 0.9rem;
    color: #495057;
}

.location-actions {
    display: flex;
    gap: 0.5rem;
}

.location-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-edit-location {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-edit-location:hover {
    background: #bbdefb;
}

.btn-remove-location {
    background: #ffebee;
    color: #d32f2f;
}

.btn-remove-location:hover {
    background: #ffcdd2;
}

.manual-location-inputs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: end;
}

.manual-location-inputs input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.manual-location-inputs button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Multiple GPS Points on Map */
.scouting-pin.multiple-point {
    position: relative;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.point-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 10px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

/* GPS Location Display */
.gps-location-container {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    background: #f8f9fa;
}

.gps-location-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.gps-location-display i {
    color: var(--primary-color);
}

.gps-location-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Send PDF Button */
.btn-success {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* PDF Options Modal */
.pdf-options {
    margin: 20px 0;
}

.option-group {
    margin-bottom: 30px;
}

.option-group h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.option-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.option-buttons .btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.option-buttons .btn i {
    margin-right: 8px;
}

.report-links-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
    background: #f8f9fa;
}

.report-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.report-link-item:last-child {
    margin-bottom: 0;
}

.report-info {
    flex: 1;
    font-size: 14px;
    color: #495057;
}

.report-actions {
    display: flex;
    gap: 8px;
}

.report-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Shareable Links Modal */
.shareable-links-container {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

.shareable-link-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.link-info {
    font-size: 14px;
    color: #495057;
    margin-bottom: 8px;
}

.link-url {
    margin-bottom: 10px;
}

.link-url input {
    font-size: 12px;
    font-family: monospace;
    background: white;
}

.link-actions {
    display: flex;
    gap: 8px;
}

.link-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

.modal-actions {
    margin-top: 20px;
    text-align: right;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.modal-actions .btn {
    margin-left: 10px;
}

/* Group Links Modal */
.group-links-section {
    margin-bottom: 20px;
}

.group-links-section .btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
}

.group-links-container {
    margin: 20px 0;
}

.group-links-container textarea {
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    resize: vertical;
    min-height: 200px;
}

/* PDF Generation Options */
.pdf-generation-options {
    margin: 20px 0;
}

.pdf-generation-options .option-group {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.pdf-generation-options .option-group h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
}

.pdf-generation-options .option-group p {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.pdf-generation-options .btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pdf-generation-options .btn i {
    margin-right: 8px;
}

/* Scouting Widget */
.scouting-widget {
    background: white;
    border: 1px solid #dee2e6;
}

.scouting-widget-content {
    padding: 0;
}

.scouting-item {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scouting-item:hover {
    background: #f8f9fa;
}

.scouting-item:last-child {
    border-bottom: none;
}

.scouting-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scouting-field-date {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scouting-field {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.scouting-date {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 4px;
}

.scouting-issues {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.issue-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.issue-tag.severity-1 { background: #28a745; }
.issue-tag.severity-2 { background: #ffc107; color: #212529; }
.issue-tag.severity-3 { background: #fd7e14; }
.issue-tag.severity-4 { background: #dc3545; }
.issue-tag.severity-5 { background: #dc3545; }

.no-issues {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.severity-badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-1 { background: #28a745; }
.severity-2 { background: #ffc107; color: #212529; }
.severity-3 { background: #fd7e14; }
.severity-4 { background: #dc3545; }
.severity-5 { background: #dc3545; }

.no-reports {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 20px;
}

/* Scouting Report Details Modal */
.scouting-detail-content {
    max-height: 70vh;
    overflow-y: auto;
}

.scouting-detail-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.scouting-detail-header h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.scouting-detail-date {
    color: #6c757d;
    margin: 5px 0;
}

.scouting-detail-location {
    color: #6c757d;
    margin: 5px 0;
}

.scouting-detail-section {
    margin-bottom: 20px;
}

.scouting-detail-section h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.scouting-detail-issue {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.scouting-detail-issue h4 {
    margin: 0 0 10px 0;
    color: #007bff;
}

.severity-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.scouting-detail-photos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.scouting-detail-photo {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Location Picker Modal */
.location-picker-modal {
    max-width: 600px;
    width: 90vw;
}

.location-picker-modal h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.location-picker-modal p {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
}

.map-container {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.selected-coordinates {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.selected-coordinates p {
    margin: 0;
    text-align: left;
    color: #495057;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Location Picker Marker */
.location-picker-marker {
    background: none;
    border: none;
}

.picker-marker {
    color: #e74c3c;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* Enhanced Black Button Styling */
.btn-dark {
    background: #000000;
    color: white;
    border: 2px solid #000000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.btn-dark:hover {
    background: #333333;
    border-color: #333333;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.btn-dark:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-dark:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25);
}

.scouting-reports-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.scouting-report-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.scouting-report-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.scouting-report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.scouting-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.scouting-type {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scouting-date {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 700;
}

.scouting-field-info {
    margin-bottom: 1rem;
}

.scouting-field-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.scouting-location {
    color: var(--text-light);
    font-size: 0.9rem;
}

.scouting-details {
    margin-bottom: 1rem;
}

.scouting-issue {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

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

.severity-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.severity-bar {
    display: flex;
    gap: 0.2rem;
}

.severity-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e9ecef;
}

.severity-dot.active {
    background: var(--primary-color);
}

.scouting-photos {
    margin-top: 1rem;
}

.scouting-photos-title {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.scouting-photo-thumbnails {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.scouting-photo-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.scouting-photo-thumbnail:hover {
    transform: scale(1.1);
}

/* Weather Page Styles */
.weather-settings {
    margin-bottom: 2rem;
}

.settings-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.settings-card h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.weather-data-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    padding: 2rem;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.weather-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.weather-card-title {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weather-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.weather-card-unit {
    font-size: 0.9rem;
    color: var(--text-light);
}

.weather-status {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.weather-status i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #e9ecef;
}

.no-scouting-reports {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.no-scouting-reports i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #e9ecef;
}

.no-scouting-reports p {
    font-size: 1.1rem;
    margin: 0;
}

/* Mobile Responsiveness for Scouting and Weather */
@media (max-width: 768px) {
    .scouting-filters {
        flex-direction: column;
    }
    
    .scouting-reports-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .scouting-report-card {
        padding: 1rem;
    }
    
    .scouting-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .weather-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .settings-card {
        padding: 1rem;
    }
}

/* Scouting Details Modal Styles */
.scouting-details-content {
    max-height: 70vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    color: var(--text-color);
}

.scouting-type-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.severity-text {
    font-weight: 600;
    color: var(--primary-color);
}

.scouting-photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.scouting-photo-full {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 2px solid #e9ecef;
}

.scouting-photo-full:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

/* Photo View Modal Styles */
.photo-view-container {
    text-align: center;
    max-height: 80vh;
    overflow: hidden;
}

.photo-view-full {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

/* Scouting Type Sections */
.scouting-type-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.scouting-type-section h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1rem;
}

.type-issue-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.severity-bar-inline {
    display: flex;
    gap: 2px;
    margin-top: 0.25rem;
}

.severity-bar-inline .severity-dot {
    width: 8px;
    height: 8px;
}

.scouting-products {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #e7f3ff;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Products Container */
.products-container {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
}

.products-list {
    margin-bottom: 1rem;
}

.product-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.product-item:last-child {
    margin-bottom: 0;
}

/* Scouting product form layout */
.product-item .form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.product-item .form-group {
    margin-bottom: 0;
}

.product-item .form-group:last-child {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Type Detail Items */
.type-detail-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.type-detail-item:last-child {
    margin-bottom: 0;
}

.type-detail-item h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

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

.product-detail-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.product-detail-item:last-child {
    margin-bottom: 0;
}

/* Checkbox Group Styling */
.scouting-types-container .checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.scouting-types-container .checkbox-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.scouting-types-container .checkbox-item:hover {
    background: #e9ecef;
}

.scouting-types-container .checkbox-item input[type="checkbox"]:checked + label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Weather Stations Management Styles */
.weather-stations-container {
    margin-top: 1rem;
}

.weather-stations-list {
    margin-bottom: 1rem;
}

.weather-station-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.weather-station-item:last-child {
    margin-bottom: 0;
}

.weather-station-selector {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.weather-station-selector h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Weather Charts Styles */
.weather-charts-container {
    margin-top: 2rem;
}

.charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.charts-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.weather-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.chart-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-header {
    margin-bottom: 1rem;
}

.chart-header h4 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.chart-container canvas {
    max-height: 400px;
}

/* Keep charts stacked vertically for better readability */
@media (min-width: 768px) {
    .chart-container {
        height: 350px;
    }
    
    .chart-container canvas {
        max-height: 350px;
    }
}

@media (min-width: 1200px) {
    .chart-container {
        height: 300px;
    }
    
    .chart-container canvas {
        max-height: 300px;
    }
}

/* Additional Mobile Responsiveness for Scouting Details */
@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .scouting-photo-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .severity-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .scouting-details-content {
        max-height: 60vh;
    }
    
    .scouting-types-container .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .types-list {
        gap: 0.5rem;
    }
    
    .type-detail-item {
        padding: 0.75rem;
    }
}

/* Dashboard Special Widgets Layout */
.dashboard-special {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Dashboard Weather Widget Styles */
.weather-widget {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.weather-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.weather-widget .widget-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.weather-header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weather-station-selector {
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}

.station-name {
    font-size: 0.85rem;
    color: var(--text-color);
    font-weight: 500;
}

.weather-widget-content {
    min-height: 120px;
}

.weather-data-compact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.temperature-display {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.temp-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
}

.temp-unit {
    font-size: 1.2rem;
    color: var(--text-color);
    font-weight: 500;
}

.weather-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    flex: 1;
}

.weather-secondary {
    display: flex;
    gap: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}

.weather-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.weather-item i {
    width: 16px;
    text-align: center;
    color: var(--primary-color);
}

.weather-loading, .weather-error, .weather-not-configured {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    text-align: center;
    color: var(--text-color);
}

.weather-loading i, .weather-error i, .weather-not-configured i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.weather-error i {
    color: #dc3545;
}

.weather-not-configured i {
    color: #6c757d;
}

.weather-loading p, .weather-error p, .weather-not-configured p {
    margin: 0.5rem 0;
    font-weight: 500;
}

.weather-loading small, .weather-error small, .weather-not-configured small {
    color: #6c757d;
    font-size: 0.8rem;
}

/* Mobile responsiveness for weather widget */
@media (max-width: 768px) {
    .weather-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .weather-details {
        width: 100%;
        justify-content: space-between;
    }
    
    .weather-secondary {
        flex-wrap: wrap;
    }
    
    .weather-header-controls {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .temp-value {
        font-size: 2rem;
    }
}

/* Drag and Drop Styles */
.draggable-widget {
    position: relative;
    transition: all 0.2s ease;
    cursor: move;
}

.draggable-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.drag-handle {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: #6c757d;
    cursor: grab;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.draggable-widget:hover .drag-handle {
    opacity: 1;
}

.drag-handle:hover {
    background: rgba(0,0,0,0.1);
    color: var(--primary-color);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Dragging states */
.draggable-widget.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.draggable-widget.drop-target {
    border: 2px dashed #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.draggable-widget.drop-over {
    border: 2px solid #007bff;
    background: rgba(0, 123, 255, 0.1);
    transform: scale(1.02);
}

/* Special widget header adjustments for drag handle */
.dashboard-special-widget .widget-header {
    position: relative;
}

.dashboard-special-widget .drag-handle {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
}

/* Adjust header layout for special widgets */
.dashboard-special-widget .widget-header h3 {
    margin-right: 2rem; /* Make space for drag handle */
}

/* Farm Map Widget Styles */
.farm-map-widget {
    min-height: 400px;
}

.farm-map-widget .farm-map-widget-content {
    position: relative;
}

.farm-map-widget .dashboard-map {
    border: 1px solid var(--border-color);
    background: #f8f9fa;
}

.farm-map-widget .map-loading {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--border-color);
}


.farm-map-widget .farm-map-legend {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    margin-top: 8px;
}

.farm-map-widget .legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
}

.farm-map-widget .legend-color {
    width: 12px;
    height: 12px;
    border: 1px solid #ccc;
    border-radius: 2px;
    flex-shrink: 0;
}

.farm-map-widget .legend-label {
    font-size: 0.75rem;
    color: #495057;
}

/* Simplified mobile-friendly map styles */
.farm-map-widget .no-drag {
    pointer-events: auto;
}

.farm-map-widget .no-drag * {
    pointer-events: auto;
}

.farm-map-widget .leaflet-container {
    pointer-events: auto;
}

.farm-map-widget .leaflet-control-container {
    pointer-events: auto;
}

/* Mobile-specific touch improvements */
@media (max-width: 768px) {
    .farm-map-widget .dashboard-map {
        touch-action: auto; /* Allow all touch gestures for map */
    }
    
    .farm-map-widget .leaflet-container {
        touch-action: auto; /* Allow all touch gestures for map */
    }
    
    /* Only restrict touch on the widget header for dragging */
    .farm-map-widget .widget-header {
        touch-action: manipulation;
    }
}

/* Table sorting styles */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: rgba(47, 127, 127, 0.1);
}

.sort-icon {
    margin-left: 8px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.sortable:hover .sort-icon {
    opacity: 1;
}

.sortable .sort-icon.fa-sort-up,
.sortable .sort-icon.fa-sort-down {
    opacity: 1;
    color: var(--primary-color);
}

/* Master admin table specific styles */
#usersManagementTable .sortable,
#organizationsTable .sortable {
    padding: 12px 8px;
    font-weight: 600;
    color: var(--text-dark);
}

#usersManagementTable .sortable:hover,
#organizationsTable .sortable:hover {
    background-color: rgba(47, 127, 127, 0.15);
    color: var(--primary-color);
}

/* Farm map search box */
.farm-map-widget .farm-map-controls {
    position: relative;
}

.farm-map-widget .farm-map-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.farm-map-lock-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: #666;
    font-size: 1rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.farm-map-lock-toggle:hover {
    color: var(--primary-color);
}

.farm-map-widget #farmMapSearch {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 150px;
    transition: border-color 0.3s ease;
}

.farm-map-widget #farmMapSearch:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(47, 127, 127, 0.2);
}

/* Map popup styles */
.leaflet-popup-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Mobile-friendly popup styles */
.field-boundary-popup-container .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.field-boundary-popup-container .leaflet-popup-content {
    margin: 12px;
    line-height: 1.4;
}

.field-boundary-popup-container .leaflet-popup-tip {
    background: white;
    border: 1px solid #ccc;
}

/* Mobile touch improvements */
@media (max-width: 768px) {
    .field-boundary-popup-container .leaflet-popup-content {
        font-size: 14px;
        min-width: 200px;
    }
    
    .field-boundary-popup-container .leaflet-popup-content h4 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .field-boundary-popup-container .leaflet-popup-content p {
        margin: 4px 0;
        font-size: 13px;
    }
    
    .field-boundary-popup-container .leaflet-popup-content button {
        padding: 8px 12px;
        font-size: 13px;
        margin-top: 8px;
    }
}

.leaflet-popup-content h4 {
    color: var(--primary-color) !important;
    font-weight: 600;
    margin-bottom: 8px;
}

.leaflet-popup-content p {
    margin: 4px 0;
    font-size: 0.9rem;
    color: #666;
}

.leaflet-popup-content button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 8px;
    width: 100%;
    transition: background-color 0.2s;
}

.leaflet-popup-content button:hover {
    background: var(--primary-dark);
}

/* Weather widget specific adjustments */
.weather-widget .widget-header {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.weather-header-controls {
    margin-left: auto;
}

/* Dashboard Special Widgets Responsive */
@media (max-width: 1200px) {
    .dashboard-special {
        grid-template-columns: 1fr; /* Single column on smaller screens */
    }
}

@media (min-width: 1201px) {
    .dashboard-special {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); /* Larger minimum width on bigger screens */
    }
}

/* Mobile drag and drop adjustments */
@media (max-width: 768px) {
    .drag-handle {
        opacity: 1; /* Always show on mobile */
        top: 0.25rem;
        right: 0.25rem;
    }
    
    .draggable-widget.dragging {
        transform: rotate(2deg) scale(0.95);
    }
    
    .dashboard-special-widget .widget-header h3 {
        margin-right: 1.5rem;
    }
    
    .dashboard-special {
        grid-template-columns: 1fr; /* Always single column on mobile */
        gap: 1rem;
    }
}

/* Disable text selection during drag */
.draggable-widget.dragging * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Scouting Map Styles */
.scouting-map-section {
    margin: 1.5rem 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.map-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.scouting-map-container {
    display: flex;
    height: 500px;
}

.map-legend {
    width: 200px;
    padding: 1rem;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    overflow-y: auto;
}

.map-legend h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.legend-item:hover {
    background: rgba(0, 123, 255, 0.1);
}

.legend-item.active {
    background: rgba(0, 123, 255, 0.15);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
}

.legend-color.weeds { background-color: #e74c3c; }
.legend-color.disease { background-color: #f39c12; }
.legend-color.pests { background-color: #9b59b6; }
.legend-color.trials { background-color: #3498db; }
.legend-color.insurance { background-color: #2ecc71; }
.legend-color.other { background-color: #95a5a6; }

.legend-label {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
}

.map-wrapper {
    flex: 1;
    position: relative;
}

.scouting-map {
    width: 100%;
    height: 100%;
}

/* Custom map pin styles */
.scouting-pin {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.scouting-pin.weeds { background-color: #e74c3c; }
.scouting-pin.disease { background-color: #f39c12; }
.scouting-pin.pests { background-color: #9b59b6; }
.scouting-pin.trials { background-color: #3498db; }
.scouting-pin.insurance { background-color: #2ecc71; }
.scouting-pin.other { background-color: #95a5a6; }

/* Mobile responsiveness */
@media (max-width: 768px) {
    .scouting-map-container {
        flex-direction: column;
        height: auto;
    }
    
    .map-legend {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .legend-items {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .legend-item {
        flex: 0 0 auto;
    }
    
    .map-wrapper {
        height: 400px;
    }
    
    .map-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .map-header h3 {
        text-align: center;
    }
}

/* Scouting Map Popup Styles */
.scouting-popup {
    font-family: inherit;
    max-width: 320px;
}

.scouting-popup h4 {
    margin: 0 0 0.75rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.scouting-popup p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.scouting-popup ul {
    margin: 0.25rem 0;
    padding-left: 1rem;
    font-size: 0.9rem;
}

.scouting-popup li {
    margin: 0.125rem 0;
}

.popup-type-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

.popup-type-header {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.popup-issue {
    font-size: 0.85rem;
    color: var(--text-color);
    margin: 0.25rem 0;
}

.popup-severity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    font-size: 0.8rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.scouting-popup .btn {
    margin-top: 0.75rem;
    width: 100%;
}

/* Override Leaflet popup styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-tip {
    background: white;
}

/* Contracts Page Styles */
.contracts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.contract-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.contract-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.contract-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.contract-number {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.contract-number i {
    color: var(--primary-color);
}

.contract-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.contract-status.pending {
    background: #ffc107;
    color: #000;
}

.contract-status.partial {
    background: #17a2b8;
    color: white;
}

.contract-status.completed {
    background: #28a745;
    color: white;
}

.contract-details {
    margin-bottom: 1rem;
}

.contract-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.contract-detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
}

.detail-value {
    font-weight: 500;
    color: #2c3e50;
}

.contract-progress {
    margin: 1rem 0;
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #00a0b0);
    transition: width 0.3s ease;
    border-radius: 12px;
}

.progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
}

.contract-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e9ecef;
}

.contract-value {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.value-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
}

.value-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.no-contracts {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.no-contracts i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

.contract-card {
    cursor: pointer;
}

.contract-delivery-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.contract-delivery-info h4 {
    margin: 0 0 0.75rem 0;
    color: #2c3e50;
    font-size: 1rem;
}

.delivery-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.delivery-stats .stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.delivery-stats .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
}

.delivery-stats .stat-value {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.contract-image-preview {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .contracts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .contract-card {
        padding: 1rem;
    }
    
    .delivery-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Force page header h2 styling - highest priority */
.page .page-header h2,
#fields .page-header h2,
#equipment .page-header h2,
#inventory .page-header h2,
#bins .page-header h2,
#tasks .page-header h2,
#timeTracker .page-header h2,
#calendar .page-header h2,
#employees .page-header h2,
#users .page-header h2,
#reports .page-header h2,
#scouting .page-header h2,
#weather .page-header h2,
#contracts .page-header h2 {
    margin: 0 !important;
    color: var(--text-color) !important;
    font-size: 1.2rem !important;
    font-weight: 500 !important;
}
