:root {
  --header-bg: #1b1f27;
  --text-main: #1b1f27;
  --text-muted: #6b7280;
  --border-soft: #e2e5ea;
  --room-header-bg: #f7f8fa;
  --room-header-bg-open: #eef0f3;
  --card-bg: #ffffff;
  --card-border: #9aa3b0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--text-main);
  background: #f4f5f7;
  overflow-x: hidden;
}

/* --- ヘッダー --- */
.app-header {
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 20;
  padding-bottom: 4px;
}

.app-title {
  color: #fff;
  font-size: 16px;
  margin: 0;
  padding: 14px 16px 4px;
}

.app-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 16px;
}

.logout-link {
  color: #cbd0d8;
  font-size: 12px;
  text-decoration: none;
}

.logout-link:hover { color: #fff; }

/* --- ログイン --- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #1b1f27;
}

.login-card {
  width: min(100%, 380px);
  padding: 28px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0,0,0,0.3);
}

.login-logo { width: 48px; height: 48px; object-fit: contain; }
.login-card h1 { margin: 10px 0 2px; font-size: 24px; }
.login-card p { margin: 0 0 22px; color: var(--text-muted); font-size: 13px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.login-card input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-size: 16px;
}
.login-card .btn { width: 100%; margin-top: 6px; }
.login-error {
  margin-bottom: 14px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #ffe8e8;
  color: #a3262e;
  font-size: 13px;
}

.president-badge {
  display: inline-block;
  margin: 4px 16px 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #ff8a3d;
  color: #1b1f27;
  font-weight: 700;
  font-size: 14px;
}

.search-bar {
  padding: 8px 12px 12px;
}

.search-bar input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  background: #2a2f3a;
  color: #fff;
}

.search-bar input::placeholder {
  color: #9aa1ad;
}

.placeholder-notice {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
}

/* --- 部屋（アコーディオン） --- */
.rooms {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.room {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.room-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--room-header-bg);
  border: none;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
}

.room.is-open .room-header {
  background: var(--room-header-bg-open);
}

.room-header-label {
  flex: 1;
}

.room-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.room-chevron {
  font-size: 11px;
  color: var(--text-muted);
  width: 1em;
  text-align: center;
}

.room-body {
  padding: 0 12px;
}

.room.is-open .room-body {
  padding: 8px 12px 12px;
}

.room-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 4px;
}

.room-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- カード --- */
.card {
  background: var(--card-bg);
  color: var(--text-main);
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 6px solid var(--card-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.card.category-jutaku {
  border: 1px solid rgba(255, 90, 54, 0.45);
  border-left: 6px solid #ff5a36;
}

.card.category-stock {
  border: 1px solid rgba(59, 111, 214, 0.35);
  border-left: 6px solid #3b6fd6;
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}

.status-dot {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-top: 2px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.status-dot.status-you {
  background: #e0393e;
}

.status-dot.status-ai {
  background: #2fae4e;
}

.status-dot.status-client {
  background: #2f6fed;
}

.status-dot.status-not_started {
  background: #aab2bf;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef0f3;
  color: var(--text-muted);
}

.tag-category.cat-jutaku {
  background: rgba(255, 90, 54, 0.12);
  color: #d9481f;
}

.tag-category.cat-stock {
  background: rgba(59, 111, 214, 0.12);
  color: #2857aa;
}

.tag-priority.priority-high,
.tag-priority.priority-urgent {
  background: #ffe5e5;
  color: #b4232c;
}

.tag-deadline {
  background: #fff0d6;
  color: #9a5b00;
}

.card-summary {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: pre-wrap;
}

.card-status {
  font-size: 12px;
  font-weight: 700;
}

.schedule-export-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #dbe4f4;
  border-radius: 12px;
  background: #f6f9ff;
}

.schedule-export-actions > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.schedule-export-actions strong { font-size: 14px; }
.schedule-export-actions span { color: var(--text-muted); font-size: 12px; }
.schedule-export-actions .btn { flex: 0 0 auto; }

/* --- モバイル --- */
@media (max-width: 480px) {
  .rooms {
    padding: 8px;
    gap: 8px;
  }

  .room-header {
    padding: 12px;
    font-size: 14px;
  }

  .schedule-export-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-export-actions .btn { width: 100%; }
}

/* --- FAB --- */
.fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #2f6fed;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  cursor: pointer;
  z-index: 30;
}

.fab:hover {
  background: #255cc9;
}

.fab.is-hidden {
  display: none;
}

/* --- モーダル --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 12px;
}

.modal-overlay.is-active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  padding: 24px 20px;
  position: relative;
  box-sizing: border-box;
  overflow-x: hidden;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body h2 {
  margin: 0 0 16px;
  font-size: 18px;
  padding-right: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea {
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.field textarea {
  resize: vertical;
  min-height: 56px;
}

.field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.field-row {
  display: flex;
  gap: 10px;
}

.field-row .field {
  flex: 1;
  min-width: 0;
}

@media (max-width: 480px) {
  .field-row {
    flex-direction: column;
    gap: 10px;
  }

  .modal {
    padding: 20px 16px;
  }
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: #2f6fed;
  color: #fff;
}

.btn-secondary {
  background: #eef0f3;
  color: var(--text-main);
}

.btn-archive {
  background: #9aa3b0;
  color: #fff;
}

.btn-delete {
  background: #e0393e;
  color: #fff;
}

.btn-promote {
  background: #33a35a;
  color: #fff;
}

.checklist-wrap {
  margin-top: 4px;
}

.checklist-list {
  margin: 4px 0 8px;
}

.checklist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
}

.checklist-row:last-child {
  border-bottom: none;
}

.checklist-label {
  flex: 1;
}

.checklist-row.is-done .checklist-label {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-delete {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
}

.checklist-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 0;
}

.card-checklist-progress {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
}

.card-checklist-progress.is-complete {
  color: #33a35a;
}

.payments-list {
  margin-top: 4px;
  max-height: 256px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
}

.payment-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.payment-row:last-child {
  border-bottom: none;
}

.payment-row input[type="date"] {
  padding: 4px 6px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  font-size: 12px;
  max-width: 140px;
}

.payment-row.is-estimate {
  background: #fff8e6;
}

.payment-estimate-label {
  font-size: 11px;
  font-weight: 700;
  color: #b8860b;
}

.payment-amount {
  font-weight: 700;
}

.payment-row input.payment-amount {
  width: 120px;
  padding: 4px 6px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}

.payment-edit-help {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.payment-row span:last-of-type {
  flex: 1;
  color: var(--text-muted);
}

.payment-delete {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
}

.payments-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 0;
}

/* --- 経営管理室 --- */
.finance-dashboard {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

/* --- 秘書室 / 外部連絡整理 --- */
.secretary-dashboard {
  background: #fffaf0;
  border: 1px solid #ead9b7;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.secretary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.secretary-block + .secretary-block {
  border-top: 1px dashed #d9c8a7;
  margin-top: 14px;
  padding-top: 14px;
}

.secretary-block h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #705b32;
}

.secretary-item {
  background: #fff;
  border: 1px solid #eadfca;
  border-left: 4px solid #c08b2e;
  border-radius: 8px;
  padding: 9px 10px;
  margin-bottom: 7px;
}

.secretary-item.is-memo {
  border-left-color: #7357b5;
}

.secretary-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.secretary-badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1ece2;
  color: #705b32;
  font-size: 10px;
  font-weight: 700;
}

.secretary-meta,
.secretary-linked {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.secretary-summary {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.secretary-empty {
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 0;
}

.finance-month-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.finance-month-btn {
  border: 1px solid var(--border-soft);
  background: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
}

.finance-month-label {
  font-weight: 700;
  font-size: 15px;
}

.finance-meter {
  margin-bottom: 12px;
}

.finance-meter-line {
  font-size: 12px;
  color: var(--text-muted);
}

.finance-meter-total {
  font-size: 18px;
  font-weight: 700;
  margin: 2px 0 6px;
}

.finance-bar {
  height: 10px;
  border-radius: 999px;
  background: #e6e8ec;
  overflow: hidden;
}

.finance-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2f6fed, #33a35a);
}

.finance-cat-rows {
  border-top: 1px dashed var(--border-soft);
  padding-top: 10px;
  margin-bottom: 12px;
}

.finance-cat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}

.finance-type-breakdown h4 {
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-soft);
  padding-top: 10px;
}

.finance-type-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}

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

.finance-yearly {
  margin-top: 4px;
}

.finance-yearly h4 {
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-soft);
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.finance-yearly-average {
  font-weight: 700;
  color: var(--text-main);
}

.finance-yearly-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 8px 22px;
  overflow: visible;
}

.finance-yearly-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  z-index: 2;
}

.finance-yearly-bar {
  width: 70%;
  background: #2f6fed;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}

.finance-yearly-bar.is-current {
  background: #33a35a;
}

.finance-yearly-bar-label {
  font-size: 9px;
  color: var(--text-muted);
  position: absolute;
  bottom: -16px;
  white-space: nowrap;
}

.finance-yearly-refline {
  position: absolute;
  left: 8px;
  right: 8px;
  border-top: 1px dashed #b8860b;
  z-index: 1;
}

.finance-yearly-refline-label {
  position: absolute;
  right: 0;
  top: -14px;
  font-size: 9px;
  color: #b8860b;
  background: #fff;
  padding: 0 2px;
  white-space: nowrap;
}

.finance-yearly-refline.is-minimum {
  border-top-color: #9aa3b0;
}

.finance-yearly-refline.is-minimum .finance-yearly-refline-label {
  color: #9aa3b0;
}

.history-list {
  margin-top: 16px;
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
}

.history-list h3 {
  font-size: 13px;
  margin: 0 0 8px;
  color: var(--text-muted);
}

.history-item {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  padding: 2px 0;
}

.history-item .history-date {
  font-weight: 700;
  flex: 0 0 auto;
}

/* --- トースト --- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(20px);
  background: #1b1f27;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Explicit AI dispatch and append-only reports */
.ai-section { margin-top: 24px; border-top: 1px solid #bbb; padding-top: 20px; }
.ai-section h3 { margin: 8px 0 12px; }
.ai-help { font-size: 13px; line-height: 1.6; opacity: .8; margin: 10px 0; }
.ai-status { font-weight: bold; margin: 12px 0; }
.ai-request-fields .field { margin-bottom: 12px; }
.ai-request-fields textarea { min-height: 90px; }
.ai-report { padding: 12px 0; border-bottom: 1px solid #ccc; }
.ai-report summary { cursor: pointer; overflow-wrap: anywhere; }
.ai-report strong { display: block; margin-top: 12px; }
.ai-report pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13px; margin: 6px 0; }
.ai-reports { margin-top: 24px; }
.ai-section button:disabled { opacity: .5; cursor: not-allowed; }

/* Home dashboard and navigation */
.app-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: 232px;
  display: flex; flex-direction: column; padding: 24px 14px 18px;
  color: #fff; background: linear-gradient(180deg, #080d35 0%, #11195b 58%, #292b8c 100%);
}
.sidebar-brand { padding: 0 14px 24px; display: flex; flex-direction: column; gap: 5px; }
.sidebar-brand strong { font-size: 24px; letter-spacing: .02em; }
.sidebar-brand span { font-size: 12px; opacity: .72; }
#sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-link {
  width: 100%; min-height: 42px; border: 0; border-radius: 10px; padding: 9px 12px;
  display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px;
  background: transparent; color: rgba(255,255,255,.72); font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer;
}
.sidebar-link:hover, .sidebar-link.is-active { color: #fff; background: linear-gradient(100deg, #246bf2, #6454ed); }
.sidebar-count {
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; font-size: 11px; opacity: .45;
}
.sidebar-count.has-items { background: rgba(255,255,255,.16); color: #fff; opacity: 1; font-weight: 800; }
.sidebar-link.is-active .sidebar-count.has-items { background: #fff; color: #4f55df; box-shadow: 0 2px 8px rgba(5,10,50,.16); }
.sidebar-icon { font-size: 18px; text-align: center; }
.sidebar-account { margin-top: auto; padding: 12px 14px; color: rgba(255,255,255,.75); font-size: 12px; text-decoration: none; }
.app-content { min-height: 100vh; margin-left: 232px; }
.app-header { background: rgba(244,245,247,.94); color: var(--text-main); backdrop-filter: blur(8px); padding: 20px 30px 8px; }
.app-title-row { padding: 0; }
.app-title { color: #0c1238; font-size: 24px; padding: 0; }
.app-subtitle { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; }
.search-bar { padding: 14px 0 0; }
.search-bar input { max-width: 520px; background: #fff; color: var(--text-main); border: 1px solid var(--border-soft); }
.search-bar input::placeholder { color: #8b93a2; }
.logout-link { display: none; }
#app { max-width: 1180px; margin: 0 auto; padding: 0 30px 48px; }
.home-dashboard { display: flex; flex-direction: column; gap: 18px; padding: 16px 0 26px; }
.home-summary { order: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.home-metric { min-height: 86px; padding: 16px 18px; background: #fff; border: 1px solid var(--border-soft); border-radius: 14px; box-shadow: 0 3px 12px rgba(15,23,42,.045); }
.home-metric-label { display: block; margin-bottom: 7px; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.home-metric-value { font-size: clamp(20px, 2.2vw, 28px); color: #17204a; }
.home-metric-progress { display: block; margin-top: 7px; color: #7a8291; font-size: 11px; font-weight: 700; }
.home-metric.is-unstarted-orders { border-top: 3px solid #20a06b; }
.home-metric.is-income { border-top: 3px solid #3268df; }
.home-metric.is-expected { border-top: 3px solid #ef8b35; }
.home-main-grid { order: 2; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 16px; align-items: start; }
.home-panel { background: #fff; border: 1px solid var(--border-soft); border-radius: 14px; box-shadow: 0 3px 12px rgba(15,23,42,.045); overflow: hidden; }
.home-panel > h2, .home-panel-head { margin: 0; padding: 15px 18px; border-bottom: 1px solid #edf0f4; }
.home-panel h2 { margin: 0; font-size: 16px; }
.home-panel-head { display: flex; align-items: center; justify-content: space-between; }
.home-refresh { border: 0; background: none; color: #3268df; font-weight: 700; cursor: pointer; }
.home-date-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.home-date-nav button { width: 28px; height: 28px; padding: 0; border: 1px solid #dce3ef; border-radius: 8px; background: #fff; color: #3268df; font-size: 20px; line-height: 1; cursor: pointer; }
.home-date-nav button:disabled { color: #b8bfca; background: #f5f6f8; cursor: default; }
.home-date-nav strong { min-width: 100px; color: #344054; font-size: 11px; text-align: center; }
.home-date-nav + .home-refresh { margin-left: 8px; }
.today-list { padding: 0 18px; }
.today-item { min-height: 58px; display: grid; grid-template-columns: 22px 100px 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid #edf0f4; cursor: default; }
.today-item:last-child { border-bottom: 0; }
.today-item.is-completed { opacity: .55; }
.today-item.is-completed strong { text-decoration: line-through; }
.today-check { width: 18px; height: 18px; border: 1px solid #bdc5d1; border-radius: 5px; display: grid; place-items: center; color: #3268df; font-size: 12px; }
.today-time { color: #245ddd; font-size: 12px; font-weight: 700; }
.today-task { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.today-task strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.today-task span { color: var(--text-muted); font-size: 11px; }
.today-priority { min-width: 28px; padding: 5px 7px; border-radius: 999px; font-size: 11px; text-align: center; }
.today-priority.is-high { background: #ffe6e2; color: #d64230; }
.today-priority.is-normal { background: #fff1df; color: #bf6c18; }
.today-priority.is-low { background: #eef0f3; color: #667085; }
.today-source { margin: 0; padding: 11px 18px; border-top: 1px solid #edf0f4; color: var(--text-muted); font-size: 11px; text-align: right; }
.home-empty { margin: 0; padding: 22px 18px; color: var(--text-muted); font-size: 13px; }
.home-empty.is-error { color: #b42318; }
.alert-item { width: 100%; padding: 15px 18px; border: 0; border-bottom: 1px solid #edf0f4; background: #fff; display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer; }
.alert-item:last-child { border-bottom: 0; }
.alert-item strong { font-size: 13px; }
.alert-item span { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.alert-item strong::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #f59e0b; }
.alert-item.is-danger strong::before { background: #e53935; }
.rooms-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.rooms-heading h2 { margin: 0; font-size: 18px; }
.president-badge { margin: 0; padding: 6px 11px; border: 0; border-radius: 999px; background: #e8edff; color: #3049a8; font: inherit; font-size: 12px; cursor: pointer; }
.president-badge.has-items {
  padding: 8px 14px; background: #dfe6ff; color: #263fa5; border: 1px solid #cbd6ff;
  font-size: 14px; font-weight: 800; box-shadow: 0 3px 10px rgba(48,73,168,.12);
}
.president-badge:focus-visible { outline: 3px solid rgba(50,104,223,.28); outline-offset: 2px; }
.rooms { max-width: none; padding: 12px 0; }
.room { scroll-margin-top: 100px; }
.secretary-dashboard { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 2px 0 10px; background: transparent; border: 0; }
.secretary-command { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.secretary-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: #eef1f6; }
.secretary-tab { flex: 0 1 190px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: #667085; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.secretary-tab.is-active { background: #fff; color: #245ddd; box-shadow: 0 1px 4px rgba(31,41,55,.1); }
.secretary-summary { padding: 14px; border: 1px solid #d9e1f2; border-radius: 12px; background: #f8faff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.secretary-summary > div { flex: 1 1 360px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.secretary-summary strong { font-size: 14px; }
.secretary-summary span { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.secretary-copy, .secretary-import { flex: 0 0 auto; }
.secretary-strategy-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.secretary-strategy-summary { min-width: 0; padding: 12px 14px; border: 1px solid #e2e6ee; border-radius: 10px; background: #fafbfc; }
.secretary-strategy-summary.is-learning { background: #fafbf8; }
.secretary-strategy-kicker { display: block; margin-bottom: 6px; color: #667085; font-size: 11px; font-weight: 800; }
.secretary-strategy-title { display: block; margin-bottom: 4px; color: #1f2937; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secretary-strategy-text { margin: 0; min-height: 2.8em; color: #4b5565; font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.secretary-strategy-empty { margin: 0; color: #98a2b3; font-size: 12px; }
.secretary-strategy-footer { min-height: 24px; margin-top: 7px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.secretary-strategy-footer small { color: #98a2b3; font-size: 10px; }
.secretary-strategy-edit { margin-left: auto; padding: 3px 8px; border: 0; border-radius: 6px; background: transparent; color: #3268df; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.secretary-strategy-edit:hover { background: #edf2ff; }
.secretary-billing-heading { padding: 9px 2px 2px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.secretary-billing-heading span { padding: 2px 7px; border-radius: 999px; background: #eef1f5; color: #667085; font-size: 11px; }
.secretary-stat { padding: 11px; border: 1px solid var(--border-soft); border-radius: 10px; background: #fafbfc; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 12px; }
.secretary-stat small { grid-column: 1 / -1; color: var(--text-muted); }
.secretary-fields { margin: 4px 0 14px; padding: 14px; border: 1px solid #d9e1f2; border-radius: 12px; background: #fbfaff; }
.project-roadmap { display: flex; flex-direction: column; gap: 12px; }
.roadmap-summary { display: grid; grid-template-columns: repeat(5,minmax(100px,1fr)); gap: 8px; }
.roadmap-stat { min-width: 0; padding: 10px 12px; border: 1px solid #e2e6ee; border-radius: 9px; background: #fff; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.roadmap-stat span { color: #667085; font-size: 11px; }
.roadmap-stat strong { color: #1f2937; font-size: 15px; white-space: nowrap; }
.roadmap-stat.is-ai { border-left: 4px solid #35a65a; }
.roadmap-stat.is-client { border-left: 4px solid #3b6fd8; }
.roadmap-stat.is-you { border-left: 4px solid #dc4c52; }
.roadmap-stat.is-not_started { border-left: 4px solid #aab2bf; }
.roadmap-stat.is-other { border-left: 4px solid #8a72c7; }
.roadmap-stat.is-total { background: #f6f8fc; }
.roadmap-scroll { overflow-x: auto; border: 1px solid #e2e6ee; border-radius: 10px; background: #fff; }
.roadmap-table { min-width: 900px; }
.roadmap-row { display: grid; grid-template-columns: 250px minmax(640px,1fr); min-height: 58px; border-top: 1px solid #edf0f4; }
.roadmap-header-row { min-height: 38px; border-top: 0; background: #f7f8fa; }
.roadmap-case-head { padding: 11px 14px; color: #667085; font-size: 11px; font-weight: 800; }
.roadmap-dates { display: grid; grid-template-columns: repeat(8,1fr); border-left: 1px solid #e2e6ee; }
.roadmap-dates span { padding: 11px 8px; border-left: 1px solid #e2e6ee; color: #667085; font-size: 10px; font-weight: 700; }
.roadmap-dates span:first-child { border-left: 0; }
.roadmap-case { min-width: 0; padding: 9px 14px; border: 0; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.roadmap-case:hover { background: #f8faff; }
.roadmap-case strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.roadmap-case span { display: block; margin-top: 4px; overflow: hidden; color: #7b8493; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.roadmap-track { position: relative; min-width: 0; border-left: 1px solid #e2e6ee; background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(12.5% - 1px), #edf0f4 calc(12.5% - 1px), #edf0f4 12.5%); }
.roadmap-today-line { position: absolute; z-index: 1; top: 0; bottom: 0; width: 1px; background: rgba(232,91,70,.6); }
.roadmap-bar { position: absolute; z-index: 2; top: 20px; height: 18px; min-width: 8px; border-radius: 6px; background: #8a72c7; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
.roadmap-bar.is-ai { background: #51b675; }
.roadmap-bar.is-client { background: #5682df; }
.roadmap-bar.is-you { background: #df6469; }
.roadmap-bar.is-not_started { background: #adb5c1; }
.roadmap-unknown { position: absolute; z-index: 3; top: 20px; color: #667085; font-size: 9px; line-height: 18px; white-space: nowrap; }
.roadmap-outside { position: absolute; top: 20px; left: 12px; color: #8b93a2; font-size: 10px; line-height: 18px; }
.roadmap-note, .roadmap-empty { margin: 0; color: #7b8493; font-size: 11px; line-height: 1.5; }
.planning-fields { margin: 4px 0 14px; padding: 14px; border: 1px solid #dce8df; border-radius: 12px; background: #f8fcf9; }
.planning-fields textarea { min-height: 76px; line-height: 1.55; }
.management-import-help { margin: 0 0 12px; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.management-import-input { width: 100%; min-height: 280px; padding: 12px; border: 1px solid var(--border-soft); border-radius: 10px; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.management-import-preview { margin-top: 14px; }
.management-import-errors { margin: 0; padding: 12px 12px 12px 32px; border-radius: 10px; background: #fff0ee; color: #b42318; font-size: 12px; line-height: 1.6; }
.management-import-id { margin: 0 0 8px; color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
.management-import-list { display: flex; flex-direction: column; gap: 7px; }
.management-import-item { padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 9px; display: grid; grid-template-columns: 90px 1fr; gap: 4px 8px; font-size: 12px; }
.management-import-item strong { color: #245ddd; }
.management-import-item.is-skip { opacity: .58; }
.management-import-item small { grid-column: 2; color: var(--text-muted); line-height: 1.55; }
.finance-overview-grid { margin: 12px 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.finance-overview-card { min-width: 0; padding: 12px; border: 1px solid var(--border-soft); border-radius: 10px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.finance-overview-card span { color: var(--text-muted); font-size: 11px; }
.finance-overview-card strong { color: #17204a; font-size: 16px; overflow-wrap: anywhere; }
.finance-overview-card small { color: #8b93a2; font-size: 10px; line-height: 1.45; }
.finance-overview-card.is-gap strong { color: #b54708; }
.finance-overview-card.is-surplus strong { color: #168353; }
.finance-income-mix { margin-bottom: 12px; padding: 12px; border: 1px solid #dce4f5; border-radius: 10px; background: #f8faff; display: grid; grid-template-columns: 1.3fr repeat(3,1fr); align-items: center; gap: 8px; }
.finance-income-mix-title { font-size: 12px; }
.finance-income-mix > div { padding-left: 10px; border-left: 1px solid #dce4f5; display: flex; flex-direction: column; gap: 3px; }
.finance-income-mix span { color: var(--text-muted); font-size: 10px; }
.finance-income-mix > div strong { font-size: 14px; color: #17204a; }
.finance-income-note { grid-column: 1 / -1; margin: 4px 0 0; padding-top: 9px; border-top: 1px solid #dce4f5; color: #667085; font-size: 11px; line-height: 1.55; }
.finance-billing-row { margin-bottom: 12px; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.finance-billing-row > div { padding: 10px 12px; border-radius: 9px; background: #f7f8fa; display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; font-size: 12px; }
.finance-billing-row small { grid-column: 1 / -1; color: #8b93a2; font-size: 10px; }
.invoice-fields { margin: 4px 0 14px; padding: 14px; border: 1px solid #d9e1f2; border-radius: 12px; background: #f8faff; }
.invoice-fields-title { margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.mobile-menu-button, .sidebar-backdrop { display: none; }
.fab { right: 28px; }

@media (max-width: 800px) {
  .app-sidebar { transform: translateX(-105%); transition: transform .2s ease; width: min(84vw, 300px); }
  .sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(5,10,35,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .mobile-menu-button { display: block; position: fixed; top: 13px; left: 12px; z-index: 30; width: 38px; height: 38px; border: 0; border-radius: 9px; background: #0b123f; color: #fff; font-size: 20px; }
  .app-content { margin-left: 0; }
  .app-header { padding: 15px 14px 8px 62px; }
  .app-title { font-size: 20px; }
  .search-bar { padding-top: 10px; }
  #app { padding: 0 14px 90px; }
  .home-dashboard { padding-top: 10px; }
  .home-main-grid { order: 1; grid-template-columns: 1fr; }
  .home-summary { order: 2; grid-template-columns: 1fr; gap: 8px; }
  .home-metric { min-height: 76px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .home-metric-label { margin: 0; }
  .home-metric-value { font-size: 21px; }
  .home-metric-progress { grid-column: 1 / -1; margin-top: 2px; text-align: right; }
  .home-alerts { order: 2; }
  .today-item { grid-template-columns: 20px 68px 1fr auto; gap: 7px; }
  .today-time { font-size: 10px; }
  .rooms-heading { margin-top: 12px; }
  .rooms { gap: 8px; }
  .room-header { min-height: 48px; }
  .secretary-dashboard { grid-template-columns: 1fr; }
  .secretary-summary { align-items: stretch; flex-direction: column; }
  .secretary-summary > div { flex: none; width: 100%; }
  .secretary-summary span { overflow-wrap: anywhere; }
  .secretary-copy, .secretary-import { width: 100%; }
  .secretary-strategy-grid { grid-template-columns: 1fr; }
  .secretary-tabs { width: 100%; }
  .secretary-tab { flex: 1 1 50%; }
  .roadmap-summary { display: flex; overflow-x: auto; }
  .roadmap-stat { flex: 0 0 112px; }
  .roadmap-row { grid-template-columns: 190px minmax(640px,1fr); }
  .finance-overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .finance-income-mix { grid-template-columns: 1fr 1fr; }
  .finance-income-mix-title { grid-column: 1 / -1; }
  .finance-billing-row { grid-template-columns: 1fr; }
  .fab { right: 18px; bottom: 18px; }
}
