:root {
    --primary-blue: #003366;
    --secondary-blue: #0055a5;
    --light-blue: #e6f0ff;
    --dark-blue: #001a33;
    --white: #ffffff;
    --gray-light: #f4f7f6;
    --gray-text: #666;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-image: url('../img/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #333;
}

.app-container {
    display: flex;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
}

.btn-back {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    width: fit-content;
}

.btn-back:hover {
    background: var(--secondary-blue);
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 20px 0;
    transition: all 0.3s;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-header img {
    max-width: 150px;
}

.sidebar-menu {
    list-style: none;
    margin-top: 20px;
}

.sidebar-menu li {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.sidebar-menu li i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.sidebar-menu li:hover, .sidebar-menu li.active {
    background-color: var(--secondary-blue);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-x: hidden;
}

/* Header */
.top-header {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 5px;
    margin-bottom: 20px;
}

.header-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-actions i {
    cursor: pointer;
}

/* Cards & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--gray-text);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-sub {
    font-size: 0.8rem;
    margin-top: 5px;
}

.stat-sub.up { color: var(--success); }
.stat-sub.down { color: var(--danger); }

/* Charts & Map Area */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

.content-card {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.content-card h2 {
    font-size: 1rem;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Map Mock */
.map-placeholder {
    background-color: #e0e0e0;
    height: 300px;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.map-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

th {
    background-color: var(--gray-light);
    color: var(--gray-text);
    font-weight: 600;
}

.badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-danger { background-color: #ffdce0; color: var(--danger); }
.badge-warning { background-color: #fff3cd; color: #856404; }
.badge-success { background-color: #d4edda; color: var(--success); }

/* Mobile View Styles */
.mobile-app {
    max-width: 450px;
    margin: 0 auto;
    background: rgba(0, 51, 102, 0.9);
    backdrop-filter: blur(10px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.mobile-header {
    padding: 25px 20px;
    text-align: center;
    color: white;
}

.mobile-content {
    background: white;
    flex: 1;
    border-radius: 30px 30px 0 0;
    padding: 25px;
}

.qr-scanner-box {
    border: 2px dashed #ccc;
    height: 250px;
    border-radius: 15px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.btn-mobile {
    padding: 15px;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.btn-green { background-color: var(--success); }
.btn-red { background-color: var(--danger); }

/* Collector Mobile Specific */
.alert-card {
    border-left: 5px solid var(--danger);
    background: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: var(--danger);
    border-radius: 4px;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .sidebar {
        display: none; /* In a real app we would use a hamburger menu */
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
