:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --bg-input: #2a2a2a;
    --border-color: #333333;
    --text-main: #f0f0f0;
    --text-muted: #aaaaaa;
    --primary-green: #2ecc71;
    --primary-green-hover: #27ae60;
    --accent-blue: #3498db;
    --warning-yellow: #f1c40f;
    --danger-red: #e74c3c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    padding: 1.25rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Sticky Header Bar */
.navbar {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-green);
    text-decoration: none;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Desktop Links Alignment */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.nav-links a:hover {
    background: var(--bg-input);
    color: var(--primary-green);
}

/* ROTATING ANIMATED RAINBOW / NEON GLOW CTA BUTTON FOR "Create Order (₱15)" */
@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateGradient {
    0% { --gradient-angle: 0deg; }
    100% { --gradient-angle: 360deg; }
}

.nav-links a.nav-highlight {
    position: relative;
    background: transparent !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 20px;
    z-index: 1;
    border: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
}

/* Inner Background Mask */
.nav-links a.nav-highlight::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: #181818;
    border-radius: 18px;
    z-index: -1;
    transition: background 0.3s ease;
}

/* Rotating Conic Gradient Border & Aura Glow */
.nav-links a.nav-highlight::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: conic-gradient(
        from var(--gradient-angle),
        #2ecc71,
        #00f2fe,
        #9b59b6,
        #e74c3c,
        #f1c40f,
        #2ecc71
    );
    border-radius: 22px;
    z-index: -2;
    animation: rotateGradient 2.5s linear infinite;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
}

.nav-links a.nav-highlight:hover {
    transform: translateY(-2px) scale(1.04);
}

.nav-links a.nav-highlight:hover::before {
    background: #2ecc71;
}

.nav-links a.nav-highlight:hover::after {
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.8);
}

.nav-links a.nav-logout {
    color: var(--danger-red);
}

.user-greeting {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    margin-left: 0.25rem;
}

/* Soundwave Animated Mobile Button (Hidden on Desktop) */
.menu-toggle {
    display: none;
    background: var(--bg-input);
    border: 1px solid var(--primary-green);
    border-radius: 8px;
    cursor: pointer;
    padding: 0.45rem 0.65rem;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.25);
    transition: all 0.25s ease;
}

.menu-toggle:hover {
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
}

.soundwave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 22px;
    width: 24px;
}

.sw-bar {
    display: block;
    width: 3.5px;
    height: 100%;
    background-color: var(--primary-green);
    border-radius: 3px;
    animation: soundwaveBounce 1.2s infinite ease-in-out;
}

.sw-bar:nth-child(1) { animation-delay: 0.0s; }
.sw-bar:nth-child(2) { animation-delay: 0.3s; }
.sw-bar:nth-child(3) { animation-delay: 0.15s; }
.sw-bar:nth-child(4) { animation-delay: 0.45s; }

@keyframes soundwaveBounce {
    0%, 100% { height: 6px; }
    50% { height: 22px; background-color: #ffffff; box-shadow: 0 0 8px var(--primary-green); }
}

/* Mobile Responsive Rules (<768px) */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .menu-toggle.active {
        background: var(--primary-green);
        border-color: #ffffff;
    }

    .menu-toggle.active .sw-bar {
        background-color: #ffffff;
        animation-play-state: paused;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 0.85rem);
        left: -1rem;
        right: -1rem;
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 1.25rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    }

    .nav-links.active {
        display: flex;
        animation: fadeInDown 0.25s ease-out forwards;
    }

    .nav-links a {
        padding: 0.75rem 1rem;
        background: var(--bg-input);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        text-align: left;
        font-size: 0.95rem;
        width: 100%;
    }

    /* Reset special desktop border glow on mobile list view */
    .nav-links a.nav-highlight {
        border-radius: 8px;
        box-shadow: none;
        background: var(--bg-input) !important;
        color: var(--primary-green) !important;
    }
    .nav-links a.nav-highlight::before,
    .nav-links a.nav-highlight::after {
        display: none;
    }

    .user-greeting {
        text-align: center;
        padding: 0.5rem 0 0.2rem 0;
        color: var(--primary-green);
        font-weight: 600;
        border-top: 1px solid var(--border-color);
        margin-top: 0.4rem;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards & Layout */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.65rem 1.2rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary-green);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-green-hover);
}

.btn-danger {
    background: var(--danger-red);
    color: #ffffff;
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-main);
}

/* Badges */
.badge {
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-block;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-yellow {
    background: rgba(241, 196, 15, 0.2);
    color: var(--warning-yellow);
    border: 1px solid var(--warning-yellow);
}

.badge-blue {
    background: rgba(52, 152, 219, 0.2);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.badge-green {
    background: rgba(46, 204, 113, 0.2);
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
}

.badge-red {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger-red);
    border: 1px solid var(--danger-red);
}

/* Mobile Touch-Scrollable Table System */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0.5rem;
    border-radius: 4px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 580px;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.data-table th {
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 600;
}

/* System Alerts */
.alert {
    padding: 0.85rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid var(--danger-red);
    color: var(--danger-red);
}

.alert-success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid var(--primary-green);
    color: var(--primary-green);
}

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
}

@media (max-width: 768px) {
    .grid-2,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1rem;
    }
}