:root {
    --bg-dark: #020617;
    /* slate-950 */
    --bg-card: rgba(255, 255, 255, 0.05);
    /* white/5 */
    --accent: #f59e0b;
    /* amber-500 */
    --accent-glow: rgba(245, 158, 11, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    /* border-white/10 */
    --glass-blur: blur(12px);
    --success: #10b981;
    --danger: #ef4444;
}

/* Light Theme Overrides */
body.light-theme {
    --bg-dark: #f1f5f9;
    /* Softer slate white */
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    /* Deeper slate-800 */
    --text-secondary: #64748b;
    /* slate-500 */
    --border-color: rgba(0, 0, 0, 0.05);
    --accent-glow: rgba(245, 158, 11, 0.15);
}

body.light-theme::before {
    background: radial-gradient(circle at 10% 10%, rgba(245, 158, 11, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
    background-color: #f1f5f9;
}

body.light-theme .module-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

body.light-theme .module-card:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    background: #ffffff;
}

body.light-theme .sidebar {
    background: rgba(255, 255, 255, 0.98);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme .sidebar-item {
    color: #1e293b;
}

body.light-theme .sidebar-item:hover {
    background: #f8fafc;
    color: var(--accent);
}

body.light-theme .overlay-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

body.light-theme .modal-card {
    background: white;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme .menu-toggle {
    background: white;
    color: #1e293b;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

/* Background Gradients */
body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 0% 0%, rgba(245, 158, 11, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.03) 0%, transparent 40%);
    z-index: -1;
}

.container {
    max-width: 1400px;
    /* Reduced for better focus and symmetry */
    width: 90%;
    text-align: center;
    padding: 80px 0;
    margin: 0 auto;
}

header {
    margin-bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* Forced 5 columns for symmetry */
    gap: 25px;
    width: 100%;
}

@media (max-width: 1200px) {
    .modules-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        max-width: 100%;
        padding: 0 10px;
    }
}

.module-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    /* Reduced from 40px */
    padding: 35px 30px;
    /* Reduced padding (~50%) */
    text-decoration: none;
    color: inherit;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.module-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.1);
}

.icon-wrapper {
    width: 70px;
    /* Reduced from 90px */
    height: 70px;
    /* Reduced from 90px */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    color: var(--accent);
    transition: all 0.5s ease;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.module-card:hover .icon-wrapper {
    background: var(--accent);
    color: var(--bg-dark);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: scale(1.1);
}

.module-card h2 {
    font-size: 1.5rem;
    /* Reduced from 2rem */
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.module-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 0.95rem;
    /* Reduced from 1.05rem */
}

/* Pill Badges */
.status-pill {
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    margin-top: auto;
    /* Force alignment to bottom of flex card */
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    position: relative;
}

.dot.pulse-success {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

.dot.pulse-warning {
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2s infinite;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.8rem;
        letter-spacing: -2px;
    }

    header {
        margin-bottom: 35px;
    }

    .container {
        padding: 30px 0;
        width: 100%;
    }

    .module-card {
        padding: 22px 15px;
        border-radius: 20px;
        align-items: center;
    }

    .module-card h2 {
        font-size: 1rem;
        margin-bottom: 8px;
        text-align: center;
    }

    .module-card p {
        display: none;
        /* hide description to keep cards compact */
    }

    .icon-wrapper {
        width: 56px;
        height: 56px;
        margin-bottom: 15px;
    }

    .icon-wrapper i {
        width: 28px !important;
        height: 28px !important;
    }

    .status-pill {
        font-size: 0.6rem;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    .module-card {
        border-radius: 18px;
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(0.95);
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Dashboard Sections */
.dashboard-section {
    width: 100%;
    margin-bottom: 80px;
    animation: fadeInDown 0.8s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.dashboard-section:nth-child(2) {
    animation-delay: 0.1s;
}

.dashboard-section:nth-child(3) {
    animation-delay: 0.2s;
}

.dashboard-section:nth-child(4) {
    animation-delay: 0.3s;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-header i {
    color: var(--accent);
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -1px;
    text-transform: uppercase;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Specific Pill Styles */
.status-pill.active-pill {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--accent);
}

.dot.pulse-active {
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 2s infinite;
}

@media (max-width: 768px) {
    .dashboard-section {
        margin-bottom: 50px;
    }

    .section-header {
        justify-content: center;
        margin-bottom: 25px;
    }

    .section-header h2 {
        font-size: 1.4rem;
    }
}

/* PWA Banner */
.pwa-banner {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--accent);
    border-radius: 20px;
    padding: 15px 25px;
    z-index: 3000;
    width: 90%;
    max-width: 400px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.pwa-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.pwa-content {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.pwa-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.pwa-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.pwa-text strong {
    font-size: 0.9rem;
    color: white;
}

.pwa-text span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pwa-btn {
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
}

.pwa-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

/* iOS Guide */
.ios-install-guide {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: black;
    padding: 20px;
    border-radius: 20px;
    z-index: 5000;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.ios-guide-content p {
    font-weight: 800;
    margin-bottom: 10px;
}

.ios-guide-content ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.ios-guide-content li {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.ios-guide-content i {
    vertical-align: middle;
    width: 18px;
    height: 18px;
}

/* Navbar & Menu Toggle */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Added to separate left and right items */
    padding: 0 20px;
    z-index: 1000;
    background: transparent;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.menu-toggle {
    width: 35px;
    /* Further reduced from 40px */
    height: 35px;
    /* Further reduced from 40px */
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(40px);
    z-index: 2000;
    transition: cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
    border-right: 1px solid var(--border-color);
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: 0.5s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-weight: 900;
    color: var(--accent);
    font-size: 1.2rem;
}

.close-sidebar {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
}

.sidebar-section-title {
    padding: 15px 10px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.7;
}

.sidebar-item {
    padding: 10px 15px;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.sidebar-item i {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
    border-color: rgba(245, 158, 11, 0.2);
    transform: translateX(5px);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: var(--bg-dark);
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
    display: block;
    transition: all 0.3s ease;
}

.sidebar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--accent-glow);
}

/* Footer */
.main-footer {
    width: 100%;
    margin-top: 80px;
    padding: 60px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(2, 6, 23, 0.4);
    backdrop-filter: blur(10px);
    text-align: center;
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.footer-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    padding: 0 5px;
}

.footer-content a:hover {
    color: white;
    text-shadow: 0 0 15px var(--accent-glow);
}

@media (max-width: 768px) {
    .main-footer {
        margin-top: 40px;
        padding: 40px 15px;
    }

    .footer-content p {
        font-size: 0.85rem;
        line-height: 1.6;
    }
}

/* Full Screen Overlays (Modals) */
.overlay-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.98);
    z-index: 5000;
    backdrop-filter: blur(40px);
    overflow-y: auto;
    padding: 100px 60px;
}

.overlay-modal.active {
    display: flex;
    flex-direction: column;
}

.modal-card {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    padding: 50px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
}

.pos-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--border-color);
    padding: 18px 30px;
    border-radius: 99px;
    color: white;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s;
}

.pos-input:focus {
    border-color: var(--accent);
}

.btn-premium {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px 25px;
    border-radius: 99px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.btn-premium:hover {
    background: var(--accent);
    color: var(--bg-dark);
    border-color: var(--accent);
}

.btn-large {
    padding: 18px 45px;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .overlay-modal {
        padding: 40px 20px;
    }

    .modal-card {
        padding: 30px 20px;
        border-radius: 24px;
    }

    .pos-input {
        padding: 14px 20px;
        font-size: 1rem;
    }
}