:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #222633;
  --border: #2a2e3a;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ---- Login ---- */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px;
  width: 420px;
  max-width: 90vw;
  text-align: center;
}
.login-box h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.login-box p { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; line-height: 1.5; }
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-google:hover { background: var(--border); }
.login-error { margin-top: 16px; color: var(--danger); font-size: 13px; min-height: 20px; }

#loginContainer { display: flex; }
#app { display: none; flex-direction: column; height: 100vh; }

/* ---- Header ---- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.logo { font-size: 18px; font-weight: 700; letter-spacing: -0.5px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-divider { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }

/* View Tabs */
.view-tabs { display: flex; gap: 2px; background: var(--surface); border-radius: 8px; padding: 3px; }
.view-tab {
  padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all 0.15s;
  display: flex; align-items: center; gap: 5px;
}
.view-tab:hover { color: var(--text); background: var(--surface-hover); }
.view-tab.active { color: #fff; background: var(--surface-hover); }
.view-tab-icon { font-size: 13px; }

/* Product Tabs */
.product-tabs { display: flex; gap: 4px; background: var(--surface); border-radius: 8px; padding: 3px; }
.product-tab {
  padding: 5px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all 0.15s;
}
.product-tab:hover { color: var(--text); background: var(--surface-hover); }
.product-tab.active { color: #fff; background: var(--surface-hover); }
.product-tab .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Team Avatars */
.team-filter { display: flex; gap: 4px; align-items: center; }
.team-avatar {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; cursor: pointer; border: 2px solid transparent;
  transition: all 0.15s; background: var(--surface); color: var(--text-muted);
}
.team-avatar:hover, .team-avatar.active { border-color: var(--accent); color: var(--text); background: var(--surface-hover); }

/* User Info */
.user-info { display: flex; align-items: center; gap: 8px; }
.user-photo { width: 28px; height: 28px; border-radius: 50%; }
.user-photo-placeholder {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff;
}
.user-name { font-size: 13px; color: var(--text-muted); }
.btn-signout {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 16px; padding: 4px; transition: color 0.15s;
}
.btn-signout:hover { color: var(--text); }

/* Buttons */
.btn-add {
  padding: 5px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: var(--accent); color: #fff; transition: all 0.15s;
}
.btn-add:hover { background: var(--accent-hover); }

/* Activity Toggle */
.activity-toggle {
  position: relative;
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted); cursor: pointer; padding: 4px 8px; font-size: 16px;
  transition: all 0.15s;
}
.activity-toggle:hover { color: var(--text); border-color: var(--accent); }
.activity-badge {
  display: none;
  position: absolute; top: -6px; right: -6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 9px; font-weight: 700;
  align-items: center; justify-content: center;
}

/* ---- Board ---- */
.board { display: flex; gap: 16px; padding: 16px 24px; flex: 1; overflow-x: auto; overflow-y: auto; }
.column { flex: 1; min-width: 270px; max-width: 360px; display: flex; flex-direction: column; gap: 8px; }
.column-header { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 10px; }
.column-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.column-dot { width: 10px; height: 10px; border-radius: 50%; }
.column-count { font-size: 11px; color: var(--text-muted); font-weight: 400; background: var(--surface); padding: 1px 7px; border-radius: 10px; }

.column-cards {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  padding: 4px; border-radius: 8px; min-height: 80px;
}
.column-cards.drag-over {
  background: rgba(59,130,246,0.05); outline: 2px dashed rgba(59,130,246,0.3);
  outline-offset: -2px; border-radius: 8px;
}

.empty-column {
  display: flex; align-items: center; justify-content: center; padding: 28px 16px;
  color: var(--text-muted); font-size: 13px; font-style: italic;
  border: 1px dashed var(--border); border-radius: 8px;
}

.add-card-btn {
  width: 100%; padding: 5px; border-radius: 6px; border: 1px dashed var(--border);
  background: transparent; color: var(--text-muted); cursor: pointer; font-size: 12px;
  font-family: inherit; transition: all 0.15s; margin-top: 2px;
}
.add-card-btn:hover { border-color: var(--accent); color: var(--text); background: rgba(59,130,246,0.05); }

/* ---- Cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 13px; cursor: grab; transition: all 0.15s; position: relative;
}
.card:hover { border-color: #3a3e4a; background: var(--surface-hover); }
.card.dragging { opacity: 0.4; transform: rotate(2deg); }
.card-title { font-size: 13px; font-weight: 500; line-height: 1.4; margin-bottom: 7px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-assignee {
  width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 600; background: var(--bg); color: var(--text-muted);
}
.card-tags { display: flex; gap: 3px; flex-wrap: wrap; }
.card-tag { font-size: 10px; padding: 1px 7px; border-radius: 10px; background: rgba(99,102,241,0.15); color: #818cf8; font-weight: 500; }
.card-actions { position: absolute; top: 7px; right: 7px; display: none; gap: 4px; }
.card:hover .card-actions { display: flex; }
.card-action-btn {
  width: 20px; height: 20px; border-radius: 4px; border: none; background: var(--bg);
  color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 11px; transition: all 0.1s;
}
.card-action-btn:hover { color: var(--text); background: var(--border); }
.card-date { font-size: 10px; color: var(--text-muted); }
.card-date.overdue { color: var(--danger); }
.card-badge { font-size: 10px; color: var(--text-muted); }

/* ---- Stats Bar ---- */
.stats-bar {
  display: flex; align-items: center; gap: 20px; padding: 8px 24px;
  border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); flex-shrink: 0;
}
.stat { display: flex; align-items: center; gap: 6px; }
.stat-value { font-weight: 600; color: var(--text); }

/* ---- Modal ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding-top: 5vh; overflow-y: auto; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; width: 560px; max-width: 90vw; margin-bottom: 5vh; }
.modal h2 { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 7px 11px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
/* Date picker styling for dark theme */
.form-group input[type="date"] { cursor: pointer; }
.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7); cursor: pointer; padding: 2px; border-radius: 3px;
}
.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover { filter: invert(0.9); }
.form-group textarea { resize: vertical; min-height: 50px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn-cancel { padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--text-muted); transition: all 0.15s; }
.btn-cancel:hover { color: var(--text); border-color: #3a3e4a; }
.btn-submit { padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; background: var(--accent); color: #fff; transition: all 0.15s; }
.btn-submit:hover { background: var(--accent-hover); }
.btn-delete { padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--danger); background: transparent; color: var(--danger); transition: all 0.15s; margin-right: auto; }
.btn-delete:hover { background: var(--danger); color: #fff; }

/* ---- Detail Sections (Comments, Attachments) ---- */
.detail-sections { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.detail-section { margin-bottom: 16px; }
.detail-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }

/* Comments */
.comment-list { max-height: 200px; overflow-y: auto; margin-bottom: 8px; }
.comment { padding: 8px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 3px; }
.comment-author { font-size: 12px; font-weight: 600; }
.comment-time { font-size: 11px; color: var(--text-muted); }
.comment-text { font-size: 13px; line-height: 1.4; color: var(--text); }
.comment-empty { font-size: 12px; color: var(--text-muted); font-style: italic; padding: 8px 0; }
.comment-form { display: flex; gap: 8px; }
.comment-form input {
  flex: 1; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 13px; font-family: inherit; outline: none;
}
.comment-form input:focus { border-color: var(--accent); }
.comment-form button {
  padding: 6px 12px; border-radius: 6px; border: none; background: var(--accent);
  color: #fff; font-size: 12px; cursor: pointer; font-weight: 500;
}

/* Attachments */
.attachment-list { margin-bottom: 8px; }
.attachment-item {
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.attachment-item:last-child { border-bottom: none; }
.attachment-preview { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name {
  font-size: 13px; color: var(--accent); text-decoration: none; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attachment-name:hover { text-decoration: underline; }
.attachment-size { font-size: 11px; color: var(--text-muted); }
.attachment-remove {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 16px; padding: 2px 6px;
}
.attachment-remove:hover { color: var(--danger); }
.attachment-empty { font-size: 12px; color: var(--text-muted); font-style: italic; padding: 8px 0; }

.attach-drop-zone {
  border: 1px dashed var(--border); border-radius: 6px; padding: 10px;
  text-align: center; font-size: 12px; color: var(--text-muted); cursor: pointer;
  transition: all 0.15s;
}
.attach-drop-zone:hover, .attach-drop-zone.drag-over {
  border-color: var(--accent); color: var(--text); background: rgba(59,130,246,0.05);
}

/* ---- Activity Panel ---- */
.activity-panel {
  position: fixed; right: -380px; top: 0; bottom: 0; width: 370px;
  background: var(--surface); border-left: 1px solid var(--border);
  transition: right 0.25s ease; z-index: 90;
  display: flex; flex-direction: column;
}
.activity-panel.open { right: 0; }
.activity-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.activity-header h3 { font-size: 14px; font-weight: 600; }
.activity-close {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 18px; padding: 2px 6px;
}
.activity-close:hover { color: var(--text); }
.activity-list { flex: 1; overflow-y: auto; padding: 12px 20px; }
.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; border: 1px solid;
}
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; line-height: 1.4; }
.activity-text em { font-style: normal; color: var(--accent); }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.activity-empty { font-size: 13px; color: var(--text-muted); font-style: italic; padding: 20px 0; text-align: center; }

/* ---- Settings Button ---- */
.btn-settings {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted); cursor: pointer; padding: 4px 8px; font-size: 16px;
  transition: all 0.15s; line-height: 1;
}
.btn-settings:hover { color: var(--text); border-color: var(--accent); }

/* ---- Settings Modal ---- */
.settings-modal { width: 520px; }
.settings-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 8px; padding: 3px; margin-bottom: 16px; }
.settings-tab {
  flex: 1; padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: transparent; color: var(--text-muted); transition: all 0.15s;
  text-align: center;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: #fff; background: var(--surface-hover); }

.settings-list { margin-bottom: 12px; }
.settings-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-bottom: 1px solid var(--border); transition: background 0.1s;
}
.settings-item:hover { background: var(--surface-hover); }
.settings-item:last-child { border-bottom: none; }
.settings-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.settings-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; border: 1px solid;
}
.settings-member-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.settings-item-name { font-size: 13px; font-weight: 500; flex: 1; }
.settings-item-email { font-size: 11px; color: var(--text-muted); }
.settings-item-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.settings-item:hover .settings-item-actions { opacity: 1; }
.settings-edit-btn, .settings-delete-btn {
  width: 24px; height: 24px; border-radius: 4px; border: none; background: var(--bg);
  color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all 0.1s;
}
.settings-edit-btn:hover { color: var(--text); background: var(--border); }
.settings-delete-btn:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

.settings-add-form, .settings-edit-form {
  display: flex; gap: 8px; align-items: center; padding: 8px 0; flex-wrap: wrap;
}
.settings-input {
  flex: 1; min-width: 100px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 13px; font-family: inherit; outline: none;
}
.settings-input:focus { border-color: var(--accent); }
.settings-input-sm { max-width: 70px; flex: 0 0 70px; }
.settings-color-input {
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); cursor: pointer; padding: 2px;
}
.settings-add-btn, .settings-save-btn {
  padding: 6px 14px; border-radius: 6px; border: none; background: var(--accent);
  color: #fff; font-size: 12px; cursor: pointer; font-weight: 500; white-space: nowrap;
}
.settings-add-btn:hover, .settings-save-btn:hover { background: var(--accent-hover); }
.settings-cancel-btn {
  padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-size: 12px; cursor: pointer; font-weight: 500; white-space: nowrap;
}
.settings-cancel-btn:hover { color: var(--text); border-color: #3a3e4a; }

/* ---- Calendar View ---- */
.calendar-container { flex: 1; display: flex; flex-direction: column; padding: 0; width: 100%; }
.calendar-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0 12px; flex-shrink: 0;
}
.calendar-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.cal-nav-btn:hover { background: var(--surface-hover); border-color: var(--accent); }
.cal-title { font-size: 15px; font-weight: 600; min-width: 180px; text-align: center; }
.cal-today-btn {
  padding: 4px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); cursor: pointer; font-size: 12px; font-weight: 500;
  transition: all 0.15s;
}
.cal-today-btn:hover { color: var(--text); border-color: var(--accent); }
.calendar-mode-toggle { display: flex; gap: 2px; background: var(--surface); border-radius: 6px; padding: 2px; }
.cal-mode-btn {
  padding: 4px 12px; border-radius: 5px; border: none; background: transparent;
  color: var(--text-muted); cursor: pointer; font-size: 12px; font-weight: 500; transition: all 0.15s;
}
.cal-mode-btn:hover { color: var(--text); }
.cal-mode-btn.active { color: #fff; background: var(--surface-hover); }

/* Calendar Grid — Month */
.calendar-grid { flex: 1; overflow-y: auto; }
.cal-header-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin-bottom: 4px; }
.cal-day-header {
  text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted); padding: 4px;
}
.cal-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin-bottom: 1px; }
.cal-cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  min-height: 90px; padding: 4px; cursor: pointer; transition: background 0.1s;
}
.cal-cell:hover { background: var(--surface-hover); }
.cal-cell-empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell-empty:hover { background: transparent; }
.cal-cell.drag-over { background: rgba(59,130,246,0.08); border-color: var(--accent); }
.cal-today { border-color: var(--accent); }
.cal-day-num { font-size: 11px; font-weight: 500; color: var(--text-muted); padding: 2px 4px; }
.cal-today-num {
  color: #fff; background: var(--accent); border-radius: 50%;
  width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.cal-day-tasks { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }

/* Calendar Cards — Compact (month) */
.cal-card {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding: 3px 6px; border-radius: 4px; background: var(--bg);
  cursor: pointer; transition: background 0.1s; font-size: 11px;
}
.cal-card:hover { background: var(--surface-hover); }
.cal-card.dragging { opacity: 0.4; }
.cal-card-overdue { color: var(--danger); }
.cal-card-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-card-avatar { font-size: 9px; font-weight: 600; flex-shrink: 0; }

/* Calendar Cards — Full (week/no-date) */
.cal-card-full {
  display: block; padding: 6px 8px; border-radius: 6px; background: var(--bg);
  cursor: pointer; transition: background 0.1s; margin-bottom: 4px;
}
.cal-card-full:hover { background: var(--surface-hover); }
.cal-card-full .cal-card-title { font-size: 12px; font-weight: 500; margin-bottom: 4px; white-space: normal; }
.cal-card-meta {
  display: flex; align-items: center; gap: 4px; font-size: 10px;
}
.cal-card-status { font-size: 10px; font-weight: 500; }
.cal-card-full .cal-card-avatar {
  width: 18px; height: 18px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 8px; font-weight: 600;
  background: var(--surface); margin-left: auto;
}

/* Calendar — Week View */
.cal-week-container { display: flex; gap: 8px; flex: 1; overflow-x: auto; }
.cal-week-day {
  flex: 1; min-width: 140px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; display: flex; flex-direction: column; overflow: hidden;
}
.cal-week-day.cal-today { border-color: var(--accent); }
.cal-week-day.drag-over { background: rgba(59,130,246,0.05); border-color: var(--accent); }
.cal-week-day-header {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.cal-week-day-name { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }
.cal-week-day-num { font-size: 12px; font-weight: 500; }
.cal-week-day-count { font-size: 11px; color: var(--text-muted); background: var(--bg); padding: 1px 7px; border-radius: 10px; margin-left: auto; }
.cal-week-day-tasks { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-week-empty { font-size: 11px; color: var(--text-muted); font-style: italic; padding: 12px 0; text-align: center; }

/* Calendar — No Date Section */
.cal-nodate {
  margin-top: 12px; padding: 10px 12px; background: var(--surface);
  border: 1px dashed var(--border); border-radius: 8px;
}
.cal-nodate-title { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.cal-nodate-tasks { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Person View ---- */
.person-col-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 600; border: 1px solid;
}

/* ---- Documents View ---- */
#documentsView { padding: 16px 24px; flex: 1; overflow-y: auto; }

.docs-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.docs-search-wrap { flex: 1; max-width: 360px; }
.docs-search {
  width: 100%; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color 0.15s;
}
.docs-search:focus { border-color: var(--accent); }
.docs-search::placeholder { color: var(--text-muted); }
.docs-upload-btn { white-space: nowrap; }

.docs-count { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

.docs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}
.docs-empty {
  grid-column: 1 / -1; text-align: center; padding: 48px 16px;
  color: var(--text-muted); font-size: 14px; font-style: italic;
}

.doc-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; cursor: pointer; transition: all 0.15s;
  display: flex; align-items: flex-start; gap: 12px;
}
.doc-card:hover { border-color: #3a3e4a; background: var(--surface-hover); }
.doc-card-icon { font-size: 24px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.doc-card-body { flex: 1; min-width: 0; }
.doc-card-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; line-height: 1.3; }
.doc-card-desc {
  font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.doc-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-card-product {
  font-size: 10px; font-weight: 500; padding: 1px 8px; border-radius: 10px;
}
.doc-card-size, .doc-card-date { font-size: 11px; color: var(--text-muted); }

/* ---- Document Modal ---- */
.doc-modal-form { margin-bottom: 4px; }

.doc-label {
  display: block; font-size: 11px; font-weight: 500; color: var(--text-muted);
  margin-bottom: 5px; margin-top: 14px; text-transform: uppercase; letter-spacing: 0.3px;
}
.doc-label:first-child { margin-top: 0; }
.doc-optional { text-transform: none; font-weight: 400; letter-spacing: 0; }

.doc-input {
  width: 100%; padding: 7px 11px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; font-family: inherit;
  outline: none; transition: border-color 0.15s;
}
.doc-input:focus { border-color: var(--accent); }
.doc-textarea { resize: vertical; min-height: 44px; }

.doc-drop-zone {
  border: 2px dashed var(--border); border-radius: 8px; padding: 28px 16px;
  text-align: center; cursor: pointer; transition: all 0.15s;
}
.doc-drop-zone:hover, .doc-drop-zone.drag-over {
  border-color: var(--accent); background: rgba(59,130,246,0.05);
}
.doc-drop-icon { font-size: 32px; margin-bottom: 6px; }
.doc-drop-text { font-size: 13px; color: var(--text-muted); }

.doc-selected-file {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px;
}
.doc-selected-file span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-clear-file {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 16px; padding: 0 4px;
}
.doc-clear-file:hover { color: var(--danger); }

.doc-file-info {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 4px;
}
.doc-file-icon { font-size: 28px; flex-shrink: 0; }
.doc-file-details { flex: 1; min-width: 0; }
.doc-file-link {
  font-size: 13px; font-weight: 500; color: var(--accent); text-decoration: none;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-file-link:hover { text-decoration: underline; }
.doc-file-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Save button in doc modal */
.btn-save {
  padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: var(--accent); color: #fff; transition: all 0.15s;
}
.btn-save:hover { background: var(--accent-hover); }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

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