@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
    --mg-black: #060913;
    --mg-obsidian: #0c1222;
    --mg-slate: #162038;
    --mg-blue: #0057ff;
    --mg-blue-hover: #0044cc;
    --mg-blue-light: #e8f0ff;
    --mg-blue-glow: rgba(0, 87, 255, 0.25);
    --mg-cyan: #00b4d8;
    --mg-white: #ffffff;
    --mg-offwhite: #f4f7fb;
    --mg-border: #dce4f0;
    --mg-text-main: #0c1222;
    --mg-text-muted: #52607a;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-md: 0 12px 30px rgba(6, 9, 19, 0.08);
    --shadow-lg: 0 24px 50px rgba(6, 9, 19, 0.16);
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--mg-offwhite);
    color: var(--mg-text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    letter-spacing: -0.02em;
    color: var(--mg-black);
    margin-top: 0;
}

/* NAVBAR */
.mg-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(6, 9, 19, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 24px;
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.mg-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--mg-white);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
}

.mg-brand img {
    height: 44px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
    background: var(--mg-white);
    padding: 2px;
}

.mg-brand-text span {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--mg-cyan);
}

.mg-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mg-nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mg-nav-links a:hover, .mg-nav-links a.active {
    color: var(--mg-white);
    background: rgba(0, 87, 255, 0.22);
}

.mg-nav-links a.nav-cta {
    background: var(--mg-blue);
    color: var(--mg-white);
    box-shadow: 0 4px 14px var(--mg-blue-glow);
}

.mg-nav-links a.nav-logout {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fda4af;
}

.mg-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--mg-white);
    width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border-radius: 10px;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* LAYOUT & CARDS */
.mg-main { flex: 1; width: 100%; }

.container {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 32px 20px;
}

.card {
    background: var(--mg-white);
    border: 1px solid var(--mg-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.page-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--mg-black);
    color: var(--mg-white);
    padding: 44px 36px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-lg);
}

.page-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.32;
}

.page-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgba(6, 9, 19, 0.94) 15%, rgba(0, 87, 255, 0.45) 100%);
}

.page-hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.page-hero-content h1, .page-hero-content h2 {
    color: var(--mg-white);
    margin-bottom: 8px;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
}

.page-hero-content p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

.mg-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(0, 87, 255, 0.25);
    border: 1px solid rgba(0, 180, 216, 0.45);
    color: #93c5fd;
    margin-bottom: 14px;
}

/* AUTH SPLIT & ZERO-ZOOM MOBILE INPUTS */
.auth-wrapper {
    min-height: calc(100vh - 150px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background:
        linear-gradient(135deg, rgba(6, 9, 19, 0.88), rgba(12, 18, 34, 0.82)),
        url("images/carwash3.jpg") center/cover no-repeat;
}

.auth-split {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    background: var(--mg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

.auth-visual {
    position: relative;
    background: var(--mg-black);
    color: var(--mg-white);
    padding: 44px 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.auth-visual img.bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
}

.auth-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 9, 19, 0.7) 0%, rgba(0, 87, 255, 0.55) 100%);
}

.auth-visual-inner { position: relative; z-index: 2; }
.auth-visual-logo {
    width: 72px;
    background: var(--mg-white);
    padding: 6px;
    border-radius: 12px;
    margin-bottom: 24px;
}
.auth-visual h2 { color: var(--mg-white); font-size: 1.85rem; }
.auth-visual p { color: rgba(255, 255, 255, 0.85); }

.auth-form-panel { padding: 44px 38px; background: var(--mg-white); }
.form-group { margin-bottom: 18px; }

label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--mg-obsidian);
    margin-bottom: 7px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    font-size: 16px !important; /* Prevents mobile zoom on focus */
    font-family: inherit;
    color: var(--mg-black);
    background-color: #f8fafd;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    background-color: var(--mg-white);
    border-color: var(--mg-blue);
    box-shadow: 0 0 0 4px rgba(0, 87, 255, 0.14);
}

/* BUTTONS */
button, .mg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 24px;
    font-size: 0.98rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    background: var(--mg-blue);
    color: var(--mg-white);
}

button:hover, .mg-btn:hover { background: var(--mg-blue-hover); transform: translateY(-1px); }
.mg-btn-block { width: 100%; }
.mg-btn-dark { background: var(--mg-black); color: var(--mg-white); }
.mg-btn-outline { background: var(--mg-white); color: var(--mg-obsidian); border: 1.5px solid var(--mg-border); }
.mg-btn-success { background: #059669; color: var(--mg-white); }
.mg-btn-warning { background: #ea580c; color: var(--mg-white); }
.mg-btn-danger, .btn-delete { background: #dc2626; color: var(--mg-white); }
.btn { display: inline-flex; align-items: center; padding: 8px 14px; min-height: 38px; border-radius: 6px; font-size: 0.85rem; font-weight: 700; text-decoration: none; color: #fff; }
.btn-edit { background: var(--mg-blue); }

/* TABLES & STATUS PILLS */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--mg-border);
    background: var(--mg-white);
}

table { width: 100%; border-collapse: collapse; min-width: 640px; }
th { background: var(--mg-obsidian); color: var(--mg-white); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 15px 16px; text-align: left; }
td { padding: 14px 16px; border-bottom: 1px solid #edf2f7; font-size: 0.94rem; }
tr:hover td { background-color: #f8fbff; }

.status-pill { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 0.76rem; font-weight: 800; text-transform: uppercase; }
.status-paid, .status-approved { background: #d1fae5; color: #065f46; }
.status-unpaid { background: #fee2e2; color: #991b1b; }
.status-pending { background: #fef3c7; color: #92400e; }

.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: 0.94rem; font-weight: 600; margin-bottom: 18px; border-left: 4px solid transparent; }
.alert-success { background: #ecfdf5; color: #065f46; border-left-color: #10b981; }
.alert-error { background: #fef2f2; color: #991b1b; border-left-color: #ef4444; }
.alert-warning { background: #fffbeb; color: #92400e; border-left-color: #f59e0b; }
.alert-info { background: #eff6ff; color: #1e40af; border-left-color: var(--mg-blue); }

.action-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

/* FOOTER */
footer.mg-footer { background: var(--mg-black); color: rgba(255, 255, 255, 0.78); padding: 36px 20px; margin-top: auto; }
.mg-footer-inner { max-width: 1220px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.mg-footer-brand { display: flex; align-items: center; gap: 12px; color: var(--mg-white); font-weight: 700; }
.mg-footer-brand img { height: 36px; background: var(--mg-white); padding: 2px; border-radius: 6px; }
.mg-footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.mg-footer-links a { color: rgba(255, 255, 255, 0.75); text-decoration: none; font-size: 0.9rem; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .mg-menu-toggle { display: inline-flex; }
    .mg-nav-links {
        display: none;
        position: absolute;
        top: 74px;
        left: 0;
        right: 0;
        background: var(--mg-obsidian);
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px 24px;
        gap: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    .mg-nav-links.open { display: flex; }
    .auth-split { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .container { padding: 20px 14px; }
    .card { padding: 20px 16px; }
    .action-bar { flex-direction: column; }
    .action-bar a, .action-bar button, .action-bar .mg-btn { width: 100%; }
}