/* ============ Tokens ============ */
:root[data-theme="light"] {
  --canvas:        #FAFAF8;
  --surface:       #FFFFFF;
  --surface-2:     #F4F3EF;
  --surface-3:     #ECEAE4;
  --border:        #E6E3DC;
  --border-strong: #D6D2C9;
  --text:          #18171A;
  --text-muted:    #6B6862;
  --text-soft:     #9A968F;
  --accent:        #4D5BD6;
  --accent-soft:   #EEF0FE;
  --accent-text:   #FFFFFF;
  --chip-gray:     #F1EFEB;
  --chip-blue:     #EEF0FE;
  --chip-amber:    #FBF1DE;
  --chip-green:    #E9F2EB;
  --shadow-sm:     0 1px 2px rgba(20,16,12,.04);
  --shadow-md:     0 4px 12px rgba(20,16,12,.06);
  --shadow-lg:     0 20px 60px rgba(20,16,12,.18);
}
:root[data-theme="dark"] {
  --canvas:        #0E0E0D;
  --surface:       #161614;
  --surface-2:     #1D1D1B;
  --surface-3:     #242422;
  --border:        #28282A;
  --border-strong: #36363A;
  --text:          #F0EFEC;
  --text-muted:    #8E8B85;
  --text-soft:     #5F5C57;
  --accent:        #8B96F7;
  --accent-soft:   #1E2148;
  --accent-text:   #0E0E0D;
  --chip-gray:     #232321;
  --chip-blue:     #1E2148;
  --chip-amber:    #3A2E1A;
  --chip-green:    #1B2E22;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.4);
  --shadow-md:     0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:     0 20px 60px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.small { font-size: 12px; }
.muted { color: var(--text-muted); }
.num { font-variant-numeric: tabular-nums; }
a.link { color: var(--accent); cursor: pointer; text-decoration: none; font-weight: 500; }
a.link:hover { text-decoration: underline; }

/* ============ App shell ============ */
.app-shell { display: flex; min-height: 100vh; }
.app-main  { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content { flex: 1; min-width: 0; padding: 28px 40px 60px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ============ Sidebar ============ */
.sidebar {
  width: 240px; flex: 0 0 240px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 14px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text);
}
.sb-brand svg { color: var(--accent); }
.sb-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 0 8px; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 7px 10px; border-radius: 6px;
  background: transparent; border: 0; text-align: left;
  color: var(--text-muted); font-size: 13.5px; font-weight: 500;
}
.sb-item:hover { background: var(--surface-2); color: var(--text); }
.sb-item.active { background: var(--surface-2); color: var(--text); }
.sb-item.active .sb-ico { color: var(--accent); }
.sb-item.compact { padding: 5px 10px; font-size: 13px; gap: 8px; }
.sb-ico { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-soft); }
.sb-lbl { flex: 1; }
.sb-badge {
  font-size: 10px; font-weight: 600;
  background: var(--accent); color: var(--accent-text);
  border-radius: 999px; padding: 1px 7px; min-width: 18px; text-align: center;
}
.sb-section { padding: 14px 0 0; border-top: 1px solid var(--border); margin-top: 6px; }
.sb-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-soft); font-weight: 600; padding: 0 10px 6px;
}
.sb-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.theme-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; border-radius: 6px;
  background: transparent; border: 0; color: var(--text-muted); font-size: 12.5px;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.sb-user {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
}
.sb-user:hover { background: var(--surface-2); }
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name { font-size: 13px; font-weight: 500; color: var(--text); }
.sb-user-role { font-size: 11px; color: var(--text-muted); }

/* ============ TopBar ============ */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 40px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--canvas) 85%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.search {
  flex: 1; max-width: 560px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted);
}
.search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 13px;
}
.search input::placeholder { color: var(--text-soft); }
.kbd {
  font-family: "Geist Mono", monospace; font-size: 11px;
  color: var(--text-soft); padding: 1px 6px;
  border: 1px solid var(--border); border-radius: 4px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn-lg {
  position: relative; width: 32px; height: 32px;
  border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn-lg:hover { background: var(--surface-2); color: var(--text); }
.badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 999px;
  background: #D14E4E; box-shadow: 0 0 0 2px var(--surface);
}

/* ============ Pages ============ */
.page { display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head-actions { display: flex; gap: 8px; }
.eyebrow {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600; margin-bottom: 4px;
}
.page-title {
  font-family: "Instrument Serif", "Geist", serif;
  font-size: 32px; font-weight: 400; letter-spacing: -0.01em;
  margin: 0; color: var(--text);
}
.breadcrumb { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; }
.breadcrumb .acc-mini { width: 16px; height: 16px; font-size: 9px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 500;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary {
  background: var(--text); color: var(--canvas); border-color: var(--text);
}
:root[data-theme="dark"] .btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--text) 88%, transparent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-md { padding: 8px 14px; font-size: 13px; }
.btn-icon { display: inline-flex; align-items: center; }
.icon-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 0; background: transparent; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ============ Cards ============ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.span-2 { grid-column: span 2; }

/* ============ Stats ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
}
.stat-k { font-size: 12px; color: var(--text-muted); }
.stat-v {
  font-family: "Instrument Serif", serif;
  font-size: 36px; font-weight: 400; letter-spacing: -0.02em;
  line-height: 1.05; margin: 6px 0 2px;
}
.stat-sub { font-size: 11.5px; color: var(--text-soft); }

/* ============ Dashboard grid ============ */
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

/* ============ Task list/row ============ */
.task-list { display: flex; flex-direction: column; }
.task-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 16px;
  border: 0; background: transparent; border-bottom: 1px solid var(--border);
  text-align: left;
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--surface-2); }
.tr-main { flex: 1; min-width: 0; }
.tr-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.tr-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* Task table */
.task-table-head, .task-table-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
}
.task-table-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-soft); font-weight: 600;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.task-table-row {
  width: 100%; border: 0; background: transparent;
  border-bottom: 1px solid var(--border); text-align: left;
  font-size: 13px;
}
.task-table-row:last-child { border-bottom: 0; }
.task-table-row:hover { background: var(--surface-2); }

/* Chip */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
}

/* Bar */
.bar {
  position: relative; height: 4px; border-radius: 99px;
  background: var(--surface-3); overflow: hidden; margin-top: 6px;
}
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ============ Projects ============ */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 14px; }
.proj-card {
  text-align: left; padding: 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, transform .15s;
}
.proj-card:hover { border-color: var(--border-strong); }
.proj-card-top { display: flex; align-items: center; gap: 8px; }
.proj-card-name { font-size: 14px; font-weight: 500; margin-top: 2px; }
.proj-card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.proj-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.proj-card-foot .bar { flex: 1; margin: 0 12px 0 0; }

/* ============ Accounts ============ */
.acc-mini, .acc-big {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; color: #fff; font-weight: 600;
  flex: 0 0 auto;
}
.acc-mini { width: 22px; height: 22px; font-size: 10px; letter-spacing: -0.02em; }
.acc-big { width: 42px; height: 42px; font-size: 14px; border-radius: 8px; letter-spacing: -0.02em; }

.cuentas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cuenta-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; text-align: left;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color .15s, transform .15s;
}
.cuenta-card:hover { border-color: var(--border-strong); }
.cuenta-top { display: flex; gap: 12px; align-items: center; }
.cuenta-name { font-size: 16px; font-weight: 500; }
.cuenta-stats { display: flex; gap: 18px; padding: 4px 0; }
.cuenta-stats > div { display: flex; flex-direction: column; }
.cuenta-stats .num { font-family: "Instrument Serif", serif; font-size: 22px; line-height: 1; }
.cuenta-stats .lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.cuenta-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); }

.cuenta-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
}

/* Tabs */
.tab-row {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 12px; border: 0; background: transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }
.tab .count {
  font-size: 11px; color: var(--text-muted);
  background: var(--surface-2); padding: 1px 6px; border-radius: 99px;
}

/* Project summary */
.proj-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.ps-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.ps-k { font-size: 11.5px; color: var(--text-muted); }
.ps-v.big {
  font-family: "Instrument Serif", serif;
  font-size: 30px; font-weight: 400; letter-spacing: -0.01em;
  margin: 4px 0;
}
.ps-v .unit { font-size: 15px; color: var(--text-muted); margin-left: 2px; }

/* Kanban */
.kanban {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.kanban-col {
  background: var(--surface-2); border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
  min-height: 320px;
}
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.kanban-list { display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  text-align: left; padding: 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.kanban-card:hover { border-color: var(--border-strong); }
.kc-title { font-size: 13px; font-weight: 500; }
.kc-meta { display: flex; align-items: center; justify-content: space-between; }
.kc-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--border); }

/* Notifications */
.notif-list { display: flex; flex-direction: column; }
.notif {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.notif:last-child { border-bottom: 0; }
.notif.expanded { padding: 14px 18px; }
.notif.read { opacity: 0.7; }
.notif:hover { background: var(--surface-2); }
.unread-dot {
  position: absolute; left: 6px; top: 22px;
  width: 6px; height: 6px; border-radius: 999px; background: var(--accent);
}
.notif-ico {
  width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; flex: 0 0 auto;
}
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 13px; color: var(--text); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 4px; }
.field.full { grid-column: 1 / -1; }
.field-label { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }
.field input, .field textarea, .field select, .select {
  border: 1px solid var(--border); border-radius: 7px;
  padding: 8px 10px; background: var(--surface); color: var(--text);
  font-size: 13.5px;
}
.field input:focus, .field textarea:focus, .field select:focus, .select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 64px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20,16,12,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 8vh;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 14px; font-weight: 600; }
.modal-body { padding: 18px; max-height: 70vh; overflow: auto; }
.modal-footer {
  padding: 12px 18px; border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* Drawer (task) */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20,16,12,0.32);
  display: flex; justify-content: flex-end;
}
.drawer {
  width: 560px; max-width: 92vw;
  background: var(--surface); height: 100vh;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0;} to { transform: translateX(0); opacity: 1;}}
.drawer-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-body { padding: 22px 24px; overflow: auto; }
.drawer-title { font-size: 22px; font-weight: 500; margin: 4px 0 6px; letter-spacing: -0.01em; }
.drawer-desc { color: var(--text-muted); margin: 0 0 18px; }
.drawer-props {
  display: grid; grid-template-columns: 110px 1fr;
  gap: 4px 18px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  margin-bottom: 18px;
}
.prop { display: contents; }
.prop-k { font-size: 12px; color: var(--text-muted); padding: 7px 0; }
.prop-v { padding: 7px 0; font-size: 13px; }
.drawer-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-soft); font-weight: 600; margin: 18px 0 10px;
}
.attach-row { display: flex; flex-wrap: wrap; gap: 6px; }
.attach {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px;
}

/* Comments */
.comments { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.c-head { font-size: 12.5px; margin-bottom: 2px; }
.c-text { font-size: 13.5px; color: var(--text); }
.comment-compose { display: flex; gap: 10px; margin-top: 16px; }
.compose-wrap { flex: 1; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.compose-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.compose {
  width: 100%; border: 0; outline: none; resize: none;
  padding: 10px 12px; font-size: 13.5px; background: transparent; color: var(--text);
}
.compose-actions { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-top: 1px solid var(--border); }

/* Calendar */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; }
.cal-month {
  font-family: "Instrument Serif", serif; font-size: 22px;
  margin-left: 12px; letter-spacing: -0.01em;
}
.cal-legend { display: flex; gap: 14px; }
.leg-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.leg-sw { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }

.cal-card { padding: 0; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cal-weekdays > div {
  padding: 8px 12px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-soft); font-weight: 600;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(110px, 1fr);
}
.cal-cell {
  padding: 6px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface);
}
.cal-cell.weekend { background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.empty { background: var(--canvas); }
.cal-date {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
}
.today-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--text); color: var(--canvas); font-weight: 600;
}
:root[data-theme="dark"] .today-num { background: var(--accent); color: var(--accent-text); }
.cal-count {
  font-size: 10px; color: var(--text-soft);
}
.cal-events { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-evt {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 6px; border-radius: 4px;
  background: var(--chip-blue);
  border: 0; text-align: left;
  font-size: 11.5px; color: var(--text);
  white-space: nowrap; overflow: hidden;
}
.cal-evt:hover { filter: brightness(0.96); }
.cal-evt-dot { width: 5px; height: 5px; border-radius: 99px; flex: 0 0 auto; }
.cal-evt-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 11px; color: var(--text-muted); padding: 0 6px; }

/* Admin / Roles */
.role-pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text);
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border);
}
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  background: var(--chip-green); color: #4F8F5C;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: #4F8F5C; }

.roles-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.role-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.role-head { display: flex; align-items: flex-start; justify-content: space-between; }
.role-title { font-size: 15px; font-weight: 600; }
.role-perms { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.perms-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); margin-bottom: 8px; font-weight: 600; }
.role-perms ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.role-perms li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); }
.role-perms svg { color: #4F8F5C; }

.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: 0; }

/* Profile */
.profile-grid { display: grid; grid-template-columns: 320px 1fr; gap: 14px; }
.profile-card { padding: 22px; }
.prof-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; padding: 16px 18px; }
.prof-stats > div { display: flex; flex-direction: column; }
.prof-stats .num { font-family: "Instrument Serif", serif; font-size: 26px; line-height: 1; }
.prof-stats .lbl { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Chat */
.chat-card { padding: 0; display: flex; flex-direction: column; height: 580px; }
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.chat-stream { flex: 1; padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.chat-msg { display: flex; gap: 10px; max-width: 80%; }
.chat-msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg-bubble {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 10px;
}
.chat-msg.mine .msg-bubble {
  background: var(--accent); color: var(--accent-text); border-color: var(--accent);
}
.msg-author { font-size: 11.5px; margin-bottom: 2px; }
.mine-author { color: rgba(255,255,255,0.7); }
.msg-text { font-size: 13.5px; }
.chat-compose {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1; border: 1px solid var(--border); background: var(--surface-2);
  padding: 8px 12px; border-radius: 999px; font-size: 13px; color: var(--text); outline: none;
}
.chat-input:focus { border-color: var(--accent); background: var(--surface); }

/* Login */
.login-shell {
  display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh;
  background: var(--canvas);
}
.login-card {
  padding: 60px; display: flex; flex-direction: column; justify-content: center;
  max-width: 460px; margin: 0 auto; width: 100%;
}
.login-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 600; margin-bottom: 60px;
}
.login-brand svg { color: var(--accent); }
.login-title { font-family: "Instrument Serif", serif; font-size: 36px; font-weight: 400; letter-spacing: -0.01em; margin: 0 0 6px; }
.login-sub { color: var(--text-muted); margin: 0 0 28px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-muted); }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.login-footer { margin-top: 24px; font-size: 12.5px; color: var(--text-muted); }

.login-side {
  background:
    radial-gradient(900px 600px at 20% 0%, rgba(77,91,214,0.12), transparent 60%),
    radial-gradient(700px 500px at 80% 100%, rgba(200,112,78,0.10), transparent 60%),
    var(--surface);
  border-left: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 60px;
}
.login-side-inner { max-width: 380px; }
.login-quote-eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-soft); font-weight: 600; margin-bottom: 18px;
}
.login-quote { display: flex; align-items: baseline; gap: 14px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.login-quote .num { font-family: "Instrument Serif", serif; font-size: 72px; line-height: 1; }
.login-quote .lbl { font-size: 16px; color: var(--text-muted); }
.login-stats { display: flex; flex-direction: column; gap: 18px; margin-top: 24px; }
.login-stats > div { display: flex; align-items: baseline; gap: 12px; }
.login-stats .num { font-family: "Instrument Serif", serif; font-size: 28px; line-height: 1; min-width: 40px; }
.login-stats .lbl { font-size: 13px; color: var(--text-muted); }

/* Responsive */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .cuentas-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .roles-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .proj-summary { grid-template-columns: repeat(2, 1fr); }
  .login-shell { grid-template-columns: 1fr; }
  .login-side { display: none; }
}
@media (max-width: 720px) {
  .sidebar { display: none; }
  .topbar, .app-content { padding-left: 16px; padding-right: 16px; }
  .stat-grid { grid-template-columns: 1fr; }
  .proj-grid, .cuentas-grid { grid-template-columns: 1fr; padding: 10px; }
  .kanban { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .cal-grid { grid-auto-rows: minmax(76px, 1fr); }
}
