/* Comm-In — gaya dasar aplikasi */
:root {
    --teal: #0f766e;
    --teal-dark: #115e59;
    --ink: #1f2933;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f4f6f8;
    --danger: #b91c1c;
    --warn: #b45309;
    --ok: #15803d;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
}

a { color: var(--teal); }

/* ---------- Tata letak ---------- */
.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--teal);
    color: #fff;
}
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 18px; }
.topnav { display: flex; flex-wrap: wrap; gap: 14px; flex: 1; }
.topnav a:hover { text-decoration: underline; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }

.container { max-width: 900px; margin: 24px auto; padding: 0 16px; }
.container.wide { max-width: 1200px; }
.footer { text-align: center; color: var(--muted); padding: 24px; }

body.centered { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.card-wrap { width: 100%; max-width: 440px; padding: 16px; }

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

h1 { font-size: 22px; margin: 0 0 14px; }
h2 { font-size: 18px; margin: 20px 0 10px; }
h3 { font-size: 15px; margin: 16px 0 8px; }

.muted { color: var(--muted); }
.center { text-align: center; }
.right { text-align: right; }
.big { font-size: 22px; }

/* ---------- Komponen ---------- */
.hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
}
.hero h1 { margin: 4px 0; }
.balance { text-align: right; display: flex; flex-direction: column; }
.balance strong { font-size: 24px; color: var(--teal); }

.summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.summary > div {
    flex: 1 1 160px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
}
.summary strong { font-size: 18px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}
.tile h3 { margin-top: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 24px; }

/* ---------- Formulir ---------- */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label, .form legend { font-weight: 600; font-size: 14px; margin-top: 8px; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.form-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.inline { display: inline; }

input, select, textarea {
    font: inherit;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    max-width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

.check { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.check input { width: auto; }

.btn {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: #f8fafc; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-danger { background: #fee2e2; border-color: #fecaca; color: var(--danger); }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-link { background: none; border: none; color: inherit; text-decoration: underline; padding: 0; }
.btn-google { display: block; text-align: center; border-color: #dadce0; font-weight: 600; }

.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #f8fafc; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.list li.unread { border-left: 4px solid var(--teal); }

/* ---------- Label & notifikasi ---------- */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 12px;
}
.badge-ok { background: #dcfce7; color: var(--ok); }
.badge-warn { background: #fef3c7; color: var(--warn); }
.badge-danger { background: #fee2e2; color: var(--danger); }

.alert { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; }
.alert-success { background: #dcfce7; border-color: #bbf7d0; color: #14532d; }
.alert-error { background: #fee2e2; border-color: #fecaca; color: #7f1d1d; }
.alert-warning { background: #fef3c7; border-color: #fde68a; color: #78350f; }
.alert-info { background: #e0f2fe; border-color: #bae6fd; color: #075985; }

.pagination { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 18px 0; color: var(--muted); }
.error-code { font-size: 48px; margin: 0; color: var(--teal); }

details > summary { list-style: none; display: inline-block; }
details > summary::-webkit-details-marker { display: none; }

@media (max-width: 640px) {
    .hero, .balance { text-align: left; }
    .topnav { gap: 10px; font-size: 14px; }
}
