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

:root {
  --bg0: #121214;
  --bg1: #1a1b1e;
  --bg2: #232428;
  --stroke: rgba(255,255,255,0.06);
  --ink: #e9ecef;
  --muted: #909296;
  --shadow: 0 24px 48px rgba(0,0,0,0.5);
  --shadow2: 0 8px 16px rgba(0,0,0,0.3);
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --danger: #ef4444;
  --sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --sidebar-w: 240px;
  --radius: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

[data-theme="light"] {
  --bg0: #f5f5f7;
  --bg1: #ffffff;
  --bg2: #f0f0f2;
  --stroke: rgba(0,0,0,0.08);
  --ink: #1a1a1a;
  --muted: #6b7280;
  --shadow: 0 24px 48px rgba(0,0,0,0.12);
  --shadow2: 0 8px 16px rgba(0,0,0,0.08);
}

[data-theme="light"] .stat-card,
[data-theme="light"] .room-card,
[data-theme="light"] .empty-state {
  background: rgba(255,255,255,0.82);
}
[data-theme="light"] .stat-card:hover,
[data-theme="light"] .room-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  border-color: rgba(0,0,0,0.12);
}

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

body {
  font-family: var(--sans);
  background: var(--bg0);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ========== AUTH PAGES ========== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg0);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg1);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-img {
  display: block;
  height: 48px;
  width: auto;
  margin: 0 auto 8px;
}

.auth-logo p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.auth-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg0);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--accent);
}

.btn-primary {
  width: 100%;
  padding: 11px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

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

.auth-success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
}

/* ========== WELCOME PAGE (Stripe LTD) ========== */
.welcome-credentials {
  background: var(--bg0);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.welcome-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.welcome-field + .welcome-field {
  border-top: 1px solid var(--stroke);
}

.welcome-field-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.welcome-field-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--ink);
  user-select: all;
}

.welcome-copy-btn {
  width: 100%;
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.welcome-copy-btn:hover {
  background: var(--accent-hover);
}

.welcome-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-oauth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg0);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-oauth:hover {
  border-color: var(--accent);
  background: var(--bg2);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--stroke);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
}

.auth-footer a {
  font-weight: 500;
}

/* ========== APP LAYOUT ========== */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  background: var(--bg1);
  border-right: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  padding: 24px 20px 20px;
}

.sidebar-logo-img {
  display: block;
  height: 28px;
  width: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

/* ---- Sidebar Sections ---- */
.sidebar-section {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  min-height: 0;
  flex: 1;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.sidebar-section-add {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.sidebar-section-add:hover {
  color: var(--accent);
  background: var(--bg2);
}

.sidebar-room-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  max-height: calc(100vh - 340px);
  scrollbar-width: thin;
  scrollbar-color: var(--bg2) transparent;
}

.sidebar-room-list::-webkit-scrollbar {
  width: 4px;
}

.sidebar-room-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-room-list::-webkit-scrollbar-thumb {
  background: var(--bg2);
  border-radius: 2px;
}

.nav-link-room {
  padding: 7px 12px;
  font-size: 13px;
}

.nav-link-room-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sidebar-room-empty {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.nav-link-bottom {
  margin-top: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-link:hover {
  background: var(--bg2);
  color: var(--ink);
}

.nav-link.active {
  background: rgba(99,102,241,0.1);
  color: var(--accent);
}

.nav-link i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-bottom {
  padding: 16px 20px;
  border-top: 1px solid var(--stroke);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.btn-logout:hover {
  color: var(--danger);
}

/* ---- Main ---- */
.app-main {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--stroke);
  background: var(--bg1);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 4px;
}

.app-header h2 {
  font-size: 18px;
  font-weight: 600;
}

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

.btn-icon {
  background: none;
  border: 1px solid var(--stroke);
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-icon:hover {
  background: var(--bg2);
  color: var(--ink);
}

.app-content {
  flex: 1;
  padding: 32px;
}

/* ========== STAT CARDS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: rgba(26, 27, 30, 0.72);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow2);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.stat-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  border-color: rgba(255,255,255,0.1);
}

.stat-card-info h3 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card-info p {
  font-size: 13px;
  color: var(--muted);
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99,102,241,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* ========== CONTENT PANEL ========== */
.content-panel {
  background: var(--bg1);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
}

.content-panel-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--stroke);
}

.content-panel-tabs {
  display: flex;
  gap: 0;
}

.content-panel-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.content-panel-tab:hover {
  color: var(--ink);
}

.content-panel-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.content-panel-badge {
  background: var(--bg2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.content-panel-tab.active .content-panel-badge {
  background: rgba(99,102,241,0.15);
  color: var(--accent);
}

.content-panel-body {
  min-height: 80px;
  max-height: 500px;
  overflow-y: auto;
  resize: vertical;
  padding: 16px;
}

.content-panel-view {
  display: none;
}

.content-panel-view.active {
  display: block;
}

.content-panel-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* Task list */
.inline-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.inline-task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg2);
  border-radius: 8px;
  border-left: 3px solid transparent;
  font-size: 13px;
  transition: background 0.15s;
}

.inline-task-item[data-status="not-started"] { border-left-color: #9ca3af; background: rgba(156,163,175,0.08); }
.inline-task-item[data-status="in-progress"] { border-left-color: #60a5fa; background: rgba(96,165,250,0.10); }
.inline-task-item[data-status="completed"]   { border-left-color: #6366f1; background: rgba(99,102,241,0.10); }
.inline-task-item[data-status="unfinished"]  { border-left-color: #fb923c; background: rgba(251,146,60,0.10); }
.inline-task-item[data-status="not-started"]:hover { background: rgba(156,163,175,0.14); }
.inline-task-item[data-status="in-progress"]:hover { background: rgba(96,165,250,0.16); }
.inline-task-item[data-status="completed"]:hover   { background: rgba(99,102,241,0.16); }
.inline-task-item[data-status="unfinished"]:hover   { background: rgba(251,146,60,0.16); }

[data-theme="light"] .inline-task-item[data-status="not-started"] { background: rgba(156,163,175,0.10); }
[data-theme="light"] .inline-task-item[data-status="in-progress"] { background: rgba(96,165,250,0.10); }
[data-theme="light"] .inline-task-item[data-status="completed"]   { background: rgba(99,102,241,0.10); }
[data-theme="light"] .inline-task-item[data-status="unfinished"]  { background: rgba(251,146,60,0.10); }
[data-theme="light"] .inline-task-item[data-status="not-started"]:hover { background: rgba(156,163,175,0.16); }
[data-theme="light"] .inline-task-item[data-status="in-progress"]:hover { background: rgba(96,165,250,0.16); }
[data-theme="light"] .inline-task-item[data-status="completed"]:hover   { background: rgba(99,102,241,0.16); }
[data-theme="light"] .inline-task-item[data-status="unfinished"]:hover   { background: rgba(251,146,60,0.16); }

.inline-task-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.inline-task-not-started { background: #9ca3af; }
.inline-task-in-progress { background: #60a5fa; }
.inline-task-completed   { background: #6366f1; }
.inline-task-unfinished  { background: #fb923c; }

.inline-task-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inline-task-title {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-task-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.inline-task-date.overdue {
  color: #f87171;
  font-weight: 600;
}

/* Message list */
.inline-message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inline-message-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.inline-message-sender {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.inline-message-text {
  color: var(--ink);
  flex: 1;
  word-break: break-word;
}

.inline-message-time {
  color: var(--muted);
  font-size: 11px;
  flex-shrink: 0;
  white-space: nowrap;
}

.inline-transcription-lang {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(99,102,241,0.12);
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ========== SECTION HEADERS ========== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn-secondary.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-secondary i {
  width: 16px;
  height: 16px;
}

.btn-secondary-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--stroke);
}

.btn-secondary-outline:hover {
  background: var(--bg2);
  color: var(--accent-hover);
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========== PROJECT CARDS ========== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg1);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s;
}

.project-card:hover {
  border-color: var(--accent);
}

.project-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(99,102,241,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.project-card-title {
  font-size: 15px;
  font-weight: 600;
}

.project-card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-card-actions {
  margin-top: auto;
}

.btn-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg2);
  color: var(--ink);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-open:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  background: rgba(26, 27, 30, 0.72);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow2);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  max-width: 320px;
  margin: 0 auto;
}

/* ========== SETTINGS PAGE ========== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.settings-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-card {
  background: var(--bg1);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 24px;
}

.settings-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

.settings-avatar-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--stroke);
}

.settings-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  flex-shrink: 0;
}

.settings-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.settings-avatar-info {
  min-width: 0;
}

.settings-avatar-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-avatar-email {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-note {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.settings-card .btn-primary {
  width: auto;
  padding: 10px 24px;
}

/* Avatar dropzone */
.avatar-dropzone {
  border: 2px dashed var(--stroke);
  border-radius: 8px;
  padding: 28px 20px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.avatar-dropzone:hover {
  border-color: var(--muted);
}

.avatar-dropzone.dragover {
  border-color: var(--accent);
  background: rgba(99,102,241,0.06);
}

.avatar-dropzone.uploading {
  opacity: 0.5;
  pointer-events: none;
}

.avatar-dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.avatar-dropzone-content > i {
  color: var(--muted);
  margin-bottom: 4px;
}

.avatar-dropzone-link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.avatar-dropzone-link:hover {
  color: var(--accent-hover);
}

.avatar-dropzone-hint {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.7;
}

.avatar-dropzone-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

/* Plan card */
.plan-card {
  background: var(--bg0);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 20px;
}

.plan-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.plan-name {
  font-size: 18px;
  font-weight: 700;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(99,102,241,0.15);
  color: var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.plan-features li i {
  color: var(--accent);
}

/* Admin plan */
.plan-card-admin {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.plan-name-admin {
  color: #ef4444;
}

.plan-badge-admin {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.plan-card-admin .plan-features li i {
  color: #ef4444;
}

/* Trial plan */
.plan-card-trial {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
}

.plan-name-trial {
  color: #22c55e;
}

.plan-badge-trial {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.plan-card-trial .plan-features li i {
  color: #22c55e;
}

/* Signup trial subtitle */
.auth-trial-subtitle {
  font-size: 13px;
  color: #22c55e;
  margin-top: 6px;
  font-weight: 500;
}

/* Provider badges */
.provider-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.provider-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg0);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.provider-badge-label {
  flex: 1;
  min-width: 0;
}
.provider-badge-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  flex-shrink: 0;
}
.provider-badge-status.connected {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}
.provider-badge-status.not-connected {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}
.provider-badge-unlinked {
  border-style: dashed;
  opacity: 0.8;
}
.provider-link-btn {
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  flex-shrink: 0;
  transition: background 0.15s;
}
.provider-link-btn:hover {
  background: var(--accent-hover, #818cf8);
}
.provider-unlink-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--stroke);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  padding: 0;
}
.provider-unlink-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

/* ========== ROOM CARDS ========== */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.room-card {
  background: rgba(26, 27, 30, 0.72);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow2);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.room-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}

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

.room-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(99,102,241,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.room-card-icon.owner {
  background: rgba(234,179,8,0.15);
  color: #eab308;
}

.room-card-title {
  font-size: 15px;
  font-weight: 600;
}

.room-card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.room-card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.btn-open-detail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-open-detail:hover {
  background: var(--bg2);
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* ========== ROOM DETAIL ========== */
.room-detail-header {
  margin-bottom: 28px;
}

.room-detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.room-detail-title {
  font-size: 22px;
  font-weight: 700;
}

.room-active-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.room-detail-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.room-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 24px;
}

/* ========== OBJECTIVE BANNER ========== */
.detail-objective-banner {
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.18);
  border-left: 3px solid #22c55e;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.detail-objective-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4ade80;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.detail-objective-date {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

.detail-objective-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
  white-space: pre-line;
}

[data-theme="light"] .detail-objective-banner {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.2);
}

[data-theme="light"] .detail-objective-header {
  color: #16a34a;
}

/* ========== COLLAPSIBLE SECTIONS ========== */
.collapsible-section {
  margin-bottom: 24px;
}

.collapsible-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  border-radius: 6px;
  transition: color 0.15s;
}

.collapsible-toggle:hover {
  color: var(--accent);
}

.collapsible-toggle svg {
  color: var(--muted);
  transition: transform 0.25s ease, color 0.15s;
  flex-shrink: 0;
}

.collapsible-toggle:hover svg {
  color: var(--ink);
}

.collapsible-section:not(.open) .collapsible-toggle svg {
  transform: rotate(180deg);
}

.collapsible-body {
  overflow: hidden;
  max-height: 2000px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.2s ease;
}

.collapsible-section:not(.open) .collapsible-body {
  max-height: 0;
  opacity: 0;
}

.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ========== TASK STATUS ========== */
.task-status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.task-status-card {
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.task-status-count {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.task-status-label {
  font-size: 13px;
  opacity: 0.8;
}

.task-status-not-started {
  background: rgba(156,163,175,0.12);
  color: #9ca3af;
  border: 1px solid rgba(156,163,175,0.2);
}

.task-status-in-progress {
  background: rgba(96,165,250,0.12);
  color: #60a5fa;
  border: 1px solid rgba(96,165,250,0.2);
}

.task-status-completed {
  background: rgba(99,102,241,0.12);
  color: #6366f1;
  border: 1px solid rgba(99,102,241,0.2);
}

.task-status-unfinished {
  background: rgba(251,146,60,0.12);
  color: #fb923c;
  border: 1px solid rgba(251,146,60,0.2);
}

/* ========== ACCESS REQUEST PAGE ========== */
.access-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg0);
  padding: 20px;
}

.access-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg1);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 48px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.access-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(99,102,241,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin: 0 auto 20px;
}

.access-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.access-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}

.access-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.access-status.pending {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  color: #f59e0b;
}

.access-status.rejected {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #f87171;
  margin-bottom: 20px;
}

.access-card .btn-primary {
  margin-bottom: 20px;
}

.access-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.access-back-link:hover {
  color: var(--accent);
}

.guest-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.guest-separator::before,
.guest-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--stroke);
}

.guest-login-link {
  display: block;
  width: 100%;
  padding: 11px 20px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 20px;
}

.guest-login-link:hover {
  border-color: var(--accent);
  background: rgba(99,102,241,0.05);
  color: var(--ink);
}

/* ========== ROOM INVITE SECTION ========== */
.room-invite-section {
  margin-bottom: 28px;
}

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

.invite-link-input {
  flex: 1;
  padding: 9px 14px;
  background: var(--bg0);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.invite-link-input:focus {
  border-color: var(--accent);
}

/* ========== ACCESS REQUESTS LIST ========== */
.access-requests-list {
  margin-bottom: 28px;
}

.access-request-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg1);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  margin-bottom: 8px;
}

.access-request-avatar,
.access-request-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.access-request-avatar-placeholder {
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.access-request-info {
  flex: 1;
  min-width: 0;
}

.access-request-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.access-request-email {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.access-request-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-approve {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(34,197,94,0.12);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-approve:hover {
  background: rgba(34,197,94,0.2);
}

.btn-reject {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reject:hover {
  background: rgba(239,68,68,0.2);
}

/* ========== MEMBERS LIST ========== */
.members-list {
  margin-bottom: 28px;
}

.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg1);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  margin-bottom: 6px;
}

.member-avatar,
.member-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.member-avatar-placeholder {
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-email {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-role {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.member-role.owner {
  background: rgba(234,179,8,0.15);
  color: #eab308;
}

.member-role.member,
.member-role.editor {
  background: rgba(99,102,241,0.1);
  color: var(--accent);
}

.member-role.collaborator {
  background: rgba(34,197,94,0.12);
  color: #22c55e;
}

.member-role.visitor {
  background: rgba(148,163,184,0.12);
  color: #94a3b8;
}

/* ========== MEMBER ACTIONS (role select + kick) ========== */
.member-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.member-role-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg2);
  color: var(--ink);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 4px 28px 4px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23909296' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

.member-role-select:hover,
.member-role-select:focus {
  border-color: var(--accent);
  outline: none;
}

.member-kick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.member-kick-btn:hover {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}

/* ========== DELETE ROOM BUTTON ========== */
.btn-delete-room {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-delete-room:hover {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}

/* ========== DANGER ZONE ========== */
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  background: var(--bg1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius);
  margin-bottom: 28px;
}

.danger-zone-info strong {
  font-size: 14px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.danger-zone-info p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

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

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: var(--bg1);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  width: 90%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--stroke);
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.modal-close:hover { color: var(--ink); }
.modal-body {
  padding: 24px;
}

/* ========== SIDEBAR OVERLAY ========== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .app-main {
    grid-column: 1;
  }

  .menu-toggle {
    display: flex;
  }

  .app-content {
    padding: 20px 16px;
  }

  .app-header {
    padding: 12px 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .task-status-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Language selector ---- */
.settings-desc {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.locale-selector {
  display: flex;
  gap: 8px;
}

.locale-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.locale-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.locale-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.locale-btn.active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50% { opacity: .7; box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}
