/* ============================================
   三时一·工作台账  —  Design System
   Apple-inspired, clean, minimal
   ============================================ */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: #e5e5ea;
  --text1: #1d1d1f;
  --text2: #424245;
  --text3: #86868b;
  --blue: #0071e3;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --purple: #af52de;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text1);
  font-size: 14px;
  line-height: 1.6;
}

/* --- Layout --- */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 56px 1fr 40px;
  height: 100vh;
}

.header {
  grid-column: 1 / -1;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 10;
}

.header h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.header h1 span {
  color: var(--text3);
  font-weight: 400;
  margin-left: 6px;
  font-size: 13px;
}

.search-box {
  margin-left: auto;
  position: relative;
}

.search-box input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px 6px 32px;
  font-size: 13px;
  width: 240px;
  background: var(--bg);
  outline: none;
  transition: border-color .2s;
}

.search-box input:focus {
  border-color: var(--blue);
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text3);
}

/* --- Sidebar --- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-bottom: 8px;
}

/* Mini calendar */
.mini-cal {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
}

.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mini-cal-header span {
  font-size: 13px;
  font-weight: 600;
}

.mini-cal-header button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--blue);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}

.mini-cal-header button:hover {
  background: rgba(0,113,227,.08);
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 11px;
}

.mini-cal-grid .day-label {
  color: var(--text3);
  font-weight: 600;
  padding: 4px 0;
}

.mini-cal-grid .day {
  padding: 4px 0;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: background .15s;
}

.mini-cal-grid .day:hover {
  background: rgba(0,113,227,.08);
}

.mini-cal-grid .day.today {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}

.mini-cal-grid .day.selected {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.mini-cal-grid .day.has-data::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
}

.mini-cal-grid .day.today.has-data::after {
  background: #fff;
}

.mini-cal-grid .day.empty {
  visibility: hidden;
}

/* Sidebar nav links */
.nav-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}

.nav-links a:hover {
  background: var(--bg);
}

.nav-links a.active {
  background: rgba(0,113,227,.08);
  color: var(--blue);
  font-weight: 600;
}

.nav-links .badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* --- Main content --- */
.main {
  overflow-y: auto;
  padding: 24px;
}

.day-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.day-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.day-header .weekday {
  font-size: 14px;
  color: var(--text3);
}

/* Entry cards */
.entry-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 12px;
  border-left: 3px solid var(--blue);
  transition: box-shadow .2s;
}

.entry-card:hover {
  box-shadow: var(--shadow-lg);
}

.entry-card[data-type="meeting"] { border-left-color: var(--blue); }
.entry-card[data-type="call"] { border-left-color: var(--green); }
.entry-card[data-type="internal"] { border-left-color: var(--purple); }
.entry-card[data-type="decision"] { border-left-color: var(--orange); }
.entry-card[data-type="note"] { border-left-color: var(--text3); }

.entry-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.entry-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  min-width: 40px;
}

.entry-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,113,227,.08);
  color: var(--blue);
}

.entry-card[data-type="call"] .entry-type {
  background: rgba(52,199,89,.08);
  color: var(--green);
}

.entry-card[data-type="internal"] .entry-type {
  background: rgba(175,82,222,.08);
  color: var(--purple);
}

.entry-card[data-type="decision"] .entry-type {
  background: rgba(255,149,0,.08);
  color: var(--orange);
}

.entry-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.entry-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.entry-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  transition: all .15s;
}

.entry-actions button:hover {
  background: var(--bg);
  color: var(--text1);
}

.entry-actions button.delete-btn,
button.delete-btn {
  color: var(--red);
  opacity: .6;
}

.entry-actions button.delete-btn:hover,
button.delete-btn:hover {
  background: rgba(255,59,48,.08);
  color: var(--red);
  opacity: 1;
}

button.delete-btn-day {
  background: none;
  border: 1px solid rgba(255,59,48,.2);
  cursor: pointer;
  color: var(--red);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-left: 8px;
  opacity: .6;
  transition: all .15s;
}

button.delete-btn-day:hover {
  background: rgba(255,59,48,.08);
  border-color: var(--red);
  opacity: 1;
}

.entry-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.entry-summary {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 12px;
  line-height: 1.7;
}

.entry-details {
  display: none;
  font-size: 13px;
  color: var(--text2);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  white-space: pre-wrap;
}

.entry-details.visible {
  display: block;
}

/* Action items & blockers in cards */
.entry-items {
  margin-top: 12px;
}

.entry-items h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin-bottom: 6px;
}

.item-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}

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

.item-row .status-dot.pending { background: var(--orange); }
.item-row .status-dot.completed { background: var(--green); }
.item-row .status-dot.open { background: var(--red); }
.item-row .status-dot.resolved { background: var(--green); }

.item-owner {
  font-size: 11px;
  color: var(--text3);
  margin-left: auto;
  white-space: nowrap;
}

/* Doc link */
.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(0,113,227,.06);
  transition: background .15s;
}

.doc-link:hover {
  background: rgba(0,113,227,.12);
}

/* Daily summary card */
.summary-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 24px;
  border-top: 3px solid var(--green);
}

.summary-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.summary-section {
  margin-bottom: 12px;
}

.summary-section h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin-bottom: 4px;
}

.summary-section p, .summary-section li {
  font-size: 13px;
  color: var(--text2);
}

.summary-section ul {
  list-style: none;
  padding: 0;
}

.summary-section li {
  padding: 2px 0;
}

.summary-section li::before {
  content: '·';
  margin-right: 8px;
  color: var(--text3);
}

/* --- Footer --- */
.footer {
  grid-column: 1 / -1;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-size: 11px;
  color: var(--text3);
  gap: 16px;
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: .4;
}

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

/* --- Search results overlay --- */
.search-results {
  position: absolute;
  top: 100%;
  right: 0;
  width: 400px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
}

.search-results.visible {
  display: block;
}

.search-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}

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

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

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

.login-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  padding: 48px 40px;
  width: 360px;
  text-align: center;
}

.login-logo {
  margin-bottom: 16px;
  color: var(--blue);
}

.login-card h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 2px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 28px;
}

.login-field {
  text-align: left;
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
}

.login-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  background: var(--bg);
}

.login-field input:focus {
  border-color: var(--blue);
}

.login-error {
  font-size: 12px;
  color: var(--red);
  min-height: 18px;
  margin-bottom: 8px;
}

.login-btn {
  width: 100%;
  padding: 10px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}

.login-btn:hover {
  opacity: .9;
}

.login-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* --- User menu --- */
.user-menu {
  position: relative;
  margin-left: 12px;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  transition: background .15s;
}

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

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

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

.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 100;
  overflow: hidden;
}

.user-dropdown.visible {
  display: block;
}

.user-dropdown-info {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text3);
}

.user-dropdown-info strong {
  display: block;
  font-size: 13px;
  color: var(--text1);
  margin-bottom: 2px;
}

.user-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--red);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}

.user-dropdown a:hover {
  background: var(--bg);
}

/* --- Loading --- */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text3);
}

/* --- Document Library --- */

.docs-stats-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.docs-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: all .2s;
}

.docs-stat-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.docs-stat-chip.active {
  background: rgba(0,113,227,.06);
  border-color: var(--blue);
  color: var(--blue);
}

.docs-stat-chip strong {
  font-weight: 600;
}

.docs-stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.docs-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.docs-search-input {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  flex: 1;
  min-width: 160px;
}

.docs-search-input svg {
  color: var(--text3);
  flex-shrink: 0;
}

.docs-search-input input {
  border: none;
  outline: none;
  background: none;
  font-size: 13px;
  color: var(--text1);
  width: 100%;
  font-family: inherit;
}

.docs-filter-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text2);
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.docs-filter-select:focus {
  border-color: var(--blue);
}

.docs-clear-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  font-size: 12px;
  color: var(--red);
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}

.docs-clear-btn:hover {
  background: rgba(255,59,48,.06);
  border-color: var(--red);
}

.docs-upload-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text3);
  font-size: 13px;
  margin-bottom: 16px;
  transition: all .2s;
  cursor: default;
}

.docs-upload-zone.dragover {
  border-color: var(--blue);
  background: rgba(0,113,227,.03);
  color: var(--blue);
}

.docs-upload-link {
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
}

.doc-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(0,113,227,.06);
  color: var(--blue);
  font-size: 11px;
  cursor: pointer;
  transition: background .15s;
}

.doc-tag:hover {
  background: rgba(0,113,227,.12);
}

/* --- Dashboard --- */

.dash-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.dash-stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
}

.dash-stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.dash-stat-num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.dash-stat-label {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}

.dash-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.dash-section h3 {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.dash-section-alert {
  border-left: 3px solid var(--red);
}

.dash-section-more {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--blue);
  cursor: pointer;
}

.dash-section-more:hover {
  text-decoration: underline;
}

.dash-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  font-size: 13px;
}

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

.dash-item-overdue {
  background: rgba(255,59,48,.04);
}

.dash-item-overdue:hover {
  background: rgba(255,59,48,.08);
}

.dash-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-item-meta {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  flex-shrink: 0;
}

.dash-type-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-type-dot[data-type="meeting"] { background: var(--blue); }
.dash-type-dot[data-type="call"] { background: var(--green); }
.dash-type-dot[data-type="internal"] { background: var(--purple); }
.dash-type-dot[data-type="decision"] { background: var(--orange); }
.dash-type-dot[data-type="external"] { background: var(--blue); }
.dash-type-dot[data-type="note"] { background: var(--text3); }

/* --- Collapsible Entry Cards --- */

.entry-card.collapsed .entry-body {
  display: none;
}

.entry-card .entry-body {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.entry-chevron {
  flex-shrink: 0;
  transition: transform .2s;
  color: var(--text3);
}

.entry-card:not(.collapsed) .entry-chevron {
  transform: rotate(90deg);
}

.entry-card-header {
  cursor: pointer;
}

.entry-chips {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.entry-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.chip-action {
  background: rgba(255,149,0,.1);
  color: var(--orange);
}

.chip-blocker {
  background: rgba(255,59,48,.1);
  color: var(--red);
}

.chip-decision {
  background: rgba(175,82,222,.1);
  color: var(--purple);
}

.chip-overdue {
  background: rgba(255,59,48,.12);
  color: var(--red);
}

.doc-link-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  padding: 4px;
  border-radius: 4px;
  text-decoration: none;
  transition: background .15s;
}

.doc-link-mini:hover {
  background: rgba(0,113,227,.08);
}

.item-overdue {
  color: var(--red);
}

.item-overdue .item-owner {
  color: var(--red);
  font-weight: 600;
}

/* --- Week View --- */

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.week-col {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 200px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .2s;
}

.week-col:hover {
  box-shadow: var(--shadow-lg);
}

.week-col-today {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.week-col-weekend {
  opacity: .7;
}

.week-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.week-day-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.week-day-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
}

.today-num {
  background: var(--blue);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.week-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.week-empty {
  text-align: center;
  color: var(--text3);
  font-size: 12px;
  padding: 20px 0;
  opacity: .4;
}

.week-entry {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--bg);
  border-left: 3px solid var(--blue);
  font-size: 12px;
  position: relative;
}

.week-entry-time {
  font-size: 10px;
  color: var(--text3);
  font-weight: 600;
  margin-bottom: 2px;
}

.week-entry-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text1);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.week-entry-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--orange);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.week-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.week-nav button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.week-nav button:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(0,113,227,.04);
}

.week-summary {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 12px;
  font-size: 12px;
  color: var(--text3);
}

.week-summary span {
  font-weight: 600;
}

/* --- Filter Bar --- */

.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-chip {
  padding: 5px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}

.filter-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.filter-chip.active {
  background: rgba(0,113,227,.08);
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}

/* --- Section Labels --- */

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  padding: 12px 0 6px;
}

.section-label-red {
  color: var(--red);
}

.section-label-dim {
  opacity: .5;
}

/* --- Docs Card Grid --- */

.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.doc-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.doc-card-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
  color: #fff;
}

.doc-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text1);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.doc-card-summary {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  flex: 1;
}

.doc-card-meta {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-card-people {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.doc-card-people .doc-tag {
  font-size: 10px;
  padding: 0 6px;
}

.doc-card-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}

.doc-card:hover .doc-card-delete {
  opacity: .6;
}

.doc-card-delete:hover {
  opacity: 1 !important;
  background: rgba(255,59,48,.08);
}

/* --- View Toggle --- */

.view-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.view-toggle:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(0,113,227,.04);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .docs-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .week-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .docs-card-grid {
    grid-template-columns: 1fr;
  }
}
