/* ============================================================
   Dashboard visual Ka Unit ke atas (Total OT, OT per Unit/
   Anggota, Kehadiran Hari Ini, Grafik Overtime) —
   app/Filament/Admin/Widgets/Management*.php +
   resources/views/filament/admin/widgets/management-*.blade.php
   ============================================================ */

/* base.css nge-transparent-in SEMUA .fi-section di seluruh app
   (sengaja, biar tidak "kotak di dalam kotak" karena background
   halaman sudah putih) — tapi di dashboard ini kartunya BERJEJER
   dalam grid 2x2, jadi butuh kebalikannya: tiap kartu HARUS kelihatan
   sebagai kotak terpisah (background + border), makanya di-override
   balik KHUSUS widget-widget ini lewat class akti-mgmt-widget, TIDAK
   ubah base.css (supaya halaman lain yang sengaja flat tidak ikut
   berubah). */
.akti-mgmt-widget .fi-section {
    background-color: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.dark .akti-mgmt-widget .fi-section {
    background-color: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ---------- Layout baris (lihat dashboard.blade.php) ---------- */
.akti-mgmt-dashboard-rows {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---------- 4 kartu KPI (lihat management-kpi.blade.php) ---------- */
.akti-mgmt-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 1024px) {
    .akti-mgmt-kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.akti-mgmt-kpi-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 1rem 1.25rem;
}

.dark .akti-mgmt-kpi-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
}

.akti-mgmt-kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.375rem;
}

.dark .akti-mgmt-kpi-label {
    color: #9ca3af;
}

.akti-mgmt-kpi-value {
    font-size: 1.875rem;
    font-weight: 800;
    line-height: 1.1;
    color: #74292a;
    font-variant-numeric: tabular-nums;
}

.dark .akti-mgmt-kpi-value {
    color: #e2a7a8;
}

.akti-mgmt-kpi-value small {
    font-size: 1rem;
    font-weight: 600;
    margin-left: 0.125rem;
}

.akti-mgmt-kpi-value--alert {
    color: #dc2626;
}

.dark .akti-mgmt-kpi-value--alert {
    color: #f87171;
}

.akti-mgmt-kpi-value--over {
    color: #ea580c;
}

.dark .akti-mgmt-kpi-value--over {
    color: #fb923c;
}

.akti-mgmt-kpi-value--under {
    color: #0284c7;
}

.dark .akti-mgmt-kpi-value--under {
    color: #38bdf8;
}

.akti-mgmt-kpi-note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.375rem;
}

.dark .akti-mgmt-kpi-note {
    color: #9ca3af;
}

.akti-mgmt-kpi-note--alert {
    color: #dc2626;
    font-weight: 600;
}

.dark .akti-mgmt-kpi-note--alert {
    color: #f87171;
}

.akti-mgmt-kpi-bar {
    height: 0.375rem;
    border-radius: 9999px;
    background: #f3f4f6;
    margin-top: 0.625rem;
    overflow: hidden;
}

.dark .akti-mgmt-kpi-bar {
    background: rgba(255, 255, 255, 0.08);
}

.akti-mgmt-kpi-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: #22c55e;
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Layout 2 kolom independen (lihat dashboard.blade.php) ---------- */
.akti-mgmt-dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.akti-mgmt-dashboard-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

@media (min-width: 1024px) {
    .akti-mgmt-dashboard-grid {
        flex-direction: row;
        align-items: flex-start;
    }

    .akti-mgmt-dashboard-col--narrow {
        flex: 0 0 22rem;
    }

    .akti-mgmt-dashboard-col--wide {
        flex: 1 1 0%;
    }
}

/* ---------- Tabel OT per Unit/Anggota (+ modal Detail) ---------- */
.akti-mgmt-table-wrap {
    overflow-x: auto;
}

.akti-mgmt-table {
    width: 100%;
    min-width: 30rem;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.akti-mgmt-table th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.dark .akti-mgmt-table th {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.akti-mgmt-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    white-space: nowrap;
}

.dark .akti-mgmt-table td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
    color: #d1d5db;
}

.akti-mgmt-table tbody tr:last-child td {
    border-bottom: none;
}

.akti-mgmt-table tfoot td {
    padding: 0.5rem 0.75rem;
    border-top: 2px solid #e5e7eb;
    font-weight: 700;
    color: #111827;
}

.dark .akti-mgmt-table tfoot td {
    border-top-color: rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
}

.akti-mgmt-table thead tr:first-child th:first-child,
.akti-mgmt-table tbody tr td:first-child,
.akti-mgmt-table tfoot tr td:first-child {
    font-weight: 600;
    color: #111827;
    white-space: normal;
}

.dark .akti-mgmt-table thead tr:first-child th:first-child,
.dark .akti-mgmt-table tbody tr td:first-child,
.dark .akti-mgmt-table tfoot tr td:first-child {
    color: #f3f4f6;
}

.akti-mgmt-col-end {
    text-align: right;
}

.akti-mgmt-empty {
    text-align: center;
    color: #9ca3af;
    padding: 1.5rem 0.75rem;
}

.akti-mgmt-row-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.akti-mgmt-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

.akti-mgmt-selisih-up {
    color: #dc2626;
}

.dark .akti-mgmt-selisih-up {
    color: #f87171;
}

.akti-mgmt-selisih-down {
    color: #16a34a;
}

.dark .akti-mgmt-selisih-down {
    color: #4ade80;
}

.akti-mgmt-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
    border-radius: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.akti-mgmt-detail-btn:hover {
    background-color: rgba(29, 78, 216, 0.06);
}

.dark .akti-mgmt-detail-btn {
    color: #93c5fd;
    border-color: rgba(147, 197, 253, 0.35);
}

.dark .akti-mgmt-detail-btn:hover {
    background-color: rgba(147, 197, 253, 0.08);
}

.akti-mgmt-detail-btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* ---------- Bar ganda Planning/Actual inline per baris ---------- */
.akti-mgmt-bar-cell {
    min-width: 11rem;
}

.akti-mgmt-dualbar {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.akti-mgmt-dualbar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.akti-mgmt-dualbar-track {
    flex: 1 1 auto;
    height: 0.5rem;
    border-radius: 9999px;
    background: #f3f4f6;
    overflow: hidden;
}

.dark .akti-mgmt-dualbar-track {
    background: rgba(255, 255, 255, 0.08);
}

.akti-mgmt-dualbar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.akti-mgmt-dualbar-fill--planning {
    background: #c9a876;
}

.akti-mgmt-dualbar-fill--actual {
    background: #74292a;
}

.akti-mgmt-dualbar-value {
    flex-shrink: 0;
    width: 2.75rem;
    text-align: right;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: #6b7280;
}

.dark .akti-mgmt-dualbar-value {
    color: #9ca3af;
}

/* ---------- Pill selisih ---------- */
.akti-mgmt-pill {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
}

.akti-mgmt-pill--over {
    background: rgba(234, 88, 12, 0.12);
    color: #c2410c;
}

.dark .akti-mgmt-pill--over {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

.akti-mgmt-pill--under {
    background: rgba(2, 132, 199, 0.1);
    color: #0369a1;
}

.dark .akti-mgmt-pill--under {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

/* ---------- Donut Kehadiran Hari Ini ---------- */
.akti-mgmt-donut-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.akti-mgmt-donut-wrap {
    position: relative;
    width: 12rem;
    height: 12rem;
    flex-shrink: 0;
    margin: 0 auto;
}

.akti-mgmt-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.akti-mgmt-donut-center strong {
    font-size: 1.75rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.1;
}

.dark .akti-mgmt-donut-center strong {
    color: #f3f4f6;
}

.akti-mgmt-donut-center span {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.125rem;
}

.dark .akti-mgmt-donut-center span {
    color: #9ca3af;
}

.akti-mgmt-legend-table {
    width: 100%;
    font-size: 0.8125rem;
    border-collapse: collapse;
}

.akti-mgmt-legend-table th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 0 0 0.375rem;
}

.akti-mgmt-legend-table th:not(:first-child),
.akti-mgmt-legend-table td:not(:first-child) {
    text-align: right;
}

.akti-mgmt-legend-table td {
    padding: 0.3125rem 0;
    border-top: 1px solid #f3f4f6;
}

.dark .akti-mgmt-legend-table td {
    border-top-color: rgba(255, 255, 255, 0.06);
}

.akti-mgmt-legend-table td:first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
}

.dark .akti-mgmt-legend-table td:first-child {
    color: #d1d5db;
}

.akti-mgmt-legend-row-alert td {
    color: #dc2626;
    font-weight: 700;
}

.dark .akti-mgmt-legend-row-alert td {
    color: #f87171;
}

/* ---------- Grafik Overtime ---------- */
.akti-mgmt-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

@media (min-width: 640px) {
    .akti-mgmt-summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.akti-mgmt-summary-box {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.dark .akti-mgmt-summary-box {
    background: rgba(255, 255, 255, 0.04);
}

.akti-mgmt-summary-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.dark .akti-mgmt-summary-label {
    color: #9ca3af;
}

.akti-mgmt-summary-value {
    font-size: 1.375rem;
    font-weight: 800;
    margin-top: 0.125rem;
}

.akti-mgmt-summary-value small {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.akti-mgmt-caption {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.75rem;
}

.dark .akti-mgmt-caption {
    color: #9ca3af;
}

.akti-mgmt-caption b {
    color: #374151;
}

.dark .akti-mgmt-caption b {
    color: #d1d5db;
}
