/* MAS Group · Live Performance — tema mengikuti MAS Group Asset Bank (navy #123b6d) */
:root {
  --navy: #123b6d;
  --navy-700: #0c2b52;
  --navy-600: #184a86;
  --navy-50: #eaf0f8;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e2e8f0;
  --text: #0f1b2d;
  --muted: #64748b;
  --green: #0f9d6b;
  --green-50: #e7f6ef;
  --amber: #b7791f;
  --red: #c53030;
  --red-50: #fdecec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 16px rgba(15, 27, 45, .05);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--navy); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.block { display: block; }
.strong { font-weight: 700; }
.green { color: var(--green); }

/* ---------- Topbar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1440px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .06em; }
.brand-mark.lg { width: 48px; height: 48px; font-size: 14px; border-radius: 12px; }
.brand-text strong, .auth-brand strong { display: block; font-size: 15px; line-height: 1.2; }
.brand-text small, .auth-brand small { color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--navy-50); color: var(--navy); }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-meta { text-align: right; line-height: 1.25; }
.user-meta strong { display: block; font-size: 13px; }
.user-meta small { color: var(--muted); font-size: 11px; }
.userbox form { margin: 0; }

/* ---------- Layout ---------- */
.container { max-width: 1440px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head p { margin: 2px 0 0; }
.eyebrow { margin: 0 0 4px !important; color: var(--navy); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.custom-range { display: flex; align-items: center; gap: 6px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-kpi { grid-template-columns: 1fr 1fr 2fr; }
.grid-main { grid-template-columns: 380px minmax(0, 1fr); align-items: start; }
.grid-main.no-form { grid-template-columns: minmax(0, 1fr); }
.grid-2-wide { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.grid-settings { grid-template-columns: 360px minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 700; }
.card > .card-title { margin-bottom: 14px; }
.card > .card-title + .small { margin: -10px 0 12px; }
.pill { background: var(--navy-50); color: var(--navy); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; margin: 0; font-size: 13px; }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi-label { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-pair { display: flex; justify-content: space-between; align-items: flex-end; }
.kpi-pair .right { text-align: right; }
.kpi-quad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi-value { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi-value.accent { color: var(--green); }
.kpi-sub { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi-foot { margin: auto 0 0; padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.kpi-foot b { color: var(--text); }
.targets { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.target-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.target-row b { color: var(--text); }
.progress { height: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .5s ease; }
.bar-green { background: var(--green); }
.bar-navy { background: var(--navy); }

/* ---------- Form ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-2.highlight { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
select.input { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(18, 59, 109, .15); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.input-sm { height: 36px; font-size: 13px; width: auto; }
.input-lg { height: 48px; font-size: 22px; font-weight: 800; }
.input.accent { color: var(--green); }
.input-file { font-size: 12px; color: var(--muted); }
.input-file::file-selector-button { margin-right: 10px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 6px 12px; font: 600 12px var(--font); color: var(--text); cursor: pointer; }
.proof { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.proof legend { padding: 0 6px; font-size: 12px; font-weight: 700; color: var(--navy); }
.dropzone { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1.5px dashed var(--navy-600); border-radius: var(--radius-sm); background: var(--navy-50); cursor: pointer; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-title { font-weight: 700; color: var(--navy); font-size: 13px; }
.dz-sub { font-size: 12px; color: var(--muted); }
.money { display: flex; align-items: center; gap: 8px; }
.money span { font-weight: 700; color: var(--muted); }
.money .input { height: 46px; font-size: 20px; font-weight: 800; text-align: right; }
.target-form { display: flex; gap: 8px; align-items: flex-end; }
.target-form label { flex: 1; }
.target-form small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.inline-form { display: inline; margin: 0; }

/* ---------- Button ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font: 600 14px var(--font); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-700); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--surface); border-color: #f2c4c4; color: var(--red); }
.btn-danger:hover { background: var(--red-50); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------- Alert / badge / toast ---------- */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; border: 1px solid; }
.alert-ok { background: var(--green-50); border-color: #bfe6d3; color: #0b6b49; }
.alert-err { background: var(--red-50); border-color: #f2c4c4; color: var(--red); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; font-weight: 700; color: var(--muted); }
.badge-navy { background: var(--navy-50); border-color: transparent; color: var(--navy); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--text); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); transition: all .2s; z-index: 200; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }

/* ---------- Board ---------- */
.board-card { display: flex; flex-direction: column; }
.board { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.board-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.rank { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: 12px; }
.rank.r1 { background: var(--navy); color: #fff; }
.rank.r2 { background: var(--navy-600); color: #fff; opacity: .8; }
.rank.r3 { background: var(--navy-50); color: var(--navy); }
.board-name { flex: 1; min-width: 0; }
.board-name strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-name small, .board-score small { color: var(--muted); font-size: 11px; }
.board-score { text-align: right; }
.board-score strong { display: block; font-size: 15px; color: var(--navy); font-variant-numeric: tabular-nums; }
.board-score small { color: var(--green); font-weight: 600; }

/* ---------- Chart ---------- */
.chart-box { position: relative; height: 260px; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.dot-green { background: var(--green); }
.dot-navy { background: var(--navy); opacity: .35; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
.table-wrap.tall { max-height: 520px; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 800; background: var(--navy-50); color: var(--navy); border-bottom: 0; }
.table td small { font-size: 11px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Calendar ---------- */
#calendar { --fc-border-color: var(--border); --fc-today-bg-color: var(--navy-50); --fc-button-bg-color: var(--surface); --fc-button-border-color: var(--border); --fc-button-text-color: var(--text); --fc-button-hover-bg-color: var(--surface-2); --fc-button-hover-border-color: var(--border); --fc-button-active-bg-color: var(--navy); --fc-button-active-border-color: var(--navy); --fc-event-border-color: transparent; font-size: 12px; }
#calendar .fc-toolbar-title { font-size: 16px; font-weight: 700; }
#calendar .fc-button { font: 600 12px var(--font); padding: 6px 10px; box-shadow: none !important; text-transform: capitalize; }
#calendar .fc-button-active { color: #fff; }
#calendar .fc-col-header-cell { background: var(--surface-2); }
#calendar .fc-col-header-cell-cushion { color: var(--muted); font-weight: 700; text-decoration: none; padding: 6px; text-transform: uppercase; font-size: 11px; }
#calendar .fc-daygrid-day-number { color: var(--text); text-decoration: none; font-weight: 600; }
#calendar .fc-event { border-radius: 5px; padding: 1px 4px; font-weight: 600; cursor: pointer; }
#calendar .ev-lead { background: var(--green); color: #fff; }
#calendar .ev-lead .fc-event-title, #calendar .ev-none .fc-event-title { color: inherit; }
#calendar .ev-none { background: var(--navy-50); color: var(--navy); }
#calendar .fc-list-event:hover td { background: var(--surface-2); }

/* ---------- Chat ---------- */
.chat-fab { position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(18, 59, 109, .35); cursor: pointer; z-index: 100; transition: transform .15s; }
.chat-fab:hover { transform: scale(1.06); }
.chat-panel { position: fixed; right: 24px; bottom: 92px; width: 370px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 120px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 16px 48px rgba(15, 27, 45, .2); display: flex; flex-direction: column; overflow: hidden; z-index: 100; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--navy); color: #fff; }
.chat-head strong { display: block; }
.chat-head small { opacity: .75; font-size: 12px; }
.chat-close { background: transparent; border: 0; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.chat-close:hover { background: rgba(255, 255, 255, .12); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.msg { max-width: 85%; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg.typing { color: var(--muted); font-style: italic; }
.msg.err { color: var(--red); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }

/* ---------- Auth ---------- */
body.auth { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #dfe8f5 0%, transparent 60%), var(--bg); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px; box-shadow: 0 12px 40px rgba(15, 27, 45, .08); }
.auth-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.auth-card h1 { font-size: 22px; font-weight: 800; }
.auth-card > .muted { margin: 4px 0 20px; }
.auth-card .alert { margin-bottom: 16px; }
.auth-foot { color: var(--muted); font-size: 12px; margin: 0; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 24px 16px 40px; color: var(--muted); }
.footer p { margin: 0; font-size: 12px; font-weight: 600; }
.footer small { font-size: 11px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid-main, .grid-2-wide, .grid-settings { grid-template-columns: minmax(0, 1fr); }
  .grid-kpi { grid-template-columns: 1fr 1fr; }
  .kpi-wide { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .topbar-inner { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .brand-text small, .user-meta { display: none; }
  .nav { order: 3; width: 100%; }
  .nav a { flex: 1; text-align: center; }
  .container { padding: 16px; gap: 16px; }
  .grid { gap: 16px; }
  .grid-2, .grid-kpi { grid-template-columns: minmax(0, 1fr); }
  .kpi-quad { grid-template-columns: 1fr 1fr; }
  .page-head h1 { font-size: 22px; }
  .toolbar { width: 100%; }
  .toolbar .input-sm { flex: 1; }
  .custom-range { width: 100%; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px -16px; }
  .auth-card { padding: 24px 20px; }
  .chat-panel { right: 16px; bottom: 84px; }
  .chat-fab { right: 16px; bottom: 16px; }
}

/* Pengaturan: Google Drive */
.form + .form { margin-top: 8px; }
.card code { word-break: break-all; }
