/* ============================================
   Formity Sidebar — desktop left rail (240px)
   Navbar height: 52px
   ============================================ */

.formity-sidebar {
  width: 240px;
  min-height: calc(100vh - 52px);
  background: #FAFAF7;
  border-right: 0.5px solid #E8E5DC;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  position: sticky;
  top: 52px;
  flex-shrink: 0;
  align-self: flex-start;
}

.sidebar-header {
  margin-bottom: 24px;
  padding: 0 8px;
}

.sidebar-eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: #185FA5;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.sidebar-title {
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  color: #0a0a0a;
}

.sidebar-tools {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-tool {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: #1a1a1a;
  transition: background 0.15s;
}

.sidebar-tool:hover {
  background: #F1EFE8;
}

.sidebar-tool:focus-visible {
  outline: 2px solid #185FA5;
  outline-offset: 1px;
}

.sidebar-tool-icon {
  flex-shrink: 0;
  color: #5F5E5A;
}

.sidebar-tool-text {
  flex: 1;
  min-width: 0;
}

.sidebar-tool-label {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.3;
}

.sidebar-label-full { display: inline; }
.sidebar-label-short { display: none; }

.sidebar-tool-subtitle {
  font-size: 11px;
  color: #888780;
  margin-top: 1px;
  line-height: 1.3;
}

.sidebar-tool-gated .sidebar-tool-label {
  color: #888780;
}

.sidebar-tool-lock {
  color: #888780;
  flex-shrink: 0;
}

.sidebar-footer {
  border-top: 0.5px solid #E8E5DC;
  padding-top: 16px;
  margin-top: 16px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #E6F1FB;
  color: #185FA5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-email {
  font-size: 12px;
  color: #1a1a1a;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-mode {
  font-size: 10px;
  color: #888780;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 1px;
}

.sidebar-signout {
  width: 100%;
  padding: 8px 12px;
  background: white;
  border: 0.5px solid #B4B2A9;
  border-radius: 6px;
  font-size: 12px;
  color: #1a1a1a;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.sidebar-signout:hover {
  background: #F1EFE8;
}

.sidebar-signin {
  display: block;
  padding: 10px 14px;
  background: #0a0a0a;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  transition: background 0.15s;
}

.sidebar-signin:hover {
  background: #2C2C2A;
}

.sidebar-signin-subtitle {
  font-size: 11px;
  color: #888780;
  text-align: center;
  margin-top: 8px;
}

/* ============================================
   Layout — sidebar + main canvas
   ============================================ */

.formity-layout {
  display: flex;
  align-items: stretch;
}

.formity-main {
  flex: 1;
  min-width: 0;
}

/* ============================================
   Mobile — bottom tab bar (< 768px)
   ============================================ */

@media (max-width: 768px) {
  .formity-layout {
    flex-direction: column;
  }

  .formity-sidebar {
    width: 100%;
    min-height: auto;
    height: 64px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    border-right: none;
    border-top: 0.5px solid #E8E5DC;
    padding: 8px 4px;
    z-index: 100;
    background: white;
    flex-direction: row;
    align-self: auto;
  }

  .sidebar-header,
  .sidebar-footer {
    display: none;
  }

  .sidebar-tools {
    flex-direction: row;
    flex: 1;
    gap: 0;
    justify-content: space-around;
  }

  .sidebar-tool {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    padding: 6px 2px;
    text-align: center;
    border-radius: 6px;
    min-height: 44px;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
  }

  .sidebar-tool-text {
    text-align: center;
    min-width: 0;
    overflow: hidden;
  }

  .sidebar-tool-label {
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-label-full { display: none; }
  .sidebar-label-short { display: inline; }

  .sidebar-tool-subtitle {
    display: none;
  }

  .sidebar-tool-lock {
    position: absolute;
    top: 2px;
    right: 4px;
    width: 10px;
    height: 10px;
  }

  .sidebar-tool-icon {
    width: 18px;
    height: 18px;
  }

  body {
    padding-bottom: 68px;
  }
}
