/* personal.css — Personal COO workspace styles */
/* Light theme with amber accent (#FFB703). Layered on top of shell.css. */

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES for personal workspace
   ═══════════════════════════════════════════════════════════════════════════ */
.personal-workspace {
  --p-bg:             #FFFBF0;
  --p-surface:        #FFFFFF;
  --p-surface-var:    #FFF8E1;
  --p-on-surface:     #1C1B1F;
  --p-on-surface-var: #49454F;
  --p-accent:         #FFB703;
  --p-accent-dark:    #D09500;
  --p-accent-light:   #FFF3CD;
  --p-border:         #E8E0D0;
  --p-tab-active:     #FFB703;
  --p-tab-active-text:#7A5900;
  --p-priority-1:     #C62828;
  --p-priority-2:     #EF6C00;
  --p-priority-3:     #1565C0;
  --p-priority-4:     #2E7D32;
  --p-priority-5:     #757575;

  background: var(--p-bg);
  min-height: 100vh;
  padding-bottom: calc(var(--navbar-h) + 16px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOP APP BAR — amber tint
   ═══════════════════════════════════════════════════════════════════════════ */
.personal-workspace .top-app-bar {
  background: #FFFBF0;
  border-bottom: 1px solid var(--p-border);
}
.personal-workspace .top-app-bar .top-app-bar-title span {
  color: var(--p-accent-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAB BAR — MD3 Primary Tabs (light, amber underline)
   ═══════════════════════════════════════════════════════════════════════════ */
.personal-tab-bar {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--p-border);
  background: var(--p-surface);
  position: sticky;
  top: var(--topbar-h);
  z-index: 10;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.personal-tab-bar::-webkit-scrollbar { display: none; }

.personal-tab {
  flex-shrink: 0;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--p-on-surface-var);
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.personal-tab:hover { color: var(--p-accent-dark); background: var(--p-accent-light); }
.personal-tab.active {
  color: var(--p-tab-active-text);
  border-bottom-color: var(--p-tab-active);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════════════════════════════════════ */
.personal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════════════════════════════════════ */
.p-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 10px;
}
.p-section-hdr:first-child { margin-top: 0; }
.p-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--p-accent-dark);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FILTER CHIPS (task filters)
   ═══════════════════════════════════════════════════════════════════════════ */
.p-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.p-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--p-border);
  background: var(--p-surface);
  color: var(--p-on-surface-var);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.p-chip:hover { background: var(--p-accent-light); }
.p-chip.selected {
  background: var(--p-accent);
  color: var(--p-tab-active-text);
  border-color: var(--p-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADD FORM (shared card pattern)
   ═══════════════════════════════════════════════════════════════════════════ */
.p-add-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.p-field-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.p-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}
.p-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--p-on-surface-var);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.p-field input,
.p-field select,
.p-field textarea {
  border: 1px solid var(--p-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  background: var(--p-bg);
  color: var(--p-on-surface);
  outline: none;
  transition: border-color 0.15s;
}
.p-field input:focus,
.p-field select:focus,
.p-field textarea:focus {
  border-color: var(--p-accent);
}
.p-field textarea { resize: vertical; min-height: 60px; }
.p-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.p-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.p-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.p-btn-filled {
  background: var(--p-accent);
  color: var(--p-tab-active-text);
}
.p-btn-filled:hover { opacity: 0.85; }
.p-btn-surface {
  background: var(--p-surface-var);
  color: var(--p-on-surface);
  border: 1px solid var(--p-border);
}
.p-btn-surface:hover { background: var(--p-accent-light); }
.p-btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--p-on-surface-var);
  font-size: 14px;
}
.p-btn-icon:hover { background: var(--p-accent-light); }
.p-btn-icon.danger:hover { color: #C62828; }

/* ═══════════════════════════════════════════════════════════════════════════
   TASK LIST
   ═══════════════════════════════════════════════════════════════════════════ */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 0.15s;
}
.task-item:hover { border-color: var(--p-accent); }
.task-item.done {
  opacity: 0.55;
  background: var(--p-surface-var);
}
.task-checkbox {
  width: 18px; height: 18px;
  border: 2px solid var(--p-border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  margin-top: 2px;
  transition: background 0.15s, border-color 0.15s;
}
.task-checkbox:hover { border-color: var(--p-accent); }
.task-checkbox.checked {
  background: var(--p-accent);
  border-color: var(--p-accent);
  color: var(--p-tab-active-text);
  font-size: 11px;
}
.task-body { flex: 1; min-width: 0; }
.task-title {
  font-size: 14px;
  color: var(--p-on-surface);
  line-height: 1.4;
}
.task-item.done .task-title { text-decoration: line-through; color: var(--p-on-surface-var); }
.task-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.task-meta-item {
  font-size: 11px;
  color: var(--p-on-surface-var);
}
.task-meta-item.overdue { color: #C62828; font-weight: 600; }
.task-meta-item.today   { color: var(--p-accent-dark); font-weight: 600; }
.priority-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.priority-1 { background: var(--p-priority-1); }
.priority-2 { background: var(--p-priority-2); }
.priority-3 { background: var(--p-priority-3); }
.priority-4 { background: var(--p-priority-4); }
.priority-5 { background: var(--p-priority-5); }

/* ═══════════════════════════════════════════════════════════════════════════
   PROJECT CARD
   ═══════════════════════════════════════════════════════════════════════════ */
.project-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.project-card:hover { border-color: var(--p-accent); box-shadow: 0 2px 8px rgba(255,183,3,0.15); }
.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.project-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--p-on-surface);
}
.project-card-desc {
  font-size: 12px;
  color: var(--p-on-surface-var);
  margin-bottom: 10px;
}
.project-progress-bar {
  height: 4px;
  background: var(--p-border);
  border-radius: 4px;
  overflow: hidden;
}
.project-progress-fill {
  height: 100%;
  background: var(--p-accent);
  border-radius: 4px;
  transition: width 0.3s;
}
.project-progress-label {
  font-size: 11px;
  color: var(--p-on-surface-var);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTACT LIST
   ═══════════════════════════════════════════════════════════════════════════ */
.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.contact-item:hover { border-color: var(--p-accent); }
.contact-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--p-accent-light);
  color: var(--p-accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-size: 14px; font-weight: 600; color: var(--p-on-surface); }
.contact-sub { font-size: 12px; color: var(--p-on-surface-var); }

/* ═══════════════════════════════════════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════════════════════════════════════ */
.cal-event-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-left: 4px solid var(--p-accent);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.cal-event-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--p-accent-dark);
  white-space: nowrap;
  min-width: 60px;
}
.cal-event-body { flex: 1; min-width: 0; }
.cal-event-title { font-size: 13px; font-weight: 600; color: var(--p-on-surface); }
.cal-event-loc { font-size: 11px; color: var(--p-on-surface-var); margin-top: 2px; }

.intent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--p-surface-var);
  border: 1px dashed var(--p-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
.intent-state-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.intent-state-chip.pending  { background: #FFF3CD; color: #856404; }
.intent-state-chip.synced   { background: #D4EDDA; color: #155724; }
.intent-state-chip.failed   { background: #F8D7DA; color: #721C24; }

/* ═══════════════════════════════════════════════════════════════════════════
   TODAY PLAN
   ═══════════════════════════════════════════════════════════════════════════ */
.today-date-hdr {
  font-size: 22px;
  font-weight: 300;
  color: var(--p-on-surface);
  margin-bottom: 4px;
}
.today-day-name {
  font-size: 13px;
  color: var(--p-on-surface-var);
  margin-bottom: 20px;
}
.today-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--p-border);
}
.today-item:last-child { border-bottom: none; }
.today-item-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--p-accent-dark);
  min-width: 56px;
  padding-top: 2px;
}
.today-item-type {
  font-size: 16px;
  flex-shrink: 0;
}
.today-item-body { flex: 1; min-width: 0; }
.today-item-title {
  font-size: 14px;
  color: var(--p-on-surface);
  font-weight: 500;
}
.today-item-sub {
  font-size: 11px;
  color: var(--p-on-surface-var);
  margin-top: 1px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ATTRIBUTE LIST
   ═══════════════════════════════════════════════════════════════════════════ */
.attr-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--p-border);
}
.attr-row:last-child { border-bottom: none; }
.attr-key {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--p-on-surface-var);
  min-width: 100px;
}
.attr-value { font-size: 13px; color: var(--p-on-surface); flex: 1; }
.attr-source { font-size: 11px; color: var(--p-on-surface-var); font-style: italic; }

/* ═══════════════════════════════════════════════════════════════════════════
   FILINGS LIST
   ═══════════════════════════════════════════════════════════════════════════ */
.filing-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
}
.filing-icon { font-size: 20px; flex-shrink: 0; }
.filing-body { flex: 1; min-width: 0; }
.filing-title { font-size: 13px; font-weight: 600; color: var(--p-on-surface); }
.filing-meta  { font-size: 11px; color: var(--p-on-surface-var); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════════ */
.p-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--p-on-surface-var);
  font-size: 14px;
}
.p-empty-icon { font-size: 36px; margin-bottom: 8px; }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTACT MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.contact-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.contact-modal {
  background: var(--p-surface);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}
.contact-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--p-on-surface);
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.p-search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--p-border);
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  background: var(--p-surface);
  color: var(--p-on-surface);
  outline: none;
  margin-bottom: 14px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.p-search:focus { border-color: var(--p-accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   SNACKBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.p-snackbar {
  position: fixed;
  bottom: calc(var(--navbar-h) + 20px);
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  color: #FFF;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 999;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DESKTOP LAYOUT adjustments
   ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 840px) {
  .personal-content { padding: 24px 32px 40px; }
  .personal-workspace { padding-bottom: 0; margin-left: 80px; }
}
@media (min-width: 1280px) {
  .personal-workspace { margin-left: 88px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GMAIL TAB
   ═══════════════════════════════════════════════════════════════════════════ */

.gmail-thread-row {
  border: 1px solid var(--p-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  background: var(--p-surface);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.gmail-thread-row:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: var(--p-accent);
}
.gmail-thread-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}
.gmail-from {
  font-size: 13px;
  font-weight: 600;
  color: var(--p-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}
.gmail-date {
  font-size: 11px;
  color: var(--p-on-surface-var);
  white-space: nowrap;
  flex-shrink: 0;
}
.gmail-subject {
  font-size: 13px;
  font-weight: 500;
  color: var(--p-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.gmail-snippet {
  font-size: 12px;
  color: var(--p-on-surface-var);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── p-surface-alt helper ──────────────────────────────────────────────────── */
.p-surface-alt {
  background: var(--p-surface-var);
}
