:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.8);
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --success: #238636;
    --warning: #d29922;
    --danger: #da3633;
    --border: #30363d;
    --glass-bg: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Glassmorphism Header */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

/* KPI Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 25px;
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.kpi-card h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.kpi-card p {
    font-size: 2rem;
    font-weight: 700;
}

/* Tables */
.table-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: var(--glass-bg);
    padding: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(35, 134, 54, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(210, 153, 34, 0.2);
    color: var(--warning);
}

.badge-danger {
    background: rgba(218, 54, 51, 0.2);
    color: var(--danger);
}

/* Forms & Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
}

input,
select {
    background: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    outline: none;
}

input:focus {
    border-color: var(--accent);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade {
    animation: fadeIn 0.5s ease forwards;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: #161b22;
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.btn-mpesa {
    background: #4ab848;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-mpesa:hover {
    background: #3e9a3c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 184, 72, 0.3);
}

.btn-secondary {

    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--glass-bg);
}
/* Premium M-Pesa Processing Modal */
#mpesa-modal {
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.85);
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.processing-card {
    background: linear-gradient(145deg, #1e252e, #161b22);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.mpesa-logo-container {
    width: 80px;
    height: 80px;
    background: #4ab848;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 25px;
    box-shadow: 0 0 20px rgba(74, 184, 72, 0.4);
    position: relative;
}

.mpesa-logo-container svg {
    width: 45px;
    height: 45px;
    fill: white;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid #4ab848;
    animation: mpesa-pulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes mpesa-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

.status-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.status-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    max-width: 200px;
    margin: 0 auto 30px;
}

.progress-steps::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 1;
}

.step-indicator {
    width: 32px;
    height: 32px;
    background: #161b22;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-indicator.active {
    border-color: #4ab848;
    color: #4ab848;
    box-shadow: 0 0 10px rgba(74, 184, 72, 0.2);
}

.step-indicator.completed {
    background: #4ab848;
    border-color: #4ab848;
    color: white;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.result-success { color: var(--success); }
.result-error { color: var(--danger); }

.modal-close-btn {
    display: none;
    width: 100%;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: #fff;
}
.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Premium Dialog Modals (Alert/Confirm) */
#global-dialog {
    display: none;
    z-index: 3000;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    justify-content: center;
    align-items: center;
}

.dialog-card {
    background: #161b22;
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.dialog-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    font-size: 1.5rem;
}

.dialog-icon.confirm { background: rgba(88, 166, 255, 0.1); color: var(--accent); }
.dialog-icon.alert { background: rgba(210, 153, 34, 0.1); color: var(--warning); }
.dialog-icon.danger { background: rgba(218, 54, 51, 0.1); color: var(--danger); }

.dialog-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.dialog-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.dialog-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.dialog-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.dialog-btn-primary { background: var(--accent); color: white; border: none; }
.dialog-btn-secondary { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.dialog-btn-danger { background: var(--danger); color: white; border: none; }

.dialog-btn:hover { opacity: 0.9; transform: translateY(-1px); }
