:root {
    /* Farm Management Module Color Scheme */
    --primary-color: #2d5016;      /* Deep forest green */
    --secondary-color: #5a9216;    /* Fresh grass green */
    --accent-color: #d4691a;       /* Warm orange/brown */
    --success-color: #27ae60;      /* Healthy green */
    --warning-color: #f39c12;      /* Alert yellow/orange */
    --danger-color: #c0392b;       /* Critical red */
    --info-color: #3498db;         /* Information blue */
    --milk-color: #e8f4f8;         /* Light milk blue */
    --cow-color: #8b4513;          /* Saddle brown */
    --light-bg: #f5f7f0;           /* Light cream/green */
    --dark-bg: #3d5a27;            /* Dark green */
    --text-color: #2c3e50;
    --light-text: #7f8c8d;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #5a9216 0%, #2d5016 100%);
    min-height: 100vh;
    color: var(--text-color);
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h1 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 300;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-control {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 20px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.password-toggle:hover {
    opacity: 1;
}

.password-toggle:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--accent-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #c0392b;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: var(--light-bg);
}

/* Sidebar Container - Preserve space to prevent layout shift */
#sidebar-container {
    width: 280px;
    flex-shrink: 0;
    transition: var(--transition);
    background: var(--primary-color);
    min-height: 100vh;
}

#sidebar-container:empty {
    /* Show subtle loading state when empty, but preserve the space */
    background: linear-gradient(90deg, var(--primary-color) 0%, rgba(45, 80, 22, 0.8) 50%, var(--primary-color) 100%);
    animation: sidebarLoading 1.5s ease-in-out infinite;
}

@keyframes sidebarLoading {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.9;
    }
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--primary-color);
    color: var(--white);
    flex-shrink: 0;
    transition: var(--transition);
    /* Ensure sidebar fills full viewport height even if content is short */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 300;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav a {
    display: block;
    padding: 15px 20px;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    padding-left: 30px;
}

.sidebar-nav a.has-submenu::after {
    content: '▼';
    position: absolute;
    right: 20px;
    font-size: 12px;
    transition: var(--transition);
}

.sidebar-nav a.has-submenu.collapsed::after {
    transform: rotate(-90deg);
}

.submenu {
    background: rgba(0,0,0,0.2);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.submenu.show {
    max-height: 200px;
}

.submenu a {
    padding-left: 40px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.submenu a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
    padding-left: 50px;
}

/* Disabled sidebar links */
.sidebar-nav a.disabled,
.submenu a.disabled {
    color: rgba(255,255,255,0.5) !important;
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 0;
    overflow-x: hidden;
}

.header {
    background: var(--white);
    padding: 20px 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: var(--primary-color);
    font-weight: 300;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-selector-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.language-selector-header label {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

.language-selector-header select {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: var(--white);
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    min-width: 110px;
    transition: all 0.2s ease;
}

.language-selector-header select:hover {
    border-color: var(--secondary-color);
    background: #fafafa;
}

.language-selector-header select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(90, 146, 22, 0.1);
}

.content {
    padding: 30px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--secondary-color);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.dashboard-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 500;
}

.dashboard-card .value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.dashboard-card .label {
    color: var(--light-text);
    font-size: 14px;
}

.dashboard-card.success::before { background: var(--success-color); }
.dashboard-card.warning::before { background: var(--warning-color); }
.dashboard-card.danger::before { background: var(--danger-color); }
.dashboard-card.info::before { background: var(--info-color); }
.dashboard-card.milk::before { background: var(--info-color); }
.dashboard-card.cow::before { background: var(--cow-color); }

.dashboard-card.success .value { color: var(--success-color); }
.dashboard-card.warning .value { color: var(--warning-color); }
.dashboard-card.danger .value { color: var(--danger-color); }
.dashboard-card.info .value { color: var(--info-color); }
.dashboard-card.milk .value { color: var(--info-color); }
.dashboard-card.cow .value { color: var(--cow-color); }
.dashboard-card.weather::before { background: var(--info-color); }
.dashboard-card.weather .value { color: var(--info-color); }
.dashboard-card.weather {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 210px;
}
.weather-current {
    display: flex;
    gap: 12px;
    align-items: center;
}
.weather-icon {
    font-size: 42px;
    line-height: 42px;
}
.weather-metrics {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.weather-temp {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--secondary-color);
}
.weather-humidity, .weather-condition { font-size: 0.85rem; color: var(--light-text); }
.weather-forecast {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.forecast-item {
    background: var(--light-bg);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}
.forecast-item .f-icon { font-size: 18px; }
.forecast-item .f-temp { font-weight: 600; }
.weather-thin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
}
.dashboard-card.weather.thin {
    padding: 8px 10px;
    min-height: 105px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}
.dashboard-card.weather.thin .thin-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--light-text);
}
.dashboard-card.weather.thin .thin-icon {
    font-size: 22px;
    line-height: 22px;
}
.dashboard-card.weather.thin .thin-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-align: center;
    word-break: break-word;
}
.dashboard-card.weather.thin.forecast .thin-value { color: var(--info-color); }

/* Disabled/Mute state for cards */
.dashboard-card.disabled {
    background: #f3f4f6; /* light gray */
    color: #9aa0a6;      /* muted text */
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    cursor: not-allowed;
    filter: grayscale(40%);
    pointer-events: none; /* make the whole card non-interactive */
}

.dashboard-card.disabled::before {
    background: #c0c4cc; /* neutral gray border strip */
}

.dashboard-card.disabled h3 {
    color: #6b7280;
}

.dashboard-card.disabled .value,
.dashboard-card.disabled .label {
    color: #9aa0a6 !important; /* override success/info/warning colors */
}

.dashboard-card.disabled:hover {
    transform: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Events Log */
.events-container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.events-header {
    padding: 20px;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.events-list {
    max-height: 400px;
    overflow-y: auto;
}

.event-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.event-item:hover {
    background: var(--light-bg);
}

.event-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-icon.info { background: var(--info-color); }
.event-icon.success { background: var(--success-color); }
.event-icon.warning { background: var(--warning-color); }
.event-icon.error { background: var(--accent-color); }

.event-content {
    flex: 1;
}

.event-message {
    font-weight: 500;
    margin-bottom: 5px;
}

.event-meta {
    font-size: 12px;
    color: var(--light-text);
}

/* Building Selector */
.building-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.building-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.building-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.building-card.selected {
    border: 2px solid var(--secondary-color);
}

.building-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: var(--white);
}

.building-body {
    padding: 20px;
}

.building-name {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.building-address {
    font-size: 14px;
    opacity: 0.9;
}

.building-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
}

.status-online {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.status-offline {
    background: rgba(231, 76, 60, 0.1);
    color: var(--accent-color);
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    border-color: var(--info-color);
    color: var(--info-color);
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: -100%;
        z-index: 1000;
        height: 100vh;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .main-content {
        width: 100%;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .content {
        padding: 20px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .building-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .header .user-info {
        display: none;
    }
    
    .main-content {
        width: 100%;
    }
    
    .dashboard-card {
        break-inside: avoid;
    }
}

/* Valve status box (diagnostic details) */
.valve-status {
    margin-top: 16px;
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
}
.valve-status h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}
.valve-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(70px, 1fr));
    gap: 10px;
}
.valve-chip {
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    box-shadow: var(--shadow);
}
.valve-chip.ok {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}
.valve-chip.err {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

/* Farm Management Module Specific Styles */

/* Cow Card/Item */
.cow-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 15px;
    transition: var(--transition);
    border-left: 4px solid var(--secondary-color);
}

.cow-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.cow-card.alert {
    border-left-color: var(--danger-color);
}

.cow-card.warning {
    border-left-color: var(--warning-color);
}

.cow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cow-ear-tag {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.cow-status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.cow-status-badge.healthy {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.cow-status-badge.attention {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

.cow-status-badge.critical {
    background: rgba(192, 57, 43, 0.1);
    color: var(--danger-color);
}

.cow-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.cow-metric {
    display: flex;
    flex-direction: column;
}

.cow-metric-label {
    font-size: 12px;
    color: var(--light-text);
    margin-bottom: 4px;
}

.cow-metric-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

/* Filter Panel */
.filter-panel {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.filter-group select,
.filter-group input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Cow Search Styles */
.cow-search-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

.cow-search-input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 14px;
    margin-bottom: 5px;
    background: var(--white);
    transition: var(--transition);
}

.cow-search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: #fafafa;
}

.cow-search-input::placeholder {
    color: #bbb;
}

/* Chart Container */
.chart-container {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-bg);
}

.chart-title {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--primary-color);
}

.chart-actions {
    display: flex;
    gap: 10px;
}

/* Table Styles */
.data-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--primary-color);
    color: var(--white);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 500;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.data-table tbody tr:hover {
    background: var(--light-bg);
    cursor: pointer;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--secondary-color);
    background: var(--white);
    color: var(--secondary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    background: var(--secondary-color);
    color: var(--white);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    padding: 8px 16px;
    color: var(--text-color);
    font-weight: 500;
}

/* Action Buttons */
.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--dark-bg);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #229954;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* Stats Grid for smaller metrics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-box {
    background: var(--white);
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: var(--light-text);
}

/* Diagnostics Table Styles */
.diagnostics-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.diagnostics-filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.diag-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diag-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diag-filter-group select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
}

.diag-filter-group select:hover {
    border-color: var(--secondary-color);
    background: #fafafa;
}

.diag-filter-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(90, 146, 22, 0.1);
}

.diagnostics-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.diag-stat {
    font-size: 13px;
    color: var(--light-text);
    font-weight: 500;
}

.diag-stat strong {
    color: var(--primary-color);
    font-weight: 700;
}

.diagnostics-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.diagnostics-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a4a11 100%);
    color: var(--white);
    font-weight: 600;
}

.diagnostics-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
}

.diagnostics-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: var(--text-color);
}

.diagnostics-table tbody tr {
    transition: var(--transition);
}

.diagnostics-table tbody tr:hover {
    background: #f9faf8;
    box-shadow: inset 0 0 0 1px #e8e8e8;
}

.diagnostics-table tbody tr:last-child td {
    border-bottom: none;
}

.diagnostics-table tbody tr td:nth-child(2) {
    font-weight: 600;
    color: var(--primary-color);
}

.diagnostics-table tbody tr td:nth-child(3) {
    color: var(--secondary-color);
    font-weight: 500;
}

.diagnostics-table tbody tr td:nth-child(4) {
    background: rgba(212, 105, 26, 0.08);
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    color: var(--accent-color);
}

/* Responsive adjustments for farm pages */
@media (max-width: 992px) {
    .cow-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .cow-metrics {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

