/* =====================================================
   CollabHub — Design System & Styles
   ===================================================== */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #ede9fe;
  --secondary: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --sidebar-w: 240px;
  --topbar-h: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: 0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 99px; }

/* ── Typography ── */
h1, h2, h3, h4 { line-height: 1.3; font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-purple { color: #7c3aed; }
.line-through { text-decoration: line-through; }

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; margin-left: var(--sidebar-w); }
.page-body { flex: 1; padding: 1.5rem 2rem; overflow-y: auto; }
.page-body-full { padding: 1.5rem; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w); position: fixed; top: 0; left: 0; height: 100vh;
  background: #1e1b4b; color: #c7d2fe;
  display: flex; flex-direction: column;
  z-index: 100; transition: width var(--transition);
}
.sidebar-logo {
  display: flex; align-items: center; gap: .6rem;
  padding: 1.1rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.logo-text { font-weight: 700; font-size: 1.05rem; color: #fff; }
.sidebar-toggle { display: none; background: none; border: none; color: #c7d2fe; cursor: pointer; margin-left: auto; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .8rem 0; }
.nav-section { margin-bottom: .4rem; }
.nav-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #6b7db3; padding: .4rem 1.2rem .2rem; display: block; }
.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem 1.2rem; color: #a5b4fc;
  font-size: .88rem; font-weight: 500; border-radius: 0;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(99,102,241,.25); color: #fff; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); border-radius: 0 3px 3px 0; }
.nav-item i { width: 18px; text-align: center; }
.nav-badge { background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700; border-radius: 99px; padding: .1rem .4rem; margin-left: auto; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding: .8rem 1rem; }
.user-info { display: flex; align-items: center; gap: .6rem; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; color: #fff; flex-shrink: 0; position: relative; overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #1e1b4b; position: absolute; bottom: 0; right: 0; }
.status-dot.online { background: var(--success); }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .7rem; color: #6b7db3; text-transform: capitalize; }
.btn-logout { background: none; border: none; color: #6b7db3; cursor: pointer; padding: .3rem; border-radius: var(--radius-sm); transition: color var(--transition); }
.btn-logout:hover { color: var(--danger); }
.logout-form { margin: 0; }

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h); background: var(--bg-card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: .6rem; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-secondary); }
.search-box { position: relative; max-width: 380px; width: 100%; }
.search-box i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .85rem; }
.search-box input { width: 100%; padding: .5rem .8rem .5rem 2.1rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: .88rem; outline: none; transition: border-color var(--transition); font-family: var(--font); }
.search-box input:focus { border-color: var(--primary); background: #fff; }
.search-results { position: absolute; top: calc(100% + .4rem); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); display: none; z-index: 200; max-height: 300px; overflow-y: auto; }
.search-results.open { display: block; }
.search-result-item { padding: .55rem .9rem; font-size: .85rem; cursor: pointer; display: flex; align-items: center; gap: .6rem; }
.search-result-item:hover { background: var(--bg-hover); }
.search-result-type { font-size: .7rem; text-transform: uppercase; color: var(--text-muted); background: var(--bg); padding: .1rem .4rem; border-radius: 4px; }
.icon-btn { background: none; border: none; width: 36px; height: 36px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); font-size: .95rem; display: flex; align-items: center; justify-content: center; position: relative; transition: background var(--transition); }
.icon-btn:hover { background: var(--bg-hover); }
.badge { position: absolute; top: 3px; right: 3px; background: var(--danger); color: #fff; font-size: .6rem; font-weight: 700; border-radius: 99px; padding: .1rem .35rem; min-width: 16px; text-align: center; }

/* Notifications dropdown */
.notif-wrapper { position: relative; }
.notif-dropdown { position: absolute; right: 0; top: calc(100% + .5rem); width: 340px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: none; z-index: 300; }
.notif-dropdown.open { display: block; }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .9rem; }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: .84rem; }
.notif-item.unread { background: #f0f4ff; }
.notif-title { font-weight: 500; margin-bottom: .2rem; }
.notif-time { color: var(--text-muted); font-size: .75rem; }
.notif-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: .88rem; }
.link-btn { background: none; border: none; color: var(--primary); font-size: .82rem; cursor: pointer; font-family: var(--font); }
.link-btn:hover { text-decoration: underline; }

/* Quick create */
.quick-create-wrapper { position: relative; }
.quick-menu { position: absolute; right: 0; top: calc(100% + .4rem); width: 220px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); display: none; z-index: 300; padding: .4rem 0; }
.quick-menu.open { display: block; }
.quick-item { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; font-size: .87rem; color: var(--text); cursor: pointer; transition: background var(--transition); }
.quick-item:hover { background: var(--bg-hover); text-decoration: none; }
.quick-item i { width: 16px; color: var(--text-muted); }

/* ── Flash messages ── */
.flash { position: fixed; top: 1rem; right: 1rem; z-index: 999; padding: .8rem 1.2rem; border-radius: var(--radius); display: flex; align-items: center; gap: .6rem; font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-md); max-width: 380px; animation: slideIn .25s ease; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-close { background: none; border: none; cursor: pointer; color: inherit; margin-left: auto; padding: .1rem; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 500; cursor: pointer; border: none; font-family: var(--font); transition: all var(--transition); white-space: nowrap; text-decoration: none !important; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: .7rem 1.4rem; font-size: .95rem; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; }
.btn-xs { padding: .2rem .5rem; font-size: .75rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { background: none; border: none; cursor: pointer; padding: .3rem .5rem; border-radius: var(--radius-sm); font-size: .9rem; color: var(--text-muted); transition: color var(--transition); }
.btn-icon:hover { color: var(--text); }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .84rem; font-weight: 500; margin-bottom: .35rem; color: var(--text-secondary); }
.form-control { width: 100%; padding: .55rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .88rem; font-family: var(--font); color: var(--text); background: #fff; outline: none; transition: border-color var(--transition); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.form-control-sm { padding: .35rem .6rem; font-size: .82rem; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .85rem; }
.input-icon .form-control { padding-left: 2.2rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

/* ── Cards ── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }

/* ── Page header ── */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.page-title i { color: var(--primary); margin-right: .3rem; }
.page-subtitle { color: var(--text-muted); font-size: .88rem; margin-top: .2rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow); }
.stat-icon { width: 46px; height: 46px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Dashboard grid ── */
.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.dash-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.dash-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.dash-card-header h3 { font-size: .95rem; font-weight: 600; }
.dash-card-header h3 i { color: var(--primary); margin-right: .3rem; }

/* ── Tasks ── */
.task-list { display: flex; flex-direction: column; gap: .6rem; }
.task-item { display: flex; align-items: center; gap: .7rem; padding: .6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); transition: background var(--transition); }
.task-item:hover { background: var(--bg-hover); }
.task-status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.task-status-dot.status-todo { background: var(--text-muted); }
.task-status-dot.status-in_progress { background: var(--warning); }
.task-status-dot.status-review { background: #8b5cf6; }
.task-status-dot.status-done { background: var(--success); }
.task-details { flex: 1; min-width: 0; }
.task-title { font-size: .88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { display: flex; gap: .4rem; margin-top: .2rem; align-items: center; flex-wrap: wrap; }
.task-due { font-size: .75rem; color: var(--text-muted); }
.task-due.overdue { color: var(--danger); font-weight: 600; }
.tag { display: inline-flex; padding: .15rem .5rem; border-radius: 4px; font-size: .72rem; font-weight: 500; }
.tag-sm { font-size: .68rem; padding: .1rem .4rem; }

/* Priority badges */
.priority-badge { font-size: .7rem; font-weight: 600; padding: .2rem .5rem; border-radius: 4px; text-transform: uppercase; }
.priority-badge.priority-urgent { background: #fee2e2; color: #dc2626; }
.priority-badge.priority-high   { background: #ffedd5; color: #ea580c; }
.priority-badge.priority-medium { background: #fef9c3; color: #ca8a04; }
.priority-badge.priority-low    { background: #dcfce7; color: #16a34a; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.priority-dot.priority-urgent { background: #dc2626; }
.priority-dot.priority-high   { background: #ea580c; }
.priority-dot.priority-medium { background: #ca8a04; }
.priority-dot.priority-low    { background: #16a34a; }

/* ── Events ── */
.event-list { display: flex; flex-direction: column; gap: .6rem; }
.event-item { display: flex; align-items: center; gap: .8rem; padding: .6rem; border-radius: var(--radius-sm); border-left: 3px solid var(--primary); background: var(--bg); }
.event-item.source-microsoft { border-color: #0078d4; }
.event-item.source-google    { border-color: #4285f4; }
.event-item.source-zoom      { border-color: #2d8cff; }
.event-date { text-align: center; min-width: 36px; }
.event-day { font-size: 1.2rem; font-weight: 700; line-height: 1; }
.event-month { font-size: .68rem; text-transform: uppercase; color: var(--text-muted); }
.event-details { flex: 1; min-width: 0; }
.event-title { font-size: .88rem; font-weight: 500; }
.event-time { font-size: .76rem; color: var(--text-muted); margin-top: .1rem; }
.event-join-btn { display: inline-block; background: var(--primary); color: #fff !important; padding: .1rem .5rem; border-radius: 4px; font-size: .7rem; margin-left: .4rem; }
.event-source-badge { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; background: var(--bg-hover); }
.event-source-badge.source-microsoft { background: #e8f0fe; color: #0078d4; }
.event-source-badge.source-google    { background: #e8f4fd; color: #4285f4; }
.event-source-badge.source-zoom      { background: #e8f2ff; color: #2d8cff; }

/* ── Integration pills ── */
.integration-pills { display: flex; flex-direction: column; gap: .5rem; }
.int-pill { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); font-size: .84rem; }
.int-pill.connected { border-color: #bbf7d0; background: #f0fdf4; }
.int-pill.disconnected { opacity: .75; }
.connected-check { color: var(--success); margin-left: auto; }
.connect-link { margin-left: auto; font-size: .78rem; color: var(--primary); }

/* ── Activity ── */
.activity-list { display: flex; flex-direction: column; gap: .5rem; }
.activity-item { display: flex; align-items: flex-start; gap: .6rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-item.unread .activity-title { font-weight: 600; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: .4rem; flex-shrink: 0; }
.activity-title { font-size: .84rem; }
.activity-time { font-size: .75rem; color: var(--text-muted); }

/* ── Data table ── */
.tasks-table-wrap, .logs-table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--bg); padding: .7rem 1rem; text-align: left; font-size: .78rem; font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .04em; }
.data-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: .86rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }
.task-row.task-done td { opacity: .55; }
.status-select { padding: .2rem .5rem; border: 1px solid var(--border); border-radius: 4px; font-size: .78rem; cursor: pointer; background: var(--bg); font-family: var(--font); }
.task-title-cell { display: flex; align-items: center; gap: .5rem; }
.source-tag { display: inline-block; padding: .12rem .45rem; border-radius: 4px; font-size: .7rem; font-weight: 600; }
.source-tag.asana { background: #fce7f3; color: #db2777; }
.source-tag.microsoft { background: #dbeafe; color: #1d4ed8; }
.source-tag.google { background: #dcfce7; color: #15803d; }
.source-tag.zoom { background: #dbeafe; color: #1e40af; }
.assignee-cell { display: flex; align-items: center; gap: .5rem; }
.avatar-sm { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; }

/* ── Filter bar ── */
.filter-bar { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.filter-select { max-width: 180px; }

/* ── Kanban ── */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; height: calc(100vh - 180px); }
.kanban-column { background: var(--bg-hover); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.kanban-col-header { padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.col-title { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 600; }
.col-count { background: var(--border); color: var(--text-secondary); padding: .1rem .45rem; border-radius: 99px; font-size: .74rem; font-weight: 700; }
.kanban-cards { flex: 1; overflow-y: auto; padding: .6rem; display: flex; flex-direction: column; gap: .5rem; }
.kanban-cards.drag-over { background: rgba(99,102,241,.07); border-radius: var(--radius-sm); }
.kanban-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem; cursor: grab; box-shadow: var(--shadow); transition: box-shadow var(--transition); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .5; box-shadow: var(--shadow-lg); }
.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card-header { display: flex; align-items: center; gap: .4rem; margin-bottom: .4rem; }
.kanban-card-title { font-size: .86rem; font-weight: 500; line-height: 1.4; }
.kanban-card-desc { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; line-height: 1.4; }
.kanban-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; }
.kanban-due { font-size: .74rem; color: var(--text-muted); }
.kanban-due.overdue { color: var(--danger); }
.kanban-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; }
.kanban-add-btn { margin: .4rem .6rem .6rem; background: none; border: 1px dashed var(--border-dark); border-radius: var(--radius-sm); padding: .4rem; color: var(--text-muted); font-size: .82rem; cursor: pointer; text-align: left; transition: all var(--transition); font-family: var(--font); }
.kanban-add-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ── Calendar ── */
.calendar-legend { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.calendar-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }

/* ── Files ── */
.upload-zone { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.2rem; box-shadow: var(--shadow); }
.drop-area { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px dashed var(--border-dark); border-radius: var(--radius); padding: 2rem; cursor: pointer; gap: .5rem; transition: border-color var(--transition); }
.drop-area:hover { border-color: var(--primary); }
.drop-area i { color: var(--primary); }
.upload-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .8rem; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.file-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .6rem; box-shadow: var(--shadow); transition: box-shadow var(--transition); }
.file-card:hover { box-shadow: var(--shadow-md); }
.file-icon { position: relative; display: flex; justify-content: center; }
.file-source { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .65rem; }
.file-name { font-size: .84rem; font-weight: 500; word-break: break-all; }
.file-meta { display: flex; gap: .4rem; font-size: .75rem; color: var(--text-muted); flex-wrap: wrap; }
.file-uploader { font-size: .75rem; color: var(--text-muted); }
.file-actions { display: flex; justify-content: flex-end; }

/* ── Chat ── */
.chat-layout { display: flex; flex: 1; overflow: hidden; }
.chat-sidebar { width: 220px; background: var(--bg-card); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.chat-sidebar-header { padding: .8rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .9rem; display: flex; align-items: center; justify-content: space-between; }
.new-channel-form { padding: .6rem .8rem; border-bottom: 1px solid var(--border); }
.channel-form-actions { display: flex; gap: .4rem; justify-content: flex-end; margin-top: .4rem; }
.channel-list { flex: 1; overflow-y: auto; padding: .4rem 0; }
.channel-item { display: flex; align-items: center; gap: .4rem; padding: .45rem .9rem; font-size: .86rem; color: var(--text-secondary); cursor: pointer; transition: background var(--transition); }
.channel-item:hover { background: var(--bg-hover); text-decoration: none; color: var(--text); }
.channel-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.channel-hash { color: var(--text-muted); font-size: 1rem; }
.chat-empty-hint { padding: 1rem; font-size: .82rem; color: var(--text-muted); text-align: center; }
.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; color: var(--text-muted); }
.chat-welcome i { color: var(--border-dark); }
.chat-header { padding: .9rem 1.2rem; border-bottom: 1px solid var(--border); background: var(--bg-card); }
.chat-header h3 { font-size: .95rem; font-weight: 600; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.message-item { display: flex; gap: .7rem; align-items: flex-start; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; overflow: hidden; }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .15rem; }
.msg-author { font-weight: 600; font-size: .86rem; }
.msg-time { color: var(--text-muted); font-size: .74rem; }
.msg-content { font-size: .88rem; line-height: 1.5; white-space: pre-wrap; }
.typing-indicator { padding: .3rem 1.2rem; font-size: .78rem; color: var(--text-muted); font-style: italic; }
.chat-input-bar { padding: .8rem 1.2rem; border-top: 1px solid var(--border); display: flex; gap: .6rem; background: var(--bg-card); }
.chat-input { flex: 1; padding: .55rem .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .88rem; font-family: var(--font); outline: none; }
.chat-input:focus { border-color: var(--primary); }

/* ── Integrations page ── */
.integrations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.integration-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow var(--transition); }
.integration-card:hover { box-shadow: var(--shadow-md); }
.integration-card.connected { border-color: #bbf7d0; }
.int-card-header { padding: 1.25rem; display: flex; justify-content: space-between; align-items: flex-start; background: var(--bg); border-bottom: 1px solid var(--border); }
.int-logo-big { width: 56px; height: 56px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }
.int-status-badge { font-size: .75rem; font-weight: 600; padding: .25rem .6rem; border-radius: 99px; display: flex; align-items: center; gap: .3rem; }
.badge-connected    { background: #dcfce7; color: #15803d; }
.badge-disconnected { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.int-card-body { padding: 1.1rem 1.25rem; }
.int-name { font-size: 1rem; font-weight: 700; }
.int-subtitle { font-size: .82rem; color: var(--text-muted); margin-top: .15rem; }
.int-features { list-style: none; margin-top: .8rem; display: flex; flex-direction: column; gap: .3rem; }
.int-features li { font-size: .82rem; color: var(--text-secondary); display: flex; align-items: center; gap: .4rem; }
.int-features li i { color: var(--success); font-size: .75rem; }
.int-last-sync { font-size: .75rem; margin-top: .6rem; }
.int-card-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.int-connected-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.badge-status { font-size: .74rem; font-weight: 600; padding: .2rem .5rem; border-radius: 4px; display: inline-flex; align-items: center; gap: .25rem; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-error   { background: #fee2e2; color: #dc2626; }

/* ── Workspaces ── */
.create-form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.create-form-card h3 { font-size: .95rem; font-weight: 600; margin-bottom: 1rem; }
.workspaces-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.workspace-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.ws-header { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.ws-logo { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; }
.ws-logo-placeholder { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; flex-shrink: 0; }
.ws-name { font-weight: 600; font-size: .95rem; }
.ws-owner { font-size: .78rem; }
.ws-desc { font-size: .84rem; color: var(--text-secondary); margin-bottom: .8rem; }
.ws-stats { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--text-muted); margin-bottom: .8rem; }
.badge-plan-free    { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.badge-plan-pro     { background: #ede9fe; color: var(--primary); }
.ws-actions { display: flex; gap: .5rem; }

/* ── Modals ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 500; display: none; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); animation: modalIn .2s ease; max-height: 90vh; overflow-y: auto; }
@keyframes modalIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: .95rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.modal-header h3 i { color: var(--primary); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1rem; }
.modal-body { padding: 1.25rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.zoom-result { background: #e8f2ff; border: 1px solid #93c5fd; border-radius: var(--radius-sm); padding: .8rem 1rem; margin-top: .8rem; font-size: .85rem; }
.zoom-result a { color: var(--primary); font-weight: 600; }

/* ── Alerts ── */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* ── Empty states ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem; gap: 1rem; color: var(--text-muted); text-align: center; background: var(--bg-card); border-radius: var(--radius); border: 1px dashed var(--border-dark); }
.empty-state i { color: var(--border-dark); }
.empty-state h3 { color: var(--text-secondary); font-size: 1rem; }
.empty-state p { font-size: .88rem; }
.empty-state-sm { display: flex; flex-direction: column; align-items: center; padding: 1.5rem; gap: .5rem; color: var(--text-muted); font-size: .84rem; text-align: center; }
.empty-state-sm i { font-size: 1.5rem; color: var(--border-dark); }

/* ── Auth pages ── */
.auth-body { background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-container { width: 100%; max-width: 420px; padding: 1rem; }
.auth-card { background: #fff; border-radius: 16px; padding: 2.5rem; box-shadow: 0 8px 40px rgba(0,0,0,.12); }
.auth-logo { display: flex; align-items: center; gap: .6rem; justify-content: center; margin-bottom: 1.5rem; font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.auth-title { font-size: 1.4rem; font-weight: 700; text-align: center; }
.auth-subtitle { color: var(--text-muted); text-align: center; font-size: .88rem; margin-top: .3rem; margin-bottom: 1.5rem; }
.auth-form { margin-top: 1.2rem; }
.auth-divider { text-align: center; position: relative; margin: 1.2rem 0; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.auth-divider span { background: #fff; padding: 0 .8rem; position: relative; font-size: .8rem; color: var(--text-muted); }
.oauth-buttons { display: flex; flex-direction: column; gap: .6rem; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .6rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; font-size: .88rem; font-weight: 500; cursor: pointer; transition: background var(--transition); font-family: var(--font); text-decoration: none !important; color: var(--text); }
.oauth-btn:hover { background: var(--bg-hover); }
.oauth-btn.microsoft i { color: #0078d4; }
.oauth-btn.google i { color: #4285f4; }
.auth-footer { text-align: center; margin-top: 1.2rem; font-size: .85rem; color: var(--text-muted); }
.btn-full { width: 100%; justify-content: center; }

/* ── Landing ── */
.landing-body { background: #fff; }
.landing-nav { position: sticky; top: 0; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); z-index: 100; }
.landing-nav-inner { max-width: 1100px; margin: 0 auto; padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.landing-logo { display: flex; align-items: center; gap: .6rem; font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.landing-nav-links { display: flex; gap: .6rem; }
.hero { max-width: 1100px; margin: 0 auto; padding: 4rem 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero-badge { display: inline-flex; align-items: center; gap: .4rem; background: var(--primary-light); color: var(--primary); padding: .35rem .8rem; border-radius: 99px; font-size: .82rem; font-weight: 600; margin-bottom: 1rem; }
.hero-title { font-size: 2.6rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.gradient-text { background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: 1rem; color: var(--text-secondary); margin-bottom: 1.8rem; line-height: 1.7; }
.hero-actions { display: flex; gap: .8rem; margin-bottom: 2rem; }
.hero-integrations { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.hero-integrations span { font-size: .82rem; color: var(--text-muted); }
.integration-logos { display: flex; gap: .5rem; }
.int-logo { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .9rem; font-weight: 800; border: 1px solid var(--border); }
.int-logo.microsoft { background: #e8f0fe; color: #0078d4; }
.int-logo.google    { background: #fce8e8; color: #ea4335; }
.int-logo.asana     { background: #fce7f3; color: #f06a6a; }
.int-logo.zoom      { background: #e8f2ff; color: #2d8cff; }
.int-logo.slack     { background: #f3e8f6; color: #4a154b; }
.int-logo.github    { background: #f0f0f0; color: #24292e; }
.hero-visual { display: flex; justify-content: center; }
.dashboard-preview { background: #f8fafc; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.preview-header { background: #fff; padding: .6rem 1rem; display: flex; gap: .4rem; border-bottom: 1px solid var(--border); }
.preview-header span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.preview-body { display: flex; height: 220px; }
.preview-sidebar { width: 60px; background: #1e1b4b; display: flex; flex-direction: column; gap: .4rem; padding: .6rem; }
.ps-item { height: 8px; border-radius: 4px; background: rgba(255,255,255,.15); }
.ps-item.active { background: rgba(99,102,241,.7); }
.preview-main { flex: 1; padding: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.pm-card { background: #fff; border-radius: 6px; flex: 1; border: 1px solid var(--border); padding: .4rem; }
.pm-card-header { height: 8px; background: var(--bg); border-radius: 3px; margin-bottom: .3rem; }
.pm-card-body { height: 20px; background: var(--bg); border-radius: 3px; }
.features { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.feature-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.feature-icon { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: .5rem; }
.feature-card p { font-size: .85rem; color: var(--text-secondary); line-height: 1.6; }
.landing-footer { text-align: center; padding: 2rem; font-size: .84rem; color: var(--text-muted); border-top: 1px solid var(--border); }

/* ── Responsive ── */
@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .features-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .page-body { padding: 1rem; }
}
