:root {
    --police-bg: #0f172a;
    --police-card-bg: rgba(30, 41, 59, 0.7);
    --police-accent: #06b6d4; /* Cyan */
    --police-accent-dim: rgba(6, 182, 212, 0.2);
    --police-text: #f8fafc;
    --police-text-muted: #94a3b8;
    --police-border: rgba(6, 182, 212, 0.3);
    --police-danger: #ef4444;
    --police-warning: #f59e0b;
    --police-success: #10b981;
}

.rp-police-app {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--police-bg);
    z-index: 1000;
    display: flex;
    font-family: 'Poppins', sans-serif;
    color: var(--police-text);
}

.rp-police-app.hidden {
    display: none;
}

/* Sidebar */
.rp-police-sidebar {
    width: 260px;
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid var(--police-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.rp-police-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--police-border);
}

.rp-police-brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--police-accent), #0891b2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 0 15px var(--police-accent-dim);
}

.rp-police-brand-info h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--police-accent);
}

.rp-police-brand-info span {
    font-size: 0.75rem;
    color: var(--police-text-muted);
}

.rp-police-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.rp-police-tab {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--police-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 0.95rem;
}

.rp-police-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--police-text);
}

.rp-police-tab.active {
    background: var(--police-accent-dim);
    border-color: var(--police-border);
    color: var(--police-accent);
    font-weight: 600;
}

.rp-police-tab i {
    width: 20px;
    text-align: center;
}

.rp-police-user {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--police-border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rp-police-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--police-card-bg);
    border: 2px solid var(--police-border);
    overflow: hidden;
}

.rp-police-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rp-police-user-info div:first-child {
    font-weight: 600;
    font-size: 0.9rem;
}

.rp-police-user-info div:last-child {
    font-size: 0.75rem;
    color: var(--police-text-muted);
}

/* Main Content */
.rp-police-main {
    flex: 1;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.1), transparent 40%),
                radial-gradient(circle at bottom left, rgba(15, 23, 42, 1), transparent 40%);
    padding: 2rem;
}

.rp-police-panel {
    max-width: 1600px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
}

.rp-police-panel.hidden {
    display: none;
}

.rp-police-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rp-police-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rp-police-header h1 i {
    color: var(--police-accent);
}

.rp-police-header p {
    color: var(--police-text-muted);
    margin: 0.5rem 0 0 0;
}

/* Dashboard Grid */
.rp-police-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 1.5rem;
}

.rp-police-card {
    background: var(--police-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--police-accent);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.rp-police-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.rp-card-agent {
    grid-column: span 1;
    grid-row: span 2;
}

.rp-card-alerts {
    grid-column: span 2;
    grid-row: span 2;
}

.rp-card-actions {
    grid-column: span 1;
    grid-row: span 2;
}

/* Card Elements */
.rp-police-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.rp-police-card-title {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: var(--police-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rp-agent-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.rp-status-active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--police-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.rp-agent-profile {
    text-align: center;
}

.rp-agent-photo {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 3px solid var(--police-accent);
    padding: 3px;
    background: rgba(6, 182, 212, 0.1);
}

.rp-agent-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.rp-agent-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.rp-agent-grade {
    color: var(--police-accent);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.rp-agent-details {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rp-agent-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rp-agent-label {
    color: var(--police-text-muted);
}

/* Stats */
.rp-stat-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rp-stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--police-accent);
}

.rp-stat-content {
    display: flex;
    flex-direction: column;
}

.rp-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.rp-stat-label {
    font-size: 0.8rem;
    color: var(--police-text-muted);
}

/* Alerts */
.rp-alert-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.rp-alert-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 4px solid transparent;
}

.rp-alert-high { border-left-color: var(--police-danger); }
.rp-alert-medium { border-left-color: var(--police-warning); }
.rp-alert-low { border-left-color: var(--police-success); }

.rp-alert-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rp-alert-high .rp-alert-icon { color: var(--police-danger); }
.rp-alert-medium .rp-alert-icon { color: var(--police-warning); }
.rp-alert-low .rp-alert-icon { color: var(--police-success); }

.rp-alert-content {
    flex: 1;
}

.rp-alert-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.rp-alert-desc {
    display: block;
    font-size: 0.85rem;
    color: var(--police-text-muted);
    margin-bottom: 0.5rem;
}

.rp-alert-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--police-text-muted);
    opacity: 0.7;
}

/* Actions */
.rp-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--police-text);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.rp-action-btn:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--police-accent);
    color: var(--police-accent);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Search Bar */
.rp-search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--police-card-bg);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--police-border);
}

.rp-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--police-text);
    font-size: 1.1rem;
    padding: 0.5rem;
    outline: none;
}

.rp-search-btn {
    background: var(--police-accent);
    color: var(--police-bg);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rp-search-btn:hover {
    background: #0891b2;
    transform: translateY(-2px);
}

/* Citizen Results */
.rp-citizen-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.rp-citizen-card {
    background: var(--police-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
}

.rp-citizen-card:hover {
    transform: translateY(-5px);
    border-color: var(--police-accent);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.rp-citizen-header {
    height: 100px;
    background: linear-gradient(to right, #0f172a, #1e293b);
    position: relative;
}

.rp-citizen-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--police-accent);
}

.rp-citizen-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--police-card-bg);
    position: absolute;
    bottom: -40px;
    left: 20px;
    overflow: hidden;
    background: #334155;
}

.rp-citizen-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rp-citizen-body {
    padding: 3rem 1.5rem 1.5rem 1.5rem;
}

.rp-citizen-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--police-text);
}

.rp-citizen-id {
    font-size: 0.85rem;
    color: var(--police-text-muted);
    margin-bottom: 1rem;
    display: block;
}

.rp-citizen-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rp-citizen-info-item {
    display: flex;
    flex-direction: column;
}

.rp-citizen-label {
    font-size: 0.75rem;
    color: var(--police-text-muted);
    text-transform: uppercase;
}

.rp-citizen-value {
    font-size: 0.95rem;
    font-weight: 500;
}

.rp-citizen-actions {
    display: flex;
    gap: 0.5rem;
}

.rp-citizen-btn {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid var(--police-border);
    background: transparent;
    color: var(--police-text);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.rp-citizen-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--police-accent);
    border-color: var(--police-accent);
}

.rp-citizen-btn.primary {
    background: var(--police-accent);
    color: var(--police-bg);
    border: none;
}

.rp-citizen-btn.primary:hover {
    background: #0891b2;
    color: white;
}

/* Responsive */
@media (max-width: 1200px) {
    .rp-police-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rp-card-agent { grid-column: span 2; grid-row: auto; }
    .rp-card-alerts { grid-column: span 2; }
    .rp-card-actions { grid-column: span 2; }
}

@media (max-width: 768px) {
    .rp-police-app {
        flex-direction: column;
    }

    .rp-police-sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
    }

    .rp-police-brand {
        margin-bottom: 0;
        border-bottom: none;
        padding-bottom: 0;
        margin-right: 2rem;
    }

    .rp-police-nav {
        flex-direction: row;
    }

    .rp-police-user {
        display: none;
    }
    
    .rp-police-grid {
        grid-template-columns: 1fr;
    }
    
    .rp-card-agent, .rp-card-alerts, .rp-card-actions {
        grid-column: span 1;
    }
}