/* style.css - v9.2 Updated with Toggle & Correction Styles */
:root {
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --accent: #3498db;         /* Blue */
    --accent-hover: #1e6fa0;   /* Dark Blue */
    --bg-body: #eaeff1;
    --text-color: #333;
    --card-bg: #ffffff;
    --success: #27ae60;
    --danger: #e74c3c;
    --sidebar-width: 280px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    color: var(--text-color);
}

/* --- LAYOUT --- */
.app-wrapper { display: flex; height: 100vh; width: 100%; }

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width); background: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column; flex-shrink: 0; box-shadow: 4px 0 10px rgba(0,0,0,0.1); z-index: 10;
}
.brand {
    padding: 20px; background: transparent; border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex; justify-content: center; align-items: center; min-height: 90px;
}
.sidebar-logo { max-width: 80%; height: auto; display: block; }

.user-profile {
    padding: 25px 20px; background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center; gap: 15px;
}
.user-avatar {
    width: 50px; height: 50px; background: var(--accent); color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: bold; border: 2px solid rgba(255,255,255,0.2);
}
.user-info { display: flex; flex-direction: column; }
.welcome-label { font-size: 0.75rem; text-transform: uppercase; opacity: 0.7; }
.username-display { font-size: 1.1rem; font-weight: 600; color: #fff; text-transform: capitalize; }
.role-badge { display: inline-block; background: rgba(39, 174, 96, 0.2); color: #2ecc71; font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; margin-top: 4px; width: fit-content; border: 1px solid rgba(39, 174, 96, 0.3); }

/* --- MODE TOGGLE SWITCH --- */
.mode-toggle-area {
    padding: 15px 20px;
    background: rgba(0,0,0,0.2);
    margin-bottom: 5px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #95a5a6;
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}
/* Toggle Active State (Correction Mode - Red) */
input:checked + .slider { background-color: #c0392b; }
input:focus + .slider { box-shadow: 0 0 1px #c0392b; }
input:checked + .slider:before { transform: translateX(26px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }
.mode-label {
    color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- NAVIGATION --- */
.nav-links { list-style: none; padding: 15px; margin: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.nav-item { padding: 12px 15px; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; font-weight: 500; display: flex; align-items: center; gap: 12px; color: #bdc3c7; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; padding-left: 20px; }
.nav-item.active { background: var(--accent); color: white; box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3); }
.nav-item.logout { margin-top: auto; color: #e74c3c; border: 1px solid rgba(231, 76, 60, 0.2); }
.nav-item.logout:hover { background: #e74c3c; color: white; }

/* --- MAIN CONTENT --- */
.main-content { flex: 1; height: 100vh; overflow-y: auto; padding: 30px; }
.container { max-width: 900px; margin: 0 auto; background: var(--card-bg); padding: 40px; border-radius: 12px; box-shadow: 0 2px 15px rgba(0,0,0,0.05); }

/* --- FORM ELEMENTS --- */
header h1 { color: #2c3e50; margin: 0 0 10px 0; }
header p { color: #7f8c8d; margin-bottom: 30px; }
.progress-container { height: 8px; background: #eee; border-radius: 4px; margin-bottom: 30px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.4s ease; }
.section-title { background: #2c3e50; color: #fff; padding: 15px 20px; border-radius: 8px; margin-bottom: 25px; font-weight: 600; }
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: #34495e; font-size: 0.95rem; }

/* Inputs */
input[type="text"], input[type="number"], input[type="date"], select, textarea {
    width: 100%; padding: 12px; border: 1px solid #dfe6e9; border-radius: 6px; font-size: 1rem; transition: border 0.2s;
}
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(52,152,219,0.1); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.radio-group, .checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 5px; }
.radio-group label, .checkbox-group label {
    font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px;
    background: #f8f9fa; padding: 8px 15px; border-radius: 20px; border: 1px solid #e0e0e0;
}
.radio-group input, .checkbox-group input { margin: 0; }

/* --- DYNAMIC ROWS ALIGNMENT --- */
.dynamic-section {
    background: #f9f9f9; padding: 15px; border-radius: 8px; border: 1px dashed #ccc; margin-top: 15px;
}
.dynamic-row {
    display: flex !important;
    gap: 10px !important;
    width: 100% !important;
    margin-bottom: 10px !important;
    align-items: center;
}
.dynamic-row input {
    flex: 1 !important; /* Forces inputs to share width */
    min-width: 0 !important;
    width: auto; 
}
.btn-delete {
    background: var(--danger); color: white; padding: 0 15px; height: 45px; /* Matches input height */
    border: none; border-radius: 6px; cursor: pointer; font-size: 0.85rem; flex-shrink: 0;
}

/* --- CORRECTION FORM SPECIFIC --- */
.fraud-header {
    background: #c0392b; /* Red for Danger/Fraud */
    color: white;
    padding: 12px 15px;
    margin-top: 30px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.q-group {
    background: #fff;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 5px solid #e74c3c;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s;
}
.q-group:hover {
    border-left-width: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.q-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c3e50;
    margin-bottom: 10px;
    display: block;
}

/* --- SCHEMES --- */
.schemes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 30px; }
.scheme-card {
    background: #fff; border: 1px solid #eee; border-left: 4px solid var(--accent);
    padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}
.scheme-title { font-weight: 700; color: #2c3e50; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #eee; }
.scheme-options { display: flex; justify-content: space-between; gap: 10px; }
.scheme-check {
    flex: 1; background: #f8f9fa; padding: 8px; border-radius: 6px; border: 1px solid #eee;
    display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; font-weight: 500;
}
.scheme-check input { margin: 0; }

/* Member Card */
.member-card { background: #fff; border: 1px solid #eee; border-left: 4px solid var(--accent); padding: 20px; border-radius: 8px; margin-bottom: 15px; }
.member-header { display: flex; justify-content: space-between; border-bottom: 1px solid #f0f0f0; padding-bottom: 10px; margin-bottom: 15px; }
.member-title { font-weight: 700; color: #2c3e50; }

/* Buttons */
.btn-group { display: flex; justify-content: space-between; margin-top: 30px; }
button { padding: 12px 24px; border: none; border-radius: 6px; font-size: 1rem; font-weight: 600; cursor: pointer; }
.btn-next, .btn-submit { background: var(--accent); color: white; }
.btn-prev { background: #95a5a6; color: white; }
.btn-add { background: var(--success); color: white; width: 100%; margin-bottom: 20px; }
.btn-add-small { background: var(--accent); color: white; padding: 8px 16px; font-size: 0.9rem; margin-top: 10px; border:none; border-radius:4px; cursor:pointer;}

/* Charts */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card, .chart-box { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.stat-card h2 { margin: 0; font-size: 2.5rem; font-weight: 800; }
.stat-card span { text-transform: uppercase; font-size: 0.8rem; opacity: 0.7; letter-spacing: 1px; }

/* Login */
.login-body { display: flex; justify-content: center; align-items: center; height: 100vh; background: #f4f7f6; }
.login-card { background: white; padding: 40px; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); width: 100%; max-width: 380px; text-align: center; }
.login-logo { max-width: 200px; height: auto; margin: 0 auto 25px; display: block; }
.login-input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 6px; }
.login-btn { width: 100%; padding: 14px; background-color: var(--accent); color: white; border: none; border-radius: 6px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background-color 0.3s; }
.login-btn:hover { background-color: var(--accent-hover); }
.error-msg { color: #e74c3c; margin-bottom: 15px; font-size: 0.9rem; }

/* --- CRITICAL VISIBILITY FIX --- */
.hidden { display: none !important; } /* Forces items to stay hidden unless toggled */
.form-step { display: none; }
.form-step.active { display: block; animation: fadeIn 0.4s ease-in-out; }
.view-section { display: none; }
.view-section.active-section { display: block; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }