/* 
   PURE OLED ADMIN THEME
   - High Contrast
   - Mobile Friendly
   - Performance Optimized
*/

:root {
    --bg-black: #000000;
    --bg-dark: #000000;
    --bg-card: #000000;
    --accent: #ffffff;
    --border: #333333;
    --text-main: #ffffff;
    --text-dim: #999999;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-black);
    color: var(--text-main);
    font-family: -apple-system, system-ui, sans-serif;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- MOBILE OPTIMIZED TYPOGRAPHY --- */
h1 {
    font-size: clamp(1.4rem, 6vw, 2.2rem);
    word-wrap: break-word;
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    line-height: 1.2;
}

h3 {
    font-size: clamp(1rem, 4vw, 1.3rem);
}

p {
    font-size: clamp(0.85rem, 3.5vw, 0.95rem);
}

/* --- SITE COMPONENTS --- */
.glass-card,
.admin-stat-card,
.setup-card,
.balance-card {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    width: 100%;
}

.btn-primary,
.btn-submit {
    background: #fff;
    color: #000;
    padding: 12px 24px;
    border: 1px solid #fff;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.75rem;
    width: auto;
}

.btn-submit:hover {
    background: #000;
    color: #fff;
}

@media (max-width: 768px) {
    .btn-primary {
        width: 100% !important;
        display: block;
        text-align: center;
    }

    .glass-card {
        padding: 15px;
    }

    .main-content {
        padding: 20px 15px;
    }
}

/* /* --- HEADER & NAV --- */
.main-header {
    background: #000000;
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 2010;
}

.header-grid {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* Allows wrapping on very small screens */
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    height: 38px;
    display: block;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.site-title {
    font-size: clamp(1rem, 4vw, 1.25rem);
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-info {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.logout-link {
    color: #ff4444;
    font-size: 0.65rem;
    font-weight: 900;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid #ff4444;
    border-radius: 4px;
    transition: 0.2s;
}

.login-link,
.signup-link {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 6px;
}

.signup-link {
    background: var(--accent);
    color: #000;
}

@media (max-width: 991px) {
    .main-header { padding: 4px 0 !important; }
    .header-grid {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 15px !important;
        padding: 0 15px !important;
        flex-wrap: nowrap !important;
    }
    .header-left { display: flex !important; align-items: center !important; gap: 10px !important; }
    .site-logo { height: 28px !important; width: auto !important; }
    #mobileMenuBtn { display: block !important; font-size: 1.4rem !important; }

    .header-right {
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 10px !important;
        flex: 1 !important;
    }
    .header-middle { display: none !important; }
    .subnav { display: none !important; }
    
    /* Shrink text to fit */
    .user-info { font-size: 0.65rem !important; margin: 0 !important; }
    .logout-link { font-size: 0.55rem !important; padding: 4px 8px !important; }
}

/* --- MOBILE DRAWER --- */
#mobileDrawer {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #000;
    border-right: 1px solid var(--border);
    z-index: 99999;
    padding: 30px 20px;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

#mobileDrawer.open {
    left: 0;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
}

#mobileDrawer a {
    display: block;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#mobileDrawerOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 99998;
    display: none;
}

.subnav {
    background: #000000;
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 69px;
    z-index: 2005;
    transition: transform 0.3s ease;
}

.subnav .container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.subnav a {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 15px 0;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hide scrollbar but keep functionality */
.subnav::-webkit-scrollbar {
    display: none;
}

.subnav {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.subnav.tucked {
    transform: translateY(-100%);
}

/* --- MOBILE DRAWER --- */
#mobileDrawer {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #000;
    border-right: 1px solid var(--border);
    z-index: 99999;
    padding: 30px 20px;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

#mobileDrawer.open {
    left: 0;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
}

#mobileDrawer a {
    display: block;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
}

#mobileDrawerOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 99998;
    display: none;
}

/* --- RESPONSIVE TABLES --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.order-table th {
    text-align: left;
    padding: 15px;
    font-size: 0.7rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

.order-table td {
    padding: 15px;
    font-size: 0.85rem;
    border-bottom: 1px solid #111;
    vertical-align: middle;
    word-break: break-all;
}

.order-table tr:hover {
    background: #050505;
}

/* --- SERVICE PRICE --- */
.service-price,
.price-tag {
    color: #ffffff !important;
    font-weight: 800;
    font-size: 1.1rem;
}

.original-price {
    color: #444;
    font-size: 0.7rem;
    text-decoration: line-through;
    margin-top: 2px;
}

.view-all-btn {
    border: 1px solid #fff;
    color: #fff;
    padding: 8px 20px;
    background: transparent;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

/* --- ADMIN LAYOUT --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #000;
    border-right: 1px solid var(--border);
    padding: 40px 20px;
    transition: left 0.3s ease;
}

.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 10000;
    background: #111;
    border: 1px solid var(--border);
    width: 45px;
    height: 45px;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu a {
    display: block;
    padding: 15px;
    color: #999;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 10px;
    margin-bottom: 5px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: #fff;
    background: #111;
}

.main-content {
    flex: 1;
    padding: 50px;
}

@media (max-width: 992px) {
    .admin-layout {
        display: block;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        width: 260px;
        height: 100vh;
        z-index: 9999;
    }

    .sidebar.mobile-open {
        left: 0;
        display: block;
    }

    .main-content {
        padding: 70px 20px 30px 20px;
    }
}

/* --- FORM INPUTS --- */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input,
select,
textarea {
    background: #000;
    border: 1px solid var(--border);
    color: #fff;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    outline: none;
    width: 100%;
    transition: 0.3s;
}

input:focus {
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

/* --- ADAPTIVE GRID --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-2 {
        /* grid-template-columns: 1fr;*/
    }
}

.status-badge {
    font-size: 0.65rem;
    font-weight: 900;
    padding: 4px 8px;
    border: 1px solid #444;
}

.status-completed {
    color: #fff;
    background: #222;
}

.status-pending {
    color: #999;
}

/* --- MODAL BACKDROP --- */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-backdrop.active {
    display: flex;
}
