:root {
  --primary: #1eadac;
  --primary-hover: #179392;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --border-radius: 8px;
  --header-height: 56px;
  --plugin-nav-width: 72px;
  --skills-panel-width: 260px;

  /* Plugin colors */
  --plugin-appraisal: #7c3aed;
  --plugin-listing: #2563eb;
  --plugin-sales: #059669;
  --plugin-offer: #d97706;
  --plugin-contract: #dc2626;
  --plugin-settlement: #0891b2;

  /* Status */
  --status-pending: #9ca3af;
  --status-in_progress: #d97706;
  --status-done: #059669;
  --status-skipped: #6b7280;

  /* Priority */
  --priority-focus: #dc2626;
  --priority-next: #d97706;
  --priority-stay: #9ca3af;

  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-large: 0 4px 12px rgba(0, 0, 0, 0.15);
  --transition: 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP",
    "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
}

/* Login */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: var(--bg);
}

.login-card {
  text-align: center;
  padding: 48px 40px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-large);
  max-width: 400px;
  width: 100%;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

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

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

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

.btn-google {
  width: 100%;
  justify-content: center;
  padding: 14px 24px;
  font-size: 15px;
}

.google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
}

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

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  font-size: 16px;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* App Layout */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.property-selector {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  min-width: 300px;
  max-width: 500px;
  cursor: pointer;
}

.property-selector:focus {
  outline: none;
  border-color: var(--primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.last-updated {
  font-size: 12px;
  color: var(--text-secondary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.user-name {
  font-size: 13px;
  color: var(--text);
}

/* Workspace (3-column) */
.workspace {
  display: flex;
  flex: 1;
  height: calc(100dvh - var(--header-height));
  overflow: hidden;
}

/* Column 1: Plugin Nav */
.plugin-nav {
  width: var(--plugin-nav-width);
  min-width: var(--plugin-nav-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  overflow-y: auto;
}

.plugin-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 10px;
  text-align: center;
  transition: var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}

.plugin-item:hover {
  background: var(--bg);
  color: var(--text);
}

.plugin-item.active {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
}

.plugin-item .plugin-icon {
  font-size: 22px;
  line-height: 1;
}

.plugin-item .plugin-label {
  font-size: 10px;
  line-height: 1.2;
  max-width: 64px;
  word-break: keep-all;
}

.plugin-item .plugin-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--status-done);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* Column 2: Skills Panel */
.skills-panel {
  width: var(--skills-panel-width);
  min-width: var(--skills-panel-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.skills-panel-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.skills-panel-header .panel-icon {
  font-size: 20px;
}

.skills-panel-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.skill-group {
  border-bottom: 1px solid var(--border);
}

.skill-group.active {
  background: #f0fafa;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 4px;
  cursor: pointer;
  transition: var(--transition);
}

.skill-item:hover {
  background: var(--bg);
}

/* Action checklist */
.action-list {
  padding: 0 16px 10px 38px;
}

.action-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  cursor: pointer;
  font-size: 12px;
}

.action-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.action-label {
  color: var(--text);
  line-height: 1.3;
}

.action-label.done {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.action-check.disabled {
  opacity: 0.4;
  cursor: default;
}

.action-link {
  flex-shrink: 0;
  font-size: 13px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.action-link:hover {
  opacity: 1;
}

.skill-progress-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  margin-left: 4px;
}

.skill-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skill-status-dot.pending {
  background: var(--status-pending);
}
.skill-status-dot.in_progress {
  background: var(--status-in_progress);
}
.skill-status-dot.done {
  background: var(--status-done);
}
.skill-status-dot.skipped {
  background: var(--status-skipped);
}

.skill-item-content {
  flex: 1;
  min-width: 0;
}

.skill-item-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-item-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Column 3: Main Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}

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

.dashboard-header h2 {
  font-size: 20px;
  font-weight: 700;
}

/* Dashboard filters */
.dashboard-filters {
  margin-bottom: 20px;
}

.search-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 14px;
  background: var(--surface);
  margin-bottom: 12px;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.phase-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.phase-chip:hover {
  border-color: var(--chip-color, var(--primary));
}

.phase-chip.active {
  background: var(--chip-color, var(--primary));
  color: white;
  border-color: var(--chip-color, var(--primary));
}

.chip-count {
  font-weight: 600;
  font-size: 11px;
  opacity: 0.8;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.property-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.property-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-light);
}

.property-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.property-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.property-card-address {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.property-card-phase {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

.property-card-progress {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

.progress-segment {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-segment-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.property-card-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Property Overview (when no plugin selected) */
/* Card progress bar */
.property-card-progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.property-card-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s;
}

.card-progress-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
}

/* Property overview header */
.property-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.property-overview-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.total-progress-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  white-space: nowrap;
}

.total-progress-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.total-progress-pct {
  font-size: 12px;
  color: var(--text-secondary);
}

.property-overview {
  max-width: 800px;
}

.property-overview h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.property-overview-meta {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
}

.plugin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.plugin-summary-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.plugin-summary-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-light);
}

.plugin-summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.plugin-summary-header .icon {
  font-size: 20px;
}

.plugin-summary-header h4 {
  font-size: 14px;
  font-weight: 600;
}

.plugin-summary-stats {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.plugin-summary-stats .stat-done {
  color: var(--status-done);
  font-weight: 600;
}

.plugin-summary-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.plugin-summary-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Skill Detail */
.skill-detail {
  max-width: 800px;
}

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

.skill-detail-header h2 {
  font-size: 18px;
  font-weight: 700;
}

/* Action detail rows */
.action-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.action-check-lg {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.action-check-lg input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.action-label-lg {
  font-size: 14px;
  color: var(--text);
}

.action-label-lg.done {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.action-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

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

.action-no-link {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.5;
}

/* Drive preview iframe */
.preview-section {
  padding: 16px;
}

.drive-preview {
  width: 100%;
  height: 500px;
  border: none;
  border-radius: 6px;
  background: #f0f0f0;
}

.detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 16px;
}

.detail-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-section textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.detail-section textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.detail-section .info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.detail-section .info-row:last-child {
  border-bottom: none;
}

.detail-section .info-label {
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 100px;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-pending {
  background: #f3f4f6;
  color: #6b7280;
}
.badge-in_progress {
  background: #fef3c7;
  color: #92400e;
}
.badge-done {
  background: #d1fae5;
  color: #065f46;
}
.badge-skipped {
  background: #f3f4f6;
  color: #6b7280;
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

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

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

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  color: var(--text-secondary);
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state p {
  font-size: 14px;
}

/* Documents list */
.doc-list {
  list-style: none;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.doc-item:last-child {
  border-bottom: none;
}

.doc-item a {
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
}

.doc-item a:hover {
  text-decoration: underline;
}

.doc-icon {
  font-size: 16px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
  padding: 16px 0;
}

.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  min-width: 36px;
  text-align: center;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Notion color badges */
.notion-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.property-card-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* AI Chat */
.ai-chat-section {
  margin-top: 24px;
}

.chat-messages {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  display: flex;
}

.chat-msg.user {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble.user {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
  background: #f3f4f6;
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 14px;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

.chat-send-btn {
  padding: 10px 20px;
  white-space: nowrap;
}

.chat-typing::after {
  content: "...";
  animation: typing 1s infinite;
}

@keyframes typing {
  0% {
    content: ".";
  }
  33% {
    content: "..";
  }
  66% {
    content: "...";
  }
}

/* Staff avatar */
.staff-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.staff-avatar-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  vertical-align: middle;
}

.staff-avatar-md {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  vertical-align: middle;
}
