/* =========================================
   1. CORE LAYOUT & TYPOGRAPHY
   ========================================= */
.kap-wrap { 
    max-width: 1200px; 
    margin: 20px auto; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #444;
}

/* Make the dashboard Grid responsive */
.kap-dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Main Content (2/3) | Sidebar (1/3) */
    gap: 30px;
    align-items: start;
}

@media (max-width: 900px) {
    .kap-dashboard-grid { grid-template-columns: 1fr; }
}

/* =========================================
   2. HERO HEADER (Professional Blue - FIXED SPECIFICITY)
   ========================================= */
#kap-root .kap-header-hero {
    /* Professional Blue Gradient */
    background: linear-gradient(135deg, #006699 0%, #004466 100%) !important;
    color: #ffffff !important; /* Force White Text */
    padding: 30px 40px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 0;
}

/* Force all headings and text inside header to be white */
#kap-root .kap-header-hero h2, 
#kap-root .kap-header-hero .kap-hero-title,
#kap-root .kap-header-hero p,
#kap-root .kap-header-hero span {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.kap-hero-title {
    margin: 0 0 5px 0;
    font-size: 28px;
    font-weight: 800;
}

.kap-hero-subtitle {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    opacity: 0.9;
    display: block;
    margin-bottom: 10px;
}

/* Meta tags in header */
#kap-root .kap-hero-meta span {
    background: rgba(255,255,255,0.2) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.3);
}

/* =========================================
   3. THE CYCLE STEPPER
   ========================================= */
.kap-stepper-container {
    background: #fff;
    padding: 30px 40px;
    border-bottom: 1px solid #e2e8f0;
    display: flex; /* THIS FORCES HORIZONTAL LAYOUT */
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.kap-step-item {
    position: relative;
    text-align: center;
    flex: 1; /* Distribute space evenly */
    z-index: 2;
}

/* The Circle */
.kap-step-circle {
    width: 32px; 
    height: 32px;
    background: #e2e8f0;
    border-radius: 50%;
    margin: 0 auto 10px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px #e2e8f0;
    transition: all 0.3s ease;
}

/* The Connecting Line */
.kap-step-line {
    position: absolute;
    top: 16px; 
    left: 50%;
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
    transform: translateX(50%);
}
.kap-step-item:last-child .kap-step-line { display: none; }

.kap-step-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

/* ACTIVE STATE (Blue) */
.kap-step-item.active .kap-step-circle {
    background: #3b82f6;
    box-shadow: 0 0 0 3px #bfdbfe;
    transform: scale(1.1);
}
.kap-step-item.active .kap-step-label { color: #3b82f6; }

/* COMPLETED STATE (Green) */
.kap-step-item.completed .kap-step-circle {
    background: #10b981;
    box-shadow: 0 0 0 3px #10b981;
}
.kap-step-line.filled { background: #10b981; }

/* =========================================
   4. NAVIGATION TABS
   ========================================= */
.kap-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: transparent;
    border: none;
    overflow-x: auto;
}

.kap-tab-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kap-tab-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.kap-tab-btn.active {
    background: #1e293b; /* Active is Dark */
    color: #fff;
    border-color: #1e293b;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Notification Dot */
.kap-dot {
    width: 8px; height: 8px; background: #ef4444; border-radius: 50%;
}
.kap-num-badge {
    background: #f1f5f9; color: #334155; padding: 2px 6px; border-radius: 6px; font-size: 11px;
}
.kap-tab-btn.active .kap-num-badge { background: rgba(255,255,255,0.2); color: #fff; }

/* =========================================
   5. CARDS & BUTTONS
   ========================================= */
.kap-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.kap-card h3 {
    margin-top: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 15px;
}

/* BIG BUTTONS */
.kap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    background: #3b82f6; /* Bright Blue */
    color: white;
}
.kap-btn:hover { background: #2563eb; transform: translateY(-1px); }

.kap-btn.small { padding: 8px 16px; font-size: 13px; }
.kap-btn.success { background: #10b981; }
.kap-btn.error { background: #ef4444; }

/* =========================================
   6. STAT CARDS
   ========================================= */
.kap-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.kap-stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kap-stat-card.attention { border-left: 4px solid #f59e0b; }
.kap-stat-card.good { border-left: 4px solid #10b981; }

.stat-icon {
    font-size: 24px;
    width: 45px;
    height: 45px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}
.stat-info h3 { margin: 0; font-size: 20px; color: #1e293b; }
.stat-info span { font-size: 12px; color: #64748b; }

/* =========================================
   7. TABLES & ACTION CARDS
   ========================================= */
.kap-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.kap-table th { 
    background: #f8fafc; 
    padding: 15px; 
    text-align: left; 
    font-size: 12px; 
    text-transform: uppercase; 
    color: #64748b; 
    border-bottom: 2px solid #e2e8f0;
}
.kap-table td { 
    padding: 15px; 
    border-bottom: 1px solid #f1f5f9; 
    vertical-align: middle;
}

.kap-action-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}
.kap-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.kap-action-card.warning {
    border-left: 5px solid #ef4444;
    background: #fffafa;
}
.action-icon { font-size: 28px; }
.action-details { flex-grow: 1; }
.action-details h4 { margin: 0 0 4px 0; font-size: 16px; font-weight: 700; }
.action-details p { margin: 0; color: #64748b; font-size: 14px; }

/* Progress Circle Widget */
.kap-progress-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    color: #fff;
    border: 3px solid rgba(255,255,255,0.1);
}