:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.4rem;
}

.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background-color: #fff;
    width: 250px;
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.card-dashboard {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.card-dashboard:hover {
    transform: translateY(-5px);
}

.card-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success-color), #146c43);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning-color), #cc9a06);
}

.stat-card.info {
    background: linear-gradient(135deg, var(--info-color), #087990);
}

.stat-card.danger {
    background: linear-gradient(135deg, var(--danger-color), #b02a37);
}

.form-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.form-section h5 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.table-responsive {
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

.datatable {
    min-width: 600px;
}

.datatable th,
.datatable td {
    white-space: nowrap;
    padding: 12px 15px;
}

.datatable .btn-group {
    display: flex;
    flex-wrap: nowrap;
}

.datatable .btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.datatable th:last-child,
.datatable td:last-child {
    position: sticky;
    right: 0;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    z-index: 1;
}

.datatable thead th:last-child {
    background: var(--primary-color);
}

.datatable tbody tr:nth-child(odd) td:last-child {
    background: #f8f9fa;
}

.datatable tbody tr:hover td:last-child {
    background: #e9ecef;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

.value-valid {
    background-color: #d1e7dd !important;
}

.value-warning {
    background-color: #fff3cd !important;
}

.value-error {
    background-color: #f8d7da !important;
}

.value-negative {
    color: var(--danger-color);
    font-weight: bold;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-width: 400px;
    width: 100%;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header i {
    font-size: 4rem;
    margin-bottom: 15px;
}

.login-body {
    padding: 30px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    border-radius: 25px;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.status-online {
    background-color: var(--success-color);
    color: white;
}

.status-offline {
    background-color: var(--secondary-color);
    color: white;
}

.status-pending {
    background-color: var(--warning-color);
    color: black;
}

.quick-action-btn {
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    transform: scale(1.05);
}

.weather-icon {
    font-size: 2.5rem;
    margin-right: 15px;
}

.alert-custom {
    border-radius: 10px;
    border: none;
}

.data-entry-table input {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 8px;
    width: 100%;
    text-align: center;
}

.data-entry-table input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

.data-entry-table input.is-invalid {
    border-color: var(--danger-color);
    background-color: #fff5f5;
}

.data-entry-table input.is-valid {
    border-color: var(--success-color);
    background-color: #f0fff4;
}

.export-buttons .btn {
    margin-right: 10px;
    margin-bottom: 10px;
}

@media print {
    .navbar, .sidebar, .no-print {
        display: none !important;
    }
    .container-fluid {
        margin: 0 !important;
        padding: 0 !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .stat-card .card-icon {
        font-size: 2rem;
    }
    .data-entry-table {
        font-size: 0.85rem;
    }
    .form-section {
        padding: 15px;
    }
    .form-section h5 {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .data-entry-table {
        display: block;
        width: 100%;
    }
    .data-entry-table thead {
        display: none;
    }
    .data-entry-table tbody,
    .data-entry-table tr {
        display: block;
        width: 100%;
    }
    .data-entry-table tr {
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        padding: 10px;
        background: #f8f9fa;
    }
    .data-entry-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 5px;
        border: none;
        border-bottom: 1px solid #eee;
    }
    .data-entry-table td:last-child {
        border-bottom: none;
    }
    .data-entry-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary-color);
        flex: 0 0 40%;
        text-align: left;
        font-size: 0.85rem;
    }
    .data-entry-table td input {
        flex: 0 0 55%;
        text-align: right;
    }
    .data-entry-table td strong {
        display: none;
    }
    .btn-lg {
        width: 100%;
        padding: 15px;
    }
    .form-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .scroll-hint {
        display: block;
        text-align: center;
        padding: 8px;
        background: linear-gradient(90deg, transparent, rgba(13, 110, 253, 0.1), transparent);
        color: var(--primary-color);
        font-size: 0.85rem;
        margin-bottom: 10px;
        border-radius: 5px;
    }
    .scroll-hint i {
        animation: scrollHint 1.5s ease-in-out infinite;
    }
    @keyframes scrollHint {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(10px); }
    }
    
    .card-dashboard .card-body {
        padding: 15px;
    }
    
    .datatable {
        min-width: 500px;
    }
    .datatable th,
    .datatable td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    .datatable th:last-child,
    .datatable td:last-child {
        min-width: 100px;
    }
}

.scroll-hint {
    display: none;
}

.footer {
    margin-top: auto;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.gps-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    background: var(--success-color);
    color: white;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

.gps-indicator.error {
    background: var(--danger-color);
}
