/* Zoho-CRM-style shell and tables. Loaded last so it overrides the earlier sheets. */

:root {
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --color-bg: #ffffff;
  --color-border: #dcdfeb;
  --sidebar-bg: #1d2b4f;
  --sidebar-active-bg: #2f4373;
  --sidebar-text: #c9d1e6;
}

/* Shell: full-height navy sidebar on the left, white header beside it. */
.app-shell {
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
}
.sidebar { padding-top: 0; display: flex; flex-direction: column; }
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 var(--space-4);
  color: #fff; font-size: 19px; font-weight: 600; flex-shrink: 0;
}
.sidebar-brand img { width: 30px; height: 30px; }
.topbar { padding: 0 var(--space-5); border-bottom: 1px solid var(--color-border); gap: var(--space-4); }
.topbar-title { font-size: 22px; font-weight: 500; color: var(--color-text-strong); white-space: nowrap; }
.topbar .topbar-brand { display: none; }
.main .page-title { display: none; }

.sidebar-nav { padding: 0 var(--space-3); gap: 2px; }
.sidebar-group-label { padding: var(--space-4) var(--space-4) var(--space-1); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: #8e9bbd; }
.nav-item { padding: 10px var(--space-3); margin: 0; font-size: 15px; gap: 14px; border-radius: 8px; }
.nav-item[aria-current="page"] { background: var(--sidebar-active-bg); font-weight: 600; }
.nav-dot { display: none; }
.nav-item::before {
  content: ""; width: 20px; height: 20px; flex-shrink: 0; background: currentColor;
  -webkit-mask: var(--nav-icon) center / contain no-repeat; mask: var(--nav-icon) center / contain no-repeat;
}
.nav-item[data-module="home"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M4 11l8-7 8 7v9a1 1 0 0 1-1 1h-4v-6H9v6H5a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.nav-item[data-module="reports"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cpath d='M8 17v-4M12 17V8M16 17v-6'/%3E%3C/svg%3E"); }
.nav-item[data-module="contacts"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3Cpath d='M6.5 18c1.2-2.3 3-3.3 5.5-3.3s4.3 1 5.5 3.3'/%3E%3C/svg%3E"); }
.nav-item[data-module="accounts"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 21V4h9v17M14 9h5v12M3 21h18M8 8h3M8 12h3M8 16h3'/%3E%3C/svg%3E"); }
.nav-item[data-module="deals"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12l5-5 4 3 5-5 4 4M3 12l9 9 9-9'/%3E%3C/svg%3E"); }
.nav-item[data-module="tasks"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='3'/%3E%3Cpath d='M8.5 12.5l2.5 2.5 4.5-5'/%3E%3C/svg%3E"); }
.nav-item[data-module="meetings"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='2'/%3E%3Cpath d='M4 10h16M9 3v4M15 3v4'/%3E%3C/svg%3E"); }
.nav-item[data-module="call-tracker"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A15 15 0 0 1 3 6a2 2 0 0 1 2-2z'/%3E%3C/svg%3E"); }
.nav-item[data-module="follow-ups"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='13' r='8'/%3E%3Cpath d='M12 9v4l3 2M5 4l3 2M19 4l-3 2'/%3E%3C/svg%3E"); }
.nav-item[data-module="account-expansion"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20l6-6 4 4 6-8M15 10h5v5'/%3E%3C/svg%3E"); }
.nav-item[data-module="pre-sales"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.6 5.6 6 .7-4.4 4.1 1.2 6L12 16.5 6.6 19.4l1.2-6L3.4 9.3l6-.7z'/%3E%3C/svg%3E"); }
.nav-item[data-module="users"] { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c.8-3.6 3.2-5.5 6.5-5.5s5.7 1.9 6.5 5.5M16 5a3.5 3.5 0 0 1 0 6.5M18 14.8c1.8.7 3 2.3 3.5 5.2'/%3E%3C/svg%3E"); }

/* Lists: white canvas, taller rows, header without shouty capitals. */
.main, .list-body { background: #fff; }
.data-table thead th {
  background: #fff; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600;
  color: var(--color-text-strong); padding: 14px 12px; border-bottom: 1px solid var(--color-border);
}
.data-table tbody td { padding: 16px 12px; font-size: 14px; border-bottom: 1px solid var(--border-row); }
.data-table tbody tr:hover { background: #f7f8fd; }
.data-table a { color: var(--color-text-strong); font-weight: 500; }
.data-table a:hover { color: var(--color-primary); }
.pagination-bar { background: #fff; }

/* Picklist pills (Sales Stream, Degree Level). */
.pill {
  display: inline-block; padding: 3px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  line-height: 1.5; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.pill-outline { background: #fff; color: var(--color-text); border: 1px solid #b9bed3; }

/* Record detail: label right-aligned beside its value, like Zoho. */
.field-grid { gap: 0 var(--space-6); }
.field-view { border-bottom: none; padding: 14px 0; align-items: center; font-size: 14px; }
.field-view .fv-label { width: 42%; text-align: right; padding-right: 28px; color: #5b6580; }
.field-view .fv-value { font-weight: 400; color: var(--color-text-strong); }
.summary-row { background: #fff; }

/* The heading already sits in the header bar; keep only the page's action buttons here. */
.form-page-header { justify-content: flex-end; }
.form-page-header > h2 { display: none; }

/* Editable Sales Stream (pencil + picklist). */
.stream-edit { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.stream-edit-view { display: inline-flex; align-items: center; gap: 8px; }
.stream-edit-btn { background: none; border: none; color: var(--color-text-muted); padding: 4px; border-radius: 4px; cursor: pointer; display: inline-flex; opacity: 0.55; }
.stream-edit.is-open .stream-edit-view { display: none; }
.stream-editor { display: inline-flex; align-items: center; gap: 8px; }
.stream-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 260px; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid var(--color-border); border-radius: 8px; box-shadow: var(--shadow-md); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.stream-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--color-text); cursor: pointer; }
.stream-opt:hover { background: #f1f3fb; }
.stream-opt.is-selected { background: #f4f0ff; }
.stream-opt-check { width: 14px; color: var(--color-primary); font-weight: 700; }
.stream-save, .stream-cancel { width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer; font-size: 14px; color: #fff; }
.stream-save { background: var(--color-primary); }
.stream-cancel { background: #7a839c; }

/* Meetings: "Filter Meetings by" panel on the left, list on the right. */
.meetings-page { display: grid; grid-template-columns: 260px 1fr; gap: var(--space-4); align-items: start; }
.meetings-main { min-width: 0; }
.filter-panel { background: #fff; border: 1px solid var(--color-border); border-radius: 10px; padding: var(--space-4); }
.filter-panel h3 { font-size: 16px; font-weight: 600; margin: 0 0 var(--space-3); color: var(--color-text-strong); }
.filter-panel .input { width: 100%; }
.filter-group-title { margin: var(--space-4) 0 var(--space-2); font-size: 14px; font-weight: 600; color: var(--color-text-strong); }
.filter-opt { display: flex; align-items: center; gap: 10px; padding: 7px 2px; font-size: 14px; color: var(--color-text); cursor: pointer; }
.rel-icon { color: #5b6580; }
@media (max-width: 900px) { .meetings-page { grid-template-columns: 1fr; } }

/* Zoho-style quick-create dialogs (Create Task, Meeting Information, Schedule a call). */
.zq-form { display: flex; flex-direction: column; }
.zq-row { display: grid; grid-template-columns: 38% 1fr; align-items: center; gap: var(--space-3); padding: 14px 0; border-bottom: 1px solid var(--color-border); position: relative; }
.zq-row label { color: #5b6580; font-size: 14px; }
.zq-row.zq-req::before { content: ""; position: absolute; left: 0; bottom: -1px; width: 30px; height: 2px; background: #f0746b; }
.zq-field { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.zq-input { width: 100%; border: none; background: transparent; font-size: 14px; color: var(--color-text-strong); padding: 4px 0; outline: none; }
.zq-input:disabled { color: var(--color-text); opacity: 0.8; }
.zq-input:focus { box-shadow: 0 1px 0 var(--color-primary); }
.zq-wide .zq-row { border: none; padding: 10px 0; }
.zq-wide .zq-row label { text-align: right; padding-right: 12px; }
.zq-wide .zq-input { border: 1px solid var(--color-border); border-radius: 6px; padding: 9px 12px; }
.zq-wide .zq-row.zq-req::before { width: 3px; height: 100%; bottom: 0; top: 0; }
.zq-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.zq-switch input { opacity: 0; width: 0; height: 0; }
.zq-switch span { position: absolute; inset: 0; background: #c5cadb; border-radius: 999px; transition: background .15s; }
.zq-switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; }
.zq-switch input:checked + span { background: var(--color-primary); }
.zq-switch input:checked + span::after { transform: translateX(16px); }

/* Click-to-edit fields (pencil, picklist, tick / cross). */
.ie { position: relative; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.ie-view { display: inline-flex; align-items: center; gap: 8px; }
.ie-btn, .stream-edit-btn { background: none; border: 1px solid transparent; color: #b4bac9; padding: 4px; border-radius: 5px; cursor: pointer; display: inline-flex; opacity: 1; transition: color .12s, border-color .12s, background .12s; }
.field-view:hover .ie-btn, .tk-field-row:hover .ie-btn, .field-view:hover .stream-edit-btn, .ie-btn:focus-visible, .stream-edit-btn:focus-visible { color: #111; border-color: #111; background: #fff; opacity: 1; }
.ie-btn:hover, .stream-edit-btn:hover { background: #f1f1f1; }

/* Hovering a field highlights the whole row. */
.field-view, .tk-field-row { border-radius: 6px; transition: background .12s; }
.field-view:hover, .tk-field-row:hover { background: #eef1fb; }
.field-view { padding-left: 8px; padding-right: 8px; }
.ie.is-open .ie-view { display: none; }
.ie-editor { display: inline-flex; align-items: center; gap: 8px; }
.ie-input { min-width: 220px; border: 1px solid var(--color-primary); border-radius: 6px; padding: 7px 10px; font-size: 14px; background: #fff; color: var(--color-text-strong); font-family: inherit; }
.ie-select { position: relative; }
.ie-trigger { min-width: 220px; text-align: left; border: 1px solid var(--color-primary); border-radius: 6px; padding: 7px 10px; font-size: 14px; background: #fff; color: var(--color-text-strong); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.ie-caret { color: #7a839c; font-size: 12px; }
.ie .stream-menu { display: none; }
.ie.menu-open .stream-menu { display: flex; }
.ie-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid #d3d7e6; flex-shrink: 0; }
.ie-locked { color: var(--color-text-strong); }

/* Record pages: related lists as separate white cards on a pale canvas, like Zoho. */
.detail-main { background: #eef1fb; }
.related-block { background: #fff; padding: 0; margin-bottom: 14px; border-top: none; border-radius: 4px; }
.related-block-header { margin: 0; padding: 14px 20px; border-bottom: 1px solid #e3e6f3; }
.related-block-header h3 { font-size: 17px; font-weight: 600; color: var(--color-text-strong); }
.related-block-header .btn, .related-block-header .btn-sm { background: #f3f4ff; border: 1px solid #b7bdf3; color: #4a54d8; font-weight: 500; border-radius: 5px; }
.related-block-header .btn:hover { background: #e7e9ff; }
.related-block > .text-muted, .related-block > .np-empty { padding: 20px; font-size: 15px; color: #8a93ad; }
.related-block .list-item-row { padding: 14px 20px; }

/* Notes: avatar, byline, bubble, inline add box. */
.np-sort { border: 1px solid var(--color-border); border-radius: 6px; padding: 6px 12px; font-size: 14px; background: #fff; color: var(--color-text-strong); }
.np-list { padding: 8px 20px 0; }
.np-note, .np-add { display: flex; gap: 14px; padding: 14px 0; }
.np-add { padding: 8px 20px 22px; }
.np-avatar { width: 44px; height: 44px; border-radius: 50%; background: #dfe3ee; color: #fff; display: inline-flex; align-items: flex-end; justify-content: center; overflow: hidden; flex-shrink: 0; }
.np-avatar svg { width: 30px; height: 30px; margin-bottom: -2px; }
.np-body { min-width: 0; max-width: 840px; flex: 1; }
.np-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; color: #4b556f; margin-bottom: 6px; }
.np-author { color: #2b3350; }
.np-meta a { color: var(--color-primary); }
.np-date { color: #8a93ad; }
.np-dot { width: 4px; height: 4px; border-radius: 50%; background: #c3c9da; }
.np-bubble { background: #f3f4ff; border: 1px solid #e2e5f6; border-radius: 12px; padding: 12px 16px; font-size: 15px; line-height: 1.45; color: #1f2740; }
.np-more { background: none; border: none; color: var(--color-primary); cursor: pointer; font-size: 15px; padding: 0; }
.np-del { margin-left: auto; background: none; border: none; color: #b4bac9; cursor: pointer; font-size: 13px; opacity: 0; }
.np-note:hover .np-del { opacity: 1; }
.np-del:hover { color: #c0392b; }
.np-addbox { flex: 1; max-width: 976px; }
.np-input, .np-text { width: 100%; border: 1px solid #cfd4e6; border-radius: 6px; padding: 12px 14px; font-size: 15px; font-family: inherit; background: #fff; }
.np-input:focus, .np-text:focus { outline: none; border-color: var(--color-primary); }
.np-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* CRM assistant: floating button and chat panel. */
.cw { position: fixed; right: 24px; bottom: 24px; z-index: 60; font-family: inherit; }
.cw-fab { width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--color-primary); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(40, 52, 120, .35); }
.cw-fab:hover { filter: brightness(1.08); }
.cw-panel { display: none; position: absolute; right: 0; bottom: 70px; width: 392px; max-width: calc(100vw - 32px); height: 580px; max-height: calc(100vh - 120px); background: #fff; border: 1px solid var(--color-border); border-radius: 14px; box-shadow: 0 12px 36px rgba(20, 28, 70, .25); flex-direction: column; overflow: hidden; }
.cw-open .cw-panel { display: flex; }
.cw-panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: #1d2b4f; color: #fff; font-size: 15px; }
.cw-panel header span { display: flex; gap: 4px; }
.cw-panel header button { background: none; border: none; color: #fff; cursor: pointer; font-size: 15px; padding: 4px 8px; border-radius: 6px; }
.cw-panel header button:hover { background: rgba(255, 255, 255, .15); }
.cw-body { flex: 1; overflow-y: auto; padding: 14px; background: #f5f6fc; }
.cw-welcome p { margin: 0 0 8px; font-size: 14px; color: #4b556f; }
.cw-chips { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cw-chips button { text-align: left; background: #fff; border: 1px solid #c9cef0; color: #3f49c9; border-radius: 10px; padding: 9px 12px; font-size: 14px; cursor: pointer; }
.cw-chips button:hover { background: #eef0ff; }
.cw-msg { display: flex; flex-direction: column; margin-bottom: 12px; }
.cw-user { align-items: flex-end; }
.cw-bubble { max-width: 88%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-wrap: break-word; }
.cw-bubble p { margin: 0 0 6px; }
.cw-bubble p:last-child, .cw-bubble ul:last-child { margin-bottom: 0; }
.cw-bubble ul { margin: 0 0 6px; padding-left: 18px; }
.cw-user .cw-bubble { background: var(--color-primary); color: #fff; border-bottom-right-radius: 4px; }
.cw-bot .cw-bubble { background: #fff; border: 1px solid #e0e3f3; color: #1f2740; border-bottom-left-radius: 4px; }
.cw-bot .cw-bubble a { color: var(--color-primary); }
.cw-rate { margin-top: 3px; display: flex; gap: 2px; }
.cw-rate button { background: none; border: none; cursor: pointer; opacity: .35; font-size: 13px; padding: 2px 4px; }
.cw-rate button:hover, .cw-rate button.on { opacity: 1; }
.cw-typing { display: flex; gap: 5px; padding: 12px 14px; }
.cw-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa3c4; animation: cw-bounce 1s infinite; }
.cw-typing span:nth-child(2) { animation-delay: .15s; }
.cw-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cw-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.cw-history { display: flex; flex-direction: column; gap: 6px; }
.cw-conv { display: flex; background: #fff; border: 1px solid #e0e3f3; border-radius: 10px; }
.cw-conv button { background: none; border: none; cursor: pointer; padding: 10px 12px; font-size: 14px; text-align: left; color: #1f2740; }
.cw-conv button:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-del { color: #b4bac9 !important; }
.cw-del:hover { color: #c0392b !important; }
.cw-empty { color: #8a93ad; font-size: 14px; }
.cw-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--color-border); background: #fff; }
.cw-input { flex: 1; resize: none; border: 1px solid #cfd4e6; border-radius: 10px; padding: 9px 12px; font-size: 14px; font-family: inherit; max-height: 90px; }
.cw-input:focus { outline: none; border-color: var(--color-primary); }
.cw-form button { width: 40px; border: none; border-radius: 10px; background: var(--color-primary); color: #fff; cursor: pointer; font-size: 16px; }
@media (max-width: 600px) { .cw { right: 12px; bottom: 12px; } .cw-panel { width: calc(100vw - 24px); height: calc(100vh - 100px); } }
