:root { color-scheme: light; }
.nav-link { display: flex; align-items: center; gap: .75rem; border-radius: 1rem; padding: .75rem 1rem; color: rgb(203 213 225); font-size: .925rem; font-weight: 700; transition: all .18s ease; }
.nav-link:hover { background: rgba(255,255,255,.08); color: white; }
.nav-link-active { background: rgba(255,255,255,.12); color: white; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; border-radius: 1rem; background: rgb(79 70 229); color: white; padding: .65rem 1rem; font-size: .875rem; font-weight: 800; transition: all .18s ease; white-space: nowrap; }
.btn-primary:hover { background: rgb(67 56 202); transform: translateY(-1px); }
.btn-primary:disabled, .btn-primary[aria-disabled="true"] { cursor: not-allowed; opacity: .68; transform: none; }
.btn-primary:disabled:hover, .btn-primary[aria-disabled="true"]:hover { background: rgb(79 70 229); transform: none; }
.btn-submit-spinner { display: inline-flex; width: 1rem; height: 1rem; margin-left: .45rem; border-radius: 999px; border: 2px solid rgba(255,255,255,.45); border-top-color: white; animation: btn-submit-spin .72s linear infinite; }
@keyframes btn-submit-spin { to { transform: rotate(360deg); } }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; border-radius: 1rem; border: 1px solid rgb(226 232 240); background: white; color: rgb(51 65 85); padding: .65rem 1rem; font-size: .875rem; font-weight: 800; transition: all .18s ease; white-space: nowrap; }
.btn-secondary:hover { border-color: rgb(203 213 225); background: rgb(248 250 252); transform: translateY(-1px); }
.btn-light { display: inline-flex; align-items: center; justify-content: center; border-radius: 1rem; background: white; color: rgb(15 23 42); padding: .75rem 1.1rem; font-weight: 900; transition: all .18s ease; }
.btn-light:hover { transform: translateY(-1px); background: rgb(248 250 252); }
.btn-ghost-light { display: inline-flex; align-items: center; justify-content: center; border-radius: 1rem; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: white; padding: .75rem 1.1rem; font-weight: 900; transition: all .18s ease; }
.btn-ghost-light:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.input, .select, .textarea { width: 100%; border-radius: 1rem; border: 1px solid rgb(226 232 240); background: white; padding: .75rem 1rem; color: rgb(15 23 42); outline: none; transition: all .15s ease; }
.input:focus, .select:focus, .textarea:focus { border-color: rgb(99 102 241); box-shadow: 0 0 0 4px rgba(99,102,241,.12); }
.input-dark { width: 100%; border-radius: 1rem; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.08); padding: .8rem 1rem; color: white; outline: none; transition: all .15s ease; }
.input-dark::placeholder { color: rgb(148 163 184); }
.input-dark:focus { border-color: rgba(255,255,255,.38); box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.th { padding: .9rem 1.25rem; text-align: left; font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.td { padding: 1rem 1.25rem; vertical-align: top; color: rgb(51 65 85); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; background: rgb(238 242 255); color: rgb(67 56 202); padding: .25rem .65rem; font-size: .72rem; font-weight: 900; letter-spacing: .04em; }
.link { color: rgb(79 70 229); font-weight: 800; }
.link:hover { color: rgb(67 56 202); text-decoration: underline; }
.link-danger { color: rgb(225 29 72); font-weight: 800; }
.link-danger:hover { color: rgb(190 18 60); text-decoration: underline; }
.alert-success { border-radius: 1.25rem; border: 1px solid rgb(167 243 208); background: rgb(236 253 245); color: rgb(6 95 70); padding: .9rem 1rem; font-size: .9rem; font-weight: 700; }
.alert-error { border-radius: 1.25rem; border: 1px solid rgb(254 205 211); background: rgb(255 241 242); color: rgb(159 18 57); padding: .9rem 1rem; font-size: .9rem; font-weight: 700; }
.dashboard-flash-toast { position: fixed; right: clamp(1rem, 2vw, 2rem); top: calc(4rem + clamp(.75rem, 1.5vw, 1.25rem)); z-index: 70; width: min(25rem, calc(100vw - 2rem)); margin: 0 !important; box-shadow: 0 20px 50px rgba(15,23,42,.16); pointer-events: none; animation: dashboard-flash-toast-out 4.6s ease forwards; }
@keyframes dashboard-flash-toast-out { 0%, 72% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-.5rem); visibility: hidden; } }
code { border-radius: .5rem; background: rgb(241 245 249); padding: .12rem .35rem; font-size: .85em; color: rgb(51 65 85); }

/* App shell: keep the browser viewport fixed; scroll only inside content areas when needed. */
html, body { height: 100%; }
.app-shell, .app-sidebar, .app-main { height: 100vh; min-height: 0; }
.app-sidebar { position: sticky; top: 0; }
.app-sidebar-nav { scrollbar-width: thin; }
.app-sidebar-user { position: relative; z-index: 2; }
.app-content { overflow-y: auto; }
.app-content-dashboard { overflow: hidden; }

/* Dashboard: compact adaptive layout for a fast no-scroll first screen on common resolutions. */
.dashboard-page { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: clamp(.75rem, 1.2vw, 1.25rem); }
.dashboard-hero-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .85fr); gap: clamp(.75rem, 1.2vw, 1.25rem); flex: 0 0 auto; min-height: 0; }
.dashboard-module-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); align-items: stretch; gap: clamp(.75rem, 1.2vw, 1.25rem); }
.dashboard-hero, .dashboard-overview, .dashboard-card { min-height: 0; }
.dashboard-card { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; overflow: hidden; padding: clamp(1rem, 1.3vw, 1.5rem) !important; text-decoration: none; }
.dashboard-card-top { min-width: 0; }
.dashboard-card-icon { flex: 0 0 auto; }
.dashboard-card-top > .text-right { min-width: 0; max-width: min(8rem, 46%); }
.dashboard-card-total { min-height: 1.75rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(1.05rem, 1.55vw, 1.5rem) !important; line-height: 1.15; }
.dashboard-card-main { align-self: end; min-width: 0; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: .35rem; overflow: hidden; padding-top: .4rem; }
.dashboard-card-title { margin: 0 !important; color: rgb(15 23 42); font-size: clamp(.95rem, .82rem + .35vw, 1.125rem) !important; line-height: 1.18; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; }
.dashboard-card-desc { margin: 0 !important; color: rgb(100 116 139); font-size: clamp(.78rem, .72rem + .18vw, .875rem) !important; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 0; max-height: 2.7em; overflow-wrap: anywhere; word-break: break-word; }
.dashboard-card.is-card-tight { padding: clamp(.85rem, 1vw, 1.15rem) !important; }
.dashboard-card.is-card-tight .dashboard-card-main { gap: .2rem; padding-top: .25rem; }
.dashboard-card.is-card-tight .dashboard-card-title { -webkit-line-clamp: 1; font-size: clamp(.9rem, .76rem + .28vw, 1rem) !important; }
.dashboard-card.is-card-tight .dashboard-card-desc { -webkit-line-clamp: 1; max-height: 1.35em; }
.dashboard-card.is-card-tight .dashboard-card-icon { height: 2.55rem !important; width: 2.55rem !important; font-size: 1.35rem !important; }
.dashboard-card.is-card-ultra-tight .dashboard-card-desc { display: none; }
.dashboard-card.is-card-ultra-tight .dashboard-card-title { -webkit-line-clamp: 1; font-size: .9rem !important; }
.dashboard-card.is-card-ultra-tight .dashboard-card-icon { height: 2.25rem !important; width: 2.25rem !important; font-size: 1.2rem !important; }
.dashboard-today-new { color: rgb(225 29 72); }
.dashboard-overview-clickable { transition: all .16s ease; }
.dashboard-overview-clickable:hover { background: rgb(248 250 252) !important; box-shadow: inset 0 0 0 1px rgb(226 232 240); }
.dashboard-core-users-trigger { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: .25rem; border: 0; background: transparent; cursor: pointer; padding: .15rem .25rem; border-radius: .75rem; line-height: 1.15; }
.dashboard-core-users-trigger:hover { color: rgb(79 70 229); }
.dashboard-core-users-trigger:focus-visible { outline: 3px solid rgba(99,102,241,.24); outline-offset: 3px; }

/* Dashboard core user monthly calendar modal. */
.core-user-calendar-modal { padding: 1.5rem; }
.core-calendar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid rgb(226 232 240); }
.core-calendar-kicker { color: rgb(99 102 241); font-size: .78rem; font-weight: 1000; letter-spacing: .08em; text-transform: uppercase; }
.core-calendar-title { margin: .25rem 0 0; color: rgb(15 23 42); font-size: 1.45rem; line-height: 1.2; font-weight: 1000; }
.core-calendar-subtitle { margin: .35rem 0 0; color: rgb(100 116 139); font-size: .9rem; }
.core-calendar-close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 2.4rem; width: 2.4rem; height: 2.4rem; border: 1px solid rgb(226 232 240); border-radius: .9rem; background: white; color: rgb(71 85 105); font-size: 1.4rem; line-height: 1; cursor: pointer; transition: all .16s ease; }
.core-calendar-close:hover { background: rgb(248 250 252); color: rgb(15 23 42); }
.core-calendar-alert { margin-top: 1rem; }
.core-calendar-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin-top: 1rem; }
.core-calendar-summary-card { border: 1px solid rgb(226 232 240); border-radius: 1.1rem; background: rgb(248 250 252); padding: .95rem 1rem; }
.core-calendar-summary-label { color: rgb(100 116 139); font-size: .78rem; font-weight: 900; }
.core-calendar-summary-value { margin-top: .25rem; color: rgb(15 23 42); font-size: 1.5rem; line-height: 1.15; font-weight: 1000; }
.core-calendar-summary-value.text-rose-600 { color: rgb(225 29 72); }
.core-calendar-month-value { font-size: 1.25rem; }
.core-calendar-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem; margin-top: 1rem; }
.core-calendar-current { color: rgb(15 23 42); font-weight: 1000; text-align: center; }
.core-calendar-nav { display: inline-flex; align-items: center; justify-content: center; justify-self: start; box-sizing: border-box; min-width: 7.25rem; min-height: 2.5rem; border: 1px solid rgb(226 232 240); border-radius: .9rem; background: white; color: rgb(51 65 85); padding: .55rem .85rem; font-size: .84rem; font-weight: 900; transition: all .16s ease; }
.core-calendar-nav:last-child { justify-self: end; }
.core-calendar-nav:hover { border-color: rgb(203 213 225); background: rgb(248 250 252); color: rgb(15 23 42); }
.core-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .55rem; margin-top: 1rem; }
.core-calendar-weekday { color: rgb(100 116 139); font-size: .75rem; font-weight: 1000; text-align: center; padding: .35rem 0; }
.core-calendar-day { min-height: 7.4rem; border: 1px solid rgb(226 232 240); border-radius: 1rem; background: white; padding: .75rem; display: flex; flex-direction: column; justify-content: space-between; gap: .6rem; box-shadow: 0 10px 24px rgba(15,23,42,.035); }
.core-calendar-day-empty { background: rgb(248 250 252); box-shadow: none; }
.core-calendar-day.is-today { border-color: rgb(99 102 241); box-shadow: 0 0 0 4px rgba(99,102,241,.12); }
.core-calendar-day-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.core-calendar-date { color: rgb(15 23 42); font-size: 1rem; font-weight: 1000; }
.core-calendar-today-badge { display: inline-flex; align-items: center; border-radius: 999px; background: rgb(238 242 255); color: rgb(67 56 202); padding: .12rem .42rem; font-size: .68rem; font-weight: 1000; }
.core-calendar-count { color: rgb(100 116 139); font-size: .78rem; font-weight: 800; }
.core-calendar-count span { color: rgb(225 29 72); font-size: 1.35rem; font-weight: 1000; }
.core-calendar-bar { height: .42rem; border-radius: 999px; background: rgb(241 245 249); overflow: hidden; }
.core-calendar-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgb(251 113 133), rgb(99 102 241)); }


@media (max-width: 1279px) {
  .dashboard-hero-grid { grid-template-columns: 1fr; }
  .dashboard-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-height: 860px) and (min-width: 1024px) {
  .app-content-dashboard { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .dashboard-hero { padding: 1.25rem !important; }
  .dashboard-overview { padding: 1rem !important; }
  .dashboard-overview-list { margin-top: .75rem !important; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .dashboard-overview-list.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 0 !important; }
  .dashboard-overview-item { padding: .85rem !important; }
  .dashboard-title { font-size: clamp(1.35rem, 2.2vw, 2rem) !important; }
  .dashboard-intro { margin-top: .5rem !important; font-size: .86rem; line-height: 1.35; }
  .dashboard-actions { margin-top: .9rem !important; }
  .dashboard-card-main { padding-top: .25rem; gap: .2rem; }
  .dashboard-card-title { -webkit-line-clamp: 1; font-size: .96rem !important; }
  .dashboard-card-desc { -webkit-line-clamp: 1; max-height: 1.35em; }
  .dashboard-card-icon { height: 2.5rem !important; width: 2.5rem !important; font-size: 1.35rem !important; }
}

@media (max-height: 720px) and (min-width: 1024px) {
  .dashboard-intro { display: none; }
  .dashboard-actions { display: none !important; }
  .dashboard-card-desc { display: none; }
  .dashboard-card { padding: .85rem !important; }
  .dashboard-card-main { padding-top: .2rem; }
  .dashboard-card-top { gap: .75rem; }
}

@media (max-width: 767px) {
  .app-content-dashboard { overflow-y: auto; padding: .75rem !important; }
  .dashboard-flash-toast { top: 4.75rem; right: .75rem; width: calc(100vw - 1.5rem); }
  .dashboard-page { height: auto; min-height: 100%; }
  .dashboard-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-hero, .dashboard-overview, .dashboard-card { border-radius: 1.25rem !important; padding: .85rem !important; }
  .dashboard-title { font-size: 1.25rem !important; }
  .dashboard-intro, .dashboard-actions, .dashboard-card-desc { display: none; }
  .dashboard-card-title { font-size: .95rem !important; -webkit-line-clamp: 2; }
  .dashboard-card-main { padding-top: .45rem; }
}

/* Sidebar compact mode */
.app-sidebar-brand { min-height: 5.75rem; }
.sidebar-brand-inner { min-width: 0; }
.sidebar-logo-icon { flex: 0 0 auto; }
.app-sidebar-nav { padding-top: 1.15rem !important; }
.nav-link { min-height: 3.25rem; gap: .95rem; border-radius: 1.15rem; padding: .9rem 1.05rem; font-size: 1rem; font-weight: 900; letter-spacing: .01em; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; flex: 0 0 2rem; border-radius: 0; background: transparent; font-size: 1.35rem; line-height: 1; }
.nav-link:hover .nav-icon, .nav-link-active .nav-icon { background: transparent; }
.sidebar-user-card { display: flex; align-items: center; gap: .85rem; min-width: 0; border-radius: 1.25rem; padding: .85rem; background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.045)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.sidebar-user-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 2.85rem; width: 2.85rem; height: 2.85rem; border-radius: 1rem; background: white; color: rgb(15 23 42); font-size: 1.05rem; font-weight: 1000; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.sidebar-user-meta { display: flex; flex-direction: column; gap: .12rem; }
.sidebar-user-kicker { color: rgb(148 163 184); font-size: .76rem; font-weight: 900; letter-spacing: .06em; }
.sidebar-user-name { color: white; font-size: 1.02rem; font-weight: 1000; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-location { color: rgb(203 213 225); font-size: .78rem; font-weight: 800; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer-actions { display: grid; grid-template-columns: 2fr 1fr; gap: .75rem; }
.sidebar-action { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 2.95rem; border-radius: 1rem; color: rgb(226 232 240); background: rgba(255,255,255,.09); font-size: .95rem; font-weight: 1000; transition: all .18s ease; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.sidebar-action:hover { color: white; background: rgba(255,255,255,.16); transform: translateY(-1px); }
.sidebar-action-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.55rem; height: 1.55rem; flex: 0 0 1.55rem; font-size: 1.18rem; line-height: 1; }
.sidebar-toggle { border: 0; cursor: pointer; }
.sidebar-toggle-mini { display: none; }
.nav-label, .sidebar-brand-text, .sidebar-user-text, .sidebar-action-text { transition: opacity .16s ease, width .16s ease; }
.app-shell.sidebar-collapsed .app-sidebar { width: 5.75rem !important; }
.app-shell.sidebar-collapsed .app-sidebar-brand { padding-left: 1rem !important; padding-right: 1rem !important; }
.app-shell.sidebar-collapsed .sidebar-brand-inner { justify-content: center; }
.app-shell.sidebar-collapsed .sidebar-logo-icon { height: 3.5rem !important; width: 3.5rem !important; border-radius: 1.25rem; padding: .4rem !important; }
.app-shell.sidebar-collapsed .app-sidebar-nav { padding-left: .9rem !important; padding-right: .9rem !important; }
.app-shell.sidebar-collapsed .app-sidebar-user { padding-left: .75rem !important; padding-right: .75rem !important; }
.app-shell.sidebar-collapsed .nav-link { justify-content: center; gap: 0; padding-left: .7rem; padding-right: .7rem; }
.app-shell.sidebar-collapsed .nav-icon { width: 2.6rem; height: 2.6rem; flex-basis: 2.6rem; font-size: 1.45rem; }
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .sidebar-brand-text,
.app-shell.sidebar-collapsed .sidebar-user-text,
.app-shell.sidebar-collapsed .sidebar-action-text { opacity: 0; width: 0; overflow: hidden; white-space: nowrap; pointer-events: none; }
.app-shell.sidebar-collapsed .sidebar-user-card { display: none; }
.app-shell.sidebar-collapsed .sidebar-footer-actions { grid-template-columns: 1fr; justify-items: center; gap: .85rem; margin-top: 0 !important; }
.app-shell.sidebar-collapsed .sidebar-action { width: 3.25rem; min-height: 3.25rem; padding: 0; border-radius: 1.1rem; gap: 0; justify-content: center; }
.app-shell.sidebar-collapsed .sidebar-action-text { display: none; }
.app-shell.sidebar-collapsed .sidebar-action-icon { width: 1.75rem; height: 1.75rem; flex-basis: 1.75rem; font-size: 1.32rem; margin: 0; }
.app-shell.sidebar-collapsed .sidebar-toggle-full { display: none; }
.app-shell.sidebar-collapsed .sidebar-toggle-mini { display: inline-flex; }

/* Shared modal for view/edit/create */
.page-modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 1.25rem; background: rgba(15,23,42,.52); backdrop-filter: blur(4px); }
.page-modal.is-open { display: flex; }
.page-modal__dialog { width: min(1280px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; border-radius: 1.5rem; background: white; box-shadow: 0 30px 90px rgba(15,23,42,.28); }
.page-modal__body { min-height: 10rem; }
.page-modal__loading { padding: 3rem; text-align: center; color: rgb(100 116 139); font-weight: 800; }
body.modal-open { overflow: hidden; }


/* Email resend result/confirm modal. */
.email-resend-modal { position: fixed; inset: 0; z-index: 95; display: none; align-items: center; justify-content: center; padding: 1.25rem; background: rgba(15,23,42,.58); backdrop-filter: blur(5px); }
.email-resend-modal.is-open { display: flex; }
.email-resend-modal__dialog { width: min(720px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: hidden; border-radius: 1.35rem; background: white; box-shadow: 0 30px 90px rgba(15,23,42,.32); }
.email-resend-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid rgb(226 232 240); }
.email-resend-modal__eyebrow { color: rgb(100 116 139); font-size: .78rem; font-weight: 900; letter-spacing: .04em; }
.email-resend-modal__title { margin-top: .22rem; color: rgb(15 23 42); font-size: 1.18rem; line-height: 1.25; font-weight: 1000; }
.email-resend-modal.is-success .email-resend-modal__title { color: rgb(5 150 105); }
.email-resend-modal.is-error .email-resend-modal__title { color: rgb(220 38 38); }
.email-resend-modal__x { width: 2.25rem; height: 2.25rem; border: 0; border-radius: .85rem; background: rgb(241 245 249); color: rgb(51 65 85); font-size: 1.35rem; line-height: 1; cursor: pointer; }
.email-resend-modal__x:hover { background: rgb(226 232 240); color: rgb(15 23 42); }
.email-resend-modal__body { padding: 1.15rem 1.25rem; }
.email-resend-modal__message { color: rgb(30 41 59); font-size: .95rem; line-height: 1.7; font-weight: 750; word-break: break-word; }
.email-resend-modal__detail-wrap { display: block; margin-top: 1rem; color: rgb(71 85 105); font-size: .8rem; font-weight: 900; }
.email-resend-modal__detail { display: block; width: 100%; min-height: 15rem; margin-top: .45rem; padding: .8rem; border: 1px solid rgb(203 213 225); border-radius: .9rem; background: rgb(248 250 252); color: rgb(15 23 42); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: .8rem; line-height: 1.55; resize: vertical; white-space: pre; }
.email-resend-modal__footer { display: flex; justify-content: flex-end; gap: .6rem; padding: .95rem 1.25rem 1.2rem; border-top: 1px solid rgb(226 232 240); background: rgb(248 250 252); }
.email-resend-modal__btn { border: 1px solid rgb(203 213 225); border-radius: .85rem; background: white; color: rgb(51 65 85); padding: .58rem .9rem; font-weight: 900; cursor: pointer; }
.email-resend-modal__btn:hover { border-color: rgb(148 163 184); background: rgb(241 245 249); }
.email-resend-modal__btn--primary { border-color: rgb(79 70 229); background: rgb(79 70 229); color: white; }
.email-resend-modal__btn--primary:hover { border-color: rgb(67 56 202); background: rgb(67 56 202); }
body.email-resend-modal-open { overflow: hidden; }

/* Mail template editor */
.mail-template-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr); gap: 1.25rem; align-items: start; }
.mail-template-preview-panel { position: sticky; top: 1rem; border: 1px solid rgb(226 232 240); border-radius: 1.5rem; background: rgb(248 250 252); overflow: hidden; min-height: 34rem; }
.mail-template-preview-wrap { height: min(68vh, 42rem); min-height: 30rem; background: white; }
.mail-template-preview-frame { width: 100%; height: 100%; border: 0; background: white; }
.mail-template-html-source { min-height: 28rem; resize: vertical; }

/* Email log list: compact cards, grouped fields, no template whitespace leakage. */
.email-log-list { display: grid; gap: .7rem; padding: .75rem; background: rgb(248 250 252); }
.email-log-card { border: 1px solid rgb(226 232 240); border-radius: 1rem; background: white; box-shadow: 0 10px 28px rgba(15,23,42,.045); overflow: hidden; }
.email-log-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .75rem .9rem; border-bottom: 1px solid rgb(241 245 249); }
.email-log-actions { flex: 0 0 auto; white-space: nowrap; }
.email-log-status { display: inline-flex; align-items: center; border-radius: 999px; padding: .18rem .5rem; font-size: .72rem; font-weight: 900; }
.email-log-status-ok { background: rgb(236 253 245); color: rgb(5 150 105); }
.email-log-status-warn { background: rgb(255 247 237); color: rgb(234 88 12); }
.email-log-body { padding: .7rem .9rem .85rem; }
.email-log-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem; }
.email-log-meta-item { min-width: 0; border: 1px solid rgb(226 232 240 / .78); border-radius: .85rem; background: rgb(248 250 252 / .68); padding: .52rem .62rem; }
.email-log-meta-item-wide { grid-column: span 2; }
.email-log-meta-label, .email-log-preview-title { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-width: 0; color: rgb(100 116 139); font-size: .72rem; font-weight: 900; line-height: 1.25; }
.email-log-meta-label code, .email-log-preview-title code { max-width: 100%; overflow-wrap: anywhere; }
.email-log-meta-value { margin-top: .22rem; color: rgb(30 41 59); font-size: .84rem; line-height: 1.4; white-space: normal; word-break: break-word; overflow-wrap: anywhere; min-width: 0; }
.email-log-monospace { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: .78rem; }
.email-log-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-top: .65rem; }
.email-log-preview-card { min-width: 0; border: 1px solid rgb(226 232 240); border-radius: .9rem; background: white; padding: .62rem .72rem; }
.email-log-preview-card-main { grid-column: 1 / -1; }
.email-log-preview-text { margin-top: .35rem; max-height: 18rem; overflow: auto; color: rgb(30 41 59); font-size: .84rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; padding-right: .35rem; }
.email-log-preview-hint { margin-top: .35rem; color: rgb(148 163 184); font-size: .72rem; font-weight: 700; }
.mail-log-html-field { grid-column: 1 / -1; }
.mail-log-html-editor { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 1rem; align-items: stretch; }
.mail-log-html-editor-panel,
.mail-log-html-preview-panel { border: 1px solid rgb(226 232 240); border-radius: 1rem; overflow: hidden; background: white; min-height: 30rem; display: flex; flex-direction: column; }
.mail-log-html-editor-head,
.mail-log-html-preview-head { display: flex; align-items: center; justify-content: space-between; gap: .85rem; padding: .75rem .95rem; border-bottom: 1px solid rgb(226 232 240); background: rgb(248 250 252); }
.mail-log-html-editor-title,
.mail-log-html-preview-title { color: rgb(15 23 42); font-size: .92rem; font-weight: 900; }
.mail-log-html-editor-subtitle,
.mail-log-html-preview-subtitle { color: rgb(100 116 139); font-size: .75rem; line-height: 1.45; margin-top: .15rem; }
.mail-log-html-editor-body { flex: 1 1 auto; padding: .85rem; display: flex; }
.mail-log-html-source { min-height: 28rem; height: 100%; width: 100%; resize: vertical; white-space: pre; overflow: auto; }
.mail-log-html-preview-meta { min-width: 0; }
.mail-log-html-preview-toolbar { margin: 0; flex-shrink: 0; }
.mail-log-html-preview-head .textarea-size-btn { white-space: nowrap; }
.mail-log-html-preview-frame { flex: 1 1 auto; width: 100%; min-height: 24rem; border: 0; background: white; }

.record-html-preview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr); gap: 1rem; white-space: normal; }
.record-html-raw { margin: 0; max-height: 32rem; overflow: auto; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; border: 1px solid rgb(226 232 240); border-radius: 1rem; background: rgb(248 250 252); padding: .9rem; color: rgb(30 41 59); font-size: .78rem; line-height: 1.65; }
.record-html-frame { width: 100%; min-height: 32rem; border: 1px solid rgb(226 232 240); border-radius: 1rem; background: white; }

@media (max-width: 1023px) {
  .mail-template-editor-grid { grid-template-columns: 1fr; }
  .mail-template-preview-panel { position: static; }
  .record-html-preview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .page-modal { padding: .5rem; }
  .page-modal__dialog { width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); border-radius: 1rem; }
  .email-log-card-head { flex-direction: column; }
  .email-log-actions { white-space: normal; }
  .email-log-meta-grid, .email-log-preview-grid { grid-template-columns: 1fr; }
  .email-log-meta-item-wide, .email-log-preview-card-main { grid-column: auto; }
  .mail-log-html-editor { grid-template-columns: 1fr; }
  .mail-log-html-editor-head,
  .mail-log-html-preview-head { align-items: flex-start; flex-direction: column; }
  .mail-log-html-preview-toolbar { width: 100%; justify-content: flex-start; }
}

/* Soft deleted records stay visible and recoverable in list pages. */
.soft-deleted-row { background: rgb(255 241 242) !important; }
.soft-deleted-row:hover { background: rgb(255 228 230) !important; }
.soft-deleted-card { border-color: rgb(254 205 211) !important; background: rgb(255 241 242) !important; }
.soft-deleted-badge { display: inline-flex; align-items: center; border-radius: 999px; background: rgb(255 228 230); color: rgb(190 18 60); padding: .18rem .5rem; font-size: .72rem; font-weight: 900; }
.link-restore { color: rgb(5 150 105); font-weight: 800; }
.link-restore:hover { color: rgb(4 120 87); text-decoration: underline; }

/* List pagination: exact totals, quick page links and manual jump. */
.list-pagination { display: flex; flex-direction: column; gap: .85rem; padding: 1rem 1.25rem; border-top: 1px solid rgb(226 232 240); background: white; color: rgb(100 116 139); font-size: .875rem; }
.pagination-summary { font-weight: 800; }
.pagination-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.pagination-pages { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.pagination-btn, .pagination-page, .pagination-submit { display: inline-flex; align-items: center; justify-content: center; min-height: 2.35rem; border-radius: .8rem; border: 1px solid rgb(226 232 240); background: white; color: rgb(51 65 85); padding: .45rem .72rem; font-size: .82rem; font-weight: 900; transition: all .16s ease; white-space: nowrap; }
.pagination-btn:hover, .pagination-page:hover, .pagination-submit:hover { border-color: rgb(203 213 225); background: rgb(248 250 252); color: rgb(15 23 42); }
.pagination-btn-disabled { cursor: not-allowed; color: rgb(148 163 184); background: rgb(248 250 252); }
.pagination-btn-disabled:hover { color: rgb(148 163 184); background: rgb(248 250 252); border-color: rgb(226 232 240); }
.pagination-page { min-width: 2.35rem; padding-left: .55rem; padding-right: .55rem; }
.pagination-page-active { border-color: rgb(79 70 229); background: rgb(79 70 229); color: white; }
.pagination-ellipsis { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6rem; color: rgb(148 163 184); font-weight: 900; }
.pagination-jump { display: inline-flex; align-items: center; gap: .35rem; margin-left: .25rem; }
.pagination-input { width: 5.2rem; min-height: 2.35rem; border-radius: .8rem; border: 1px solid rgb(226 232 240); padding: .45rem .6rem; color: rgb(15 23 42); outline: none; font-weight: 900; }
.pagination-input:focus { border-color: rgb(99 102 241); box-shadow: 0 0 0 4px rgba(99,102,241,.12); }
.pagination-submit { cursor: pointer; }

@media (min-width: 768px) {
  .list-pagination { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (max-width: 767px) {
  .pagination-controls { align-items: stretch; }
  .pagination-pages { width: 100%; order: 2; }
  .pagination-jump { width: 100%; order: 3; margin-left: 0; }
}

@media (max-width: 767px) {
  .dashboard-core-users-trigger { font-size: 1.25rem !important; }
  .core-user-calendar-modal { padding: 1rem; }
  .core-calendar-head { gap: .75rem; }
  .core-calendar-title { font-size: 1.18rem; }
  .core-calendar-summary-grid { grid-template-columns: 1fr; }
  .core-calendar-toolbar { grid-template-columns: 1fr; }
  .core-calendar-nav, .core-calendar-nav:last-child { justify-self: stretch; width: 100%; min-width: 0; }
  .core-calendar-grid { gap: .35rem; }
  .core-calendar-day { min-height: 5.8rem; border-radius: .75rem; padding: .48rem; }
  .core-calendar-count { font-size: .68rem; }
  .core-calendar-count span { font-size: 1rem; }
  .core-calendar-today-badge { display: none; }
}

/* User references in lists: show nickname as primary and email as secondary instead of raw user_id. */
.user-ref-cell { display: flex; flex-direction: column; gap: .16rem; min-width: 9rem; max-width: 16rem; }
.user-ref-name { color: rgb(15 23 42); font-size: .9rem; line-height: 1.25; font-weight: 1000; word-break: break-word; }
.user-ref-email { color: rgb(100 116 139); font-size: .78rem; line-height: 1.25; word-break: break-all; }
.link-watch-history { color: rgb(124 58 237); font-weight: 900; }
.link-watch-history:hover { color: rgb(109 40 217); text-decoration: underline; }
.watch-plan-title-link { display: inline-flex; max-width: 100%; color: rgb(79 70 229); font-weight: 1000; line-height: 1.45; white-space: normal; word-break: break-word; }
.watch-plan-title-link:hover { color: rgb(67 56 202); text-decoration: underline; }

/* AI watch notification history modal. */
.notice-history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid rgb(226 232 240); }
.notice-history-title { margin-top: .45rem; color: rgb(15 23 42); font-size: 1.35rem; line-height: 1.25; font-weight: 1000; word-break: break-word; }
.notice-history-subtitle { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .45rem; color: rgb(100 116 139); font-size: .85rem; }
.notice-history-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.notice-history-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; padding: 1rem 1.5rem; background: rgb(248 250 252); border-bottom: 1px solid rgb(226 232 240); }
.notice-history-summary-card { border: 1px solid rgb(226 232 240); border-radius: 1rem; background: white; padding: .85rem 1rem; }
.notice-history-summary-label { color: rgb(100 116 139); font-size: .75rem; font-weight: 900; }
.notice-history-summary-value { margin-top: .25rem; color: rgb(15 23 42); font-size: 1rem; line-height: 1.25; font-weight: 1000; word-break: break-word; }
.notice-history-list { display: grid; gap: .75rem; padding: 1rem; background: rgb(248 250 252); }
.notice-history-empty { border: 1px dashed rgb(203 213 225); border-radius: 1rem; background: white; padding: 1.25rem; color: rgb(100 116 139); text-align: center; font-weight: 800; }
.notice-history-card { border: 1px solid rgb(226 232 240); border-radius: 1.1rem; background: white; box-shadow: 0 10px 28px rgba(15,23,42,.04); overflow: hidden; }
.notice-history-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .95rem 1rem; border-bottom: 1px solid rgb(241 245 249); }
.notice-history-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; color: rgb(100 116 139); font-size: .76rem; font-weight: 800; }
.notice-history-source { display: inline-flex; align-items: center; border-radius: 999px; padding: .18rem .55rem; font-size: .72rem; font-weight: 1000; }
.notice-history-source-email { background: rgb(239 246 255); color: rgb(37 99 235); }
.notice-history-source-web { background: rgb(236 253 245); color: rgb(5 150 105); }
.notice-history-source-plan { background: rgb(238 242 255); color: rgb(67 56 202); }
.notice-history-card-title { margin-top: .45rem; color: rgb(15 23 42); font-size: 1rem; line-height: 1.35; font-weight: 1000; word-break: break-word; }
.notice-history-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .5rem; padding: .75rem 1rem 0; }
.notice-history-meta-item { border: 1px solid rgb(226 232 240); border-radius: .85rem; background: rgb(248 250 252); padding: .55rem .65rem; min-width: 0; }
.notice-history-meta-item span { display: block; color: rgb(100 116 139); font-size: .72rem; font-weight: 900; }
.notice-history-meta-item strong { display: block; margin-top: .2rem; color: rgb(30 41 59); font-size: .82rem; line-height: 1.35; word-break: break-word; }
.notice-history-content { margin: .75rem 1rem 1rem; max-height: 20rem; overflow: auto; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; border: 1px solid rgb(226 232 240); border-radius: .9rem; background: rgb(248 250 252); padding: .8rem; color: rgb(30 41 59); font-size: .82rem; line-height: 1.6; }
.notice-history-no-content { margin: .75rem 1rem 1rem; color: rgb(148 163 184); font-size: .82rem; font-weight: 800; }

@media (max-width: 767px) {
  .notice-history-head { flex-direction: column; }
  .notice-history-actions { justify-content: flex-start; }
  .notice-history-summary { grid-template-columns: 1fr; }
  .notice-history-card-top { flex-direction: column; }
}

/* AI watch list: work_flag quick start / pause toggle. */
.watch-work-toggle-form { display: inline-flex; align-items: center; margin: 0; }
.watch-work-toggle { display: inline-flex; align-items: center; justify-content: center; gap: .38rem; min-width: 4.35rem; min-height: 2.15rem; border-radius: 999px; border: 1px solid transparent; padding: .32rem .72rem; font-size: .78rem; font-weight: 1000; line-height: 1; cursor: pointer; transition: all .16s ease; box-shadow: 0 8px 18px rgba(15,23,42,.06); }
.watch-work-toggle:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(15,23,42,.10); }
.watch-work-toggle:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(99,102,241,.16); }
.watch-work-toggle-running { border-color: rgb(187 247 208); background: rgb(240 253 244); color: rgb(22 101 52); }
.watch-work-toggle-running:hover { background: rgb(220 252 231); }
.watch-work-toggle-paused { border-color: rgb(199 210 254); background: rgb(238 242 255); color: rgb(67 56 202); }
.watch-work-toggle-paused:hover { background: rgb(224 231 255); }
.watch-work-icon { display: inline-flex; align-items: center; justify-content: center; width: 1rem; height: 1rem; font-size: .82rem; line-height: 1; }
.watch-work-label { line-height: 1; }

/* MongoDB conversation detail and email-thread relation views. */
.chat-detail-link, .link-email-related, .link-email-resend { color: rgb(79 70 229); font-weight: 900; }
.chat-detail-link:hover, .link-email-related:hover, .link-email-resend:hover { color: rgb(67 56 202); text-decoration: underline; }
.link-email-resend[disabled], .link-email-resend[aria-disabled="true"] { cursor: wait; opacity: .62; text-decoration: none; }
.chat-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid rgb(226 232 240); }
.chat-detail-title { margin-top: .45rem; color: rgb(15 23 42); font-size: 1.35rem; line-height: 1.25; font-weight: 1000; word-break: break-word; }
.chat-detail-subtitle { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .45rem; color: rgb(100 116 139); font-size: .82rem; font-weight: 800; }
.chat-detail-subtitle code { border-radius: .5rem; background: rgb(241 245 249); padding: .18rem .45rem; color: rgb(51 65 85); font-size: .75rem; word-break: break-all; }
.chat-detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.chat-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; padding: 1rem 1.5rem; background: rgb(248 250 252); border-bottom: 1px solid rgb(226 232 240); }
.chat-summary-card { border: 1px solid rgb(226 232 240); border-radius: 1rem; background: white; padding: .85rem 1rem; min-width: 0; }
.chat-summary-card-main { grid-column: 1 / -1; }
.chat-summary-label { color: rgb(100 116 139); font-size: .74rem; font-weight: 900; }
.chat-summary-value { margin-top: .28rem; color: rgb(15 23 42); font-size: 1rem; line-height: 1.45; font-weight: 1000; word-break: break-word; }
.chat-summary-text { white-space: pre-wrap; font-size: .9rem; font-weight: 700; color: rgb(51 65 85); }
.chat-message-list { display: grid; gap: .8rem; padding: 1rem; background: rgb(248 250 252); }
.chat-empty { border: 1px dashed rgb(203 213 225); border-radius: 1rem; background: white; padding: 1.25rem; color: rgb(100 116 139); text-align: center; font-weight: 800; }
.chat-message-card { border: 1px solid rgb(226 232 240); border-radius: 1.1rem; background: white; box-shadow: 0 10px 28px rgba(15,23,42,.04); overflow: hidden; }
.chat-msg-user { border-left: .35rem solid rgb(99 102 241); }
.chat-msg-assistant { border-left: .35rem solid rgb(16 185 129); }
.chat-msg-system, .chat-msg-tool { border-left: .35rem solid rgb(148 163 184); }
.chat-message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .75rem .95rem; border-bottom: 1px solid rgb(241 245 249); color: rgb(100 116 139); font-size: .75rem; font-weight: 900; }
.chat-message-role { display: inline-flex; align-items: center; border-radius: 999px; background: rgb(238 242 255); color: rgb(67 56 202); padding: .16rem .55rem; font-weight: 1000; }
.chat-message-content { margin: 0; max-height: 36rem; overflow: auto; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; padding: .9rem .95rem; color: rgb(30 41 59); font-size: .88rem; line-height: 1.68; font-family: inherit; }
.chat-message-empty { padding: .9rem .95rem; color: rgb(148 163 184); font-size: .82rem; font-weight: 800; }
.email-related-mail-box { display: grid; gap: .45rem; padding: 1rem 1.5rem; border-bottom: 1px solid rgb(226 232 240); background: rgb(248 250 252); color: rgb(51 65 85); font-size: .84rem; word-break: break-word; }
.email-related-list { display: grid; gap: .8rem; padding: 1rem; background: rgb(248 250 252); }
.email-related-card { border: 1px solid rgb(226 232 240); border-radius: 1.1rem; background: white; box-shadow: 0 10px 28px rgba(15,23,42,.04); overflow: hidden; }
.email-related-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; padding: .95rem 1rem; border-bottom: 1px solid rgb(241 245 249); }
.email-related-title { margin-top: .45rem; color: rgb(15 23 42); font-size: 1rem; line-height: 1.35; font-weight: 1000; word-break: break-word; }
.email-related-brief { padding: .85rem 1rem; color: rgb(51 65 85); font-size: .86rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 767px) {
  .chat-detail-head, .email-related-card-head { flex-direction: column; }
  .chat-detail-actions { justify-content: flex-start; }
  .chat-summary-grid { grid-template-columns: 1fr; }
}

.email-related-card-current {
  border-color: #0f172a;
  background: #f8fafc;
}

.email-related-mail-line {
  margin-top: .25rem;
  font-size: .78rem;
  color: #64748b;
  overflow-wrap: anywhere;
}

/* daily-screen-card-fix */
[data-daily-screen] .stat-card{min-height:8rem}

/* 20260519 UI fix: right-top settings, sidebar footer proportions, AJAX daily screen. */
.top-settings-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.35rem; height: 2.35rem; border-radius: .95rem; border: 1px solid rgb(226 232 240); background: white; color: rgb(15 23 42); font-size: 1.05rem; font-weight: 900; transition: all .16s ease; }
.top-settings-icon:hover { background: rgb(248 250 252); border-color: rgb(203 213 225); transform: translateY(-1px); }
.sidebar-footer-actions { display: grid !important; grid-template-columns: minmax(0, 1fr) 3.25rem !important; gap: .75rem !important; align-items: stretch !important; }
.sidebar-action { min-height: 3.25rem; }
.sidebar-logout { width: 100%; justify-content: flex-start; }
.sidebar-toggle { width: 3.25rem; min-width: 3.25rem; justify-content: center; padding-left: 0 !important; padding-right: 0 !important; }
.app-shell.sidebar-collapsed .sidebar-footer-actions { grid-template-columns: 1fr !important; justify-items: center !important; gap: .85rem !important; }
.daily-screen-page { display: grid; gap: 1rem; }
.daily-screen-groups { display: grid; gap: 1rem; }
.daily-screen-group { border: 1px solid rgb(226 232 240); border-radius: 1.5rem; background: white; box-shadow: 0 20px 60px rgba(15,23,42,0.08); overflow: hidden; }
.daily-screen-group-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid rgb(226 232 240); background: rgb(248 250 252); }
.daily-screen-group-title { color: rgb(15 23 42); font-size: 1rem; font-weight: 1000; }
.daily-screen-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; padding: 1rem; }
.daily-screen-card { border: 1px solid rgb(226 232 240); border-radius: 1.25rem; background: white; padding: 1rem; }
.daily-screen-card-label { color: rgb(100 116 139); font-size: .82rem; font-weight: 900; }
.daily-screen-card-value { margin-top: .55rem; color: rgb(15 23 42); font-size: 2rem; line-height: 1.1; font-weight: 1000; }
.daily-screen-status.is-error { border-color: rgb(254 205 211); background: rgb(255 241 242); color: rgb(190 18 60); }
.daily-screen-status.is-ok { border-color: rgb(187 247 208); background: rgb(240 253 244); color: rgb(21 128 61); }


/* 20260519 conversation list and daily screen upgrade. */
.top-env-check { height: 2.35rem; min-height: 2.35rem; padding-top: 0; padding-bottom: 0; border-radius: .95rem; }
.conversation-time-cell { min-width: 8.5rem; }
.chat-flag-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: .2rem .55rem; font-size: .75rem; font-weight: 900; white-space: nowrap; border: 1px solid rgb(226 232 240); background: rgb(248 250 252); color: rgb(51 65 85); }
.chat-flag-1 { background: rgb(239 246 255); border-color: rgb(191 219 254); color: rgb(37 99 235); }
.chat-flag-2 { background: rgb(241 245 249); border-color: rgb(203 213 225); color: rgb(71 85 105); }
.chat-flag-3 { background: rgb(240 253 244); border-color: rgb(187 247 208); color: rgb(22 163 74); }
.daily-screen-card-delta { margin-top: .45rem; font-size: .8rem; font-weight: 1000; }
.daily-screen-card-delta.is-up { color: rgb(220 38 38); }
.daily-screen-card-delta.is-down { color: rgb(22 163 74); }
.daily-screen-card-delta.is-flat { color: rgb(100 116 139); }

/* AJAX list loading + compact header field chips */
.ajax-list-card { position: relative; }
.ajax-list-card.is-ajax-loading { min-height: 16rem; }
.ajax-list-card.is-ajax-loading > :not(.ajax-list-loading) { filter: blur(.5px); opacity: .58; pointer-events: none; transition: opacity .18s ease, filter .18s ease; }
.ajax-list-loading { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 2rem; background: linear-gradient(135deg, rgba(248,250,252,.72), rgba(255,255,255,.9)); backdrop-filter: blur(3px); }
.ajax-loader-card { display: inline-flex; align-items: center; gap: .75rem; border: 1px solid rgb(226 232 240); border-radius: 1.25rem; background: white; padding: .85rem 1.05rem; box-shadow: 0 18px 45px rgba(15,23,42,.12); color: rgb(51 65 85); font-size: .9rem; font-weight: 900; }
.ajax-loader-spinner, .btn-submit-spinner, .page-loader-spinner { width: 1.1rem; height: 1.1rem; border-radius: 999px; border: 3px solid rgb(226 232 240); border-top-color: rgb(79 70 229); animation: ajaxSpin .78s linear infinite; flex: 0 0 auto; }
@keyframes ajaxSpin { to { transform: rotate(360deg); } }
.list-head-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .55rem; min-width: 0; }
.search-field-summary { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .28rem; min-width: 0; max-width: 100%; }
.search-field-title { flex: 0 0 auto; }
.search-field-chip { display: inline-flex; max-width: 15rem; align-items: center; border-radius: 999px; background: rgb(248 250 252); border: 1px solid rgb(226 232 240); color: rgb(71 85 105); padding: .12rem .45rem; font-size: .72rem; font-weight: 800; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-field-hidden { display: none; flex-wrap: wrap; gap: .28rem; min-width: 0; }
.search-field-hidden.is-open { display: inline-flex; }
.search-field-more { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid rgb(199 210 254); background: rgb(238 242 255); color: rgb(67 56 202); padding: .12rem .5rem; font-size: .72rem; font-weight: 900; cursor: pointer; line-height: 1.45; }
.search-field-more:hover { background: rgb(224 231 255); border-color: rgb(165 180 252); }
.page-modal__loading { display: flex; min-height: 13rem; align-items: center; justify-content: center; gap: .75rem; padding: 3rem; text-align: center; color: rgb(71 85 105); font-weight: 900; }
.page-modal__loading::before { content: ''; width: 1.25rem; height: 1.25rem; border-radius: 999px; border: 3px solid rgb(226 232 240); border-top-color: rgb(79 70 229); animation: ajaxSpin .78s linear infinite; }
.btn-primary.is-loading, .btn-secondary.is-loading { cursor: wait; opacity: .9; }
.btn-primary.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; }
.btn-submit-spinner { width: .95rem; height: .95rem; border-width: 2px; border-top-color: currentColor; opacity: .9; }
.email-log-actions, .td.text-right { white-space: nowrap; }

@media (max-width: 1023px) {
  .search-field-chip { max-width: 11rem; }
}

@media (max-width: 767px) {
  .list-head-meta { align-items: flex-start; flex-direction: column; }
  .search-field-summary { width: 100%; }
  .search-field-chip { max-width: 100%; }
  .ajax-list-loading { align-items: flex-start; padding-top: 6rem; }
}

/* 20260519 full-page AJAX list shell: first paint before heavy table data. */
.ajax-list-shell { min-height: 24rem; }
.ajax-list-shell > .ajax-list-loading { background: linear-gradient(135deg, rgba(248,250,252,.55), rgba(255,255,255,.78)); }
.ajax-skeleton-body { padding: 1.25rem; display: grid; gap: 1rem; background: linear-gradient(180deg, rgb(255 255 255), rgb(248 250 252)); }
.ajax-skeleton-banner { display: flex; align-items: center; gap: .85rem; border: 1px solid rgb(226 232 240); border-radius: 1.5rem; background: white; padding: 1rem 1.1rem; box-shadow: 0 18px 50px rgba(15,23,42,.07); }
.ajax-skeleton-title { color: rgb(15 23 42); font-weight: 1000; }
.ajax-skeleton-subtitle { margin-top: .2rem; color: rgb(100 116 139); font-size: .84rem; font-weight: 800; }
.ajax-skeleton-table { display: grid; gap: .65rem; }
.ajax-skeleton-row { display: grid; grid-template-columns: 1.2fr .9fr 1.6fr .7fr; gap: .75rem; border: 1px solid rgb(226 232 240); border-radius: 1rem; background: white; padding: .85rem; overflow: hidden; }
.ajax-skeleton-row span { height: .85rem; border-radius: 999px; background: linear-gradient(90deg, rgb(241 245 249), rgb(226 232 240), rgb(241 245 249)); background-size: 220% 100%; animation: ajaxSkeletonPulse 1.2s ease-in-out infinite; }
.ajax-skeleton-row:nth-child(2n) span:nth-child(3), .ajax-skeleton-row:nth-child(3n) span:nth-child(1) { opacity: .58; }
@keyframes ajaxSkeletonPulse { 0% { background-position: 0 0; } 100% { background-position: -220% 0; } }

@media (max-width: 767px) {
  .ajax-skeleton-row { grid-template-columns: 1fr; }
}

/* Old user AJAX initializer debug output. */
.old-user-init-status { font-size: .82rem; font-weight: 900; }
.old-user-init-debug summary { cursor: pointer; color: rgb(79 70 229); font-weight: 900; }
.old-user-init-debug pre { margin-top: .55rem; max-width: 44rem; max-height: 18rem; overflow: auto; border-radius: .9rem; border: 1px solid rgb(226 232 240); background: rgb(15 23 42); color: rgb(226 232 240); padding: .8rem; font-size: .76rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.old-user-init-select { width: 100%; border-radius: 1rem; border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.94); padding: .8rem 1rem; color: rgb(15 23 42); font-weight: 900; outline: none; transition: all .15s ease; }
.old-user-init-select:focus { border-color: rgba(255,255,255,.65); box-shadow: 0 0 0 4px rgba(255,255,255,.12); }
.old-user-init-select option { background: rgb(255 255 255); color: rgb(15 23 42); }

/* Upgrade 2026-05-22: long text editors and search tools. */
.textarea { resize: vertical; min-height: 7.5rem; }
.textarea-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; margin: -.25rem 0 .45rem; }
.textarea-size-btn { border: 1px solid rgb(226 232 240); border-radius: .75rem; background: rgb(248 250 252); color: rgb(71 85 105); padding: .28rem .55rem; font-size: .75rem; font-weight: 800; line-height: 1.2; transition: all .15s ease; }
.textarea-size-btn:hover { background: white; border-color: rgb(203 213 225); color: rgb(15 23 42); }
.textarea-fullscreen-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(15,23,42,.54); padding: min(4vw, 2rem); display: flex; }
.textarea-fullscreen-card { width: min(1100px, 100%); height: min(820px, 100%); margin: auto; border-radius: 1.5rem; background: white; box-shadow: 0 30px 90px rgba(15,23,42,.28); display: flex; flex-direction: column; overflow: hidden; }
.textarea-fullscreen-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid rgb(226 232 240); font-weight: 1000; color: rgb(15 23 42); }
.textarea-fullscreen-close { border: 1px solid rgb(226 232 240); border-radius: .9rem; background: white; color: rgb(71 85 105); padding: .5rem .85rem; font-weight: 900; }
.textarea-fullscreen-card textarea { flex: 1 1 auto; min-height: 0; border: 0; border-radius: 0; box-shadow: none !important; resize: none; padding: 1rem; }
.search-clear-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Upgrade 2026-05-22 hotfix: compact sidebar after adding more modules. */
.app-sidebar-brand { min-height: 4.85rem !important; padding: 1rem 1.15rem !important; }
.sidebar-logo-icon { width: 2.65rem !important; height: 2.65rem !important; border-radius: 1rem !important; }
.sidebar-brand-text .text-xl { font-size: 1.04rem !important; line-height: 1.2 !important; }
.sidebar-brand-text .text-xs { font-size: .68rem !important; }
.app-sidebar-nav { padding: .8rem .85rem !important; gap: .2rem !important; scrollbar-width: none; }
.app-sidebar-nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
.nav-link { min-height: 2.68rem !important; padding: .58rem .72rem !important; gap: .62rem !important; border-radius: .9rem !important; font-size: .9rem !important; line-height: 1.15 !important; }
.nav-icon { width: 1.72rem !important; height: 1.72rem !important; flex-basis: 1.72rem !important; font-size: 1.12rem !important; }
.app-sidebar-user { padding: .85rem !important; }
.sidebar-user-card { padding: .65rem !important; border-radius: 1rem !important; }
.sidebar-user-avatar { width: 2.35rem !important; height: 2.35rem !important; flex-basis: 2.35rem !important; border-radius: .85rem !important; }
.sidebar-user-name { font-size: .92rem !important; }
.sidebar-user-location { font-size: .72rem !important; }
.sidebar-footer-actions { margin-top: .65rem !important; gap: .55rem !important; }
.sidebar-action { min-height: 2.65rem !important; border-radius: .85rem !important; font-size: .86rem !important; }
.sidebar-toggle { width: 2.75rem !important; min-width: 2.75rem !important; }
.app-shell.sidebar-collapsed .app-sidebar { width: 5.15rem !important; }
.app-shell.sidebar-collapsed .app-sidebar-nav { padding-left: .65rem !important; padding-right: .65rem !important; }
.app-shell.sidebar-collapsed .nav-icon { width: 2.25rem !important; height: 2.25rem !important; flex-basis: 2.25rem !important; font-size: 1.25rem !important; }
.app-shell.sidebar-collapsed .sidebar-action { width: 2.8rem !important; min-height: 2.8rem !important; }

/* Upgrade 2026-05-22: sidebar bigger override after compact mode. */
nav.app-sidebar-nav > a.nav-link {
  min-height: 3.18rem !important;
  padding: .82rem 1rem !important;
  gap: .82rem !important;
  font-size: 1.05rem !important;
  line-height: 1.18 !important;
}

nav.app-sidebar-nav > a.nav-link > .nav-icon {
  width: 2.12rem !important;
  height: 2.12rem !important;
  flex-basis: 2.12rem !important;
  font-size: 1.36rem !important;
}

nav.app-sidebar-nav > a.nav-link > .nav-label {
  font-size: 1.05rem !important;
}

/* FORCE FIX 2026-05-22: data screen v2 styles, appended without patch context. */
.daily-screen-page-v2 {
  min-height: 100%;
  display: grid;
  gap: .85rem;
  padding: .85rem;
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at 12% 0%, rgba(59,130,246,.22), transparent 30rem),
    radial-gradient(circle at 92% 8%, rgba(168,85,247,.20), transparent 28rem),
    linear-gradient(180deg, rgb(2 6 23), rgb(15 23 42) 45%, rgb(15 23 42));
  color: white;
}
.daily-screen-hero-v2 {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 1.35rem;
  background: linear-gradient(135deg, rgba(15,23,42,.92), rgba(30,41,59,.78));
  box-shadow: 0 22px 70px rgba(0,0,0,.25);
}
.daily-screen-hero-glow { position: absolute; border-radius: 999px; filter: blur(46px); opacity: .72; pointer-events: none; }
.daily-screen-hero-glow-a { right: 8%; top: -4rem; width: 16rem; height: 16rem; background: rgba(99,102,241,.42); }
.daily-screen-hero-glow-b { left: 18%; bottom: -5rem; width: 13rem; height: 13rem; background: rgba(14,165,233,.28); }
.daily-screen-hero-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; }
.daily-screen-hero-copy { min-width: 0; }
.daily-screen-kicker { color: rgb(125 211 252); font-size: .68rem; line-height: 1.2; font-weight: 1000; letter-spacing: .14em; }
.daily-screen-hero-copy h1 { margin: .2rem 0 0; font-size: clamp(1.25rem, 2vw, 2rem); line-height: 1.1; font-weight: 1000; letter-spacing: -.04em; }
.daily-screen-hero-copy p { margin: .35rem 0 0; max-width: 46rem; color: rgb(203 213 225); font-size: .82rem; line-height: 1.45; }
.daily-screen-form-v2 { flex: 0 0 auto; display: grid; grid-template-columns: auto auto auto; align-items: center; gap: .5rem; border: 1px solid rgba(255,255,255,.12); border-radius: 1rem; background: rgba(255,255,255,.08); padding: .5rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.daily-screen-date-label { color: rgb(203 213 225); font-size: .72rem; font-weight: 900; white-space: nowrap; }
.daily-screen-form-v2 input { min-height: 2.35rem; border: 0; border-radius: .8rem; background: rgba(255,255,255,.94); padding: .45rem .65rem; color: rgb(15 23 42); font-size: .82rem; font-weight: 1000; outline: none; }
.daily-screen-form-v2 button { min-height: 2.35rem; border: 0; border-radius: .8rem; background: rgb(56 189 248); color: rgb(8 47 73); padding: .45rem .75rem; font-size: .82rem; font-weight: 1000; cursor: pointer; transition: all .16s ease; }
.daily-screen-form-v2 button:hover { transform: translateY(-1px); background: rgb(125 211 252); }
.daily-screen-status-v2 { display: inline-flex; width: fit-content; align-items: center; gap: .45rem; min-height: 2.25rem; border: 1px solid rgba(148,163,184,.22); border-radius: 999px; background: rgba(15,23,42,.68); padding: .42rem .75rem; color: rgb(203 213 225); font-size: .78rem; font-weight: 900; box-shadow: 0 12px 30px rgba(0,0,0,.16); }
.daily-screen-status-v2 span { width: .55rem; height: .55rem; border-radius: 999px; background: rgb(148 163 184); box-shadow: 0 0 16px currentColor; }
.daily-screen-status-v2.is-loading span { background: rgb(56 189 248); animation: dailyPulse 1s ease-in-out infinite; }
.daily-screen-status-v2.is-ok { color: rgb(187 247 208); border-color: rgba(34,197,94,.28); background: rgba(20,83,45,.28); }
.daily-screen-status-v2.is-ok span { background: rgb(34 197 94); }
.daily-screen-status-v2.is-error { color: rgb(254 205 211); border-color: rgba(244,63,94,.35); background: rgba(127,29,29,.34); }
.daily-screen-status-v2.is-error span { background: rgb(244 63 94); }
@keyframes dailyPulse { 0%, 100% { opacity: .45; transform: scale(.86); } 50% { opacity: 1; transform: scale(1.08); } }
.daily-screen-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .7rem; }
.daily-screen-summary-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid rgba(148,163,184,.18); border-radius: 1.05rem; background: linear-gradient(180deg, rgba(30,41,59,.88), rgba(15,23,42,.86)); padding: .8rem .85rem; box-shadow: 0 16px 42px rgba(0,0,0,.18); }
.daily-screen-summary-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: .22rem; background: rgb(56 189 248); opacity: .92; }
.daily-screen-summary-card.tone-green::before { background: rgb(34 197 94); }
.daily-screen-summary-card.tone-purple::before { background: rgb(168 85 247); }
.daily-screen-summary-card.tone-orange::before { background: rgb(249 115 22); }
.daily-screen-summary-card.tone-rose::before { background: rgb(244 63 94); }
.daily-screen-summary-card.tone-cyan::before { background: rgb(6 182 212); }
.daily-screen-summary-label { color: rgb(148 163 184); font-size: .72rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-screen-summary-value { margin-top: .32rem; color: white; font-size: clamp(1.55rem, 2vw, 2.15rem); line-height: 1; font-weight: 1000; letter-spacing: -.05em; }
.daily-screen-summary-sub { margin-top: .35rem; color: rgb(203 213 225); font-size: .72rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-screen-groups-v2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.daily-screen-group-v2 { min-width: 0; overflow: hidden; border: 1px solid rgba(148,163,184,.18); border-radius: 1.15rem; background: rgba(15,23,42,.72); box-shadow: 0 18px 50px rgba(0,0,0,.18); backdrop-filter: blur(8px); }
.daily-screen-group-v2 .daily-screen-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; border-bottom: 1px solid rgba(148,163,184,.16); background: linear-gradient(90deg, rgba(30,41,59,.82), rgba(15,23,42,.46)); padding: .75rem .85rem; }
.daily-screen-group-kicker { color: rgb(56 189 248); font-size: .64rem; line-height: 1.2; font-weight: 1000; letter-spacing: .12em; text-transform: uppercase; }
.daily-screen-group-title { margin-top: .16rem; color: white; font-size: .98rem; line-height: 1.2; font-weight: 1000; }
.daily-screen-group-subtitle { margin-top: .18rem; color: rgb(148 163 184); font-size: .72rem; font-weight: 800; line-height: 1.35; }
.daily-screen-group-count { flex: 0 0 auto; border-radius: 999px; background: rgba(56,189,248,.12); color: rgb(125 211 252); padding: .25rem .55rem; font-size: .68rem; font-weight: 1000; white-space: nowrap; }
.daily-screen-group-v2 .daily-screen-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; padding: .7rem; }
.daily-screen-card-v2 { min-width: 0; border: 1px solid rgba(148,163,184,.16); border-radius: .95rem; background: rgba(30,41,59,.72); padding: .68rem .72rem; box-shadow: none; }
.daily-screen-card-v2:hover { background: rgba(51,65,85,.72); border-color: rgba(125,211,252,.24); }
.daily-screen-card-label { color: rgb(148 163 184); font-size: .72rem; line-height: 1.25; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-screen-card-row { display: flex; align-items: flex-end; gap: .28rem; min-width: 0; margin-top: .32rem; }
.daily-screen-card-value { color: white; font-size: 1.55rem; line-height: 1; font-weight: 1000; letter-spacing: -.04em; }
.daily-screen-card-suffix { padding-bottom: .1rem; color: rgb(148 163 184); font-size: .75rem; font-weight: 900; }
.daily-screen-card-delta { margin-top: .38rem; font-size: .7rem; line-height: 1.2; font-weight: 1000; }
.daily-screen-card-delta.is-up { color: rgb(248 113 113); }
.daily-screen-card-delta.is-down { color: rgb(74 222 128); }
.daily-screen-card-delta.is-flat { color: rgb(148 163 184); }
.daily-screen-empty { border: 1px dashed rgba(148,163,184,.35); border-radius: 1rem; background: rgba(15,23,42,.55); padding: 1rem; color: rgb(203 213 225); font-weight: 900; }

@media (max-width: 1500px) {
  .daily-screen-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .daily-screen-groups-v2 { grid-template-columns: 1fr; }
  .daily-screen-group-v2 .daily-screen-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .daily-screen-hero-inner { align-items: stretch; flex-direction: column; }
  .daily-screen-form-v2 { width: 100%; grid-template-columns: 1fr; }
  .daily-screen-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .daily-screen-group-v2 .daily-screen-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .daily-screen-page-v2 { padding: .55rem; border-radius: 1rem; }
  .daily-screen-summary-grid, .daily-screen-group-v2 .daily-screen-card-grid { grid-template-columns: 1fr; }
}

/* HOME DASHBOARD 4COL TITLE FIX 2026-05-22 START */
/* 首页模块卡片：一行至少 4 列，标题放在 icon 后面，避免 icon 和标题上下重叠。 */
.dashboard-module-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-auto-rows: auto !important;
  align-items: stretch !important;
  gap: clamp(.85rem, 1vw, 1.15rem) !important;
}

.dashboard-card {
  min-height: 8.8rem !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: 1rem 1.1rem !important;
  border-radius: 1.35rem !important;
}

.dashboard-card-top {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: .75rem !important;
  min-width: 0 !important;
}

.dashboard-card-heading {
  display: flex !important;
  align-items: center !important;
  gap: .72rem !important;
  min-width: 0 !important;
}

.dashboard-card-icon {
  flex: 0 0 2.75rem !important;
  width: 2.75rem !important;
  height: 2.75rem !important;
  border-radius: 1rem !important;
  font-size: 1.42rem !important;
}

.dashboard-card-title {
  margin: 0 !important;
  min-width: 0 !important;
  color: rgb(15 23 42) !important;
  font-size: 1rem !important;
  line-height: 1.18 !important;
  font-weight: 1000 !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

.dashboard-card-metric,
.dashboard-card-top > .text-right {
  min-width: 5.4rem !important;
  max-width: 6.8rem !important;
  text-align: right !important;
}

.dashboard-card-total {
  min-height: 0 !important;
  font-size: clamp(1.35rem, 1.3vw, 1.85rem) !important;
  line-height: 1.05 !important;
}

.dashboard-card-unit,
.dashboard-card-top .text-xs {
  margin-top: .22rem !important;
  font-size: .74rem !important;
  line-height: 1.15 !important;
}

.dashboard-card-main {
  margin-top: .85rem !important;
  padding-top: 0 !important;
  align-self: auto !important;
  display: block !important;
  overflow: hidden !important;
}

.dashboard-card-desc {
  margin: 0 !important;
  font-size: .86rem !important;
  line-height: 1.45 !important;
  -webkit-line-clamp: 2 !important;
  max-height: 2.9em !important;
}

@media (max-width: 1535px) and (min-width: 1024px) {
  .dashboard-module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .dashboard-card { padding: .95rem 1rem !important; }
  .dashboard-card-icon { flex-basis: 2.55rem !important; width: 2.55rem !important; height: 2.55rem !important; font-size: 1.32rem !important; }
  .dashboard-card-title { font-size: .96rem !important; }
  .dashboard-card-total { font-size: clamp(1.22rem, 1.1vw, 1.65rem) !important; }
}

@media (max-width: 1279px) and (min-width: 768px) {
  .dashboard-module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 767px) {
  .dashboard-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .dashboard-card { min-height: 7.8rem !important; padding: .85rem !important; }
  .dashboard-card-top { grid-template-columns: 1fr !important; gap: .55rem !important; }
  .dashboard-card-heading { gap: .55rem !important; }
  .dashboard-card-icon { flex-basis: 2.2rem !important; width: 2.2rem !important; height: 2.2rem !important; font-size: 1.12rem !important; }
  .dashboard-card-title { font-size: .92rem !important; -webkit-line-clamp: 2 !important; }
  .dashboard-card-metric, .dashboard-card-top > .text-right { max-width: none !important; text-align: left !important; }
  .dashboard-card-desc { display: none !important; }
}
/* HOME DASHBOARD 4COL TITLE FIX 2026-05-22 END */

/* HOME CARD TITLE DOMINANT REFINE 2026-05-22 START */
/* Home dashboard cards: title is primary; count becomes a small subtitle under the title. */
.dashboard-module-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(.85rem, 1vw, 1.12rem) !important;
}
.dashboard-card {
  min-height: 8.15rem !important;
  height: auto !important;
  padding: 1rem 1.1rem !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}
.dashboard-card-top {
  display: block !important;
  min-width: 0 !important;
}
.dashboard-card-heading {
  display: flex !important;
  align-items: center !important;
  gap: .78rem !important;
  min-width: 0 !important;
}
.dashboard-card-icon {
  flex: 0 0 2.85rem !important;
  width: 2.85rem !important;
  height: 2.85rem !important;
  border-radius: 1rem !important;
  font-size: 1.5rem !important;
}
.dashboard-card-title-stack {
  min-width: 0 !important;
  display: grid !important;
  gap: .22rem !important;
}
.dashboard-card-title {
  margin: 0 !important;
  color: rgb(15 23 42) !important;
  font-size: clamp(1.45rem, 1.45vw, 1.8rem) !important;
  line-height: 1.06 !important;
  font-weight: 1000 !important;
  letter-spacing: -.045em !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 1 !important;
  overflow: hidden !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}
.dashboard-card-statline {
  color: rgb(100 116 139) !important;
  font-size: .72rem !important;
  line-height: 1.25 !important;
  /* 将900改为400或normal，保留!important确保覆盖原有样式 */
  font-weight: 200 !important; 
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.dashboard-card-metric,
.dashboard-card-total,
.dashboard-card-unit,
.dashboard-card-top > .text-right {
  display: none !important;
}
.dashboard-card-main {
  margin-top: .8rem !important;
  padding-top: 0 !important;
  display: block !important;
  overflow: hidden !important;
}
.dashboard-card-desc {
  margin: 0 !important;
  color: rgb(100 116 139) !important;
  font-size: .88rem !important;
  line-height: 1.45 !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  max-height: 2.9em !important;
}
@media (max-width: 1535px) and (min-width: 1024px) {
  .dashboard-card { min-height: 7.75rem !important; padding: .9rem 1rem !important; }
  .dashboard-card-icon { flex-basis: 2.55rem !important; width: 2.55rem !important; height: 2.55rem !important; font-size: 1.32rem !important; }
  .dashboard-card-title { font-size: clamp(1.18rem, 1.18vw, 1.45rem) !important; }
  .dashboard-card-statline { font-size: .78rem !important; }
  .dashboard-card-desc { font-size: .82rem !important; }
}
@media (max-width: 1279px) and (min-width: 768px) {
  .dashboard-module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 767px) {
  .dashboard-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .dashboard-card { min-height: 7rem !important; padding: .85rem !important; }
  .dashboard-card-heading { gap: .55rem !important; }
  .dashboard-card-icon { flex-basis: 2.2rem !important; width: 2.2rem !important; height: 2.2rem !important; font-size: 1.12rem !important; }
  .dashboard-card-title { font-size: 1rem !important; -webkit-line-clamp: 2 !important; }
  .dashboard-card-statline { font-size: .74rem !important; }
  .dashboard-card-desc { display: none !important; }
}
/* HOME CARD TITLE DOMINANT REFINE 2026-05-22 END */

/* DAILY SCREEN MODULE LABEL REFINE 2026-05-22 START */
/* Data screen groups: do not show "Module 01 / Module 02" labels. */
.daily-screen-group-kicker {
  display: none !important;
}
.daily-screen-group-v2 .daily-screen-group-head {
  align-items: center !important;
}
.daily-screen-group-title {
  margin-top: 0 !important;
  font-size: 1.05rem !important;
}
.daily-screen-group-subtitle {
  margin-top: .24rem !important;
}
/* DAILY SCREEN MODULE LABEL REFINE 2026-05-22 END */

/* HOME CARD TITLE SMALLER - 20260522
   Make homepage module titles two steps smaller while keeping count as subtitle. */
.dashboard-card-title,
.dashboard-card-heading .dashboard-card-title,
.dashboard-card-main .dashboard-card-title,
.dashboard-card h3,
.dashboard-card .font-black,
.dashboard-card .font-extrabold {
  font-size: clamp(1.28rem, 1.05rem + .55vw, 1.72rem) !important;
  line-height: 1.15 !important;
  letter-spacing: -0.035em !important;
}

.dashboard-card-statline,
.dashboard-card-subtitle,
.dashboard-card-count,
.dashboard-card .text-slate-500,
.dashboard-card .text-slate-600 {
  font-size: .75rem !important;
  line-height: 1.28 !important;
  font-weight: 400 !important;
}

.dashboard-card-icon {
  width: 2.65rem !important;
  height: 2.65rem !important;
  flex-basis: 2.65rem !important;
  font-size: 1.35rem !important;
}

.dashboard-card-heading,
.dashboard-card-top {
  gap: .72rem !important;
  align-items: flex-start !important;
}

@media (min-width: 1280px) {
  .dashboard-card-title,
  .dashboard-card-heading .dashboard-card-title,
  .dashboard-card-main .dashboard-card-title,
  .dashboard-card h3,
  .dashboard-card .font-black,
  .dashboard-card .font-extrabold {
    font-size: 1.2rem !important;
  }
}

@media (max-width: 767px) {
  .dashboard-card-title,
  .dashboard-card-heading .dashboard-card-title,
  .dashboard-card-main .dashboard-card-title,
  .dashboard-card h3,
  .dashboard-card .font-black,
  .dashboard-card .font-extrabold {
    font-size: 1.22rem !important;
  }
}

/* MODEL PROMPT TOKEN COUNTER 20260528 START */
.prompt-token-badge,
.prompt-token-list-badge {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  border-radius: 999px;
  border: 1px solid rgb(199 210 254);
  background: rgb(238 242 255);
  color: rgb(67 56 202);
  padding: .16rem .5rem;
  font-size: .72rem;
  line-height: 1.2;
  font-weight: 900;
  white-space: nowrap;
}
.prompt-token-badge strong,
.prompt-token-list-badge {
  font-variant-numeric: tabular-nums;
}
.prompt-token-list-badge {
  justify-content: center;
  min-width: 4.4rem;
  padding: .25rem .62rem;
}
.prompt-token-textarea {
  min-height: 18rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .78rem;
  line-height: 1.65;
}
/* MODEL PROMPT TOKEN COUNTER 20260528 END */

/* Common admin action modal: delete/lock/restore/high-risk confirmations. */
.admin-action-modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(15, 23, 42, .48); backdrop-filter: blur(6px); }
.admin-action-modal.is-open { display: flex; }
.admin-action-modal__dialog { width: min(92vw, 34rem); max-height: 88vh; overflow: hidden; border-radius: 1.5rem; border: 1px solid rgb(226 232 240); background: white; box-shadow: 0 24px 70px rgba(15, 23, 42, .25); }
.admin-action-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid rgb(226 232 240); background: linear-gradient(135deg, rgb(248 250 252), white); }
.admin-action-modal__eyebrow { color: rgb(99 102 241); font-size: .72rem; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.admin-action-modal.is-error .admin-action-modal__eyebrow { color: rgb(225 29 72); }
.admin-action-modal.is-success .admin-action-modal__eyebrow { color: rgb(5 150 105); }
.admin-action-modal__title { margin-top: .25rem; color: rgb(15 23 42); font-size: 1.08rem; font-weight: 950; line-height: 1.25; }
.admin-action-modal__x { width: 2.1rem; height: 2.1rem; border: 1px solid rgb(226 232 240); border-radius: .75rem; background: white; color: rgb(100 116 139); font-size: 1.35rem; line-height: 1; cursor: pointer; }
.admin-action-modal__x:hover { border-color: rgb(148 163 184); color: rgb(15 23 42); }
.admin-action-modal__body { padding: 1.1rem 1.25rem 1.25rem; overflow: auto; max-height: calc(88vh - 8.8rem); }
.admin-action-modal__message { color: rgb(30 41 59); font-size: .92rem; line-height: 1.65; font-weight: 750; word-break: break-word; }
.admin-action-modal__password-wrap,
.admin-action-modal__detail-wrap { display: block; margin-top: 1rem; color: rgb(71 85 105); font-size: .8rem; font-weight: 900; }
.admin-action-modal__password { display: block; width: 100%; margin-top: .45rem; border: 1px solid rgb(203 213 225); border-radius: .9rem; background: white; color: rgb(15 23 42); padding: .72rem .85rem; outline: none; font-size: .92rem; }
.admin-action-modal__password:focus { border-color: rgb(99 102 241); box-shadow: 0 0 0 3px rgb(199 210 254 / .55); }
.admin-action-modal__error { display: block; min-height: 1rem; margin-top: .35rem; color: rgb(225 29 72); font-size: .75rem; font-weight: 900; }
.admin-action-modal__detail { display: block; width: 100%; min-height: 12rem; margin-top: .45rem; padding: .8rem; border: 1px solid rgb(203 213 225); border-radius: .9rem; background: rgb(248 250 252); color: rgb(15 23 42); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: .8rem; line-height: 1.55; resize: vertical; white-space: pre; }
.admin-action-modal__footer { display: flex; justify-content: flex-end; gap: .6rem; padding: .95rem 1.25rem 1.2rem; border-top: 1px solid rgb(226 232 240); background: rgb(248 250 252); }
.admin-action-modal__btn { border: 1px solid rgb(203 213 225); border-radius: .85rem; background: white; color: rgb(51 65 85); padding: .58rem .9rem; font-weight: 900; cursor: pointer; }
.admin-action-modal__btn:hover { border-color: rgb(148 163 184); background: rgb(241 245 249); }
.admin-action-modal__btn--primary { border-color: rgb(79 70 229); background: rgb(79 70 229); color: white; }
.admin-action-modal.has-password .admin-action-modal__btn--primary,
.admin-action-modal.is-error .admin-action-modal__btn--primary { border-color: rgb(225 29 72); background: rgb(225 29 72); }
.admin-action-modal__btn--primary:hover { filter: brightness(.96); }
body.admin-action-modal-open { overflow: hidden; }

/* 20260604 multimodal message rendering. */
.multimodal-content { display: grid; gap: .8rem; white-space: normal; }
.multimodal-text { border: 1px solid rgb(226 232 240); border-radius: .95rem; background: rgb(248 250 252); padding: .8rem .9rem; color: rgb(30 41 59); font-size: .9rem; line-height: 1.68; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.multimodal-image-card { margin: 0; width: min(100%, 34rem); border: 1px solid rgb(226 232 240); border-radius: 1rem; background: white; overflow: hidden; box-shadow: 0 12px 28px rgba(15,23,42,.06); }
.multimodal-image-card a { display: block; background: rgb(15 23 42); }
.multimodal-image-card img { display: block; width: 100%; max-height: 30rem; object-fit: contain; }
.multimodal-image-card figcaption { padding: .55rem .75rem; color: rgb(100 116 139); font-size: .76rem; font-weight: 800; background: rgb(248 250 252); border-top: 1px solid rgb(226 232 240); }
.multimodal-json { margin: 0; max-height: 24rem; overflow: auto; border: 1px solid rgb(226 232 240); border-radius: .95rem; background: rgb(248 250 252); padding: .8rem .9rem; color: rgb(51 65 85); font-size: .78rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.chat-message-content-rich { white-space: normal; }
.chat-message-content-rich .multimodal-text { background: white; }

/* 20260604 daily screen loading aligns with table AJAX loading. */
.daily-screen-page-v2 { position: relative; min-height: calc(100vh - 8rem); }
.daily-screen-page-v2.is-ajax-loading { min-height: calc(100vh - 8rem); }
.daily-screen-page-v2.is-ajax-loading > :not(.ajax-list-loading) { filter: blur(.5px); opacity: .58; pointer-events: none; transition: opacity .18s ease, filter .18s ease; }
.daily-screen-page-v2 > .ajax-list-loading { align-items: center; justify-content: center; padding: 2rem; border-radius: 1.2rem; }
.daily-screen-status-v2.is-loading { display: none; }
.ajax-list-card:not(.is-ajax-loading) > .ajax-list-loading,
.ajax-list-shell:not(.is-ajax-loading) > .ajax-list-loading,
.daily-screen-page-v2:not(.is-ajax-loading) > .ajax-list-loading { display: none; }
