/* 1. RESET & BASE */
body {
    background: #f4f6f9;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    color: #1f2937;
}

.iof-wrap {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* DASHBOARD */
.iof-dashboard {
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:15px;
    margin-bottom:20px;
}

.dash-card {
    background:#fff;
    border-radius:12px;
    padding:15px;
    box-shadow:0 6px 20px rgba(0,0,0,0.05);
}

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

.dash-header span {
    background:#eee;
    padding:4px 10px;
    border-radius:20px;
    font-size:12px;
}

/* LIST */
.dash-list {
    max-height:180px;
    overflow:auto;
}

.dash-item {
    display:flex;
    justify-content:space-between;
    padding:6px 0;
    border-bottom:1px solid #f1f1f1;
    font-size:13px;
}

/* 2. KPI CARDS (Consolidated) */
.iof-kpi-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.iof-kpi-bar div {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    color: #6b7280;
    font-size: 14px;
}

.iof-kpi-bar span {
    display: block;
    font-size: 24px;
    font-weight: 700;
    margin-top: 8px;
    color: #111827;
}

/* 3. TABLES (Modernized) */
.iof-table-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
    overflow: hidden;
}

.iof-table {
    width: 100%;
    border-collapse: collapse;
}

.iof-table th {
    background: #f9fafb;
    text-align: left;
    padding: 14px 18px;
    font-size: 13px;
    color: #4b5563;
    border-bottom: 1px solid #edf2f7;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.iof-table td {
    padding: 16px 18px;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
}

/* Row States - Border Indicators */
.iof-table tr { transition: background 0.2s; border-left: 4px solid transparent; }
.iof-table tr:hover { background: #f9fafb; }
.iof-table tr.overdue { border-left-color: #ef4444; }
.iof-table tr.today { border-left-color: #f59e0b; }
.iof-table tr.upcoming { border-left-color: #10b981; }

/* 4. BUTTONS & INPUTS */
button, .btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

button:hover { background: #1d4ed8; transform: translateY(-1px); }

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

input:focus { border-color: #2563eb; outline: 2px solid rgba(37, 99, 235, 0.1); }

/* 5. BADGES */
.badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
}

.badge.ongoing   { background: #dbeafe; color: #1d4ed8; }
.badge.done      { background: #dcfce7; color: #15803d; }
.badge.converted { background: #ede9fe; color: #6d28d9; }

/* 6. MODALS & LOGIN */
.iof-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex; /* Toggle via JS */
    align-items: center;
    justify-content: center;
}

.iof-modal-box, .iof-login {
    background: #fff;
    width: 100%;
    max-width: 420px;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    animation: slideUp 0.3s ease-out;
}

.iof-login { margin: 100px auto; }

/* 7. ANIMATIONS & RESPONSIVE */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .iof-kpi-bar { grid-template-columns: 1fr 1fr; }
    .iof-modal-box { width: 90%; padding: 20px; }
}