:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --bg: #0b0f1a;
    --sidebar-bg: rgba(15, 23, 42, 0.6);
    --card-bg: rgba(255, 255, 255, 0.03);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

.animate-fade { animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 40%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.03) 0px, transparent 40%);
}

.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
}

/* Header */
.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
}

@media (min-width: 768px) {
    .dashboard-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 2rem;
    }
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    text-decoration: none;
}

.logo span { color: var(--primary); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

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

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.stat-card:hover::after {
    transform: translateX(100%);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -10px rgba(0, 0, 0, 0.5);
}

.stat-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Content Sections */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.section-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Contacts List */
#contacts-list {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    #contacts-list {
        padding: 1.5rem;
        gap: 1.25rem;
    }
}

.contact-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.2s ease;
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary);
}

.contact-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.contact-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.contact-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.95rem;
    width: 100%;
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--glass-bg);
    border-color: var(--border);
    color: var(--text);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

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

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

/* Map */
#admin-tracking-map, #map-picker {
    width: 100%;
    height: 400px;
    border-radius: 0;
    filter: invert(90%) hue-rotate(180deg) brightness(0.9) contrast(1.2);
}

@media (min-width: 768px) {
    #admin-tracking-map {
        height: 500px;
    }
}

/* Mission Log */
.errand-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .errand-item {
        grid-template-columns: auto 1fr auto;
        align-items: center;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-content {
    background: var(--bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.mobile-only {
    display: inline-flex;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none;
    }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(11, 15, 26, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    height: 72px;
    display: flex;
    align-items: center;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-links a:not(.btn) {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:not(.btn):hover {
    color: var(--text);
}

/* Landing Page Specifics */
.landing-page {
    padding-top: 72px;
}

.hero-section {
    position: relative;
    padding: 6rem 0 4rem;
    text-align: center;
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.04em;
}

.text-gradient {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 5rem;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
        padding: 0 1rem;
    }
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Landing Stats */
.landing-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .landing-stats.grid-5 {
        grid-template-columns: repeat(5, 1fr);
    }
}

.stat-item {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sections */
.section {
    padding: 8rem 0;
}

.section.alt {
    background: rgba(255, 255, 255, 0.01);
}

.centered {
    text-align: center;
}

.section-header {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon.primary { background: var(--primary-light); color: var(--primary); }
.feature-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.feature-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.step-item {
    position: relative;
    text-align: center;
}

.step-number {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary);
    opacity: 0.1;
    line-height: 1;
    margin-bottom: -2rem;
}

.step-item h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}

.step-item p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* CTA Banner */
.cta-banner {
    padding: 6rem 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(192, 132, 252, 0.1) 100%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.cta-banner h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.cta-banner p {
    color: var(--text-muted);
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
}

/* Footer */
.footer {
    padding: 6rem 0 2rem;
    border-top: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6, #ec4899);
    transform: translateX(-100%);
    animation: footerGradient 3s linear infinite;
}

@keyframes footerGradient {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

@media (min-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

.footer-brand .logo {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 1rem;
}

.footer-brand .logo span {
    color: var(--primary);
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 280px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.footer-powered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.footer-powered:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -5px rgba(99, 102, 241, 0.2);
}

.footer-powered svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
    transition: transform 0.3s ease;
}

.footer-powered:hover svg {
    transform: scale(1.2) rotate(15deg);
}

.footer-powered a {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-powered a:hover {
    color: var(--primary);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (min-width: 640px) {
    .footer-links {
        grid-template-columns: repeat(4, 1fr);
    }
}

.link-group h5 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    color: var(--text);
    position: relative;
    display: inline-block;
}

.link-group h5::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.link-group:hover h5::after {
    width: 100%;
}

.link-group a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    position: relative;
    padding-left: 0;
}

.link-group a:hover {
    color: var(--primary);
    transform: translateX(4px);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    position: relative;
    z-index: 2;
}

.footer-bottom p {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-bottom .powered-by {
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer-bottom .powered-by a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
}

.footer-bottom .powered-by a:hover {
    color: #8b5cf6;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-bottom .powered-by svg {
    width: 16px;
    height: 16px;
    fill: var(--primary);
    transition: transform 0.3s ease;
}

.footer-bottom .powered-by:hover svg {
    transform: scale(1.2) rotate(15deg);
}

/* Utility */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
