/* ==========================================================================
   VPE Agency — Agency OS
   ========================================================================== */
:root {
  --paper: #f6f5f1;
  --surface: #fff;
  --ink: #17161c;
  --ink-2: #222129;
  --ink-3: #2e2d36;
  --muted: #6b6a72;
  --line: #e6e3da;
  --line-2: #efede6;
  --primary: #3345ff;
  --primary-600: #2432e6;
  --primary-soft: #eceeff;
  --amber: #f59f1c;
  --amber-ink: #9a5d08;
  --amber-soft: #fff2de;
  --red: #e5484d;
  --red-soft: #fde8e8;
  --green: #2e8b57;
  --green-soft: #e3f3ea;
  --violet: #8b5cf6;
  --violet-soft: #f1ecfe;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 22, 28, .04), 0 2px 8px rgba(23, 22, 28, .04);
  --shadow-lg: 0 12px 40px rgba(23, 22, 28, .14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--font);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.015em; margin: 0 0 .4em; line-height: 1.2; }
p { margin: 0 0 .8em; }
.i { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 18px; } .mt-s { margin-top: 10px; }
.mb { margin-bottom: 18px; } .mb-s { margin-bottom: 10px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.spacer { flex: 1; }
.text-red { color: var(--red); } .text-green { color: var(--green); } .text-primary { color: var(--primary); }
.hidden { display: none !important; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--ink); color: #c9c7d1; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 20px 12px 14px; z-index: 40; scrollbar-width: thin; scrollbar-color: #33323c transparent; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; font: 700 15px var(--display); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.brand-name { font: 600 16px var(--display); letter-spacing: -.02em; color: #fff; }
.brand-sub { font: 500 9.5px var(--mono); color: #8c8a96; letter-spacing: .08em; }
.nav-label { font: 600 9.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #5f5d6c; padding: 14px 10px 6px; }
.nav { display: grid; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.nav a .i { width: 16px; height: 16px; opacity: .75; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.nav a.active .i { opacity: 1; }
.nav .count { margin-left: auto; background: var(--red); color: #fff; font: 600 10px var(--mono); padding: 1px 7px; border-radius: 999px; }
.nav a.active .count { background: #fff; color: var(--primary); }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--ink-3); display: flex; align-items: center; gap: 10px; }
.sidebar-foot .who { font-size: 12.5px; font-weight: 600; color: #efeeea; line-height: 1.3; }
.sidebar-foot .role { font-size: 10.5px; color: #8c8a96; }
.sidebar-foot form { margin-left: auto; }
.sidebar-foot button { background: none; border: 0; color: #8c8a96; cursor: pointer; padding: 6px; border-radius: 7px; display: grid; }
.sidebar-foot button:hover { background: var(--ink-2); color: #fff; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--c, var(--amber)); flex-shrink: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; text-transform: uppercase; }
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.ticker { background: var(--ink); overflow: hidden; white-space: nowrap; padding: 7px 0; border-left: 1px solid var(--ink-3); }
.ticker-track { display: inline-block; font: 12px var(--mono); color: #d8d6e0; animation: ticker 40s linear infinite; padding-left: 100%; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track a { margin-right: 40px; }
.ticker-track a:hover { color: #fff; text-decoration: underline; }
.ticker .dot { margin-right: 6px; }
.dot.red { color: var(--red); } .dot.amber { color: var(--amber); } .dot.blue { color: #8e99ff; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 32px; background: rgba(246, 245, 241, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar .search input { width: 100%; padding: 8px 12px 8px 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 13px; }
.topbar .search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.topbar .date { font: 12px var(--mono); color: var(--muted); margin-left: auto; letter-spacing: .02em; }
.mobile-toggle { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 7px; cursor: pointer; }
.content { padding: 26px 32px 64px; width: 100%; max-width: 1320px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; margin: 0 0 3px; }
.page-head .subtitle { color: var(--muted); font-size: 13.5px; max-width: 680px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--primary); margin-bottom: 12px; font-weight: 600; }
.back-link:hover { text-decoration: underline; }

/* ---------- Komponen dasar ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card.flat { box-shadow: none; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3, .section-title { font: 600 11.5px var(--font); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0; }
.section-title { margin-bottom: 12px; }
.section-title.mt { margin-top: 24px; }
input[type=file] { padding: 5px; font-size: 12.5px; color: var(--muted); }
input[type=file]::file-selector-button { font: 600 12px var(--font); border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 7px; padding: 5px 11px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--primary); color: var(--primary); }
.card-head a { font-size: 12px; font-weight: 600; color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.side-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow); position: relative; display: block; transition: border-color .15s, transform .15s; }
a.stat-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.stat-card .n { font: 700 27px/1 var(--display); letter-spacing: -.02em; }
.stat-card .n.money { font: 600 19px/1.15 var(--mono); letter-spacing: -.01em; }
.stat-card .l { font-size: 12px; color: var(--muted); margin-top: 7px; }
.stat-card .ic { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-card.warn .n { color: var(--red); }
.stat-card.warn .ic { background: var(--red-soft); color: var(--red); }
.stat-card.ok .ic { background: var(--green-soft); color: var(--green); }
.stat-card.amber .ic { background: var(--amber-soft); color: var(--amber-ink); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; background: var(--line-2); color: var(--muted); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber-ink); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.dark { background: var(--ink); color: #fff; }
.pkg { font-size: 11.5px; color: var(--primary); background: var(--primary-soft); display: inline-block; padding: 3px 9px; border-radius: 6px; font-weight: 500; }
.prio { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; text-transform: uppercase; letter-spacing: .03em; }
.prio.high { background: var(--red-soft); color: var(--red); }
.prio.medium { background: var(--amber-soft); color: var(--amber-ink); }
.prio.low { background: var(--green-soft); color: var(--green); }
.cd { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--c, var(--primary)); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 12.5px var(--font); padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: #cfccc2; background: #fbfaf7; }
.btn .i { width: 15px; height: 15px; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red-soft); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 11.5px; border-radius: 7px; }
.btn.xs { padding: 3px 7px; font-size: 11px; border-radius: 6px; }
.btn.icon { padding: 6px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.inline { display: inline; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.pill-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.pill-toggle a, .pill-toggle button { border: 0; background: transparent; font: 600 12.5px var(--font); padding: 6px 13px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.pill-toggle a:hover, .pill-toggle button:hover { color: var(--ink); }
.pill-toggle .active { background: var(--primary); color: #fff !important; }
.client-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.client-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.client-pill:hover { color: var(--ink); }
.client-pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.month-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.month-nav a { padding: 5px 8px; border-radius: 7px; color: var(--muted); display: grid; }
.month-nav a:hover { background: var(--line-2); color: var(--ink); }
.month-nav span { font: 600 12.5px var(--font); padding: 0 8px; min-width: 120px; text-align: center; }

.progress-bar { height: 7px; background: var(--line-2); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress-bar > div { height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s; }
.progress-bar.red > div { background: var(--red); }
.progress-bar.green > div { background: var(--green); }
.progress-bar.amber > div { background: var(--amber); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); font-size: 13px; }
.empty .i { width: 28px; height: 28px; margin-bottom: 6px; opacity: .5; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #faf9f5; }
.card.pad-0 th:first-child, .card.pad-0 td:first-child { padding-left: 20px; }
.card.pad-0 th:last-child, .card.pad-0 td:last-child { padding-right: 20px; }
.crumb { font-size: 11.5px; color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 600; }
.assignee { display: flex; align-items: center; gap: 7px; white-space: nowrap; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 5px; }
.field > span, label.lbl { font-size: 12px; font-weight: 600; color: #3d3c44; }
.field small, .help { font-size: 11.5px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=month], input[type=color], input[type=search], input[type=url], input[type=file], select, textarea {
  width: 100%; font: inherit; font-size: 13.5px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink);
}
input[type=color] { padding: 3px; height: 38px; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-bar input, .filter-bar select { width: auto; min-width: 150px; padding: 7px 10px; font-size: 12.5px; }
.lines-table td { padding: 6px 4px; border: 0; }
.lines-table input, .lines-table select { padding: 6px 8px; font-size: 13px; }

/* ---------- Flash & modal ---------- */
.flash { background: var(--green-soft); color: #1e6b41; border: 1px solid #bfe3cd; padding: 11px 14px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.errors { background: var(--red-soft); color: #9e2b2f; border: 1px solid #f5c7c8; padding: 11px 14px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; }
.errors ul { margin: 4px 0 0; padding-left: 18px; }
dialog.modal { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(23, 22, 28, .45); backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 6px; display: grid; }
.modal-head button:hover { background: var(--line-2); }
.modal-body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: #fcfbf8; }

/* ---------- Home ---------- */
.attn-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.attn-row:last-child { border-bottom: 0; }
a.attn-row:hover { background: #faf9f5; }
.flag { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.flag.red { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.flag.amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.flag.blue { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.attn-row .client { font-weight: 600; }
.attn-row .meta { margin-left: auto; color: var(--muted); font: 11.5px var(--mono); white-space: nowrap; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1.5px; background: var(--line); }
.t-item { position: relative; padding-bottom: 15px; }
.t-item:last-child { padding-bottom: 0; }
.t-item::before { content: ""; position: absolute; left: -20px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.t-item .d { font: 10.5px var(--mono); color: var(--muted); text-transform: uppercase; }
.t-item .txt { font-size: 13.5px; margin-top: 1px; }
.t-item .by { font-size: 11.5px; color: var(--muted); }
.mini-list { display: grid; }
.mini-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.mini-item:last-child { border-bottom: 0; }
.mini-item .when { font: 11px var(--mono); color: var(--muted); width: 54px; flex-shrink: 0; }
.mini-item .grow { flex: 1; min-width: 0; }
.mini-item .grow .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-item .grow .s { font-size: 11.5px; color: var(--muted); }

/* ---------- Clients ---------- */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.client-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.client-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c, var(--primary)); }
.client-card:hover { border-color: var(--c, var(--primary)); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(23, 22, 28, .07); }
.client-card .top { display: flex; align-items: center; gap: 10px; }
.client-card .cname { font: 600 16px var(--display); }
.client-card .row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-top: 8px; gap: 8px; }
.client-card .card-link { font-size: 11.5px; color: var(--primary); font-weight: 600; margin-top: 10px; }
.client-card.add { align-items: center; justify-content: center; color: var(--muted); font-size: 13px; border-style: dashed; box-shadow: none; min-height: 170px; }
.client-card.add::before { display: none; }
.client-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--c, var(--primary)); color: #fff; display: grid; place-items: center; font: 700 15px var(--display); flex-shrink: 0; }
.client-mark.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.detail-head .who { display: flex; gap: 14px; align-items: center; }
.detail-head h2 { margin: 0 0 4px; font-size: 21px; }
.detail-head .meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.quota-setting { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px; font-size: 12px; color: var(--muted); }
.quota-setting select { border: 0; padding: 4px 6px; font-weight: 600; width: auto; background: var(--line-2); border-radius: 7px; font-size: 12px; }
.quota-row { margin-bottom: 16px; }
.quota-row:last-child { margin-bottom: 0; }
.quota-row .qhead { display: flex; justify-content: space-between; font-size: 13px; }
.quota-remaining { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.quota-remaining.tight { color: var(--red); font-weight: 600; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.milestone-list { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.milestone-step { flex: 1; min-width: 120px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; font-size: 12.5px; text-align: center; position: relative; }
.milestone-step small { display: block; font: 10.5px var(--mono); color: var(--muted); margin-top: 2px; }
.milestone-step.done { background: var(--green-soft); border-color: var(--green); color: #1e6b41; font-weight: 600; }
.milestone-step.current { background: var(--amber-soft); border-color: var(--amber); color: var(--amber-ink); font-weight: 600; }
.milestone-step form { margin-top: 6px; }

/* ---------- Calendar ---------- */
.legend { display: flex; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 11px; font-weight: 600; color: var(--muted); padding: 0 4px 4px; text-transform: uppercase; letter-spacing: .05em; }
.day-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-height: 112px; padding: 6px 7px; min-width: 0; position: relative; }
.day-cell .dnum { font: 11px var(--mono); color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.day-cell .dnum a { opacity: 0; color: var(--primary); font-size: 14px; line-height: 1; padding: 0 2px; }
.day-cell:hover .dnum a { opacity: 1; }
.day-cell.out { background: transparent; border-style: dashed; opacity: .55; }
.day-cell.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.day-cell.today .dnum > span { background: var(--primary); color: #fff; border-radius: 5px; padding: 0 5px; }
.day-cell.weekend { background: #fcfbf8; }
.chip { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; padding: 3px 6px; border-radius: 6px; margin-top: 4px; border-left: 3px solid var(--c, var(--primary)); background: color-mix(in srgb, var(--c, var(--primary)) 11%, #fff); color: color-mix(in srgb, var(--c, var(--primary)) 70%, #111); line-height: 1.3; min-width: 0; }
.chip span.t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.chip:hover { filter: brightness(.96); }
.chip.st-published { opacity: .6; }
.chip .ok { margin-left: auto; font-size: 9px; }
.more-link { font-size: 10.5px; color: var(--muted); margin-top: 4px; display: block; }
.week-row { display: flex; gap: 16px; padding: 13px 4px; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.week-row:last-child { border-bottom: 0; }
.week-row.today .wd .day { color: var(--primary); }
.week-row .wd { width: 84px; flex-shrink: 0; }
.week-row .wd .day { font-weight: 700; font-size: 13px; }
.week-row .wd .dt { font: 11px var(--mono); color: var(--muted); }
.week-cards { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.wcard { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--primary)); border-radius: 10px; padding: 9px 11px; min-width: 180px; max-width: 240px; font-size: 12px; display: block; }
.wcard:hover { border-color: var(--c, var(--primary)); }
.wcard .plat { font-size: 10px; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.wcard .ttl { font-weight: 600; margin: 3px 0; font-size: 12.5px; }
.wcard .ctag { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); margin: 3px 0; }
.wcard .meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10.5px; gap: 6px; }
.agenda-row { display: flex; align-items: flex-start; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--line-2); }
.agenda-row:last-child { border-bottom: 0; }
.agenda-row .adate { width: 58px; flex-shrink: 0; text-align: center; background: var(--paper); border-radius: 10px; padding: 6px 0; }
.agenda-row .adate b { display: block; font: 700 18px/1 var(--display); }
.agenda-row .adate span { font: 10px var(--mono); color: var(--muted); text-transform: uppercase; }
.agenda-row .atxt { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.agenda-row .aloc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.agenda-row .actions { margin-left: auto; display: flex; gap: 4px; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kcol { background: #efede6; border-radius: var(--radius); padding: 10px; min-height: 140px; transition: background .15s, box-shadow .15s; }
.kcol.drag-over { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.kcol h4 { font: 600 11px var(--font); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 2px 4px 10px; display: flex; justify-content: space-between; align-items: center; }
.kcol h4 .n { font-family: var(--mono); background: var(--surface); border-radius: 999px; padding: 0 7px; }
.kcard { background: var(--surface); border-radius: 10px; padding: 10px 11px; margin-bottom: 8px; border: 1px solid var(--line); font-size: 12.5px; cursor: grab; box-shadow: var(--shadow); border-left: 3px solid var(--c, var(--primary)); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .45; }
.kcard .kc-plat { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.kcard .kc-title { font-weight: 600; margin-bottom: 7px; line-height: 1.35; display: block; }
.kcard .kc-title:hover { color: var(--primary); }
.kcard .kc-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; gap: 6px; }
.kcard .kc-move { display: flex; gap: 4px; margin-top: 8px; }
.kcard .kc-move form { flex: 1; }
.kcard .kc-move button { width: 100%; }

/* ---------- Tasks ---------- */
.cap-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.cap-row:last-child { border-bottom: 0; }
.cap-row .cname2 { width: 170px; font-size: 13px; font-weight: 600; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.cap-row .cname2 small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.cap-track { flex: 1; height: 9px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.cap-track > div { height: 100%; border-radius: 5px; }
.cap-pct { width: 74px; text-align: right; font: 12px var(--mono); flex-shrink: 0; }
.checklist { list-style: none; padding: 0; margin: 4px 0 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.checklist li:last-child { border-bottom: 0; }
.checklist .chk { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #cfccc2; flex-shrink: 0; display: grid; place-items: center; color: #fff; background: var(--surface); cursor: pointer; padding: 0; }
.checklist .chk .i { width: 12px; height: 12px; stroke-width: 3; }
.checklist li.done .chk { background: var(--green); border-color: var(--green); }
.checklist li.done .txt { text-decoration: line-through; color: var(--muted); }
.checklist .txt { flex: 1; }
.checklist .del { opacity: 0; }
.checklist li:hover .del { opacity: 1; }
.add-inline { display: flex; gap: 8px; margin-top: 10px; }
.add-inline input { flex: 1; }
.attachment-card { display: flex; align-items: center; gap: 11px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin-top: 8px; font-size: 12.5px; }
.attachment-card .fic { width: 34px; height: 34px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.attachment-card .fic img { width: 100%; height: 100%; object-fit: cover; }
.attachment-card .meta2 { font-size: 11px; color: var(--muted); }
.attachment-card .grow { flex: 1; min-width: 0; }
.attachment-card .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-date-box { margin-top: 18px; padding: 14px 16px; border-radius: 12px; font-size: 13px; }
.post-date-box.active { background: var(--green-soft); border: 1px dashed var(--green); }
.post-date-box.locked { background: var(--paper); border: 1px dashed #d5d2c8; color: var(--muted); }
.post-date-box .pd-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.post-date-box.active .pd-label { color: #1e6b41; }
.post-date-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.post-date-row .field { min-width: 150px; }
.detail-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 18px; }
.detail-meta-grid .dm { background: var(--paper); border-radius: 10px; padding: 9px 12px; }
.detail-meta-grid .dm .l2 { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.detail-meta-grid .dm .v2 { font-size: 13px; font-weight: 600; margin-top: 2px; }
.status-steps { display: flex; gap: 4px; flex-wrap: wrap; }
.status-steps button { border: 1px solid var(--line); background: var(--surface); font: 600 11.5px var(--font); padding: 5px 10px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.status-steps button:hover { border-color: var(--primary); color: var(--primary); }
.status-steps button.current { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Meetings ---------- */
.meet-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.meet-list { display: grid; gap: 4px; }
.meet-list-item { padding: 11px 13px; border-radius: 11px; border: 1px solid transparent; display: block; }
.meet-list-item:hover { background: rgba(255, 255, 255, .6); }
.meet-list-item.active { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.meet-list-item .mc { font-size: 11px; color: var(--primary); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.meet-list-item .mt { font-size: 13px; font-weight: 600; margin-top: 2px; }
.meet-list-item .md { font: 11px var(--mono); color: var(--muted); margin-top: 2px; }
.quad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.quad { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.quad h4 { margin: 0 0 10px; font: 600 11.5px var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.quad ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.75; }
.quad.wide { grid-column: 1 / -1; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.action-row:last-child { border-bottom: 0; }
.convert-result { margin-top: 6px; background: var(--green-soft); border: 1px dashed var(--green); border-radius: 10px; padding: 8px 12px; font-size: 12px; color: #1e6b41; }

/* ---------- Inbox ---------- */
.req { display: flex; align-items: flex-start; gap: 14px; padding: 15px 4px; border-bottom: 1px solid var(--line-2); }
.req:last-child { border-bottom: 0; }
.req .ch { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--paper); color: var(--muted); flex-shrink: 0; }
.req .ch.whatsapp { background: #e3f6ea; color: #1f9d55; }
.req .ch.instagram { background: #fde7f1; color: #d6246e; }
.req .ch.email { background: var(--primary-soft); color: var(--primary); }
.req .ch.meeting { background: var(--violet-soft); color: var(--violet); }
.req .rc { flex: 1; min-width: 0; }
.req .rclient { font-size: 11.5px; color: var(--primary); font-weight: 700; display: flex; gap: 8px; align-items: center; }
.req .rclient .when { color: var(--muted); font: 400 11px var(--mono); }
.req .rtxt { font-size: 14px; margin-top: 3px; }
.req .tags { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.req .ractions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------- Assets ---------- */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.asset-tile { background: linear-gradient(150deg, #ece9df, #dcd8cb); border: 1px solid var(--line); border-radius: 13px; aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 9px; position: relative; overflow: hidden; background-size: cover; background-position: center; transition: transform .15s, box-shadow .15s; }
.asset-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23, 22, 28, .12); }
.asset-tile.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, .55)); }
.asset-tile > * { position: relative; z-index: 1; }
.asset-tile .ftype { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -70%); color: #8b877a; z-index: 0; }
.asset-tile .ftype .i { width: 34px; height: 34px; stroke-width: 1.4; }
.asset-tile .ftype b { display: block; text-align: center; font: 600 10px var(--mono); margin-top: 2px; }
.asset-tile .tag { font: 10px var(--mono); color: #4f4d44; background: rgba(255, 255, 255, .82); padding: 2px 6px; border-radius: 5px; align-self: flex-start; margin-bottom: 4px; }
.asset-tile .fname { font-size: 11.5px; font-weight: 600; color: #2d2b25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-tile .fclient { font-size: 10.5px; color: #5b594f; }
.asset-tile.has-img .fname, .asset-tile.has-img .fclient { color: #fff; }
.asset-tile .tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; z-index: 2; }
.asset-tile:hover .tools { opacity: 1; }
.asset-tile .tools a, .asset-tile .tools button { background: rgba(255, 255, 255, .92); border: 0; border-radius: 7px; padding: 5px; display: grid; cursor: pointer; color: var(--ink); }

/* ---------- Reports ---------- */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 150px; margin: 14px 0 22px; }
.bars .bar { flex: 1; background: var(--primary-soft); border-radius: 7px 7px 0 0; position: relative; min-height: 4px; }
.bars .bar.hi { background: var(--primary); }
.bars .bar span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font: 10px var(--mono); color: var(--muted); }
.bars .bar em { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font: normal 10px var(--mono); color: var(--muted); }
.heatmap { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 12px; }
.heatmap .hlbl { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; }
.heatmap .hlbl.c { justify-content: center; font-family: var(--mono); }
.heat-cell { aspect-ratio: 1.6 / 1; border-radius: 5px; background: var(--primary); }
.heat-0 { opacity: .07; } .heat-1 { opacity: .22; } .heat-2 { opacity: .45; } .heat-3 { opacity: .72; } .heat-4 { opacity: 1; }
.heat-input { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); gap: 4px; align-items: center; }
.heat-input select { padding: 4px; font-size: 12px; }
.ai-insight { background: var(--violet-soft); border: 1px solid #dacbfb; border-radius: var(--radius); padding: 16px 18px; }
.ai-insight .ai-lbl { font-size: 11px; font-weight: 700; color: var(--violet); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.ai-insight ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.85; color: #3d2f5e; }
.insight-block { border-left: 3px solid var(--primary); padding: 4px 0 4px 14px; margin-bottom: 14px; }
.insight-block:last-child { margin-bottom: 0; }
.insight-block.bad { border-color: var(--red); }
.insight-block.rec { border-color: var(--amber); }
.insight-block .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.insight-block .txt { font-size: 13.5px; margin-top: 3px; white-space: pre-line; }

/* ---------- Templates / dokumen ---------- */
.tpl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.doc-page { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 40px; max-width: 720px; font-size: 13px; line-height: 1.7; box-shadow: var(--shadow); }
.doc-page h2 { font-size: 19px; margin: 0 0 2px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.doc-page h2 .mono { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.doc-page .doc-from { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
.doc-page .doc-from .agency b { font: 700 16px var(--display); display: block; }
.doc-page .doc-from small { color: var(--muted); display: block; line-height: 1.5; }
.doc-page .doc-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.doc-page hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.doc-page table { margin-top: 8px; }
.doc-page td, .doc-page th { padding: 8px 4px; font-size: 12.5px; }
.doc-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 2px 0; }
.doc-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; margin-top: 10px; padding-top: 10px; border-top: 1.5px solid var(--ink); }
.clause { margin-bottom: 14px; }
.clause b { display: block; margin-bottom: 2px; }
.doc-body { white-space: pre-line; }
.placeholder { display: inline-block; background: var(--primary-soft); color: var(--primary); border: 1px dashed var(--primary); border-radius: 6px; padding: 0 6px; font: 11.5px var(--mono); }
.sign-row { display: flex; justify-content: space-between; gap: 30px; margin-top: 40px; font-size: 12.5px; }
.sign-row > div { flex: 1; text-align: center; }
.sign-row .line { border-top: 1px solid var(--ink); margin-top: 60px; padding-top: 6px; font-weight: 600; }
.field-note { font-size: 12px; color: var(--muted); line-height: 1.65; }
.doc-list { display: grid; }
.doc-list a { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 9px; font-size: 13px; gap: 8px; }
.doc-list a:hover { background: var(--paper); }
.doc-list a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--ink); color: #efeeea; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(51, 69, 255, .55), transparent 65%); }
.auth-art h2 { font-size: 40px; line-height: 1.1; max-width: 460px; color: #fff; position: relative; z-index: 1; }
.auth-art h2 em { font-style: normal; color: #8e99ff; }
.auth-art .feat { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.auth-art .feat span { font: 11px var(--mono); border: 1px solid #3a3944; border-radius: 999px; padding: 4px 10px; color: #c9c7d1; }
.auth-form { display: grid; place-items: center; padding: 32px; }
.auth-form form { width: min(380px, 100%); display: grid; gap: 14px; }
.auth-form h1 { font-size: 26px; margin: 0; }

.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; }
.pagination .active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .disabled { opacity: .45; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .two-col, .side-col, .tpl-layout { grid-template-columns: minmax(0, 1fr); }
  .detail-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; width: 248px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .mobile-toggle { display: grid; }
  .topbar { padding: 10px 16px; }
  .topbar .date { display: none; }
  .content { padding: 20px 16px 48px; }
  .grid-2, .grid-3, .form-grid, .form-grid.cols-3, .quad-grid, .meet-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-grid { gap: 3px; }
  .day-cell { min-height: 74px; padding: 4px; border-radius: 7px; }
  .chip { font-size: 0; padding: 0; height: 6px; border-left-width: 0; background: var(--c, var(--primary)); }
  .chip * { display: none; }
  .cal-dow { font-size: 9.5px; padding: 0 2px 4px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .cap-row .cname2 { width: 120px; }
  .doc-page { padding: 22px 18px; }
}

/* ---------- Print ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .sidebar, .topbar, .ticker, .no-print, .flash { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .doc-page, .card, .stat-card, .quad { box-shadow: none; border-color: #ddd; }
  .doc-page { border: 0; padding: 0; max-width: none; }
  .placeholder { border: 0; background: none; color: inherit; padding: 0; font: inherit; }
  .bars .bar, .heat-cell, .progress-bar > div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
