:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #0ea5e9;
    --dark: #0f172a;
    --light: #f8fafc;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    --bg: radial-gradient(circle at top right, #e0e7ff, #f8fafc);
    --text: #0f172a;
    --text-muted: #64748b;
    --card-bg: white;
    --card-border: #f1f5f9;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --nav-bg: rgba(255, 255, 255, 0.7);
}

.dark-theme {
    --bg: radial-gradient(circle at top right, #0f172a, #1e293b);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --card-bg: #1e293b;
    --card-border: #334155;
    --input-bg: #0f172a;
    --input-border: #334155;
    --nav-bg: rgba(15, 23, 42, 0.8);
    --glass: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

select:hover {
    border-color: var(--primary);
    background-position: right 0.85rem center;
}

.dark-theme select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Custom Number Spinner Styling */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    height: 24px;
    margin-right: 4px;
    cursor: pointer;
    filter: invert(var(--spinner-invert, 0));
}

.dark-theme {
    --spinner-invert: 1;
}

/* Compact Select for Tables */
.compact-select {
    padding: 6px 30px 6px 10px;
    font-size: 0.75rem;
    border-radius: 8px;
    background-position: right 0.5rem center;
    background-size: 1rem;
    width: auto;
    font-weight: 700;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    background-color: var(--card-bg);
    transform: translateY(-1px);
}

input::placeholder {
    color: var(--text-muted);
}

/* Navbar */
nav {
    padding: 15px 0;
    backdrop-filter: blur(10px);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: 0.3s;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    padding: 100px 0 60px;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Buttons */
.btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: 0.3s transform, 0.3s box-shadow;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-outline-danger {
    background: rgba(239, 68, 68, 0.05);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    transition: 0.3s;
    display: inline-block;
    text-decoration: none;
    border-radius: 12px;
}

.btn-outline-danger:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: translateY(-2px);
}

/* Action Buttons for Tables */
.action-btn-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    border: 1px solid transparent;
    cursor: pointer;
    background: var(--bg);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-edit {
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.1);
    border-color: rgba(79, 70, 229, 0.2);
}

.btn-edit:hover {
    background: #4f46e5;
    color: white;
}

.btn-print {
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.2);
}

.btn-print:hover {
    background: #0ea5e9;
    color: white;
}

.btn-delete {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
}

/* Form Sections */
.tracking-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    margin-top: -40px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

input {
    flex: 1;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    font-size: 1rem;
    transition: 0.3s;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 80px;
    padding-bottom: 100px;
}

.service-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    transition: 0.3s;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.service-card h3 {
    margin: 15px 0 10px;
    font-size: 1.25rem;
    color: var(--text);
}

.price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 15px;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
}

/* Mobile Menu Button */
.menu-toggle {
    display: none;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: 0.3s;
    flex: 0 0 auto;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 1rem;
}

table {
    min-width: 600px;
}

/* Responsive */
@media (max-width: 992px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        flex-direction: column;
        padding: 40px 20px;
        gap: 20px;
        border-bottom: 1px solid var(--card-border);
        box-shadow: var(--shadow);
        transform: translateY(-150%);
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        justify-content: flex-start;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .menu-toggle {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        display: block;
        padding: 10px;
        font-size: 1.1rem;
    }

    .logo {
        text-align: left;
    }
}

/* Admin Layout Refinement */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.admin-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    z-index: 1200;
    backdrop-filter: blur(10px);
}

.admin-sidebar {
    width: 260px;
    background: var(--card-bg);
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    border-right: 1px solid var(--card-border);
    padding: 20px;
    z-index: 1500; /* Higher than everything else on mobile */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

/* Background Overlay for Sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1400;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.admin-main {
    margin-left: 260px;
    flex: 1;
    padding: 40px;
    max-width: 100%;
    transition: 0.4s;
}

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

.admin-sidebar-link {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    transition: 0.2s;
    margin-bottom: 5px;
}

.admin-sidebar-link:hover, .admin-sidebar-link.active {
    background: var(--primary);
    color: white;
}

/* Fix for sidebar nav inheriting global nav styles */
.admin-sidebar nav {
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    position: static !important;
    padding: 0 !important;
    box-shadow: none !important;
    display: block !important;
}

.admin-sidebar .theme-toggle {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--card-border);
    color: var(--text);
    transition: 0.3s;
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.admin-sidebar .theme-toggle:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: var(--primary);
}

/* Responsive Admin */
@media (max-width: 1024px) {
    .admin-mobile-header {
        display: flex;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: none;
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
    }
    
    .admin-main {
        margin-left: 0;
        padding: 80px 20px 40px; /* Space for mobile header */
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 2.5fr;
    gap: 30px;
}

/* Visibility Utilities */
.mobile-hide { display: block; }
.mobile-show { display: none; }

/* Admin Data Card (Mobile View) */
.admin-data-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.admin-data-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
}

.admin-data-card-row:last-child {
    border-bottom: none;
}

.admin-data-card-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-data-card-value {
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .admin-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .mobile-hide { display: none !important; }
    .mobile-show { display: block !important; }
    
    .tracking-card {
        padding: 20px 15px !important;
    }
}
/* Responsive Utilities */
.mobile-view { display: none !important; }
.desktop-view { display: block !important; }

@media (max-width: 768px) {
    .mobile-view { display: block !important; }
    .desktop-view { display: none !important; }
}
