/* POKO Admin Dashboard - Modern Dark Theme */
:root {
    --bg: #0d0f14;
    --bg2: #13161e;
    --bg3: #1a1e2a;
    --border: #252836;
    --text: #e8eaf0;
    --text-muted: #6b7280;
    --accent: #4f8ef7;
    --accent2: #7c3aed;
    --green: #22c55e;
    --orange: #f97316;
    --red: #ef4444;
    --yellow: #eab308;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

/* ─── LOGIN ─────────────────────────────── */
.login-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(79,142,247,0.08) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 20%, rgba(124,58,237,0.08) 0%, transparent 60%);
}

.login-wrapper {
    width: 100%;
    max-width: 380px;
    padding: 16px 20px;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.login-brand h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

.login-brand h1 span { color: var(--accent); }

.login-brand p {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 13px;
}

.login-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
}

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

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
}

.form-group textarea { resize: vertical; }
.form-group select { cursor: pointer; }

.btn-login {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 8px;
}

.btn-login:hover { opacity: 0.9; transform: translateY(-1px); }

.alert-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* ─── DASHBOARD LAYOUT ─────────────────── */
.dashboard-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

/* ─── SIDEBAR ───────────────────────────── */
.sidebar {
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    font-family: 'DM Sans', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: var(--text);
}

.sidebar-brand .brand-icon { font-size: 20px; }

.sidebar-nav {
    padding: 12px 10px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg3);
    color: var(--text);
}

.nav-item.active {
    background: rgba(79,142,247,0.12);
    color: var(--accent);
}

.nav-icon { font-size: 16px; opacity: 0.8; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.logout-btn {
    color: var(--red);
    text-decoration: none;
    font-size: 12px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.logout-btn:hover { opacity: 1; }

/* ─── MAIN CONTENT ──────────────────────── */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

.topbar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.content-area {
    padding: 24px 28px;
    flex: 1;
    overflow-y: auto;
}

/* ─── STAT CARDS ────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
}

.accent-blue::before { background: var(--accent); }
.accent-orange::before { background: var(--orange); }
.accent-green::before { background: var(--green); }
.accent-purple::before { background: var(--accent2); }

.stat-icon { font-size: 20px; margin-bottom: 8px; }

.stat-value {
    font-family: 'DM Sans', sans-serif;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 4px;
}

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

.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── DASHBOARD GRID ────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.card-header {
    margin-bottom: 16px;
}

.card-header h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* City bars */
.city-list { display: flex; flex-direction: column; gap: 10px; }

.city-row {
    display: grid;
    grid-template-columns: 120px 1fr 60px;
    align-items: center;
    gap: 10px;
}

.city-name { font-size: 13px; font-weight: 500; }

.city-bar-wrap {
    background: var(--bg3);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}

.city-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.city-followers {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

/* Status list */
.status-list { display: flex; flex-direction: column; gap: 10px; }

.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.ok { background: var(--green); }
.status-indicator.warn { background: var(--yellow); }
.status-indicator.err { background: var(--red); }

.status-value { margin-left: auto; color: var(--text-muted); font-size: 12px; }

/* Quick actions */
.quick-actions { display: flex; flex-direction: column; gap: 8px; }

.quick-btn {
    display: block;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
}

.quick-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── TOOLBAR ───────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.toolbar-info { display: flex; align-items: center; gap: 8px; }

.text-muted { color: var(--text-muted); font-size: 13px; }

.search-input {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    width: 280px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--accent); }

.btn-search {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-search:hover { opacity: 0.85; }

.btn-clear {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.btn-clear:hover { color: var(--red); }

.btn-refresh {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-refresh:hover { border-color: var(--accent); color: var(--accent); }

/* ─── BADGES & PILLS ────────────────────── */
.badge {
    background: rgba(79,142,247,0.15);
    color: var(--accent);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
}

.id-badge {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.type-stationary { background: rgba(79,142,247,0.15); color: #60a5fa; }
.type-mobile { background: rgba(249,115,22,0.15); color: #fb923c; }
.type-police { background: rgba(124,58,237,0.15); color: #a78bfa; }
.type-accident { background: rgba(239,68,68,0.15); color: #f87171; }
.type-jam { background: rgba(234,179,8,0.15); color: #facc15; }
.type-unknown { background: var(--bg3); color: var(--text-muted); }

.status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-pill.active { background: rgba(34,197,94,0.15); color: #4ade80; }
.status-pill.inactive { background: rgba(239,68,68,0.1); color: #f87171; }

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.role-1 { background: var(--bg3); color: var(--text-muted); }
.role-2 { background: rgba(234,179,8,0.15); color: #facc15; }
.role-3 { background: rgba(249,115,22,0.15); color: #fb923c; }
.role-4 { background: rgba(239,68,68,0.15); color: #f87171; }

/* ─── TABLE ─────────────────────────────── */
.table-wrap {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    overflow-x: auto;
}

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

.data-table th {
    background: var(--bg3);
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

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

.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.row-inactive td { opacity: 0.5; }

.td-address { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-desc { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.td-email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }

/* ─── ACTION BUTTONS ────────────────────── */
.action-btns { display: flex; gap: 4px; }

.btn-sm {
    border: none;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
    line-height: 1;
}

.btn-sm:hover { opacity: 0.8; }

.btn-edit { background: rgba(79,142,247,0.15); color: #60a5fa; }
.btn-success { background: rgba(34,197,94,0.15); color: #4ade80; }
.btn-warning { background: rgba(234,179,8,0.15); color: #facc15; }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; }

/* ─── REPORT CARDS ──────────────────────── */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

.report-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s;
}

.report-card:hover { transform: translateY(-2px); }

.report-header {
    padding: 12px 14px;
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-id { font-family: monospace; font-size: 12px; color: var(--text-muted); }
.report-time { margin-left: auto; font-size: 11px; color: var(--text-muted); }

.report-body { padding: 14px; }
.report-address { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.report-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.4; }
.report-speed { font-size: 12px; color: var(--accent); margin-bottom: 8px; }

.report-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.report-actions {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.btn-success, .btn-warning, .btn-danger {
    padding: 7px 12px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-success { background: rgba(34,197,94,0.15); color: #4ade80; }
.btn-warning { background: rgba(234,179,8,0.15); color: #facc15; }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; }

.btn-success:hover, .btn-warning:hover, .btn-danger:hover { opacity: 0.7; }

/* ─── EMPTY STATE ───────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    color: var(--green);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 20px;
    color: var(--text);
    margin-bottom: 8px;
}

/* ─── PAGINATION ────────────────────────── */
.pagination {
    display: flex;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.page-btn {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 11px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
}

.page-btn:hover, .page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ─── MODAL ─────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.modal-box {
    position: relative;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
    z-index: 1;
}

.modal-box h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

.input-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.checkbox-label input { width: auto; cursor: pointer; }

/* ─── RESPONSIVE ────────────────────────── */
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ─── MOBILE ─────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .hamburger { display: flex !important; }
    .dashboard-layout { grid-template-columns: 1fr; }
    .sidebar {
        display: none;
        position: fixed;
        top: 0; left: 0;
        z-index: 50;
        width: 220px;
        height: 100vh;
    }
    .sidebar.open { display: flex; }
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .stat-value { font-size: 18px !important; }
    .table-wrap { overflow-x: auto; }
    .data-table th, .data-table td { padding: 8px 10px; font-size: 12px; }
    .td-address, .td-desc, .td-email { max-width: 120px; }
    .search-input { width: 180px; }
    .toolbar { flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr !important; }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 16px !important; }
    .stat-label { font-size: 11px; }
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 49;
}

.mobile-overlay.open { display: block; }
