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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-form {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    color: #2c3e50;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #4a5568;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

#admin-page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #2d3748;
    color: white;
    padding: 20px;
    flex-shrink: 0;
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #4a5568;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li {
    margin-bottom: 8px;
}

.sidebar nav ul li a {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    color: #a0aec0;
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
    background: #4a5568;
    color: white;
}

.sidebar .user-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #4a5568;
}

.sidebar .user-info span {
    color: #a0aec0;
    font-size: 14px;
    display: block;
    margin-bottom: 10px;
}

.site-footer {
    background: #2d3748;
    color: white;
    padding: 24px 0;
    margin-top: 40px;
}

.site-footer .container {
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.footer-section {
    text-align: center;
}

.footer-site-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.footer-icp,
.footer-police {
    font-size: 13px;
    color: white;
    margin: 4px 0;
}

.footer-icp a,
.footer-police a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-icp a:hover,
.footer-police a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.footer-icp a::before,
.footer-police a::before {
    margin-right: 6px;
}

.footer-icp a::before {
    content: "📋";
}

.footer-police a::before {
    content: "🛡️";
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .footer-section {
        text-align: left;
    }
    
    .footer-section:last-child {
        text-align: right;
    }
}

.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: #718096;
}

.stat-card.total .stat-value { color: #667eea; }
.stat-card.pending .stat-value { color: #ed8936; }
.stat-card.accepted .stat-value { color: #9f7aea; }
.stat-card.scheduled .stat-value { color: #ed64a6; }
.stat-card.processing .stat-value { color: #3182ce; }
.stat-card.completed .stat-value { color: #38a169; }
.stat-card.rated .stat-value { color: #48bb78; }
.stat-card.cancelled .stat-value { color: #fc8181; }

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

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

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

table th {
    background: #f7fafc;
    font-weight: 600;
    font-size: 13px;
    color: #4a5568;
}

table tr:hover {
    background: #f7fafc;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending { background: #feebc8; color: #744210; }
.status-assigned { background: #e6fffa; color: #234e52; }
.status-repairing { background: #ebf8ff; color: #1a365d; }
.status-completed { background: #c6f6d5; color: #22543d; }
.status-cancelled { background: #fed7d7; color: #742a2a; }

.status-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.status-filter button {
    flex: 0 0 auto;
    min-width: 80px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.status-filter button:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f0f4ff;
}

.status-filter button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-top: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.filter-summary strong {
    color: #ffd700;
    font-size: 18px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

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

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #9ca3af;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.order-detail-content {
    padding: 0;
}

.order-header-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.order-header-section .order-number {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.order-header-section .order-number span:first-child {
    font-size: 18px;
    font-weight: 600;
}

.order-header-section .order-date {
    font-size: 13px;
    opacity: 0.9;
}

.order-status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: white;
    color: #667eea;
}

.order-detail-content .info-section {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.order-detail-content .info-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.order-detail-content .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.order-detail-content .info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-detail-content .info-item .label {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.order-detail-content .info-item .value {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.order-detail-content .info-item .empty {
    color: #a0aec0;
    font-style: italic;
}

.order-detail-content .worker-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: white;
    border-radius: 8px;
}

.order-detail-content .worker-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.order-detail-content .worker-details {
    flex: 1;
}

.order-detail-content .worker-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.order-detail-content .worker-role {
    font-size: 13px;
    color: #718096;
}

.order-detail-content .rating-section {
    padding: 16px;
    background: linear-gradient(135deg, #f6e05e 0%, #faf089 100%);
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.order-detail-content .rating-score {
    font-size: 32px;
    font-weight: 700;
    color: #744210;
    margin-bottom: 8px;
}

.order-detail-content .rating-stars {
    font-size: 24px;
    margin-bottom: 8px;
}

.order-detail-content .rating-content {
    font-size: 14px;
    color: #744210;
    font-style: italic;
}

.order-detail-content .service-items-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-detail-content .service-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.order-detail-content .service-item-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-detail-content .service-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

.order-detail-content .service-item-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    width: fit-content;
}

.order-detail-content .service-item-type.service {
    background: #bee3f8;
    color: #2b6cb0;
}

.order-detail-content .service-item-type.repair {
    background: #feebc8;
    color: #744210;
}

.order-detail-content .service-item-type.maintenance {
    background: #c6f6d5;
    color: #22543d;
}

.order-detail-content .service-item-cost {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
}

.order-detail-content .action-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.order-detail-content .action-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.order-detail-content .action-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.order-detail-content .action-btn.secondary:hover {
    background: #cbd5e0;
}

.site-info-section {
    margin-bottom: 24px;
}

.site-section-header {
    margin-bottom: 12px;
}

.site-section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    padding-left: 12px;
    border-left: 4px solid #667eea;
}

.site-info-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    max-width: 800px;
}

.site-info-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-info-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.site-info-title {
    flex: 1;
}

.site-info-title h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.site-info-title .site-domain {
    font-size: 14px;
    opacity: 0.9;
    color: rgba(255,255,255,0.9);
}

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

.site-info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-info-label {
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

.site-info-value {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 500;
    padding: 10px 14px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.site-info-full-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 24px 16px;
}

.site-info-actions {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
}

@media (max-width: 768px) {
    .site-info-header {
        flex-direction: column;
        text-align: center;
    }
    
    .site-info-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .site-info-actions {
        justify-content: center;
    }
    
    #admin-page {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .stat-value {
        font-size: 28px;
    }
    
    .status-filter button {
        flex: 1 1 calc(25% - 8px);
        min-width: calc(25% - 8px);
        padding: 12px 8px;
        font-size: 14px;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-bar input {
        width: 100%;
    }
    
    .search-bar button {
        width: 100%;
    }
    
    .filter-summary {
        flex-direction: column;
        text-align: center;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .status-filter button {
        flex: 1 1 calc(50% - 8px);
        min-width: calc(50% - 8px);
    }
}