/* ============================================================
   ZEYN COFFEE — Specialty Coffee Design System & Motion Styles
   ============================================================ */

:root {
  --bg: #F6F3EC;
  --bg-elevated: #FFFFFF;
  --bg-subtle: #EDE8DF;
  --bg-hover: #F2EDE4;
  --text: #221A15;
  --text-muted: #76695F;
  --text-soft: #9C8F84;
  --border: #E4DDD2;
  --border-strong: #D4C9BA;

  --brand: #A85D2F;
  --brand-hover: #8E4C24;
  --brand-soft: rgba(168, 93, 47, 0.11);
  --brand-text: #FFFFFF;

  --sage: #2D6A4F;
  --sage-soft: rgba(45, 106, 79, 0.12);

  --amber: #B97719;
  --amber-soft: rgba(185, 119, 25, 0.13);

  --danger: #C0392B;
  --danger-soft: rgba(192, 57, 43, 0.11);

  --shadow-sm: 0 2px 8px rgba(34, 26, 21, 0.04);
  --shadow-md: 0 10px 28px -6px rgba(34, 26, 21, 0.08);
  --shadow-lg: 0 20px 44px -12px rgba(34, 26, 21, 0.14);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-display: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
  --bg: #15110E;
  --bg-elevated: #1E1815;
  --bg-subtle: #28211C;
  --bg-hover: #2E2620;
  --text: #F5EFE7;
  --text-muted: #A99B8E;
  --text-soft: #7E7065;
  --border: #312822;
  --border-strong: #43372F;

  --brand: #DA8B54;
  --brand-hover: #E59B67;
  --brand-soft: rgba(218, 139, 84, 0.16);
  --brand-text: #1A130F;

  --sage: #55B380;
  --sage-soft: rgba(85, 179, 128, 0.15);

  --amber: #E4A84B;
  --amber-soft: rgba(228, 168, 75, 0.16);

  --danger: #E56B60;
  --danger-soft: rgba(229, 107, 96, 0.16);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 50px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }

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

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 15% 15%, var(--brand-soft), transparent 45%),
    radial-gradient(circle at 85% 85%, var(--sage-soft), transparent 45%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: #2C211B;
  color: #F7F4EE;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(44, 33, 27, 0.22);
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.staff-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 9px;
  border-radius: 15px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  text-align: left;
  min-width: 0;
  transition: border-color 0.18s ease, transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.staff-pick:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.staff-pick.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.staff-pick-info { min-width: 0; flex: 1; }
.staff-pick-name {
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staff-pick-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 16px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-dot.filled {
  background: var(--brand);
  border-color: var(--brand);
  transform: scale(1.18);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pin-key {
  height: 46px;
  border-radius: 13px;
  background: var(--bg-subtle);
  font-size: 1.05rem;
  font-weight: 700;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.pin-key:hover { background: var(--border); }
.pin-key:active { transform: scale(0.94); }
.pin-key.action { font-size: 0.85rem; color: var(--text-muted); }

.pin-error {
  text-align: center;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 18px;
  margin-top: 8px;
}

/* ============================================================
   APP SHELL LAYOUT
   ============================================================ */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 78px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topbar-brand-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.topbar-logo {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.topbar-title {
  font-size: 1rem;
  white-space: nowrap;
}

.live-pill-text {
  display: none;
}

.btn-add-text {
  display: none;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--sage-soft);
  color: var(--sage);
}

.live-pill.local {
  background: var(--amber-soft);
  color: var(--amber);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.icon-btn:hover { background: var(--bg-hover); }
.icon-btn:active { transform: scale(0.94); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 11px;
  background: var(--brand);
  color: var(--brand-text);
  font-weight: 700;
  font-size: 0.84rem;
  box-shadow: 0 6px 16px rgba(168, 93, 47, 0.24);
  transition: background-color 0.15s ease, transform 0.14s ease, box-shadow 0.15s ease;
}

.topbar-add-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1.05rem;
}

.btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.96); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.82rem;
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-danger-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
  font-size: 0.78rem;
  transition: opacity 0.15s ease;
}
.btn-danger-soft:hover { opacity: 0.85; }

/* Desktop Nav Bar inside Header */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-item.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.badge-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Main Container */
.main-wrap {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 14px 12px 24px;
}

/* ============================================================
   HERO SUMMARY CARD
   ============================================================ */
.hero-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 14px;
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.progress-ring-wrap {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

.progress-ring-wrap svg {
  width: 54px;
  height: 54px;
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--bg-subtle);
  stroke-width: 6;
}

.progress-ring-fg {
  fill: none;
  stroke: var(--sage);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
}

.hero-greeting {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.hero-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.stat-chip {
  padding: 8px 9px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-chip-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-chip-val {
  font-size: 0.9rem;
  font-weight: 800;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   TASKS + DOCKED CHAT GRID
   ============================================================ */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.workspace-grid > * {
  min-width: 0;
  max-width: 100%;
}

/* Filter Strip */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
  min-width: 0;
}

.search-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border-radius: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.pill-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pill-strip::-webkit-scrollbar { display: none; }

.filter-pill {
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.16s ease;
}

.filter-pill:hover { border-color: var(--brand); color: var(--text); }

.filter-pill.active {
  background: var(--brand);
  color: var(--brand-text);
  border-color: var(--brand);
}

/* Category Section */
.cat-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.cat-header {
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-subtle) 55%, var(--bg-elevated));
}

.cat-title-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.cat-title {
  font-size: 0.92rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cat-bar {
  display: none;
  width: 56px;
  height: 6px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  background: var(--sage);
  border-radius: 99px;
  transition: width 0.35s ease;
}

/* Tactile Task Row */
.task-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.16s ease, opacity 0.2s ease;
}

.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--bg-hover); }
.task-row.done { opacity: 0.62; }

.check-btn {
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 9px;
  border: 2px solid var(--border-strong);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.check-btn:hover { border-color: var(--sage); }

.check-btn.checked {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

.check-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.check-btn.checked svg {
  opacity: 1;
  transform: scale(1);
}

.task-body { flex: 1; min-width: 0; cursor: pointer; }

.task-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.task-title {
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 0.18s ease;
}

.task-row.done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.freq-badge {
  font-size: 0.69rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.freq-badge.daily { background: var(--sage-soft); color: var(--sage); }
.freq-badge.weekly12 { background: var(--brand-soft); color: var(--brand); }
.freq-badge.weekly1 { background: var(--amber-soft); color: var(--amber); }
.freq-badge.bimonthly { background: var(--danger-soft); color: var(--danger); }

.urgent-badge {
  font-size: 0.69rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
}

.task-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.task-meta {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--sage);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.task-mini-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.task-mini-btn:hover { background: var(--bg-subtle); color: var(--text); }
.task-mini-btn.del:hover { background: var(--danger-soft); color: var(--danger); }

/* ============================================================
   CHAT PANEL
   ============================================================ */
.chat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-dock {
  display: none;
  position: sticky;
  top: 78px;
  height: calc(100vh - 210px);
  max-height: 620px;
  min-height: 390px;
}

.chat-full {
  height: calc(100dvh - 154px);
  min-height: 360px;
}

.chat-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.msg-wrap {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.msg-wrap.mine { align-self: flex-end; align-items: flex-end; }
.msg-wrap.other { align-self: flex-start; align-items: flex-start; }

.msg-head {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 3px;
  padding: 0 4px;
  display: flex;
  gap: 6px;
}

.msg-bubble {
  padding: 9px 13px;
  border-radius: 15px;
  font-size: 0.83rem;
  line-height: 1.42;
  word-break: break-word;
}

.msg-wrap.mine .msg-bubble {
  background: var(--brand);
  color: var(--brand-text);
  border-bottom-right-radius: 4px;
}

.msg-wrap.other .msg-bubble {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.quick-chips {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-chip {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.15s ease;
}

.quick-chip:hover { border-color: var(--brand); }

.chat-form {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 10px 13px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  outline: none;
}

.chat-input:focus { border-color: var(--brand); }

/* ============================================================
   CALENDAR VIEW
   ============================================================ */
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.calendar-layout > *, .admin-grid > * {
  min-width: 0;
  max-width: 100%;
}

.panel-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.cal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cal-weekdays, .cal-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-weekdays div {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 4px;
}

.cal-cell {
  min-height: 50px;
  padding: 5px 4px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  min-width: 0;
  transition: border-color 0.15s ease, transform 0.12s ease, background-color 0.15s ease;
}

.cal-cell:hover { border-color: var(--brand); transform: translateY(-1px); }
.cal-cell.today { border-color: var(--sage); background: var(--sage-soft); }
.cal-cell.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cal-cell.empty { border-color: transparent; background: transparent; pointer-events: none; }

.cal-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* ============================================================
   ADMIN & TEAM PANEL
   ============================================================ */
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 15px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.form-group { margin-bottom: 12px; }
.form-label {
  display: block;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  outline: none;
}
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ============================================================
   MOBILE BOTTOM DOCK
   ============================================================ */
.mobile-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 35;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
}

.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.dock-btn.active {
  color: var(--brand);
  background: var(--brand-soft);
}

/* ============================================================
   MODAL & TOASTS
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(18, 13, 10, 0.52);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.toast-stack {
  position: fixed;
  top: 74px;
  right: 16px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
  width: calc(100% - 32px);
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 15px;
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toast-item.success { border-left-color: var(--sage); }
.toast-item.danger { border-left-color: var(--danger); }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (min-width: 480px) {
  .form-row-2 { grid-template-columns: 1fr 1fr; }
  .cat-bar { display: block; }
  .live-pill-text { display: inline; }
}

@media (min-width: 640px) {
  .topbar-inner { padding: 12px 16px; gap: 12px; }
  .topbar-logo { width: 38px; height: 38px; border-radius: 12px; }
  .topbar-title { font-size: 1.12rem; }
  .topbar-actions { gap: 8px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
  .topbar-add-btn { width: auto; height: 38px; padding: 0 15px; font-size: 0.84rem; }
  .btn-add-text { display: inline; }
  .main-wrap { padding: 18px 16px 28px; }
  .hero-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 18px 20px; gap: 16px; margin-bottom: 18px; }
  .hero-left { gap: 16px; }
  .progress-ring-wrap, .progress-ring-wrap svg { width: 64px; height: 64px; }
  .progress-ring-text { font-size: 0.85rem; }
  .hero-greeting { font-size: 1.2rem; }
  .hero-stats { width: auto; min-width: 310px; gap: 10px; }
  .stat-chip { padding: 8px 13px; }
  .task-row { padding: 13px 16px; gap: 13px; }
  .panel-card { padding: 18px; }
  .cal-weekdays, .cal-days { gap: 6px; }
  .cal-cell { min-height: 76px; padding: 7px; border-radius: 13px; }
  .cal-dot { width: 7px; height: 7px; }
  .modal-backdrop { align-items: center; }
  .chat-full { height: calc(100vh - 150px); }
}

@media (min-width: 960px) {
  .app-shell { padding-bottom: 24px; }
  .desktop-nav { display: inline-flex; }
  .mobile-dock { display: none; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 360px; }
  .chat-dock { display: flex; }
  .calendar-layout { grid-template-columns: minmax(0, 1fr) 350px; }
  .admin-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
