* {
    box-sizing: border-box;
}

:root {
    --bg: #f3f5fa;
    --surface: #ffffff;
    --surface-muted: #f7f8fb;
    --text: #172033;
    --muted: #6d7688;
    --border: #e0e5ef;
    --primary: #2457e6;
    --primary-soft: #e7edff;
    --danger: #9c2a36;
    --danger-soft: #ffe7e9;
    --success: #176d50;
    --success-soft: #e2f7ef;
    --warning: #9a6500;
    --warning-soft: #fff2cc;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

header {
    min-height: 68px;
    background: #111a2f;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 5vw;
}

header > div {
    display: flex;
    gap: 12px;
    align-items: baseline;
}

header b {
    font-size: 20px;
}

header span {
    color: #aeb9d1;
}

main {
    max-width: 1500px;
    margin: auto;
    padding: 28px 5vw;
}
.admin-nav { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.admin-nav a { background:white; border:1px solid var(--border); border-radius:999px; padding:7px 11px; color:#29406e; text-decoration:none; font-weight:700; }
.admin-nav a.active { background:var(--primary); border-color:var(--primary); color:white; }
.service-filters { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; margin-bottom:14px; }
.service-review { border-top:1px solid var(--border); padding:14px 0; }
.service-review:first-child { border-top:0; }
.service-review small { color:var(--muted); }
.directory-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.directory-grid article { border:1px solid var(--border); border-radius:9px; padding:10px; }
.directory-grid small { display:block; color:var(--muted); }
.directory-filters { display:grid; grid-template-columns:minmax(220px,2fr) repeat(2,minmax(130px,1fr)) auto auto; gap:8px; margin-bottom:16px; }
.button-link { display:inline-flex; align-items:center; justify-content:center; border-radius:8px; padding:10px 14px; text-decoration:none; font-weight:700; }
.pagination { display:flex; align-items:center; justify-content:center; gap:14px; margin-top:18px; }
.pagination a { color:var(--primary); font-weight:700; }
.pagination .disabled { color:var(--muted); }
@media (max-width: 900px) { .service-filters { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 760px) { .directory-grid { grid-template-columns:1fr; } }
@media (max-width: 760px) { .directory-filters { grid-template-columns:1fr; } }

h2,
h3,
h4,
p {
    margin-top: 0;
}

.muted,
.subtle,
.hint,
.empty {
    color: var(--muted);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stats article,
.panel,
.project {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 35px rgb(29 41 68 / 8%);
}

.stats article {
    padding: 18px;
}

.stats span {
    color: var(--muted);
}

.stats b {
    display: block;
    font-size: 27px;
    margin-top: 8px;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 20px;
    align-items: start;
}

.panel {
    padding: 18px;
    margin-bottom: 18px;
    min-width: 0;
}

.title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.title h2,
.title p {
    margin-bottom: 0;
}

/* Satu project per baris agar form dan detail tidak terjepit. */
.cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.project {
    padding: 20px;
    scroll-margin-top: 20px;
}

.project-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.project-code {
    display: block;
    margin-bottom: 3px;
    color: #111a2f;
}

.project h3 {
    margin: 0 0 9px;
    font-size: 19px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.project-rating {
    min-width: 78px;
    text-align: right;
}

.project-rating span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.project-rating strong {
    font-size: 23px;
    color: #d78a00;
}

.tag,
.mini-tag,
.severity {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
}

.tag {
    background: var(--primary-soft);
    color: #244bb9;
    padding: 4px 9px;
    font-size: 11px;
}

.mini-tag {
    background: #edf1fa;
    color: #29406e;
    padding: 3px 7px;
    font-size: 10px;
}

.issue {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-left: 3px solid #9eb4f8;
    background: #f7f9ff;
    color: #48536a;
    border-radius: 0 8px 8px 0;
}

.bar {
    height: 8px;
    background: #e8ecf4;
    border-radius: 10px;
    margin: 17px 0 7px;
    overflow: hidden;
}

.bar i {
    display: block;
    height: 100%;
    background: var(--primary);
}

.bar.small {
    flex: 1;
    min-width: 100px;
    margin: 0;
    height: 6px;
}

.summary,
.review p {
    color: var(--muted);
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 4px;
}

.project details {
    margin-top: 14px;
    border-top: 1px solid #e7eaf1;
    padding-top: 12px;
}

.project summary {
    cursor: pointer;
    font-weight: 700;
    color: #29406e;
}

.project-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.detail-block {
    min-width: 0;
    background: var(--surface-muted);
    border: 1px solid #e8ebf2;
    border-radius: 12px;
    padding: 13px;
}

.task-block {
    grid-column: 1 / -1;
}

.detail-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.detail-title h4 {
    margin: 0;
}

.detail-title > span {
    min-width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #e9edf5;
    color: #4e5a70;
    font-weight: 700;
    font-size: 12px;
}

.member-row,
.problem-row,
.task-row {
    border-top: 1px solid #e4e8f0;
    padding: 10px 0;
}

.member-row:first-of-type,
.problem-row:first-of-type,
.task-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.member-row small,
.task-row small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.problem-row p {
    margin: 6px 0 0;
    overflow-wrap: anywhere;
}

.severity {
    padding: 3px 7px;
    font-size: 10px;
}

.severity-low {
    color: #176d50;
    background: #e2f7ef;
}

.severity-medium {
    color: #6b5700;
    background: #fff4bd;
}

.severity-high {
    color: #994300;
    background: #ffe7cf;
}

.severity-critical {
    color: #9c2a36;
    background: #ffe7e9;
}

.task-main,
.task-progress,
.assignees {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-main {
    justify-content: space-between;
}

.task-progress {
    margin-top: 9px;
}

.task-progress > span {
    min-width: 36px;
    text-align: right;
    color: var(--muted);
    font-size: 12px;
}

.assignees {
    flex-wrap: wrap;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.assignees span {
    background: #edf1fa;
    padding: 3px 7px;
    border-radius: 999px;
}

.update-history {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.update-entry {
    margin-top: 8px;
    padding: 9px 10px;
    border-radius: 8px;
    background: white;
}

.update-entry p {
    margin: 6px 0 0;
    white-space: pre-wrap;
}

.late {
    color: #b43a45;
    font-weight: 700;
}

.rank {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e7eaf1;
    padding: 11px 0;
}

.rank div {
    flex: 1;
    min-width: 0;
}

.rank small {
    display: block;
    color: var(--muted);
}

.rank strong {
    color: #d78a00;
}

.review {
    border-top: 1px solid #e7eaf1;
    padding: 12px 0;
}

.review span {
    float: right;
    color: #d78a00;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #cbd2df;
    border-radius: 8px;
    background: white;
    color: var(--text);
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgb(36 87 230 / 14%);
    border-color: #7f9df0;
}

button {
    border: 0;
    background: var(--primary);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    filter: brightness(0.97);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.light {
    background: #edf1fa;
    color: #29406e;
}

.success,
.alert,
.notice {
    padding: 12px 14px;
    border-radius: 9px;
    margin-bottom: 15px;
}

.success {
    background: var(--success-soft);
    color: var(--success);
}

.alert {
    background: var(--danger-soft);
    color: var(--danger);
}

.notice {
    background: #fff7df;
    color: #745300;
}

dialog {
    border: 0;
    border-radius: 16px;
    padding: 0;
    width: min(520px, calc(100vw - 28px));
    max-height: min(86vh, 850px);
    box-shadow: 0 30px 100px rgb(0 0 0 / 26%);
}

dialog.large {
    width: min(780px, calc(100vw - 28px));
}

dialog::backdrop {
    background: rgb(17 26 47 / 62%);
}

dialog > form {
    padding: 22px;
    overflow: auto;
    max-height: min(86vh, 850px);
}

.dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 17px;
}

.dialog-head h2,
.dialog-head p {
    margin-bottom: 0;
}

.dialog-head p {
    color: var(--muted);
    margin-top: 3px;
}

.icon-button {
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #edf1fa;
    color: #29406e;
    font-size: 21px;
}

.field {
    display: grid;
    gap: 6px;
    margin: 12px 0;
    min-width: 0;
}

.field > span,
.field legend {
    font-weight: 700;
}

fieldset.field {
    border: 1px solid #d8deea;
    border-radius: 10px;
    padding: 12px;
}

fieldset.field legend {
    padding: 0 5px;
}

.field-error {
    color: var(--danger);
    font-weight: 600;
}

.form-grid {
    display: grid;
    gap: 0 14px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
    grid-column: 1 / -1;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.check-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border: 1px solid #dfe4ee;
    background: white;
    border-radius: 9px;
    padding: 10px;
    cursor: pointer;
}

.check-option input {
    width: auto;
    margin-top: 3px;
}

.check-option span {
    min-width: 0;
}

.check-option small {
    display: block;
    color: var(--muted);
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.empty-card {
    border: 1px dashed #cbd2df;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    color: var(--muted);
}

/* Login */
.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e5ebff, #f4f6fb);
}

.login-card {
    background: white;
    width: min(410px, 92vw);
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 20px 70px rgb(29 41 68 / 16%);
}

.brand {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 800;
}

.login form {
    display: grid;
    gap: 12px;
}

.login label {
    display: grid;
    gap: 5px;
}

.check {
    display: flex !important;
    align-items: center;
}

.check input {
    width: auto;
}

.login form button {
    width: 100%;
}

@media (max-width: 1100px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    main {
        padding: 18px 14px;
    }

    header {
        padding-inline: 14px;
    }

    header span {
        display: none;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .title,
    .project-head {
        align-items: stretch;
        flex-direction: column;
    }

    .project-rating {
        text-align: left;
    }

    .project-details,
    .form-grid.two,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .task-block,
    .form-grid .full {
        grid-column: auto;
    }

    .project-actions button {
        flex: 1 1 130px;
    }
}
.project-dialog { width: min(1080px, calc(100vw - 32px)); }
.member-picker { border: 1px solid var(--line, #dbe3ec); border-radius: 14px; padding: 14px; margin: 10px 0; }
.member-picker-owner { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: center; padding: 10px; background: #f2f7ff; border-radius: 10px; }
.member-picker-owner small { grid-column: 2; color: #64748b; }
.member-picker-filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; margin-top: 12px; }
.member-quick-filters, .member-picker-toolbar, .member-pagination { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.member-quick-filters .active { background: #dceafe; border-color: #8bb6ee; }
.member-picker-toolbar { justify-content: space-between; }
.link-button { border: 0; background: transparent; color: #1769aa; padding: 0; }
.member-picker-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); gap: 12px; margin-top: 10px; }
.member-results, .member-selected { min-width: 0; min-height: 180px; max-height: 290px; overflow-x: hidden; overflow-y: auto; border: 1px solid #e3e9f0; border-radius: 10px; padding: 8px; }
.member-result-row, .member-selected-row { display: flex; width: 100%; min-width: 0; align-items: center; gap: 9px; padding: 8px; border-bottom: 1px solid #edf1f5; }
.member-result-row:last-child, .member-selected-row:last-child { border-bottom: 0; }
.member-result-row > input[type="checkbox"] { flex: 0 0 auto; width: auto; margin: 0; }
.member-person { display: flex; flex: 1 1 auto; min-width: 0; flex-direction: column; word-break: normal; overflow-wrap: normal; }
.member-person b, .member-person small { min-width: 0; word-break: normal; overflow-wrap: normal; white-space: normal; }
.member-person small { color: #64748b; }
.member-selected > strong { display: block; padding: 5px 8px; }
.member-selected-row select { flex: 0 0 112px; width: 112px; }
.member-selected-row .icon-button { flex: 0 0 auto; }
.member-pagination { justify-content: flex-end; }
.check-row { display: flex; gap: 8px; align-items: center; align-self: center; }
@media (max-width: 900px) {
    .member-picker-filters, .member-picker-body { grid-template-columns: 1fr; }
    .member-results, .member-selected { max-height: 230px; }
}
