/* =========================================================
   SIDARKA — REKAPITULASI QUICK COUNT
   Tema orange & green, selaras dengan Home SIDARKA
   File: assets/css/rekap.css
   ========================================================= */

.rekap-page {
    width: 100%;
    max-width: 1440px !important;
    margin: 0 auto;
    padding: 24px 32px 56px !important;
    flex: 1 0 auto;
    color: #172b25;
}
.rekap-page * { box-sizing: border-box; }
.rekap-page-heading {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; margin-bottom: 20px;
}
.rekap-heading-copy { min-width: 0; }
.rekap-eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    color: #168344; font-size: .72rem; font-weight: 850;
    letter-spacing: .9px; text-transform: uppercase; margin-bottom: 7px;
}
.rekap-page-heading h1 {
    display: flex; align-items: center; gap: 10px; margin: 0;
    color: #172b25; font-size: clamp(1.35rem, 2.4vw, 2rem);
    line-height: 1.2; font-weight: 850; letter-spacing: -.55px;
}
.rekap-page-heading h1 i { color: #168344; }
.rekap-page-heading p { color: #718077; margin: 7px 0 0; font-size: .9rem; }
.rekap-refresh-button, .rekap-table-refresh {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    flex-shrink: 0; padding: 11px 16px; border: 0; border-radius: 12px;
    background: #168344; color: #fff; font-size: .86rem; font-weight: 750;
    box-shadow: 0 5px 13px rgba(22,131,68,.16); cursor: pointer;
    transition: background .2s, transform .2s;
}
.rekap-refresh-button:hover, .rekap-table-refresh:hover { background: #116735; transform: translateY(-1px); }

.rekap-notice {
    display: flex; align-items: flex-start; gap: 13px; padding: 16px 18px;
    margin-bottom: 20px; border: 1px solid #ffdfb3; border-radius: 17px;
    background: linear-gradient(120deg, #fff5e7, #fffaf2);
    box-shadow: 0 5px 16px rgba(110,80,40,.045);
}
.rekap-notice-icon {
    display: flex; align-items: center; justify-content: center; flex: 0 0 38px;
    width: 38px; height: 38px; border-radius: 12px;
    color: #e85b12; background: #ffe4c3; font-size: 1.15rem;
}
.rekap-notice h2 { margin: 0 0 4px; color: #8a4613; font-size: .92rem; font-weight: 850; }
.rekap-notice p { margin: 0; color: #785c43; font-size: .82rem; line-height: 1.55; }

/* Kandidat quick count */
.rekap-candidate-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px; margin-bottom: 20px;
}
.rekap-candidate-card {
    position: relative; overflow: hidden; min-width: 0; padding: 20px;
    border: 1px solid transparent; border-radius: 22px;
    box-shadow: 0 7px 22px rgba(29,66,43,.06);
}
.candidate-orange { background: linear-gradient(145deg, #fff8ee, #ffedd9); border-color: #ffdbb8; }
.candidate-green { background: linear-gradient(145deg, #f3fcf4, #e5f8e9); border-color: #c8edcf; }
.candidate-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.candidate-number {
    display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px;
    background: rgba(255,255,255,.8); font-size: .73rem; font-weight: 850;
}
.candidate-accent-orange { color: #e85b12; background-color: #f06418; }
.candidate-accent-green { color: #168344; background-color: #168344; }
.candidate-percent { color: #172b25; font-size: clamp(1.65rem, 3vw, 2.5rem); line-height: 1; font-weight: 900; letter-spacing: -1px; }
.candidate-percent small { font-size: .55em; margin-left: 2px; }
.candidate-visual {
    position: relative; display: flex; align-items: flex-end; justify-content: center;
    height: 135px; margin: 14px 0 12px; overflow: hidden;
    border-radius: 17px; background: rgba(255,255,255,.64);
}
.candidate-visual img {
    position: relative; z-index: 2; display: block; width: 100px; height: 100px;
    margin-bottom: 10px; object-fit: cover; object-position: center;
    border: 4px solid #fff; border-radius: 50%;
    box-shadow: 0 5px 14px rgba(30,50,35,.14); background: #fff;
}
.candidate-progress {
    position: absolute; z-index: 1; bottom: 0; left: 0; width: 100%;
    max-height: 100%; opacity: .13; border-radius: 12px 12px 0 0;
}
.candidate-progress.candidate-accent-orange { background: linear-gradient(0deg,#f06418,#ffb46b); }
.candidate-progress.candidate-accent-green { background: linear-gradient(0deg,#168344,#83d69a); }
.candidate-votes { display: flex; align-items: baseline; gap: 7px; margin-bottom: 6px; }
.candidate-votes strong { color: #172b25; font-size: clamp(1.35rem, 2.5vw, 1.9rem); font-weight: 900; line-height: 1.1; }
.candidate-votes span { color: #738077; font-size: .82rem; font-weight: 650; }
.rekap-candidate-card h2 { margin: 0 0 11px; color: #172b25; font-size: clamp(.95rem, 1.8vw, 1.2rem); line-height: 1.3; font-weight: 850; overflow-wrap: anywhere; }
.candidate-progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(39,60,45,.09); }
.candidate-progress-track span { display: block; height: 100%; border-radius: inherit; }
.candidate-footnote { margin: 8px 0 0; color: #718077; font-size: .72rem; font-weight: 600; }
.rekap-empty-state, .table-empty {
    padding: 25px 15px; color: #718077; text-align: center; background: #fff;
}

/* Ringkasan angka */
.rekap-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; margin-bottom: 17px; }
.rekap-summary-card {
    display: flex; align-items: center; gap: 12px; min-width: 0; padding: 16px 14px;
    border: 1px solid transparent; border-radius: 17px; box-shadow: 0 5px 16px rgba(29,66,43,.045);
}
.summary-orange { background: #fff1e2; border-color: #ffdfbd; }
.summary-green { background: #eaf8ed; border-color: #ccefd4; }
.summary-red { background: #fff0ef; border-color: #ffdcd8; }
.summary-darkgreen { background: #edf7e9; border-color: #d7ebcc; }
.summary-icon {
    display: flex; align-items: center; justify-content: center; flex: 0 0 42px;
    width: 42px; height: 42px; border-radius: 14px; background: #fff; font-size: 1.1rem;
}
.summary-orange .summary-icon { color: #f06418; }
.summary-green .summary-icon, .summary-darkgreen .summary-icon { color: #168344; }
.summary-red .summary-icon { color: #e65355; }
.rekap-summary-card > div { display: flex; flex-direction: column; min-width: 0; }
.summary-label { color: #69776e; font-size: .74rem; font-weight: 700; line-height: 1.25; }
.rekap-summary-card strong { margin-top: 3px; color: #172b25; font-size: clamp(1.15rem, 2vw, 1.6rem); line-height: 1.2; font-weight: 900; font-variant-numeric: tabular-nums; }
.rekap-summary-card strong small { color: #738077; font-size: .65em; font-weight: 750; }
.rekap-summary-card > div > small { margin-top: 2px; color: #819087; font-size: .68rem; }

/* Waktu */
.rekap-time-card {
    display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px;
    padding: 15px 18px; margin-bottom: 24px; background: #fff;
    border: 1px solid #e8eee8; border-radius: 17px; box-shadow: 0 5px 16px rgba(29,66,43,.045);
}
.rekap-time-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rekap-time-item + .rekap-time-item { border-left: 1px solid #e9eee9; padding-left: 18px; }
.rekap-time-icon { display: flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; background: #fff0e2; }
.rekap-time-icon.orange { color: #f06418; background: #fff0e2; }
.rekap-time-icon.green { color: #168344; background: #e9f8ed; }
.rekap-time-item div { display: flex; flex-direction: column; min-width: 0; }
.rekap-time-item small { color: #7b887f; font-size: .72rem; }
.rekap-time-item strong { color: #253a2d; font-size: .82rem; font-weight: 800; overflow-wrap: anywhere; }

/* Detail TPS */
.rekap-table-panel { overflow: hidden; margin-bottom: 30px; background: #fff; border: 1px solid #e7ede7; border-radius: 20px; box-shadow: 0 7px 22px rgba(29,66,43,.055); }
.rekap-table-heading {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 20px 22px; border-bottom: 1px solid #edf1ed;
}
.rekap-table-heading .rekap-eyebrow { margin-bottom: 5px; }
.rekap-table-heading h2 { display: flex; align-items: center; gap: 9px; margin: 0; color: #172b25; font-size: 1.05rem; font-weight: 850; }
.rekap-table-heading h2 i { color: #168344; }
.rekap-table-heading p { margin: 5px 0 0; color: #78867d; font-size: .78rem; }
.rekap-table-refresh { padding: 9px 12px; background: #fff; color: #168344; border: 1px solid #cce6d2; box-shadow: none; font-size: .78rem; }
.rekap-table-refresh:hover { color: #fff; }
.desktop-table-view { display: block; width: 100%; }
.mobile-card-view { display: none; }
.rekap-table { width: 100%; border-collapse: separate; border-spacing: 0; color: #33483b; font-size: .82rem; }
.rekap-table thead th {
    padding: 13px 12px; color: #587064; background: #f5f9f5; border-bottom: 1px solid #e6eee6;
    text-align: center; white-space: nowrap; font-size: .7rem; font-weight: 850; letter-spacing: .35px; text-transform: uppercase;
}
.rekap-table tbody td { padding: 13px 12px; border-bottom: 1px solid #eef2ee; text-align: center; white-space: nowrap; }
.rekap-table tbody tr:last-child td { border-bottom: 0; }
.rekap-table tbody tr:hover td { background: #fbfdfb; }
.rekap-table tbody td:first-child { color: #168344; }
.rekap-status { display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; border-radius: 999px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.status-done { color: #13733b; background: #e5f7e9; border: 1px solid #c9edcf; }
.status-process { color: #a65b09; background: #fff2d8; border: 1px solid #f6dfac; }
.status-pending { color: #b54737; background: #fff0ed; border: 1px solid #ffd6cf; }

/* Mobile TPS cards */
.tps-mobile-card { padding: 15px; margin: 12px; border: 1px solid #e8eee8; border-radius: 16px; background: #fff; box-shadow: 0 3px 12px rgba(29,66,43,.04); }
.tps-mobile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid #edf1ed; }
.tps-mobile-top h3 { margin: 0; color: #168344; font-size: .95rem; font-weight: 900; }
.tps-mobile-meta { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; color: #7a877f; font-size: .72rem; }
.tps-mobile-meta strong { color: #263b2e; font-size: .8rem; }
.tps-vote-list { padding: 8px 11px; border-radius: 12px; background: #f7faf7; }
.tps-vote-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 7px 0; color: #596b60; font-size: .75rem; }
.tps-vote-row + .tps-vote-row { border-top: 1px dashed #e2e9e2; }
.tps-vote-row span { min-width: 0; overflow-wrap: anywhere; }
.tps-vote-row strong { flex-shrink: 0; color: #172b25; font-size: .8rem; }
.tps-mobile-invalid { display: flex; justify-content: space-between; gap: 10px; padding-top: 10px; color: #7a877f; font-size: .75rem; }
.tps-mobile-invalid strong { color: #172b25; }

/* Tombol refresh mengambang */
.mobile-floating-refresh {
    display: none;
    position: fixed; right: 16px; bottom: 78px; z-index: 1040;
    display: flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border: 0; border-radius: 15px;
    color: #fff; background: #168344; box-shadow: 0 7px 18px rgba(22,131,68,.28);
    font-size: 1rem; cursor: pointer;
}
.mobile-floating-refresh:hover { background: #116735; }

/* Tablet */
@media (max-width: 1024px) {
    .rekap-page { padding-left: 22px !important; padding-right: 22px !important; }
    .rekap-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .rekap-candidate-card { padding: 17px; }
}

/* Mobile */
@media (max-width: 767.98px) {
    .rekap-page { padding: 16px 15px 30px !important; }
    .rekap-page-heading { align-items: flex-start; gap: 10px; margin-bottom: 15px; }
    .rekap-page-heading h1 { align-items: flex-start; gap: 7px; font-size: 1.12rem; }
    .rekap-page-heading h1 i { margin-top: 2px; }
    .rekap-page-heading p { font-size: .75rem; line-height: 1.4; }
    .rekap-eyebrow { font-size: .62rem; letter-spacing: .65px; }
    .rekap-refresh-button { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
    .rekap-refresh-button span { display: none; }
    .rekap-notice { gap: 10px; padding: 13px; border-radius: 15px; margin-bottom: 15px; }
    .rekap-notice-icon { flex-basis: 32px; width: 32px; height: 32px; font-size: 1rem; border-radius: 10px; }
    .rekap-notice h2 { font-size: .82rem; }
    .rekap-notice p { font-size: .71rem; line-height: 1.5; }
    .rekap-candidate-grid { gap: 10px; margin-bottom: 13px; }
    .rekap-candidate-card { padding: 12px 10px 14px; border-radius: 17px; }
    .candidate-number { padding: 5px 8px; font-size: .62rem; }
    .candidate-percent { font-size: 1.55rem; }
    .candidate-visual { height: 108px; margin: 10px 0; border-radius: 13px; }
    .candidate-visual img { width: 76px; height: 76px; margin-bottom: 8px; border-width: 3px; }
    .candidate-votes strong { font-size: 1.3rem; }
    .candidate-votes span { font-size: .7rem; }
    .rekap-candidate-card h2 { font-size: .76rem; margin-bottom: 9px; }
    .candidate-progress-track { height: 6px; }
    .candidate-footnote { font-size: .64rem; }
    .rekap-summary-grid { gap: 8px; margin-bottom: 13px; }
    .rekap-summary-card { gap: 8px; padding: 11px 9px; border-radius: 14px; }
    .summary-icon { flex-basis: 34px; width: 34px; height: 34px; border-radius: 11px; font-size: .95rem; }
    .summary-label { font-size: .65rem; }
    .rekap-summary-card strong { font-size: 1.05rem; }
    .rekap-summary-card > div > small { font-size: .6rem; }
    .rekap-time-card { grid-template-columns: 1fr; gap: 10px; padding: 13px; margin-bottom: 17px; border-radius: 15px; }
    .rekap-time-item + .rekap-time-item { padding: 10px 0 0; border-left: 0; border-top: 1px solid #e9eee9; }
    .rekap-time-icon { flex-basis: 34px; width: 34px; height: 34px; }
    .rekap-time-item small { font-size: .65rem; }
    .rekap-time-item strong { font-size: .72rem; }
    .rekap-table-panel { border-radius: 16px; margin-bottom: 10px; }
    .rekap-table-heading { align-items: flex-start; padding: 15px 13px; }
    .rekap-table-heading h2 { align-items: flex-start; gap: 7px; font-size: .88rem; }
    .rekap-table-heading p { font-size: .68rem; line-height: 1.4; }
    .rekap-table-refresh { display: none; }
    .desktop-table-view { display: none; }
    .mobile-card-view { display: block; padding: 1px 0 3px; background: #f8faf8; }
    .tps-mobile-card { margin: 10px; padding: 12px; border-radius: 14px; }
    .tps-mobile-meta { font-size: .68rem; }
    .tps-vote-row { font-size: .69rem; }
    .mobile-floating-refresh { display: flex; bottom: calc(75px + env(safe-area-inset-bottom)); right: 14px; }
}
@media (min-width: 768px) {
    .desktop-table-view { display: block; }
    .mobile-card-view { display: none; }
}
@media (max-width: 360px) {
    .rekap-page { padding-left: 10px !important; padding-right: 10px !important; }
    .rekap-candidate-card { padding: 10px 8px 12px; }
    .candidate-percent { font-size: 1.35rem; }
    .candidate-visual { height: 95px; }
    .candidate-visual img { width: 68px; height: 68px; }
    .rekap-summary-card { gap: 6px; padding: 9px 7px; }
    .summary-icon { flex-basis: 29px; width: 29px; height: 29px; font-size: .8rem; }
    .rekap-summary-card strong { font-size: .94rem; }
}
