/* SaaS shell: auth pages, boards dashboard, share modal, presence, conn badge */

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 28px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-card h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: hsl(var(--muted));
  padding: 4px;
  border-radius: 8px;
}

.auth-tab {
  flex: 1;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab.active {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form .input {
  height: 38px;
  font-size: 14px;
}

.auth-form button[type="submit"] {
  margin-top: 4px;
  height: 38px;
  font-size: 14px;
}

.auth-msg {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
}
.auth-msg.error {
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
}
.auth-msg.info {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

/* Boards dashboard */
.boards-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px;
}

.boards-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.boards-head h1 {
  font-size: 22px;
  font-weight: 600;
}

.boards-head .user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

.boards-section {
  margin-bottom: 32px;
}

.boards-section h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 10px;
  font-weight: 600;
}

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

.board-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  text-decoration: none;
  color: hsl(var(--foreground));
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  position: relative;
}
.board-card:hover {
  border-color: hsl(var(--ring) / 0.4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.board-card .b-name {
  font-size: 15px;
  font-weight: 600;
}
.board-card .b-meta {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}
.board-card .b-role {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 999px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  margin-top: 6px;
  align-self: flex-start;
}
.board-card .b-role.owner { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.board-card .b-del {
  position: absolute;
  top: 8px;
  right: 8px;
}

.boards-empty {
  padding: 32px;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
}

.boards-newrow {
  display: flex;
  gap: 8px;
  align-items: center;
}
.boards-newrow .input { flex: 1; max-width: 360px; }

/* Connection badge & presence */
.conn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  width: 24px;
  height: 36px;
  color: hsl(120 60% 45%);
  user-select: none;
}
.conn-badge.offline { color: hsl(0 70% 55%); animation: pulse 1.2s ease-in-out infinite; }
.conn-badge.connecting { color: hsl(35 90% 55%); animation: pulse 1.2s ease-in-out infinite; }
.conn-badge.readonly { color: hsl(var(--muted-foreground)); }

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.presence-strip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}
.presence-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 0 0 2px hsl(var(--background));
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: hsl(var(--card));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  padding: 20px;
  width: 100%;
  max-width: 460px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-head h2 {
  font-size: 16px;
  font-weight: 600;
}

.share-form {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "email email"
    "role  submit";
  gap: 8px;
  margin-bottom: 12px;
}
.share-form .input { height: 36px; min-width: 0; }
.share-form input[type="email"] { grid-area: email; }
.share-form select { grid-area: role; }
.share-form button[type="submit"] { grid-area: submit; }

.share-msg {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.share-msg.error { background: hsl(var(--destructive) / 0.1); color: hsl(var(--destructive)); }
.share-msg.info { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

.share-section {
  margin-top: 16px;
}
.share-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
  font-weight: 600;
}
.share-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.share-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  font-size: 13px;
}
.share-list .email { flex: 1; }
.share-list .role-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 999px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-weight: 600;
}
.share-list .role-pill.owner { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }

.board-title-input {
  font-size: inherit;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-family: inherit;
  height: 32px;
  padding: 2px 8px;
  min-width: 200px;
  max-width: 420px;
}
.b-name-input {
  height: 28px;
  padding: 2px 6px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  width: 100%;
}

body.readonly .gantt-bar,
body.readonly .row-input,
body.readonly .btn-row-del,
body.readonly .avatar-stack,
body.readonly .dep-handle,
body.readonly .gantt-bar-handle,
body.readonly .row-grip,
body.readonly .col-resize {
  pointer-events: none;
}
body.readonly .gantt-bar { cursor: default; }
body.readonly .row-input { background: transparent; cursor: default; }
body.readonly .btn-row-del,
body.readonly .avatar-stack { opacity: 0.4; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: hsl(var(--destructive)); color: hsl(var(--destructive)); }
