/* Coweave Estate - Owner Portal Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --cw-primary: #0057B3;
  --cw-primary-light: #E8F0FE;
  --cw-primary-hover: #004494;
  --cw-secondary: #00A86B;
  --cw-secondary-light: #E6F7F0;
  --cw-accent: #FF6B35;
  --cw-accent-light: #FFF0EB;
  --cw-bg: #F8FAFC;
  --cw-surface: #FFFFFF;
  --cw-text: #1E293B;
  --cw-text-secondary: #475569;
  --cw-text-muted: #94A3B8;
  --cw-border: #E2E8F0;
  --cw-border-light: #F1F5F9;
  --cw-danger: #DC2626;
  --cw-warning: #F59E0B;
  --cw-sidebar-w: 256px;
  --cw-header-h: 64px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--cw-bg);
  color: var(--cw-text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#root { width: 100vw; height: 100vh; overflow: hidden; }

/* Layout */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.sidebar {
  width: var(--cw-sidebar-w);
  min-width: var(--cw-sidebar-w);
  height: 100vh;
  background: var(--cw-surface);
  border-right: 1px solid var(--cw-border);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, width 0.25s ease, min-width 0.25s ease;
  z-index: 40;
  overflow-y: auto;
}

.sidebar.collapsed {
  width: 72px;
  min-width: 72px;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

.header-bar {
  height: var(--cw-header-h);
  min-height: var(--cw-header-h);
  background: var(--cw-surface);
  border-bottom: 1px solid var(--cw-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--cw-bg);
}

/* Sidebar nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 2px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--cw-text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: var(--cw-primary-light);
  color: var(--cw-primary);
}

.nav-item.active {
  background: var(--cw-primary);
  color: #FFFFFF;
}

.nav-item.active:hover {
  background: var(--cw-primary-hover);
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
  margin: 2px 8px;
}

.sidebar.collapsed .nav-label { display: none; }

/* Cards */
.cw-card {
  background: var(--cw-surface);
  border: 1px solid var(--cw-border);
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow 0.2s ease;
}

.cw-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--cw-surface);
  border: 1px solid var(--cw-border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-top: 20px;
}

/* Chat UI */
.chat-layout {
  display: flex;
  height: calc(100vh - var(--cw-header-h) - 48px);
  background: var(--cw-surface);
  border: 1px solid var(--cw-border);
  border-radius: 12px;
  overflow: hidden;
}

.chat-sidebar {
  width: 300px;
  min-width: 300px;
  border-right: 1px solid var(--cw-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-input-bar {
  padding: 16px 20px;
  border-top: 1px solid var(--cw-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cw-surface);
}

.chat-room-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--cw-border-light);
  transition: background 0.15s ease;
}

.chat-room-item:hover { background: var(--cw-bg); }
.chat-room-item.active { background: var(--cw-primary-light); }

.message-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.message-bubble.sent {
  background: var(--cw-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message-bubble.received {
  background: var(--cw-bg);
  color: var(--cw-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

/* Badges */
.cw-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  padding: 2px 8px;
  line-height: 1;
}

/* Buttons */
.cw-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cw-btn-primary {
  background: var(--cw-primary);
  color: #fff;
}
.cw-btn-primary:hover { background: var(--cw-primary-hover); }

.cw-btn-ghost {
  background: transparent;
  color: var(--cw-text-secondary);
}
.cw-btn-ghost:hover { background: var(--cw-bg); }

/* Search input */
.cw-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cw-bg);
  border: 1px solid var(--cw-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--cw-text);
  transition: border-color 0.15s ease;
}

.cw-search:focus-within { border-color: var(--cw-primary); }

.cw-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--cw-text);
  width: 100%;
  font-family: inherit;
}

.cw-search input::placeholder { color: var(--cw-text-muted); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cw-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cw-text-muted); }

/* Activity feed */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--cw-border-light);
}

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

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

/* Notification badge */
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--cw-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Quick action buttons */
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--cw-surface);
  border: 1px solid var(--cw-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13px;
  color: var(--cw-text-secondary);
  font-weight: 500;
}

.quick-action:hover {
  border-color: var(--cw-primary);
  color: var(--cw-primary);
  box-shadow: 0 2px 8px rgba(0,87,179,0.08);
}

/* Placeholder pages */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--cw-text-muted);
  gap: 12px;
}

.placeholder-page h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--cw-text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .chat-sidebar { width: 100%; min-width: 100%; }
  .chat-layout { flex-direction: column; }
}
