/* Global CSS Variables and Styling System */
:root {
    --bg-dark: #09080f;
    --bg-glow: radial-gradient(circle at 50% 50%, #1e133a 0%, #09080f 100%);
    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.45);
    --glass-bg: rgba(20, 16, 35, 0.55);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-glow-border: rgba(139, 92, 246, 0.25);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --status-success: #10b981;
    --status-success-bg: rgba(16, 185, 129, 0.15);
    --status-error: #ef4444;
    --status-error-bg: rgba(239, 68, 68, 0.15);
    --status-warning: #f59e0b;
    --status-warning-bg: rgba(245, 158, 11, 0.15);
    --font-stack: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-stack);
}

body {
    background: var(--bg-dark);
    background-image: var(--bg-glow);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Glassmorphism styling blocks */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

/* Buttons and interactions */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 25px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

/* Login Panel Layout */
#login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-color: var(--glass-glow-border);
}

.brand {
    text-align: center;
    margin-bottom: 35px;
}

.logo-icon {
    font-size: 2.8rem;
    display: inline-block;
    filter: drop-shadow(0 0 15px var(--accent));
    animation: pulse 2.5s infinite;
}

.brand h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-top: 10px;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 6px;
}

.input-group {
    margin-bottom: 22px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    outline: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.error-msg {
    background: var(--status-error-bg);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* Master Admin Dashboard Layout */
.dashboard {
    width: 100%;
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 280px;
    padding: 30px 20px;
    margin: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
    position: fixed;
    left: 0;
    top: 0;
    border-color: var(--glass-glow-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 10px;
}

.sidebar-brand h2 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.nav-item {
    background: transparent;
    border: none;
    padding: 14px 18px;
    border-radius: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    transition: var(--transition-smooth);
    width: 100%;
}

.nav-item:hover, .nav-item.active {
    background: rgba(139, 92, 246, 0.12);
    color: #fff;
    border-left: 3px solid var(--accent);
    padding-left: 15px;
}

.nav-item .icon {
    font-size: 1.2rem;
}

.content {
    flex-grow: 1;
    margin-left: 320px;
    padding: 40px;
    min-height: 100vh;
    width: calc(100% - 320px);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.header-title h1 {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-title p {
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 0.95rem;
}

/* Statistics dashboard metric widgets */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stats-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stats-icon {
    font-size: 2.2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
}

.stats-info h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 4px;
    color: #fff;
}

/* Dynamic Interactive tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 18px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.data-table th {
    background: rgba(0, 0, 0, 0.15);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    transition: var(--transition-smooth);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--glass-border);
}

.avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    border: 2px solid var(--glass-border);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.user-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.user-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Status Indicators */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-success {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.badge-danger {
    background: var(--status-error-bg);
    color: var(--status-error);
}

.badge-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.code-style {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: #cbd5e1;
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
}

/* Modals Overlay layer */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: var(--transition-smooth);
}

.modal {
    width: 100%;
    max-width: 500px;
    padding: 35px;
    border-color: var(--glass-glow-border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    color: #fff;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

/* Helper animation utility classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.zoom-in {
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.7)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4)); }
}

/* Responsive adjustments */
@media(max-width: 992px) {
    .sidebar {
        display: none;
    }
    .content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
}
