* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  margin: 0;
  background: #f6f7f9;
  color: #111827;
}

/* ---------- Top Bar ---------- */

.topbar {
  background: white;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}

.subtitle {
  font-size: 0.85rem;
  color: #6b7280;
}

.topbar-right {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* ---------- Dashboard Grid ---------- */

.dashboard-wrapper {
  padding: 32px;
  display: flex;
  justify-content: center;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1600px;
  width: 100%;
}

/* Break to fewer columns */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.token-display {
  margin-top: 12px;
  background: white;
  padding: 12px;
  border-radius: 15px;
}

.token-section {
  max-width: 1100px;
  margin: 0 auto 16px;
}

/* Token content */
.token-content {
  margin-top: 10px;
  padding: 12px;
  width: 100%;
  max-width: 100%;

  /* Visuals */
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.4;

  /* CRITICAL BEHAVIOR */
  white-space: pre-wrap;
  /* wrap long tokens */
  word-break: break-all;
  /* break JWT safely */
  overflow-y: auto;
  /* vertical scroll */
  overflow-x: hidden;
  /* no horizontal growth */

  /* Size control */
  max-height: 180px;
  /* scroll after this */
  box-sizing: border-box;
}

/* Hide when toggled off */
.token-content.hidden {
  display: none;
}

/* ---------- Cards ---------- */

.card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 190px;
}

.card h2 {
  margin: 0;
  font-size: 1.05rem;
}

/* ---------- Lists ---------- */

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  font-size: 0.9rem;
  padding: 6px 0;
  border-bottom: 1px solid #e5e7eb;
}

.list li:last-child {
  border-bottom: none;
}

/* ---------- Chat Preview ---------- */

.chat-preview {
  background: #f9fafb;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.chat-preview p {
  margin: 6px 0;
}

/* ---------- Metrics ---------- */

.metrics {
  display: flex;
  justify-content: space-between;
  text-align: center;
}

.metrics div {
  flex: 1;
}

.metrics strong {
  font-size: 1.2rem;
  display: block;
}

.metrics span {
  font-size: 0.75rem;
  color: #6b7280;
}

/* ---------- Buttons ---------- */

button {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

button.primary {
  background: #2563eb;
  color: white;
  padding: 8px 12px;
}

button.secondary {
  background: #e5e7eb;
  padding: 8px 12px;
}

button.small {
  align-self: flex-start;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.topbar-right {
  display: flex;
  flex-direction: column;
  /* stack vertically */
  align-items: flex-end;
  /* align to the right */
  gap: 6px;
  /* spacing between rows */
}

.small-text {
  font-size: 0.85rem;
  color: #374151;
}

.small-text.muted {
  color: #6b7280;
  font-size: 0.75rem;
}

.logout-btn {
  margin-top: 4px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted black;
  /* Add dots under the hoverable text */
  cursor: pointer;
}

/* Tooltip text */
.tooltiptext {
  visibility: hidden;
  /* Hidden by default */
  width: 130px;
  background-color: black;
  color: #ffffff;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;
  position: absolute;
  z-index: 1;
  /* Ensure tooltip is displayed above content */
}

/* Show the tooltip text on hover */
.tooltip:hover .tooltiptext {
  visibility: visible;
}

.google-signin-section {
  display: flex;
  justify-content: center;
  margin-top: 25px;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 10px 16px;
  border-radius: 6px;

  background: white;
  color: #3c4043;

  border: 1px solid #dadce0;
  font-size: 14px;
  font-weight: 500;

  cursor: pointer;
}

.google-btn img {
  width: 32px;
  height: 32px;
}

.google-btn:hover {
  background: #f8f9fa;
}

.google-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  background: white;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.google-btn.connected {
  cursor: default;
}

.google-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.google-logo {
  width: 18px;
  height: 18px;
  margin-left: 6px;
}

.google-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.google-email {
  font-size: 12px;
  color: #5f6368;
  /* Google grey */
  margin-top: 2px;
}

.hidden {
  display: none;
}

.disconnect-btn {
  margin-top: 6px;
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 12px;
  color: #5f6368;
  cursor: pointer;
}

.disconnect-btn:hover {
  color: #202124;
  text-decoration: underline;
}

/* ---------- Calendar ---------- */

.calendar-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 51px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 8px;
}

/* Day headers */
.calendar-grid .day-name {
  font-size: 0.7rem;
  text-align: center;
  color: #6b7280;
  padding-bottom: 4px;
}

/* Day cell */
.calendar-grid .day {
  height: 48px;
  border-radius: 6px;
  font-size: 0.8rem;
  padding: 4px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calendar-grid .day.today {
  border: 1px solid #2563eb;
  background: #eef2ff;
}

.calendar-grid .day.has-event::after {
  content: "";
  width: 6px;
  height: 6px;
  background: #2563eb;
  border-radius: 50%;
  align-self: center;
  margin-bottom: 2px;
}

.calendar-grid .day.empty {
  background: transparent;
}

.calendar-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.calendar-select {
  padding: 8px 8px;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: white;
  justify-content: left;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 20px;
  width: 320px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-actions {
  margin-top: 16px;
  text-align: right;
}

/* ---------- Account Toggle ---------- */

.account-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
}

.account-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2563eb;
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.account-initial {
  font-size: 1rem;
}

.account-panel {
  position: absolute;
  top: 48px;
  right: 0;
  width: 260px;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.15);
}

.account-panel.hidden {
  display: none;
}

.account-header h3 {
  margin: 0;
}

.account-info {
  margin: 12px 0;
}

.account-info div {
  margin-bottom: 6px;
}

.time-row.hidden {
  display: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1rem;
}

.icon-btn.danger {
  color: #dc2626;
}

.date-row {
  margin-top: -3px;
  font-size: 0.95rem;
}

.date-row span {
  margin-right: 6px;
}

.date-time-view {
  /* display: flex; */
  /* gap: 12px; */
  /* margin-top: -3px; */
  font-size: 0.95rem;
  color:#2563eb;
  /* background-color: #5f6368; */
}