/* Rodin PM - soft, premium, RTL friendly */
:root {
	--pm-bg: #f5f2ec;
	--pm-surface: #fbf9f5;
	--pm-card: #fffdf9;
	--pm-line: #e6e0d4;
	--pm-ink: #2b2f3a;
	--pm-muted: #7a7f8c;
	--pm-accent: #3d5a80;
	--pm-ok: #4f7c5a;
	--pm-warn: #b5793a;
	--pm-bad: #a8504a;
	--pm-radius: 14px;
	--pm-shadow: 0 1px 2px rgba(43, 47, 58, .06), 0 4px 14px rgba(43, 47, 58, .05);
}
.pm-root { background: var(--pm-bg); border-radius: var(--pm-radius); padding: 16px; color: var(--pm-ink); min-height: 70vh; }
.pm-root * { box-sizing: border-box; }
.pm-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.pm-toolbar .frappe-control { margin: 0; min-width: 200px; }
.pm-toolbar .form-group { margin-bottom: 0; }
.pm-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--pm-line); background: var(--pm-card); color: var(--pm-ink);
	border-radius: 10px; padding: 6px 12px; font-size: 13px; cursor: pointer; transition: background .15s; }
.pm-btn:hover { background: #f0ebe1; }
.pm-btn.active, .pm-btn.primary { background: var(--pm-ink); color: #fbf9f5; border-color: var(--pm-ink); }
.pm-icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pm-muted { color: var(--pm-muted); font-size: 12px; }
.pm-layout { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
@media (max-width: 1100px) { .pm-layout { grid-template-columns: 1fr; } }

/* Kanban */
.pm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.pm-col { background: var(--pm-surface); border: 1px solid var(--pm-line); border-radius: var(--pm-radius); padding: 10px; min-height: 360px; display: flex; flex-direction: column; }
.pm-col.drag-over { background: #ece6da; }
.pm-col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 8px; padding: 2px 4px; }
.pm-count { background: var(--pm-bg); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--pm-muted); }
.pm-card { background: var(--pm-card); border: 1px solid var(--pm-line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--pm-shadow); cursor: grab; }
.pm-card:active { cursor: grabbing; }
.pm-card-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; line-height: 1.5; }
.pm-card-title a { color: var(--pm-ink); }
.pm-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--pm-muted); }
.pm-meta span { display: inline-flex; align-items: center; gap: 4px; }
.pm-badge { border-radius: 999px; padding: 1px 8px; font-size: 11px; border: 1px solid var(--pm-line); background: var(--pm-bg); color: var(--pm-ink); }
.pm-badge.pending { color: var(--pm-warn); border-color: #e7cfb2; }
.pm-badge.approved { color: var(--pm-ok); border-color: #c5d8c9; }
.pm-badge.rejected, .pm-badge.overdue { color: var(--pm-bad); border-color: #e3c3c0; }
.pm-card-actions { display: flex; gap: 6px; margin-top: 8px; }
.pm-card-actions .pm-btn { padding: 2px 8px; font-size: 12px; }

/* list */
.pm-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--pm-card); border: 1px solid var(--pm-line); border-radius: var(--pm-radius); overflow: hidden; }
.pm-table th, .pm-table td { padding: 9px 12px; border-bottom: 1px solid var(--pm-line); font-size: 13px; text-align: start; }
.pm-table th { background: var(--pm-surface); color: var(--pm-muted); font-weight: 600; }
.pm-table tr:last-child td { border-bottom: 0; }
.pm-progress { height: 8px; background: #ebe5d9; border-radius: 99px; overflow: hidden; min-width: 90px; }
.pm-progress > div { height: 100%; background: var(--pm-accent); border-radius: 99px; }

/* chat */
.pm-panel { background: var(--pm-surface); border: 1px solid var(--pm-line); border-radius: var(--pm-radius); padding: 12px; display: flex; flex-direction: column; max-height: 78vh; }
.pm-panel h5 { margin: 0 0 8px; display: flex; gap: 6px; align-items: center; }
.pm-msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.pm-msg { background: var(--pm-card); border: 1px solid var(--pm-line); border-radius: 12px; padding: 8px 10px; font-size: 13px; }
.pm-msg.mine { background: #eef1f5; }
.pm-msg .who { font-weight: 600; font-size: 12px; }
.pm-msg .when { color: var(--pm-muted); font-size: 11px; }
.pm-compose { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.pm-compose textarea { border: 1px solid var(--pm-line); border-radius: 10px; padding: 8px; background: var(--pm-card); resize: vertical; min-height: 60px; }

/* calendar */
.pm-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.pm-cal-head { text-align: center; font-size: 12px; color: var(--pm-muted); padding: 4px; }
.pm-day { background: var(--pm-card); border: 1px solid var(--pm-line); border-radius: 10px; min-height: 104px; padding: 6px; }
.pm-day.other { opacity: .45; }
.pm-day.today { border-color: var(--pm-ink); }
.pm-day.friday { background: #f3eee5; }
.pm-day.drag-over { background: #e9e3d6; }
.pm-day-num { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.pm-chip { font-size: 11px; background: #e7ecf2; color: var(--pm-ink); border-radius: 6px; padding: 2px 6px; margin-bottom: 3px; cursor: grab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-chip.done { background: #e2ece4; text-decoration: line-through; color: var(--pm-muted); }

/* gantt */
.pm-gantt { background: var(--pm-card); border: 1px solid var(--pm-line); border-radius: var(--pm-radius); overflow: auto; position: relative; }
.pm-gantt-grid { position: relative; }
.pm-g-row { display: flex; height: 36px; border-bottom: 1px solid #f0ebe1; }
.pm-g-label { position: sticky; inset-inline-start: 0; z-index: 3; width: 240px; flex: none; background: var(--pm-surface); border-inline-end: 1px solid var(--pm-line);
	padding: 8px 10px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-g-track { position: relative; flex: none; }
.pm-g-head .pm-g-track { display: flex; }
.pm-g-day { flex: none; text-align: center; font-size: 10px; color: var(--pm-muted); border-inline-start: 1px solid #f0ebe1; padding-top: 18px; position: relative; }
.pm-g-day.friday { background: #f6f1e8; }
.pm-g-day.month-start::before { content: attr(data-month); position: absolute; top: 2px; inset-inline-start: 2px; font-size: 11px; color: var(--pm-ink); font-weight: 600; white-space: nowrap; }
.pm-g-bar { position: absolute; top: 7px; height: 22px; border-radius: 7px; background: var(--pm-accent); color: #fbf9f5; font-size: 11px; padding: 3px 8px; cursor: grab;
	white-space: nowrap; overflow: hidden; box-shadow: var(--pm-shadow); }
.pm-g-bar.done { background: var(--pm-ok); }
.pm-g-bar.overdue { background: var(--pm-bad); }
.pm-g-bar .handle { position: absolute; top: 0; bottom: 0; width: 7px; inset-inline-end: 0; cursor: ew-resize; }
.pm-g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--pm-warn); z-index: 2; opacity: .6; }
.pm-g-links { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 1; }

/* dashboard */
.pm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pm-kpi { background: var(--pm-card); border: 1px solid var(--pm-line); border-radius: var(--pm-radius); padding: 14px; box-shadow: var(--pm-shadow); }
.pm-kpi .v { font-size: 24px; font-weight: 700; }
.pm-kpi .l { color: var(--pm-muted); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.pm-section-title { font-weight: 700; margin: 18px 0 8px; display: flex; gap: 6px; align-items: center; }

/* portal */
.pm-portal { background: var(--pm-bg); padding: 24px; border-radius: 18px; color: var(--pm-ink); }
.pm-portal .pm-card { cursor: default; }
.pm-portal a.pm-card { display: block; text-decoration: none; }
.pm-check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
