@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #0066CC;
    --primary-dark: #0052A3;
    --primary-light: #E6F0FF;
    --secondary: #FF6B6B;
    --secondary-dark: #E85555;
    --accent: #FFE66D;
    --accent-dark: #E6CC4D;
    --success: #28A745;
    --success-dark: #1E7E34;
    --warning: #FF9F43;
    --danger: #DC3545;
    --purple: #A55EEA;
    --pink: #FF6B9D;
    --dark: #2C3E50;
    --dark-secondary: #34495E;
    --dark-tertiary: #5D6D7E;
    --light: #F8F9FA;
    --white: #FFFFFF;
    --bg-light: #F0F2F5;
    --bg-card: #FFFFFF;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #495057;
    --gray-800: #343A40;
    --text-primary: #2C3E50;
    --text-secondary: #6C757D;
    --text-muted: #ADB5BD;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --border-color: #E9ECEF;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 102, 204, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 230, 109, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    z-index: 100;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 50px;
    padding: 0 10px;
}

.logo-icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--success) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 8px 25px rgba(0, 217, 255, 0.3);
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.logo-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 1px;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link:hover::before {
    height: 70%;
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(0, 102, 204, 0.2);
}

.nav-link.active::before {
    height: 70%;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.main-content {
    margin-left: 280px;
    padding: 30px 40px;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.header-title h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-title p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 5px;
}

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

.location-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-light);
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: 50px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.1;
    transform: translate(30%, -30%);
}

.stat-card:nth-child(1)::before { background: var(--primary); }
.stat-card:nth-child(2)::before { background: var(--secondary); }
.stat-card:nth-child(3)::before { background: var(--success); }
.stat-card:nth-child(4)::before { background: var(--accent); }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 18px;
}

.stat-card:nth-child(1) .stat-icon { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); }
.stat-card:nth-child(2) .stat-icon { background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%); }
.stat-card:nth-child(3) .stat-icon { background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%); }
.stat-card:nth-child(4) .stat-icon { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%); }

.stat-value {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 5px;
}

.stat-card:nth-child(1) .stat-value { color: var(--primary); }
.stat-card:nth-child(2) .stat-value { color: var(--secondary); }
.stat-card:nth-child(3) .stat-value { color: var(--success); }
.stat-card:nth-child(4) .stat-value { color: var(--accent); }

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.content-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-title span {
    font-size: 26px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-success {
    background: var(--success);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-info {
    background: #0ea5e9;
    color: var(--white);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.data-table tr:hover {
    background: var(--gray-100);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: rgba(0, 217, 255, 0.15);
    color: var(--primary);
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.badge-success {
    background: rgba(78, 205, 196, 0.15);
    color: var(--success);
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.badge-warning {
    background: rgba(255, 159, 67, 0.15);
    color: var(--warning);
    border: 1px solid rgba(255, 159, 67, 0.3);
}

.badge-danger {
    background: rgba(238, 90, 90, 0.15);
    color: var(--danger);
    border: 1px solid rgba(238, 90, 90, 0.3);
}

.badge-purple {
    background: rgba(165, 94, 234, 0.15);
    color: var(--purple);
    border: 1px solid rgba(165, 94, 234, 0.3);
}

.badge-pink {
    background: rgba(255, 107, 157, 0.15);
    color: var(--pink);
    border: 1px solid rgba(255, 107, 157, 0.3);
}

.action-btns {
    display: flex;
    gap: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23adb5bd' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 45px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 35px;
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    background: var(--gray-100);
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
}

.modal-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 10px;
    color: var(--gray-400);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--danger);
    color: var(--white);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.search-box {
    position: relative;
    max-width: 300px;
}

.search-box input {
    padding-left: 45px;
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.5;
}

.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    width: auto;
    min-width: 150px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.chart-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

.service-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px 20px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.service-card:nth-child(1) .service-name { color: #004499; }
.service-card:nth-child(2) .service-name { color: #1B5E20; }
.service-card:nth-child(3) .service-name { color: #E65100; }
.service-card:nth-child(4) .service-name { color: #6A1B9A; }
.service-card:nth-child(5) .service-name { color: #AD1457; }

.service-card:nth-child(1) .service-count { color: #0066CC; }
.service-card:nth-child(2) .service-count { color: #28A745; }
.service-card:nth-child(3) .service-count { color: #FF9800; }
.service-card:nth-child(4) .service-count { color: #9C27B0; }
.service-card:nth-child(5) .service-count { color: #E91E63; }

.service-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 15px;
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.service-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.service-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.service-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.service-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.service-count {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.service-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
}

.service-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.service-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
}

.service-count {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 5px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

.mobile-menu-btn {
    display: none;
}

/* Mobile styles handled by inline CSS in sidebar.php */
    
    .logo {
        justify-content: center;
    }
    
    .nav-link {
        justify-content: center;
        padding: 16px;
        min-height: 50px;
    }
    
    .nav-link span:not(.nav-icon) {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 75px 15px 30px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar .form-control {
        width: 100%;
    }
    
    .data-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table th, .data-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    .content-card {
        padding: 15px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .chart-grid {
        grid-template-columns: 1fr;
    }
    
    .service-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 70px 10px 20px;
    }
    
    .header-title h1 {
        font-size: 24px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .mobile-menu-btn {
        width: 50px;
        height: 40px;
        font-size: 12px;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-200);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

.animated {
    animation: fadeInUp 0.5s ease forwards;
}

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

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    color: var(--white);
    font-weight: 500;
    z-index: 2000;
    transform: translateX(400px);
    transition: var(--transition);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}

.notification.error {
    background: linear-gradient(135deg, var(--danger) 0%, #c44545 100%);
    box-shadow: 0 8px 25px rgba(238, 90, 90, 0.4);
}

.nav-user {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

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

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-logout:hover {
    background: #c44545;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}
