@import url('https://fonts.googleapis.com/css2?family=Geologica:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-2: #F4F4F5;
  --border: #E4E4E7;
  --border-2: #D4D4D8;
  --text-1: #18181B;
  --text-2: #52525B;
  --text-3: #A1A1AA;
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-fg: #FFFFFF;
  --primary-subtle: #EFF6FF;
  --primary-subtle-2: #DBEAFE;
  --destructive: #EF4444;
  --destructive-hover: #DC2626;
  --destructive-subtle: #FEF2F2;
  --destructive-border: #FECACA;
  --destructive-text: #B91C1C;
  --success: #22C55E;
  --success-subtle: #F0FDF4;
  --success-text: #15803D;
  --warning: #F59E0B;
  --warning-subtle: #FFFBEB;
  --warning-text: #92400E;
  --danger: #EF4444; /* alias for --destructive — legacy compat */
  --overlay: rgba(0, 0, 0, 0.48);
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-full: 9999px;
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 60px rgb(0 0 0 / 0.15);
  --room-bg: #0F0F0F;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body { height: 100%; margin: 0; overflow: hidden; }

body {
  font-family: 'Geologica', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: 0;
}

.sidebar__logo {
  padding: 20px 16px 8px;
}

.sidebar__brand {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}

.brand-main {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.5px;
}

.brand-dot {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.brand-tld {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-2);
}

.sidebar__nav {
  flex: 1;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: all 150ms;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.sidebar__item:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.sidebar__item--active {
  background: var(--primary-subtle);
  color: var(--primary);
}

.sidebar__item--active:hover {
  background: var(--primary-subtle-2);
}

.sidebar__item--muted {
  opacity: 0.45;
  pointer-events: none;
}

.sidebar__item i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar__divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.sidebar__section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
}

.sidebar__footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

.sidebar__logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 150ms;
}

.sidebar__logout:hover {
  background: #FEF2F2;
  color: var(--destructive);
}

.sidebar__logout i {
  width: 16px;
  height: 16px;
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.main-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============================================================
   PAGE
   ============================================================ */
.page {
  padding: 32px 40px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--text-2);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb i {
  width: 12px;
  height: 12px;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
}

.card + .card {
  margin-top: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn i {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-outline {
  background: var(--surface);
  color: var(--text-1);
  border-color: var(--border-2);
}

.btn-outline:hover {
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.btn-destructive {
  background: var(--destructive);
  color: #fff;
  border-color: var(--destructive);
}

.btn-destructive:hover {
  background: var(--destructive-hover);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 10px 20px;
  font-size: 14.5px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ============================================================
   INPUTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

.input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-xs);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-1);
  background: var(--surface);
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.input::placeholder {
  color: var(--text-3);
}

.input-wrapper {
  position: relative;
}

.input-wrapper .input {
  padding-right: 40px;
}

.input-action {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 2px;
  display: flex;
  align-items: center;
}

.input-action:hover {
  color: var(--text-2);
}

.input-action i {
  width: 16px;
  height: 16px;
}

/* ============================================================
   BADGE
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 500;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge--scheduled {
  background: #F4F4F5;
  color: #52525B;
}

.badge--scheduled .badge-dot {
  background: #A1A1AA;
}

.badge--active {
  background: var(--primary-subtle);
  color: var(--primary);
}

.badge--active .badge-dot {
  background: var(--primary);
}

.badge--processing {
  background: var(--warning-subtle);
  color: #92400E;
}

.badge--processing .badge-dot {
  background: var(--warning);
  animation: pulse-dot 1s infinite;
}

.badge--completed {
  background: var(--success-subtle);
  color: #166534;
}

.badge--completed .badge-dot {
  background: var(--success);
}

.badge--failed {
  background: #FEF2F2;
  color: #991B1B;
}

.badge--failed .badge-dot {
  background: var(--destructive);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   MEETING CARDS GRID
   ============================================================ */
.meetings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.meeting-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 150ms;
  cursor: pointer;
}

.meeting-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.meeting-card__body {
  flex: 1;
}

.meeting-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
}

.meeting-card__meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.meeting-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meeting-card__arrow {
  width: 15px;
  height: 15px;
  color: var(--text-3);
}

.toolbar {
  margin-bottom: 16px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 64px 20px;
}

.empty-state__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--text-3);
}

.empty-state__icon i {
  width: 48px;
  height: 48px;
}

.empty-state__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.empty-state__text {
  font-size: 13px;
  color: var(--text-3);
}

/* ============================================================
   PARTICIPANT ROW
   ============================================================ */
.participants-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.participant-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.participant-row .input {
  flex: 1;
}

.btn-remove {
  padding: 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 150ms;
  flex-shrink: 0;
}

.btn-remove:hover {
  background: #FEF2F2;
  color: var(--destructive);
  border-color: #FECACA;
}

.btn-remove i {
  width: 14px;
  height: 14px;
}

/* ============================================================
   DROPZONE
   ============================================================ */
.dropzone {
  border: 2px dashed var(--border-2);
  border-radius: var(--r-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 150ms;
}

.dropzone:hover,
.dropzone--active {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.dropzone__icon {
  color: var(--text-3);
  margin-bottom: 12px;
}

.dropzone__icon i {
  width: 32px;
  height: 32px;
}

.dropzone__text {
  font-size: 13.5px;
  color: var(--text-2);
  font-weight: 500;
}

.dropzone__hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.dropzone__input {
  display: none;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  margin-top: 8px;
}

.file-info i {
  color: var(--primary);
  width: 14px;
  height: 14px;
}

/* ============================================================
   INVITE BOX
   ============================================================ */
.invite-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
}

.invite-box__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.invite-box__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.invite-box__url {
  flex: 1;
  font-family: monospace;
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 7px 10px;
}

/* ============================================================
   AUDIO PLAYER
   ============================================================ */
.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--r-md);
}

.play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms;
  font-size: 14px;
  font-family: inherit;
  line-height: 1;
}

.play-btn:hover {
  background: var(--primary-hover);
}

.player-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: var(--r-full);
  cursor: pointer;
  position: relative;
}

.player-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--r-full);
  transition: width 100ms linear;
  width: 0%;
}

.player-time {
  font-size: 12px;
  font-family: monospace;
  color: var(--text-3);
  flex-shrink: 0;
  min-width: 90px;
  text-align: right;
}

/* ============================================================
   PROCESSING
   ============================================================ */
.processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
}

.processing-step {
  font-size: 12.5px;
  color: var(--text-3);
}

/* ============================================================
   TRANSCRIPT
   ============================================================ */
.transcript {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.transcript-segment {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.transcript-segment:last-child {
  border-bottom: none;
}

.transcript-segment:hover {
  background: var(--surface-2);
  margin: 0 -20px;
  padding: 10px 20px;
  border-radius: var(--r-xs);
}

.segment-time {
  font-size: 11.5px;
  font-family: monospace;
  color: var(--text-3);
  min-width: 44px;
  padding-top: 2px;
  flex-shrink: 0;
}

.segment-speaker {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.segment-text {
  font-size: 13.5px;
  color: var(--text-1);
  line-height: 1.5;
}

/* ============================================================
   PROTOCOL
   ============================================================ */
.protocol-body h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  margin: 16px 0 8px;
}

.protocol-body h3:first-child {
  margin-top: 0;
}

.protocol-body p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.protocol-body ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.protocol-body li {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ============================================================
   TASKS TABLE
   ============================================================ */
.tasks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tasks-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.tasks-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}

.tasks-table tr:last-child td {
  border-bottom: none;
}

.priority--critical {
  color: #991B1B;
  font-weight: 600;
}

.priority--high {
  color: #C2410C;
  font-weight: 500;
}

.priority--medium {
  color: #B45309;
}

.priority--low {
  color: var(--text-3);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.login-brand {
  flex: 0 0 55%;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.login-brand__title {
  font-size: 52px;
  font-weight: 800;
  color: white;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.login-brand__title span {
  color: rgba(255, 255, 255, 0.6);
}

.login-brand__sub {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  max-width: 340px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.login-brand__deco {
  position: absolute;
  pointer-events: none;
  inset: 0;
}

.login-form-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: white;
}

.login-form-box {
  width: 100%;
  max-width: 360px;
}

.login-form-box__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-form-box__sub {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 32px;
}

.error-msg {
  display: none;
  padding: 10px 12px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: #991B1B;
  margin-top: 12px;
}

/* ============================================================
   ROOM PAGE
   ============================================================ */
.room-page {
  height: 100vh;
  background: #0C0C0C;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: 'Geologica', sans-serif;
}

.room-prejoin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 320px;
  padding: 20px;
}

.room-prejoin__title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
}

.room-prejoin__name {
  font-size: 22px;
  font-weight: 600;
  color: white;
  text-align: center;
}

.room-prejoin__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.room-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 150ms;
}

.room-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

.room-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.btn-join {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
}

.btn-join:hover {
  background: var(--primary-hover);
}

.room-incall {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 500px;
  padding: 20px;
}

.room-header {
  display: flex;
  align-items: center;
  gap: 24px;
}

.rec-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.1em;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  animation: blink 1.2s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.room-timer {
  font-size: 56px;
  font-weight: 700;
  color: white;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.participants-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.participants-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
}

.participants-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.room__participant {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-full);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  transition: all 150ms;
}

.room__participant-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ADE80;
}

.room__participant--speaking {
  border-color: #4ADE80;
  background: rgba(74, 222, 128, 0.1);
  color: white;
}

.room__participant--speaking .room__participant-dot {
  animation: pulse-speaker 0.6s ease infinite alternate;
}

@keyframes pulse-speaker {
  from { transform: scale(1); }
  to { transform: scale(1.6); }
}

.waiting-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
}

.room-controls {
  display: flex;
  gap: 12px;
}

.btn-mute-self {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  cursor: pointer;
  transition: all 150ms;
  flex-shrink: 0;
}
.btn-mute-self:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-mute-self.muted {
  background: #fef2f2;
  border-color: #ef4444;
  color: #ef4444;
}
.btn-mute-self i { width: 18px; height: 18px; }

.btn-end {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: #EF4444;
  border: none;
  border-radius: var(--r-full);
  color: white;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms;
}

.btn-end:hover {
  background: #DC2626;
  transform: scale(1.02);
}

.btn-end i {
  width: 17px;
  height: 17px;
}

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

/* ============================================================
   UTILITY HELPERS
   ============================================================ */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-3); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* ── Mobile top-bar + hamburger sidebar ──────────────────── */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mobile-burger {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 18px;
  color: var(--text-1);
}
.mobile-topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 299;
}

@media (max-width: 768px) {
  .login-brand { display: none; }
  .login-form-area { padding: 24px; }

  /* App shell becomes column, fills viewport */
  .app-shell {
    flex-direction: column;
    height: 100vh;
  }
  @supports (height: 100dvh) {
    .app-shell { height: 100dvh; }
  }

  .mobile-topbar { display: flex; }

  /* Sidebar becomes fixed overlay drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    height: 100% !important;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgb(0 0 0 / .15);
  }
  .sidebar-overlay.is-open { display: block; }

  /* Main area fills remaining space */
  .main-area {
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow-y: auto;
  }
  .page { padding: 16px 14px; }
  .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .meetings-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    #e8e8eb 50%,
    var(--surface-2) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}

.skel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.skel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.skel-row { display: flex; gap: 12px; align-items: center; }
.skel-gap { margin-top: 12px; }

/* Header skeleton */
.skel-title-block { display: flex; flex-direction: column; gap: 10px; }
.skel-h1   { height: 32px; width: 280px; }
.skel-meta { height: 16px; width: 160px; }
.skel-badge{ height: 24px; width: 100px; border-radius: var(--r-full); }

/* Player skeleton */
.skel-player {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0;
}
.skel-play { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skel-track{ height: 6px; flex: 1; border-radius: var(--r-full); }
.skel-time { width: 80px; height: 14px; flex-shrink: 0; }

/* Text lines */
.skel-line       { height: 14px; border-radius: var(--r-xs); }
.skel-line--full { width: 100%; }
.skel-line--lg   { width: 85%; }
.skel-line--md   { width: 65%; }
.skel-line--sm   { width: 40%; }

/* Transcript skeleton */
.skel-transcript-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.skel-transcript-row:last-child { border-bottom: none; }
.skel-ts-time { width: 44px; height: 13px; flex-shrink: 0; margin-top: 2px; }
.skel-ts-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }

/* Table skeleton */
.skel-table { width: 100%; border-collapse: collapse; }
.skel-table th { padding: 8px 12px; text-align: left; }
.skel-table td { padding: 12px; border-top: 1px solid var(--border); }
.skel-cell { height: 14px; border-radius: var(--r-xs); }

/* Section label */
.skel-section-label {
  height: 13px;
  width: 120px;
  margin-bottom: 20px;
  border-radius: var(--r-xs);
}

/* Pending skeleton state — shimmer stops, shows label */
.skel-pending .skeleton {
  animation: none;
  background: var(--surface-2);
  opacity: 0.5;
}
.skel-pending-label {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  padding: 12px 0 4px;
  font-style: italic;
}

/* Fade-in for content reveal */
.content-reveal {
  animation: contentReveal 0.35s ease forwards;
}
@keyframes contentReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   PROTOCOL PREVIEW MODAL
   ============================================================ */

.proto-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

.proto-modal {
  background: #f4f4f5;
  border-radius: 12px;
  width: 100%;
  max-width: 820px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.proto-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.proto-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.proto-modal-body {
  padding: 32px 24px 40px;
  overflow-y: auto;
}

/* ── A4 page ── */
.proto-page {
  background: #fff;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 56px 64px 64px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.18);
  border-radius: 4px;
  font-family: "Times New Roman", Times, serif;
  font-size: 13px;
  line-height: 1.6;
  color: #000;
}

/* ── УТВЕРЖДАЮ block ── */
.proto-utv {
  text-align: right;
  margin-bottom: 24px;
}
.proto-utv-label {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}
.proto-utv-sub { font-size: 13px; }
.proto-utv-sig { font-size: 13px; margin-top: 4px; }
.proto-utv-date { font-size: 13px; margin-top: 4px; }

/* ── Title block ── */
.proto-title-block {
  text-align: center;
  margin: 20px 0 16px;
}
.proto-doc-title {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.proto-doc-sub { font-size: 13px; margin-top: 4px; }
.proto-meeting-title {
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
  min-height: 22px;
}

/* ── Date line ── */
.proto-dateline {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin: 12px 0 16px;
}

.proto-divider {
  border-top: 1px solid #000;
  margin: 16px 0;
}

/* ── Sections ── */
.proto-section {
  margin-bottom: 20px;
}
.proto-section-label {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── Editable fields ── */
.proto-edit {
  display: inline-block;
  min-width: 60px;
  border-bottom: 1px dashed #2563EB;
  outline: none;
  padding: 0 2px;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
.proto-edit:focus {
  background: rgba(37, 99, 235, 0.06);
  border-bottom-color: #2563EB;
}

.proto-meeting-title.proto-edit {
  display: block;
  border: none;
  border-bottom: 1px dashed #2563EB;
  width: 100%;
  text-align: center;
  padding: 4px 8px;
  box-sizing: border-box;
}
.proto-meeting-title.proto-edit:focus {
  background: rgba(37, 99, 235, 0.06);
  border-radius: 4px;
  border-bottom-color: #2563EB;
}

/* ── Editable list items ── */
.proto-list-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}
.proto-list-item-num {
  min-width: 20px;
  font-size: 13px;
  padding-top: 2px;
  color: #555;
  user-select: none;
}
.proto-list-item-text {
  flex: 1;
  min-height: 20px;
  border: none;
  border-bottom: 1px dashed #ccc;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  padding: 1px 4px;
  background: transparent;
}
.proto-list-item-text:focus {
  background: rgba(37, 99, 235, 0.05);
  border-bottom-color: #2563EB;
  border-radius: 2px;
}
.proto-list-item-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #dc2626;
  opacity: 0.4;
  padding: 2px 4px;
  font-size: 14px;
  line-height: 1;
  font-family: sans-serif;
}
.proto-list-item-del:hover { opacity: 1; }

/* ── Decision items ── */
.proto-decision-item {
  border: 1px dashed #d4d4d8;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  position: relative;
}
.proto-decision-num {
  font-weight: 700;
  font-size: 12px;
  color: #555;
  margin-bottom: 6px;
  user-select: none;
}
.proto-decision-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.proto-decision-key {
  font-weight: 700;
  font-size: 12px;
  min-width: 100px;
  padding-top: 3px;
  white-space: nowrap;
}
.proto-decision-val {
  flex: 1;
  min-height: 20px;
  border: none;
  border-bottom: 1px dashed #ccc;
  outline: none;
  font-family: "Times New Roman", Times, serif;
  font-size: 13px;
  padding: 1px 4px;
  background: transparent;
}
.proto-decision-val:focus {
  background: rgba(37, 99, 235, 0.05);
  border-bottom-color: #2563EB;
  border-radius: 2px;
}
.proto-decision-del {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #dc2626;
  opacity: 0.35;
  font-size: 16px;
  font-family: sans-serif;
  line-height: 1;
}
.proto-decision-del:hover { opacity: 1; }

/* ── Add button ── */
.proto-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 11px;
  border: 1px dashed #2563EB;
  border-radius: 4px;
  color: #2563EB;
  background: rgba(37,99,235,0.05);
  cursor: pointer;
  transition: background 150ms;
}
.proto-add-btn:hover { background: rgba(37,99,235,0.12); }
.proto-add-btn i { width: 11px; height: 11px; }

/* ── Signatures ── */
.proto-signatures {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.proto-sig-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}
.proto-sig-label { font-weight: 700; min-width: 220px; }
.proto-sig-line { letter-spacing: 2px; }

/* ============================================================
   ROOM — RECORDING CONTROLS + ADMIN UI
   ============================================================ */

.rec-badge--paused {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}

.rec-badge--paused .rec-dot {
  background: #fbbf24;
  animation: none;
}

.room-title-display {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  flex: 1;
  text-align: center;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-recording-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
}

.btn-rec {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: var(--r-full);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms;
}

.btn-rec:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.8);
}

.btn-rec i { width: 14px; height: 14px; }

.btn-rec--pause {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}
.btn-rec--pause:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.8);
}

.btn-rec--resume {
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}
.btn-rec--resume:hover {
  background: rgba(74, 222, 128, 0.2);
  border-color: rgba(74, 222, 128, 0.8);
}

.room__participant-name {
  flex: 1;
}

.role-admin {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

.btn-mute {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 50%;
  background: transparent;
  color: rgba(239, 68, 68, 0.7);
  cursor: pointer;
  transition: all 150ms;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-mute:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: #f87171;
}

.btn-mute i { width: 13px; height: 13px; }

/* ============================================================
   USERS ADMIN PAGE
   ============================================================ */

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.users-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.users-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}

.users-table tr:last-child td { border-bottom: none; }

.badge--admin {
  background: rgba(251, 191, 36, 0.15);
  color: #b45309;
  border: 1px solid rgba(251, 191, 36, 0.4);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.badge--member {
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.badge--inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

/* ============================================================
   INTEGRATIONS PAGE
   ============================================================ */

.badge--integration-active {
  background: var(--success-subtle);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.badge--integration-disabled {
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.badge--integration-not-configured {
  background: var(--warning-subtle);
  color: #92400E;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.integration-section {
  margin-bottom: 32px;
}

.integration-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.integration-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.integration-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  margin-bottom: 12px;
}

.integration-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.integration-card__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.integration-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}

.integration-card__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.integration-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.integration-config-item {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}

.integration-config-item__key {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.integration-config-item__val {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  font-family: monospace;
}

.integration-note {
  font-size: 12.5px;
  color: var(--text-3);
  font-style: italic;
  margin-top: 8px;
}

.integration-test-result {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  display: none;
}

.integration-test-result--ok {
  background: var(--success-subtle);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.integration-test-result--error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.llm-test-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.llm-test-response {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-1);
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.llm-test-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.llm-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}

.llm-history-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.llm-history-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.llm-history-table tr:last-child td {
  border-bottom: none;
}

.sip-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.sip-form .form-group:nth-child(3),
.sip-form .form-group:nth-child(4) {
  grid-column: span 1;
}

.sip-instruction {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-subtle-2);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.sip-instruction strong {
  color: var(--primary);
}

.dial-in-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-subtle-2);
  border-radius: var(--r-md);
  margin-top: 12px;
}

.dial-in-card i {
  width: 22px;
  height: 22px;
  color: var(--primary);
  flex-shrink: 0;
}

.dial-in-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.dial-in-number {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0.03em;
}

.dial-in-pin {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ============================================================
   GLOBAL TOAST NOTIFICATIONS
   ============================================================ */
#cs-toast-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.cs-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  max-width: 360px;
  pointer-events: all;
  box-shadow: var(--shadow-md);
  border: 1px solid transparent;
  animation: cs-toast-in 0.2s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.cs-toast.fade-out { opacity: 0; transform: translateX(16px); }

@keyframes cs-toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cs-toast--info    { background: var(--surface); border-color: var(--border); color: var(--text-1); }
.cs-toast--success { background: var(--success-subtle); border-color: #BBF7D0; color: var(--success-text); }
.cs-toast--error   { background: var(--destructive-subtle); border-color: var(--destructive-border); color: var(--destructive-text); }
.cs-toast--warning { background: var(--warning-subtle); border-color: #FDE68A; color: var(--warning-text); }
.cs-toast__icon    { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; }
.cs-toast__close   {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  font-size: 15px;
  line-height: 1;
  padding: 0 0 0 6px;
}
.cs-toast__close:hover { opacity: 1; }

/* ============================================================
   GLOBAL CONFIRM DIALOG
   ============================================================ */
.cs-confirm-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cs-fadein 0.15s ease;
}
@keyframes cs-fadein { from { opacity: 0; } to { opacity: 1; } }

.cs-confirm-dialog {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px;
  width: min(400px, 90vw);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cs-confirm-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}
.cs-confirm-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.cs-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============================================================
   GLOBAL MODAL OVERLAY (shared class)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   STYLED NATIVE SELECT (globally override appearance)
   ============================================================ */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A1A1AA' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px !important;
}

/* ============================================================
   STYLED CHECKBOX
   ============================================================ */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-xs);
  background: var(--surface);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 120ms, background 120ms;
}
input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 1px;
  width: 6px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   GLOBAL SEARCH — sidebar input + command-palette overlay
   ============================================================ */

/* ── Sidebar search bar ─────────────────────────────────── */
.sidebar__search {
  padding: 12px 12px 4px;
}

.sidebar__search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 7px 10px;
  cursor: text;
  transition: border-color 120ms, box-shadow 120ms;
}
.sidebar__search-wrap:hover {
  border-color: var(--border-2);
}
.sidebar__search-wrap.is-focused {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}
.sidebar__search-wrap svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  flex-shrink: 0;
}
.sidebar__search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text-1);
  outline: none;
}
.sidebar__search-input::placeholder {
  color: var(--text-3);
}
.sidebar__search-kbd {
  font-size: 10px;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-3);
  flex-shrink: 0;
  line-height: 1.6;
  pointer-events: none;
  transition: opacity 120ms;
}
.sidebar__search-wrap.is-focused .sidebar__search-kbd { opacity: 0; }

/* ── Command-palette overlay ────────────────────────────── */
.gs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.gs-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.gs-panel {
  width: min(660px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.22), 0 2px 8px rgb(0 0 0 / 0.08);
  overflow: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: transform 160ms cubic-bezier(.22, .68, 0, 1.2);
}
.gs-overlay.is-open .gs-panel {
  transform: translateY(0) scale(1);
}

/* Input row */
.gs-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.gs-input-row svg {
  width: 18px;
  height: 18px;
  color: var(--text-2);
  flex-shrink: 0;
}
.gs-input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--text-1);
  outline: none;
}
.gs-input::placeholder { color: var(--text-3); }
.gs-esc {
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* Results list */
.gs-results {
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.gs-results::-webkit-scrollbar { width: 4px; }
.gs-results::-webkit-scrollbar-track { background: transparent; }
.gs-results::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* Result item */
.gs-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 80ms;
  text-decoration: none;
  color: inherit;
}
.gs-item:last-child { border-bottom: none; }
.gs-item:hover, .gs-item.is-active {
  background: var(--primary-subtle);
}
.gs-item.is-active .gs-item-title { color: var(--primary); }

.gs-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 13px;
}
.gs-item-icon--title    { background: var(--primary-subtle-2); color: var(--primary); }
.gs-item-icon--transcript { background: #F4F4F5; color: #52525B; }
.gs-item-icon--summary  { background: #F3E8FF; color: #7C3AED; }
.gs-item-icon--action   { background: #FEF3C7; color: #B45309; }
.gs-item-icon--participant { background: #DCFCE7; color: #15803D; }

.gs-item-body { flex: 1; min-width: 0; }
.gs-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.gs-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-item-date {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}
.gs-item-snippet {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gs-item-snippet mark {
  background: color-mix(in srgb, #FBBF24 35%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.gs-item-type {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Status rows */
.gs-status {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.gs-status-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  color: var(--border-2);
}
.gs-status-icon svg { width: 100%; height: 100%; }

/* Footer hint */
.gs-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.gs-footer-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-3);
}
.gs-footer-hint kbd {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 10px;
}

/* ============================================================
   TASKS PAGE — tabs, toolbar, views, detail panel
   ============================================================ */

/* ── Priority colors ─────────────────────────────────────── */
.pr-critical { --pr: #EF4444; --pr-bg: #FEF2F2; }
.pr-high     { --pr: #F59E0B; --pr-bg: #FFFBEB; }
.pr-medium   { --pr: #2563EB; --pr-bg: #EFF6FF; }
.pr-low      { --pr: #A1A1AA; --pr-bg: #F4F4F5; }

/* ── Tab bar + toolbar row ──────────────────────────────── */
.tk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 16px;
  flex-wrap: wrap;
}

.tk-tabs {
  display: flex;
  position: relative;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
}
.tk-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border-radius: var(--r-sm);
  position: relative;
  z-index: 1;
  transition: color 160ms;
  white-space: nowrap;
}
.tk-tab svg, .tk-tab i { width: 15px; height: 15px; }
.tk-tab:hover { color: var(--text-1); }
.tk-tab.is-active { color: var(--primary); }
.tk-tab-ink {
  position: absolute;
  top: 3px;
  height: calc(100% - 6px);
  background: var(--surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs);
  transition: left 220ms cubic-bezier(.4,0,.2,1), width 220ms cubic-bezier(.4,0,.2,1);
  z-index: 0;
}

.tk-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tk-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 10px;
}
.tk-search-wrap svg, .tk-search-wrap i { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; }
.tk-search {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text-1);
  outline: none;
  width: 140px;
}
.tk-search::placeholder { color: var(--text-3); }
.tk-select {
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13px;
  color: var(--text-1);
  background: var(--surface);
  cursor: pointer;
}

/* ── View container ──────────────────────────────────────── */
.tk-view { min-height: 200px; }
.tk-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
}

/* ── Priority badge ──────────────────────────────────────── */
.tk-pr-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--pr-bg);
  color: var(--pr);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.tk-pr-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pr);
}

/* ── Overdue styles ──────────────────────────────────────── */
.is-overdue { color: var(--destructive-text) !important; }

/* ============================================================
   TABLE VIEW
   ============================================================ */
.tk-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.tk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tk-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.tk-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.tk-table th:hover { color: var(--text-1); }
.tk-table th svg, .tk-table th i {
  vertical-align: -2px;
  margin-left: 2px;
}
.tk-th-pr { width: 130px; }
.tk-row {
  cursor: pointer;
  transition: background 80ms;
}
.tk-row:hover { background: var(--primary-subtle); }
.tk-row td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tk-row:last-child td { border-bottom: none; }
.tk-cell-task {
  font-weight: 500;
  color: var(--text-1);
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-cell-assignee { color: var(--text-2); white-space: nowrap; }
.tk-cell-deadline { white-space: nowrap; }
.tk-cell-meeting {
  color: var(--text-3);
  font-size: 12px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   KANBAN VIEW
   ============================================================ */
.kb-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  min-height: 300px;
}
@media (max-width: 960px) { .kb-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .kb-board { grid-template-columns: 1fr; } }

.kb-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.kb-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 8px;
}
.kb-col-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--pr);
}
.kb-col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kb-col-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 1px 7px;
  font-weight: 500;
}
.kb-col-body {
  flex: 1;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 12px;
  color: var(--text-3);
}

.kb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--pr);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow 120ms, transform 100ms;
}
.kb-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.kb-card-task {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kb-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 4px;
}
.kb-card-assignee, .kb-card-deadline {
  display: flex;
  align-items: center;
  gap: 4px;
}
.kb-card-meeting {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ============================================================
   CALENDAR VIEW
   ============================================================ */
.cal-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.cal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.cal-month-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  min-width: 160px;
  text-align: center;
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  color: var(--text-2);
  transition: background 80ms;
}
.cal-nav:hover { background: var(--surface-2); }
.cal-nav svg, .cal-nav i { width: 16px; height: 16px; }
.cal-today-btn { margin-left: auto; font-weight: 500; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-dow {
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.cal-cell {
  min-height: 90px;
  padding: 6px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  position: relative;
}
.cal-cell:nth-child(7n+7) { border-right: none; }
.cal-cell--empty { background: var(--surface-2); opacity: .5; }
.cal-cell--today {
  background: var(--primary-subtle);
}
.cal-cell--today .cal-day {
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-day {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  display: inline-block;
  margin-bottom: 4px;
}
.cal-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-pill {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--pr-bg);
  color: var(--pr);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border-left: 2px solid var(--pr);
  transition: opacity 80ms;
}
.cal-pill:hover { opacity: .75; }
.cal-more {
  font-size: 10px;
  color: var(--text-3);
  padding: 1px 5px;
  font-weight: 500;
}

/* ============================================================
   GANTT VIEW
   ============================================================ */
.gt-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 540px;
}
.gt-chart {
  min-width: 800px;
}
.gt-header-row {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.gt-header-label {
  width: 240px;
  min-width: 240px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--border);
}
.gt-header-timeline {
  flex: 1;
  display: flex;
}
.gt-hcell {
  flex: 1;
  min-width: 32px;
  text-align: center;
  padding: 4px 2px;
  border-right: 1px solid var(--border);
  position: relative;
}
.gt-hcell--weekend { background: color-mix(in srgb, var(--surface-2) 60%, var(--border)); }
.gt-hcell--today { background: var(--primary-subtle-2); }
.gt-hcell-month {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gt-hcell-day {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
}
.gt-hcell--today .gt-hcell-day { color: var(--primary); font-weight: 700; }

.gt-body { position: relative; }

.gt-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 80ms;
}
.gt-row:hover { background: var(--primary-subtle); }
.gt-row:last-child { border-bottom: none; }
.gt-row-label {
  width: 240px;
  min-width: 240px;
  padding: 8px 14px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.gt-row-task {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gt-row-assignee {
  font-size: 11px;
  color: var(--text-3);
}
.gt-row-timeline {
  flex: 1;
  position: relative;
  height: 44px;
}
.gt-bar {
  position: absolute;
  top: 10px;
  height: 24px;
  border-radius: 4px;
  background: var(--pr);
  opacity: .85;
  display: flex;
  align-items: center;
  padding: 0 8px;
  min-width: 20px;
  transition: opacity 120ms;
}
.gt-bar:hover { opacity: 1; }
.gt-bar-label {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgb(0 0 0 / .2);
}

.gt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--destructive);
  z-index: 2;
  pointer-events: none;
}
.gt-today-line::before {
  content: 'Сегодня';
  position: absolute;
  top: -18px;
  left: -22px;
  font-size: 9px;
  font-weight: 600;
  color: var(--destructive);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   DETAIL PANEL (slide-in from right)
   ============================================================ */
.tk-detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
}
.tk-detail-overlay.is-open { opacity: 1; pointer-events: all; }

.tk-detail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 90vw);
  background: var(--surface);
  z-index: 901;
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(.22, .68, 0, 1.1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgb(0 0 0 / .12);
}
.tk-detail.is-open { transform: translateX(0); }

.tk-d-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 0;
}
.tk-d-close {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
  transition: background 80ms;
}
.tk-d-close:hover { background: var(--surface-2); }
.tk-d-close svg, .tk-d-close i { width: 16px; height: 16px; }

.tk-d-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
}
.tk-d-priority { margin-bottom: 12px; }
.tk-d-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
  margin: 0 0 24px;
}

.tk-d-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.tk-d-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tk-d-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.tk-d-label svg, .tk-d-label i { width: 14px; height: 14px; }
.tk-d-value {
  font-size: 14px;
  color: var(--text-1);
}
.tk-d-link {
  color: var(--primary);
  text-decoration: none;
}
.tk-d-link:hover { text-decoration: underline; }
.tk-d-overdue-tag {
  font-size: 10px;
  font-weight: 600;
  background: var(--destructive-subtle);
  color: var(--destructive-text);
  border-radius: var(--r-full);
  padding: 2px 7px;
  margin-left: 6px;
}

.tk-d-quote-wrap { margin-bottom: 20px; }
.tk-d-quote {
  margin: 8px 0 0;
  padding: 12px 16px;
  border-left: 3px solid var(--primary);
  background: var(--primary-subtle);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13px;
  font-style: italic;
  color: var(--text-2);
  line-height: 1.55;
}

.tk-d-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   MESSENGER — layout, sidebar, chat, messages, compose
   ============================================================ */

/* ── Layout ──────────────────────────────────────────────── */
.ms-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Chat Sidebar ────────────────────────────────────────── */
.ms-sidebar {
  width: 300px;
  min-width: 300px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ms-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 10px;
}
.ms-sidebar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}
.ms-btn-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
  transition: background 80ms;
}
.ms-btn-icon:hover { background: var(--surface-2); }
.ms-btn-icon svg, .ms-btn-icon i { width: 16px; height: 16px; }
.ms-btn-xs { width: 24px; height: 24px; border: none; }
.ms-btn-xs svg, .ms-btn-xs i { width: 14px; height: 14px; }

.ms-sidebar-search { padding: 0 12px 10px; }
.ms-search-wrap {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 7px 10px;
}
.ms-search-wrap svg, .ms-search-wrap i { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; }
.ms-search-input {
  flex: 1; border: none; background: transparent;
  font: inherit; font-size: 13px; color: var(--text-1); outline: none;
}
.ms-search-input::placeholder { color: var(--text-3); }

/* ── Channel List ────────────────────────────────────────── */
.ms-channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 6px;
}
.ms-channel-list::-webkit-scrollbar { width: 4px; }
.ms-channel-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

.ms-ch-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.ms-ch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  cursor: pointer;
  border-radius: var(--r-md);
  transition: background 100ms;
  position: relative;
}
.ms-ch-item:hover { background: var(--surface-2); }
.ms-ch-item.is-active { background: var(--primary-subtle); }
.ms-ch-item.has-unread .ms-ch-name { font-weight: 700; }
.ms-ch-item.has-unread .ms-ch-preview { color: var(--text-1); font-weight: 500; }

.ms-ch-avatar {
  width: 42px; height: 42px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  flex-shrink: 0;
  position: relative;
}
.ms-online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--surface);
}
.ms-online-dot--static { position: static; border: none; width: 8px; height: 8px; flex-shrink: 0; }

.ms-ch-body { flex: 1; min-width: 0; }
.ms-ch-top {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
  margin-bottom: 2px;
}
.ms-ch-name {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ms-ch-time { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.ms-ch-preview {
  font-size: 12.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.4;
}
.ms-ch-preview-name { color: var(--text-2); font-weight: 500; }
.ms-ch-badge {
  min-width: 20px; height: 20px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: #fff;
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 0 6px;
  flex-shrink: 0;
}

/* ── Chat Area ───────────────────────────────────────────── */
.ms-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.ms-chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Empty state */
.ms-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ms-empty-icon { width: 56px; height: 56px; color: var(--border-2); }
.ms-empty-icon svg { width: 100%; height: 100%; }
.ms-empty-title { font-size: 16px; font-weight: 600; color: var(--text-2); margin: 8px 0 0; }
.ms-empty-text { font-size: 13px; color: var(--text-3); margin: 0 0 12px; }

/* ── Chat Header ─────────────────────────────────────────── */
.ms-chat-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.ms-header-avatar {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  flex-shrink: 0;
}
.ms-header-info { display: flex; flex-direction: column; gap: 1px; }
.ms-header-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.ms-header-sub { font-size: 12px; color: var(--text-3); }
.ms-header-online { color: var(--success-text); }
.ms-header-offline { color: var(--text-3); }

/* ── Messages ────────────────────────────────────────────── */
.ms-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ms-messages::-webkit-scrollbar { width: 5px; }
.ms-messages::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

.ms-no-messages {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-3);
}

/* Date separator */
.ms-date-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ms-date-sep::before, .ms-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* System message */
.ms-msg-system {
  text-align: center;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
}

/* Message bubble */
.ms-msg {
  display: flex;
  gap: 8px;
  max-width: 65%;
  align-self: flex-start;
  margin-top: 2px;
}
.ms-msg--own {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.ms-msg--grouped { margin-top: 1px; }
.ms-msg--grouped .ms-msg-sender { display: none; }

.ms-msg-avatar {
  width: 30px; height: 30px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.ms-msg-avatar-spacer { width: 30px; flex-shrink: 0; }

.ms-msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 4px;
  padding: 8px 12px;
}
.ms-msg--own .ms-msg-bubble {
  background: var(--primary-subtle);
  border-color: var(--primary-subtle-2);
  border-radius: 12px 12px 4px 12px;
}
.ms-msg-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}
.ms-msg-content {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-1);
  word-break: break-word;
  white-space: pre-wrap;
}
.ms-msg-deleted {
  font-style: italic;
  color: var(--text-3);
  font-size: 12.5px;
}
.ms-msg-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
  margin-top: 3px;
}
.ms-msg-time { font-size: 10.5px; color: var(--text-3); }
.ms-msg-edited { font-size: 10px; color: var(--text-3); font-style: italic; }

/* Reply in message */
.ms-msg-reply {
  padding: 4px 8px;
  margin-bottom: 6px;
  border-left: 2px solid var(--primary);
  background: var(--surface-2);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ms-msg-reply-name { font-weight: 600; color: var(--primary); }
.ms-msg-reply-text { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Typing Indicator ────────────────────────────────────── */
.ms-typing {
  padding: 0 20px;
  height: 0;
  overflow: hidden;
  transition: height 200ms;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.ms-typing.is-visible { height: 28px; }
.ms-typing-dots { display: flex; gap: 3px; }
.ms-typing-dots span {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-3);
  animation: ms-dot-bounce 1.4s infinite;
}
.ms-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ms-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ms-dot-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}

/* ── Compose ─────────────────────────────────────────────── */
.ms-compose {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.ms-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--primary-subtle);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-bottom: 8px;
  font-size: 12px;
}
.ms-reply-bar-body { flex: 1; min-width: 0; }
.ms-reply-bar-name { font-weight: 600; color: var(--primary); margin-right: 6px; }
.ms-reply-bar-text { color: var(--text-2); }

.ms-compose-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.ms-compose-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font: inherit;
  font-size: 13.5px;
  max-height: 120px;
  outline: none;
  transition: border-color 150ms;
  line-height: 1.5;
  background: var(--surface);
}
.ms-compose-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.ms-compose-input::placeholder { color: var(--text-3); }
.ms-send-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 100ms;
}
.ms-send-btn:hover { background: var(--primary-hover); }
.ms-send-btn svg, .ms-send-btn i { width: 18px; height: 18px; }

/* ── Context Menu ────────────────────────────────────────── */
.ms-ctx-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 4px 0;
  z-index: 800;
  min-width: 190px;
}
.ms-ctx-item {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 80ms;
}
.ms-ctx-item:hover { background: var(--surface-2); }
.ms-ctx-item svg, .ms-ctx-item i { width: 15px; height: 15px; color: var(--text-2); }
.ms-ctx-item--danger { color: var(--destructive-text); }
.ms-ctx-item--danger svg, .ms-ctx-item--danger i { color: var(--destructive-text); }

/* ── New Chat Modal ──────────────────────────────────────── */
.ms-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: min(440px, 90vw);
  max-height: 80vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ms-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
}
.ms-modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text-1); margin: 0; }
.ms-modal-tabs {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.ms-modal-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 120ms, border-color 120ms;
}
.ms-modal-tab:hover { color: var(--text-1); }
.ms-modal-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }

.ms-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.ms-modal-search { margin-bottom: 12px; }
.ms-modal-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.ms-modal-input:focus { border-color: var(--primary); }
.ms-modal-field { margin-bottom: 14px; }
.ms-modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.ms-user-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
}
.ms-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 80ms;
}
.ms-user-item:hover { background: var(--surface-2); }
.ms-user-item--check { cursor: pointer; }
.ms-user-item--check input[type="checkbox"] { flex-shrink: 0; }
.ms-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ms-user-name { font-size: 13px; font-weight: 500; color: var(--text-1); }
.ms-user-email { font-size: 11.5px; color: var(--text-3); }

/* ── Messenger mobile back button ─────────────────────────── */
.ms-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
  flex-shrink: 0;
}
.ms-back-btn svg, .ms-back-btn i { width: 16px; height: 16px; }

/* ── Messenger mobile ────────────────────────────────────── */
@media (max-width: 768px) {
  .ms-layout {
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }

  .ms-sidebar {
    width: 100%; min-width: 100%;
    flex: 1;
    min-height: 0;
    border-right: none;
    overflow-y: auto;
  }

  .ms-chat {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 250;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform 220ms cubic-bezier(.4,0,.2,1);
  }
  .ms-layout.ms-show-chat .ms-chat {
    transform: translateX(0);
  }

  .ms-back-btn { display: flex; }
  .ms-sidebar-header { padding: 14px 16px 8px; }
  .ms-compose { padding: 10px 14px 14px; }
  .ms-messages { padding: 12px 14px; }
  .ms-chat-header { padding: 10px 14px; }
}

/* ── Messenger attachments ───────────────────────────────── */
.ms-msg-attach { margin-bottom: 4px; }
.ms-msg-img {
  max-width: 280px;
  max-height: 320px;
  border-radius: var(--r-md);
  display: block;
  cursor: pointer;
  object-fit: cover;
}
@media (max-width: 768px) {
  .ms-msg-img { max-width: 200px; max-height: 240px; }
}
.ms-msg-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: background 80ms;
  margin-bottom: 4px;
}
.ms-msg-file:hover { background: var(--bg); }
.ms-msg-file-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ms-msg-file-icon svg, .ms-msg-file-icon i { width: 18px; height: 18px; }
.ms-msg-file-info { display: flex; flex-direction: column; min-width: 0; }
.ms-msg-file-name {
  font-size: 13px; font-weight: 500; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ms-msg-file-size { font-size: 11px; color: var(--text-3); }

/* Compose attach button */
.ms-btn-attach {
  border: none;
  background: none;
  color: var(--text-3);
  flex-shrink: 0;
  width: 36px; height: 36px;
}
.ms-btn-attach:hover { color: var(--primary); }
.ms-btn-attach svg, .ms-btn-attach i { width: 20px; height: 20px; }

/* Drag & drop overlay */
.ms-dragover::after {
  content: 'Перетащите файлы сюда';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface) 92%);
  border: 2px dashed var(--primary);
  border-radius: var(--r-lg);
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  z-index: 10;
  pointer-events: none;
  margin: 8px;
}
.ms-chat { position: relative; }

/* Messenger burger button on mobile */
.ms-burger { display: none; }
@media (max-width: 768px) {
  .ms-burger { display: flex; }
}

/* ── Attach preview before send ──────────────────────────── */
.ms-attach-preview {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.ms-ap-item {
  position: relative;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.ms-ap-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--r-sm);
  display: block;
  border: 1px solid var(--border);
}
.ms-ap-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-ap-remove:hover { background: rgba(0,0,0,.8); }
.ms-ap-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.ms-ap-file-info {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ms-ap-file-icon svg, .ms-ap-file-icon i { width: 16px; height: 16px; color: var(--primary); }
.ms-ap-file-name { font-size: 12px; font-weight: 500; color: var(--text-1); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-ap-file-size { font-size: 11px; color: var(--text-3); }

/* ============================================================
   DASHBOARD — KPI cards, charts, widgets
   ============================================================ */

/* ── KPI Row ─────────────────────────────────────────────── */
.db-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 20px 0;
}
@media (max-width: 900px) { .db-kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .db-kpi-row { grid-template-columns: 1fr; } }

.db-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  opacity: 0;
  transform: translateY(12px);
  animation: db-kpi-in 0.5s cubic-bezier(.22,.68,0,1.1) forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes db-kpi-in {
  to { opacity: 1; transform: translateY(0); }
}
.db-kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.db-kpi-icon svg, .db-kpi-icon i { width: 22px; height: 22px; }
.db-kpi-body { display: flex; flex-direction: column; }
.db-kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.1;
}
.db-kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-top: 2px;
}
.db-kpi-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}

/* ── Card Grid ───────────────────────────────────────────── */
.db-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 768px) { .db-grid { grid-template-columns: 1fr; } }

.db-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.db-card--anim {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s cubic-bezier(.22,.68,0,1.1), transform 0.45s cubic-bezier(.22,.68,0,1.1);
  transition-delay: var(--delay, 0s);
}
.db-card--anim.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.db-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}
.db-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.db-card-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.db-card-body { padding: 16px 20px 20px; }
.db-empty-msg {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  padding: 20px 0;
}

/* ── Donut Chart ─────────────────────────────────────────── */
.db-donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}
@media (max-width: 500px) { .db-donut-wrap { flex-direction: column; } }
.db-donut {
  width: 130px; height: 130px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.db-donut-center {
  position: absolute;
  inset: 18px;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.db-donut-num { font-size: 24px; font-weight: 700; color: var(--text-1); }
.db-donut-lbl { font-size: 11px; color: var(--text-3); }
.db-legend { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.db-legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-1);
}
.db-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.db-legend-label { flex: 1; }
.db-legend-count { font-weight: 600; color: var(--text-2); }

/* ── Bar Charts ──────────────────────────────────────────── */
.db-bars { display: flex; flex-direction: column; gap: 10px; }
.db-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.db-bar-label {
  width: 95px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  flex-shrink: 0;
  text-align: right;
}
.db-bar-label--wide { width: 140px; text-align: left; }
.db-bar-track {
  flex: 1;
  height: 22px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}
.db-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.7s cubic-bezier(.22,.68,0,1.1);
  min-width: 0;
}
.db-bar-count {
  width: 28px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  flex-shrink: 0;
}

/* ── Deadline List ───────────────────────────────────────── */
.db-deadline-list { display: flex; flex-direction: column; gap: 10px; }
.db-deadline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.db-deadline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.db-deadline-body { display: flex; flex-direction: column; gap: 1px; }
.db-deadline-task {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.4;
}
.db-deadline-meta { font-size: 11.5px; color: var(--text-3); }

/* ── Sparkline Bar Chart ─────────────────────────────────── */
.db-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100px;
  padding-bottom: 18px;
  position: relative;
}
.db-spark-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}
.db-spark-bar {
  width: 100%;
  max-width: 24px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
  opacity: 0.7;
  transition: height 0.6s cubic-bezier(.22,.68,0,1.1);
}
.db-spark-col--today .db-spark-bar {
  background: var(--primary);
  opacity: 1;
}
.db-spark-col:hover .db-spark-bar { opacity: 1; }
.db-spark-lbl {
  position: absolute;
  bottom: -16px;
  font-size: 9px;
  color: var(--text-3);
  font-weight: 500;
}
.db-spark-col--today .db-spark-lbl {
  color: var(--primary);
  font-weight: 700;
}

/* ── Recent Meetings ─────────────────────────────────────── */
.db-recent-list { display: flex; flex-direction: column; gap: 2px; }
.db-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: inherit;
  transition: background 80ms;
}
.db-recent-item:hover { background: var(--surface-2); }
.db-recent-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.db-recent-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.db-recent-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-recent-meta { font-size: 11px; color: var(--text-3); }
.db-recent-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Dashboard clickable elements ────────────────────────── */
.db-kpi {
  cursor: pointer;
  transition: box-shadow 150ms, transform 120ms, border-color 150ms;
}
.db-kpi:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  border-color: var(--border-2);
}

.db-bar-row--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--r-sm);
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 100ms;
}
.db-bar-row--link:hover { background: var(--surface-2); }

.db-deadline-item--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--r-sm);
  padding: 6px 8px;
  margin: -6px -8px;
  transition: background 100ms;
}
.db-deadline-item--link:hover { background: var(--surface-2); }
.db-deadline-arrow {
  flex-shrink: 0;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 150ms;
}
.db-deadline-item--link:hover .db-deadline-arrow { opacity: 1; }
.db-deadline-arrow svg, .db-deadline-arrow i { width: 14px; height: 14px; }

.db-legend-item--link {
  cursor: pointer;
  border-radius: var(--r-xs);
  padding: 3px 6px;
  margin: -3px -6px;
  transition: background 100ms;
}
.db-legend-item--link:hover { background: var(--surface-2); }
.db-legend-arrow {
  margin-left: auto;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 150ms;
}
.db-legend-item--link:hover .db-legend-arrow { opacity: 1; }
.db-legend-arrow svg, .db-legend-arrow i { width: 12px; height: 12px; }
