:root {
    --bg: #f5f5f7;
    --card-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #007aff;
    --success: #34c759;
    --danger: #ff3b30;
    --warning: #ffcc00;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding: 30px;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    background: linear-gradient(45deg, #007aff, #5856d6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-item {
    display: block;
    padding: 12px 15px;
    margin-bottom: 5px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent);
}

.nav-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main {
    margin-left: 260px;
    padding: 40px;
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
}

.company-select {
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

/* Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid white;
    border-radius: 24px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    margin-bottom: 24px;
}

.glass-card:hover {
    transform: translateY(-3px);
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.col-3 {
    grid-column: span 3;
}

.col-4 {
    grid-column: span 4;
}

.col-6 {
    grid-column: span 6;
}

.col-8 {
    grid-column: span 8;
}

.col-12 {
    grid-column: span 12;
}

/* KPIs */
.kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-val {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-trend {
    font-size: 0.9rem;
    margin-top: 5px;
    font-weight: 500;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

/* Tables */
table.dataTable {
    width: 100% !important;
    border-collapse: collapse !important;
}

table.dataTable thead th {
    text-align: left;
    padding: 15px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

table.dataTable tbody td {
    padding: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.95rem;
}

.status-dot {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.dot-green {
    background: var(--success);
}

.dot-red {
    background: var(--danger);
}

/* Buttons */
.btn-check {
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: #ddd;
    transition: all 0.2s;
}

.btn-check.paid {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.btn-check:hover {
    border-color: var(--success);
    color: var(--success);
}

.btn-check.paid:hover {
    color: white;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* Upload Zone */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 20px;
    padding: 60px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--accent);
    background: rgba(0, 122, 255, 0.05);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-A {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-B {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-C {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pill-green {
    background: rgba(52, 199, 89, 0.2);
    color: #248a3d;
}

.pill-yellow {
    background: rgba(255, 204, 0, 0.2);
    color: #b38f00;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 16px;
    z-index: 1;
}

@media(max-width: 1200px) {

    .col-3,
    .col-4,
    .col-6,
    .col-8 {
        grid-column: span 12;
    }

    .sidebar {
        width: 80px;
        padding: 20px 10px;
    }

    .nav-item span {
        display: none;
    }

    .main {
        margin-left: 80px;
    }
}

.status-select {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.status-select:hover {
    background: rgba(0, 0, 0, 0.05);
}

.status-select:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.05);
}