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

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(31, 41, 55, 0.95);
    --border-color: rgba(255, 255, 255, 0.1);
    
    --primary: #06b6d4; /* Swift Cyan */
    --primary-hover: #0891b2;
    --primary-glow: rgba(6, 182, 212, 0.3);
    
    --accent: #3b82f6; /* Electric Blue */
    --success: #10b981; /* Emerald */
    --warning: #f59e0b; /* Amber */
    --danger: #ef4444; /* Crimson Emergency */
    
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-glass: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(6, 182, 212, 0.1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.25);
    --backdrop: blur(16px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

h1, h2, h3, h4, h5, h6, .brand-title {
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(59, 130, 246, 0.08) 0%, transparent 40%);
}

/* TOP SWITCHER & HEADER BAR */
.top-navbar {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: var(--backdrop);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1.5rem;
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff, #a5f3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-switcher {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.25rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.role-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.25s ease;
}

.role-btn:hover {
    color: var(--text-main);
}

.role-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 10px var(--primary-glow);
}

.quick-scan-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0.25rem 0.5rem 0.25rem 0.85rem;
}

.quick-scan-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 0.85rem;
    width: 110px;
    outline: none;
}

.quick-scan-btn {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.quick-scan-btn:hover {
    transform: scale(1.05);
}

/* MAIN CONTAINER */
.main-wrapper {
    flex: 1;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* MOBILE WEBVIEW CONTAINER SWITCHER */
.webview-container {
    max-width: 440px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 36px;
    padding: 1.25rem;
    box-shadow: var(--shadow-glass);
    position: relative;
}

.phone-notch {
    width: 140px;
    height: 24px;
    background: #000;
    margin: -0.5rem auto 1rem auto;
    border-radius: 0 0 14px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.notch-camera {
    width: 10px;
    height: 10px;
    background: #1e293b;
    border-radius: 50%;
}

.notch-speaker {
    width: 40px;
    height: 4px;
    background: #1e293b;
    border-radius: 4px;
}

/* HERO SECTION */
.hero-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto 1.75rem auto;
    line-height: 1.6;
}

.badge-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.badge-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* CARDS & GRID */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: var(--backdrop);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: rgba(6, 182, 212, 0.4);
}

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

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* SCANNER ACTION BUTTONS (PHASE 1) */
.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin: 1.25rem 0;
}

.btn-action-preset {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.btn-action-preset:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-action-preset.urgent {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.08);
}

.btn-action-preset.urgent:hover {
    background: rgba(239, 68, 68, 0.2);
}

.action-icon {
    font-size: 1.75rem;
}

.action-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.action-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* VEHICLE CARD MASKED */
.vehicle-plate-badge {
    display: inline-block;
    background: #fef08a;
    color: #111827;
    font-family: monospace;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 2px solid #000;
    letter-spacing: 1px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.privacy-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* FORM ELEMENTS */
.form-group {
    margin-bottom: 1.15rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ALERT INBOX LIST (PHASE 2) */
.alert-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.85rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    position: relative;
}

.alert-item.status-pending {
    border-left: 4px solid var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.alert-item.status-critical {
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.alert-icon {
    font-size: 1.75rem;
}

.alert-body {
    flex: 1;
}

.alert-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.alert-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.alert-time {
    font-size: 0.75rem;
    color: var(--text-dim);
}

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

/* TABLES (ADMIN & AGENT) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.custom-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.custom-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

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

/* QR STICKER GRAPHIC CARD */
.qr-sticker-preview {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 3px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    max-width: 280px;
    margin: 0 auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.qr-sticker-header {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.qr-box {
    background: #ffffff;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    display: inline-block;
    margin: 0.5rem 0;
}

.qr-tag-id {
    font-family: monospace;
    font-weight: 800;
    color: #ffffff;
    background: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    display: inline-block;
}

/* TOAST NOTIFICATION */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    color: var(--text-main);
    box-shadow: var(--shadow-glass);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideUp 0.3s ease;
}

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

/* TAB NAVIGATION */
.tab-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-link {
    padding: 0.65rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-link:hover {
    color: var(--text-main);
}

.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* FOOTER */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: auto;
}
