:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #10b981;
    --accent: #f59e0b;
    --success: #10b981;
    --error: #ef4444;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e3a5f;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 10px 13px -3px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --text-light: #f8fafc;
    --glass-border: #d1d5db;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: #0f172a;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* APP LAYOUT */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* SIDEBAR */
.sidebar {
    width: 280px;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav ul {
    list-style: none;
    margin-top: 2rem;
}

.nav-item {
    margin-bottom: 0.75rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.nav-item.active a,
.nav-item a:hover {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.15);
}

.nav-item.active a {
    border: 1px solid rgba(99, 102, 241, 0.3);
}

header .header-icon {
    color: var(--primary);
    animation: float 3s ease-in-out infinite;
    display: none;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}


.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* MAIN CONTENT AREA */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    min-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
}

.user-profile::before {
    content: '';
    width: 32px;
    height: 32px;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    border-radius: 50%;
}

/* DASHBOARD SECTIONS */
.dashboard-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.dashboard-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBILE RESPONSIVENESS */
.mobile-only {
    display: none;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-only {
        display: block;
    }

    .menu-btn,
    .close-btn {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
    }
}

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
}

h2 {
    font-size: 1.6rem;
    margin-bottom: 2rem;
    color: #ffffff;
    font-weight: 700;
}

.card-visual-container {
    perspective: 1000px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.card-visual {
    width: 320px;
    height: 200px;
    background: linear-gradient(135deg, #5e72e4 0%, #10b981 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    opacity: 0.6;
    filter: grayscale(0.5);
}

.card-visual.active {
    opacity: 1;
    filter: grayscale(0);
    transform: rotateY(0deg) scale(1.05);
}

.card-chip {
    width: 45px;
    height: 35px;
    background: linear-gradient(135deg, #fde047 0%, #eab308 100%);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.card-number {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.25rem;
    letter-spacing: 2px;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.card-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-label {
    display: block;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.2rem;
}

.card-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.status-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-placeholder {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
}

input {
    width: 100%;
    background: #f9fafb;
    border: 1.5px solid #d1d5db;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.3s ease;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.1);
}

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

button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 1rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(94, 114, 228, 0.3);
    position: relative;
    overflow: hidden;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(94, 114, 228, 0.4);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.activity-log {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.activity-log:hover {
    box-shadow: var(--card-shadow-hover);
}

.activity-log h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    position: relative;
    padding-bottom: 0.75rem;
}

.activity-log h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
}

#log-list {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
}

#log-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

#log-list li:hover {
    color: var(--text-main);
}

#log-list li:last-child {
    border-bottom: none;
}

footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 1rem 0;
    border-top: 1px solid #e5e7eb;
}

/* Data styling */
.data-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.data-label {
    color: var(--text-muted);
}

.data-value {
    font-weight: 600;
}

/* Additional enhancements */
.status-card {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.topup-card {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-visual.active {
    animation: cardFlip 0.8s ease-in-out forwards;
}

@keyframes cardFlip {
    0% {
        transform: rotateY(0deg) scale(1);
    }

    50% {
        transform: rotateY(90deg) scale(1.02);
    }

    100% {
        transform: rotateY(0deg) scale(1.05);
    }
}

/* Scrollbar styling */
#log-list::-webkit-scrollbar {
    width: 6px;
}

#log-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#log-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

#log-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Focus ring for accessibility */
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========================================
   ROLE SELECTOR
   ======================================== */
.role-selector {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.role-btn {
    background: #f0f4f8;
    color: var(--text-main);
    border: 2px solid #d1d5db;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.role-btn:hover {
    border-color: var(--primary);
    background: #f3f0ff;
}

.role-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.role-btn .icon {
    font-size: 1.2rem;
}

/* ========================================
   FORM GROUPS
   ======================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    background: #f9fafb;
    border: 1.5px solid #d1d5db;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group select::placeholder {
    color: var(--text-muted);
}

.form-group input:disabled,
.form-group select:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 1rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary .icon {
    font-size: 1.2rem;
}

/* ========================================
   RESPONSE MESSAGES
   ======================================== */
.response-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    font-weight: 600;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.response-message.success {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.response-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ========================================
   STATUS BADGE
   ======================================== */
.status-online {
    color: var(--success);
    font-weight: bold;
}

.status-offline {
    color: var(--error);
    font-weight: bold;
}

/* ========================================
   LOG LIST
   ======================================== */
.log-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    padding: 0;
}

.log-list li {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    transition: color 0.2s ease;
}

.log-list li:hover {
    color: var(--text-main);
    background: #f9fafb;
}

.log-list li:last-child {
    border-bottom: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2rem;
    }

    .role-selector {
        flex-direction: column;
    }

    .role-btn {
        width: 100%;
    }
}

/* ========================================
   AUTH ENHANCEMENTS
   ======================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.4s ease;
}

.login-card {
    width: 90%;
    max-width: 420px;
    padding: 3rem;
    text-align: center;
    border-color: var(--primary);
}

.login-card h2 {
    margin-bottom: 0.75rem;
    font-size: 2rem;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

.auth-toggle {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.auth-toggle a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    margin-left: 0.25rem;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.btn-logout {
    background: #fee2e2;
    color: #ef4444;
    border: 2px solid #fecaca;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    width: auto;
    box-shadow: none;
}

.btn-logout:hover {
    background: #fecaca;
    transform: translateY(-2px);
}