/* ============================================================
   Benefits Realization Tracker — Phase 25
   Consistent with LeanSpace: #0071e3 primary, card border-radius: 12px
   ============================================================ */

/* ─── Container ───────────────────────────────────────────── */
.ben-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1d1d1f;
}

/* ─── Header ──────────────────────────────────────────────── */
.ben-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ben-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ben-title {
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.ben-subtitle {
    font-size: 13px;
    color: #6e6e73;
}

.ben-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.ben-back-btn {
    background: none;
    border: none;
    color: #0071e3;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}

.ben-back-btn:hover { text-decoration: underline; }

/* ─── Buttons ─────────────────────────────────────────────── */
.ben-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.ben-btn-primary {
    background: #0071e3;
    color: white;
}
.ben-btn-primary:hover { background: #0064c8; }

.ben-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e5e5;
}
.ben-btn-secondary:hover { background: #e5e7eb; }

.ben-btn-ghost {
    background: transparent;
    color: #6e6e73;
    border: 1px solid #d1d1d6;
}
.ben-btn-ghost:hover { background: #f5f5f7; }

.ben-btn-danger {
    background: #fff0f0;
    color: #ff3b30;
    border: 1px solid #ffcdd0;
}
.ben-btn-danger:hover { background: #ffe0e0; }

.ben-link {
    background: none;
    border: none;
    color: #0071e3;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
}
.ben-link:hover { text-decoration: underline; }

/* ─── KPI Grid (Portfolio) ────────────────────────────────── */
.ben-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .ben-kpi-grid { grid-template-columns: 1fr; }
}

.ben-kpi-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.ben-kpi-green { border-left: 4px solid #34c759; }

.ben-kpi-value {
    font-size: 36px;
    font-weight: 800;
    color: #1d1d1f;
    line-height: 1;
    margin-bottom: 2px;
}

.ben-kpi-unit {
    font-size: 11px;
    color: #6e6e73;
    margin-bottom: 6px;
    min-height: 16px;
}

.ben-kpi-label {
    font-size: 13px;
    color: #6e6e73;
    font-weight: 500;
}

/* ─── Progress Bar ────────────────────────────────────────── */
.ben-progress-bar {
    height: 8px;
    background: #f0f0f5;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.ben-progress-bar.ben-progress-lg {
    height: 12px;
    border-radius: 6px;
}

.ben-progress-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.5s ease;
}

.ben-progress-label {
    font-size: 11px;
    color: #6e6e73;
    margin-top: 4px;
}

/* ─── Section ─────────────────────────────────────────────── */
.ben-section {
    margin-bottom: 24px;
}

.ben-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ben-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 12px 0;
}

.ben-section-header .ben-section-title { margin: 0; }

/* ─── Status Cards (Portfolio) ────────────────────────────── */
.ben-status-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

@media (max-width: 768px) {
    .ben-status-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .ben-status-grid { grid-template-columns: 1fr 1fr; }
}

.ben-status-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s;
}

.ben-status-card:hover {
    border-color: #0071e3;
    box-shadow: 0 2px 8px rgba(0,113,227,0.1);
}

.ben-status-tracking  { border-top: 3px solid #0071e3; }
.ben-status-achieved  { border-top: 3px solid #34c759; }
.ben-status-at_risk   { border-top: 3px solid #ff9500; }
.ben-status-not_achieved { border-top: 3px solid #ff3b30; }
.ben-status-closed    { border-top: 3px solid #8e8e93; }

.ben-status-count {
    font-size: 28px;
    font-weight: 800;
    color: #1d1d1f;
    line-height: 1.1;
}

.ben-status-label {
    font-size: 11px;
    color: #6e6e73;
    margin-top: 4px;
}

/* ─── Type List ───────────────────────────────────────────── */
.ben-type-list {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
}

.ben-type-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f5;
    font-size: 14px;
}

.ben-type-row:last-child { border-bottom: none; }

.ben-type-label { color: #1d1d1f; }

.ben-type-count {
    font-weight: 700;
    color: #0071e3;
    min-width: 24px;
    text-align: right;
}

/* ─── Tracker Cards Grid ──────────────────────────────────── */
.ben-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

@media (max-width: 600px) {
    .ben-cards-grid { grid-template-columns: 1fr; }
}

.ben-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ben-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: #c7c7cc;
    transform: translateY(-1px);
}

.ben-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.ben-card-type {
    font-size: 11px;
    color: #8e8e93;
}

.ben-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ben-card-owner {
    font-size: 12px;
    color: #6e6e73;
}

.ben-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.ben-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ben-metric-label {
    font-size: 10px;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ben-metric-value {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
}

.ben-card-progress {
    margin-top: 4px;
}

.ben-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #8e8e93;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #f5f5f7;
}

/* ─── Badges ──────────────────────────────────────────────── */
.ben-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ben-badge-tracking   { background: #e8f1fb; color: #0071e3; }
.ben-badge-achieved   { background: #e8f8ed; color: #1a7f37; }
.ben-badge-at_risk    { background: #fff4e5; color: #c05e00; }
.ben-badge-not_achieved { background: #ffebeb; color: #c0392b; }
.ben-badge-closed     { background: #f2f2f7; color: #636366; }
.ben-badge-type       { background: #f2f2f7; color: #3c3c43; }

/* ─── Filters ─────────────────────────────────────────────── */
.ben-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

/* ─── Select / Input ──────────────────────────────────────── */
.ben-select,
.ben-input {
    border: 1px solid #d1d1d6;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: #1d1d1f;
    background: white;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.ben-select:focus,
.ben-input:focus {
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}

.ben-textarea {
    resize: vertical;
    min-height: 60px;
}

/* ─── Form ────────────────────────────────────────────────── */
.ben-form-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ben-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.ben-form-group-wide { flex: 2; }

.ben-label {
    font-size: 13px;
    font-weight: 600;
    color: #3c3c43;
}

.ben-required { color: #ff3b30; }

.ben-form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}

@media (max-width: 600px) {
    .ben-form-row { flex-direction: column; }
}

.ben-form-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #3c3c43;
    padding: 8px 0 4px;
    border-bottom: 1px solid #f0f0f5;
    margin-bottom: 4px;
}

.ben-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #f0f0f5;
    flex-wrap: wrap;
}

/* ─── Detail View ─────────────────────────────────────────── */
.ben-detail-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}

.ben-meta-item {
    font-size: 13px;
    color: #6e6e73;
}

.ben-description {
    color: #3c3c43;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 16px;
    padding: 12px 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #e5e5e5;
}

/* Baseline → Target → Actual */
.ben-bvt-grid {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ben-bvt-card {
    flex: 1;
    min-width: 160px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 14px 16px;
}

.ben-bvt-target  { border-top: 3px solid #0071e3; }
.ben-bvt-actual  { border-top: 3px solid #34c759; }

.ben-bvt-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #8e8e93;
    margin-bottom: 4px;
}

.ben-bvt-metric {
    font-size: 12px;
    color: #6e6e73;
    margin-bottom: 2px;
    font-style: italic;
}

.ben-bvt-value {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
}

.ben-bvt-date {
    font-size: 11px;
    color: #8e8e93;
    margin-top: 4px;
}

.ben-bvt-arrow {
    font-size: 20px;
    color: #c7c7cc;
    flex-shrink: 0;
    align-self: center;
}

@media (max-width: 600px) {
    .ben-bvt-arrow { display: none; }
    .ben-bvt-card { min-width: 140px; }
}

/* Detail progress */
.ben-detail-progress {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.ben-detail-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #3c3c43;
}

/* ─── Timeline ────────────────────────────────────────────── */
.ben-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 20px;
}

.ben-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e5e5;
}

.ben-tl-item {
    display: flex;
    gap: 12px;
    position: relative;
    padding-bottom: 16px;
}

.ben-tl-item:last-child { padding-bottom: 0; }

.ben-tl-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: -20px;
    margin-top: 3px;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e5e5e5;
    position: relative;
    z-index: 1;
}

.ben-tl-dot-blue   { background: #0071e3; box-shadow: 0 0 0 2px #0071e3; }
.ben-tl-dot-green  { background: #34c759; box-shadow: 0 0 0 2px #34c759; }
.ben-tl-dot-orange { background: #ff9500; box-shadow: 0 0 0 2px #ff9500; }

.ben-tl-content {
    flex: 1;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 12px 14px;
}

.ben-tl-header {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.ben-tl-period {
    font-size: 12px;
    font-weight: 600;
    background: #f0f0f5;
    color: #3c3c43;
    padding: 2px 8px;
    border-radius: 4px;
}

.ben-tl-date {
    font-size: 12px;
    color: #8e8e93;
}

.ben-tl-who {
    font-size: 12px;
    color: #6e6e73;
    margin-left: auto;
}

.ben-tl-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 16px;
    color: #1d1d1f;
}

.ben-tl-pct {
    font-size: 12px;
    font-weight: 600;
}

.ben-tl-notes {
    font-size: 12px;
    color: #6e6e73;
    margin-top: 6px;
    font-style: italic;
}

/* ─── Modal ───────────────────────────────────────────────── */
.ben-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ben-modal-box {
    background: white;
    border-radius: 14px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
}

.ben-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.ben-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.ben-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6e6e73;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
}

.ben-modal-close:hover { background: #f5f5f7; }

.ben-modal-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ben-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f5;
}

/* ─── Utility ─────────────────────────────────────────────── */
.ben-green { color: #34c759 !important; }

.ben-empty {
    padding: 32px 16px;
    text-align: center;
    color: #8e8e93;
    font-size: 14px;
}

.ben-empty-hint {
    color: #8e8e93;
    font-size: 13px;
    padding: 8px 0;
}

.ben-notes {
    padding: 12px 16px;
    background: #f9f9f9;
    border-radius: 8px;
    font-size: 13px;
    color: #3c3c43;
    border-left: 3px solid #e5e5e5;
    margin-top: 12px;
}
