/* ===== Auth Pages ===== */
.auth-section {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

.auth-card {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
}

.auth-card h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.auth-desc {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 32px;
}

/* ===== Unified Form Styles ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* All inputs, textarea, select inside forms */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8b9e' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Placeholder styling */
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(139, 139, 158, 0.5);
}

/* Auth-form specific (inherits from above) */
.auth-form .form-group {
  margin-bottom: 20px;
}

.btn-full { width: 100%; }

.btn-sm {
  padding: 6px 16px;
  font-size: 13px;
}

.auth-divider {
  text-align: center;
  margin: 24px 0;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 70px);
  height: 1px;
  background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-divider span {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-card);
  padding: 0 12px;
  position: relative;
}

.oauth-buttons {
  display: flex;
  gap: 12px;
}

.oauth-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.oauth-btn:hover {
  border-color: var(--text-dim);
  opacity: 1;
}

.oauth-icon {
  font-weight: 700;
  font-size: 16px;
}

.oauth-google .oauth-icon {
  background: conic-gradient(from -45deg, #ea4335 110deg, #fbbc05 90deg 180deg, #4285f4 90deg 270deg, #34a853 90deg);
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  font-size: 18px;
}

.auth-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 24px;
}

.auth-footer a {
  margin-left: 4px;
}

/* ===== Dashboard ===== */
.dashboard-section {
  padding: 40px 0 80px;
  min-height: calc(100vh - 200px);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.dashboard-header h2 {
  font-size: 28px;
  font-weight: 800;
}

.dashboard-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

#user-display-name {
  font-size: 14px;
  color: var(--text-dim);
}

.dashboard-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 28px;
}

.tab-btn {
  flex: 1;
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.tab-header h3 {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
}

.team-select {
  max-width: 240px;
  padding: 12px 32px 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8b9e' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.team-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.15);
}

/* Teams List */
.teams-list, .fragments-list {
  display: grid;
  gap: 12px;
}

.team-card, .fragment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.team-card-info, .fragment-card-info {
  flex: 1;
}

.team-card-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.team-card-desc {
  font-size: 13px;
  color: var(--text-dim);
}

.team-card-role {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
}

.fragment-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.fragment-card-command {
  font-size: 13px;
  color: var(--accent);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
  white-space: pre-wrap;
  word-break: break-all;
}

.fragment-card-category {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.fragment-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.fragment-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 14px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 440px;
}

.modal-content h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Auth Nav */
.auth-nav {
  display: flex;
  gap: 8px;
  margin-left: 8px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  animation: toast-in 0.3s ease;
  max-width: 360px;
}

.toast-success {
  background: rgba(110, 231, 183, 0.15);
  border: 1px solid rgba(110, 231, 183, 0.3);
  color: var(--accent);
}

.toast-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Page visibility */
.page { display: none; }
.page.active { display: block; }

/* Responsive */
@media (max-width: 768px) {
  .auth-card { padding: 28px 20px; }
  .dashboard-header { flex-direction: column; gap: 16px; align-items: flex-start; }
  .tab-header { flex-wrap: wrap; }
  .team-select { max-width: 100%; width: 100%; }
  .modal-content { width: 95%; padding: 24px; }
  .modal-content-lg { max-width: 560px; }
  .pricing-grid { grid-template-columns: 1fr; }
}

/* ===== Members Management ===== */
.modal-content-lg {
  max-width: 600px;
}

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

.modal-header h3 {
  margin-bottom: 0;
}

.member-add-form {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
}

.member-add-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.member-add-form input,
.member-add-form select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.member-add-form input:focus,
.member-add-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.15);
}

.members-list {
  max-height: 400px;
  overflow-y: auto;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--bg);
}

.member-info {
  flex: 1;
}

.member-user-id {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.member-joined {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.member-role-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.member-role-badge.admin {
  background: rgba(110, 231, 183, 0.15);
  color: var(--accent);
}

.member-role-badge.editor {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.member-role-badge.viewer {
  background: rgba(139, 139, 158, 0.15);
  color: var(--text-dim);
}

.member-actions {
  display: flex;
  gap: 6px;
}

.member-actions select {
  padding: 4px 24px 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8b9e' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.member-actions select:focus {
  outline: none;
  border-color: var(--accent);
}

.member-remove-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: transparent;
  color: #f87171;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.member-remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}
}

/* ===== Pricing ===== */
.pricing-section {
  padding: 80px 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 28px;
  text-align: center;
  position: relative;
  transition: border-color 0.2s;
}

.pricing-card:hover {
  border-color: var(--accent-border);
}

.pricing-card.featured {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, rgba(110, 231, 183, 0.05) 0%, var(--bg-card) 100%);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #0a0a0f;
  font-size: 12px;
  font-weight: 700;
}

.pricing-name {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 40px;
  font-weight: 800;
  margin-bottom: 4px;
}

.pricing-price .currency {
  font-size: 20px;
  vertical-align: top;
}

.pricing-price .period {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 400;
}

.pricing-desc {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 28px;
}

.pricing-features li {
  font-size: 14px;
  padding: 6px 0;
  padding-left: 24px;
  position: relative;
  color: var(--text-dim);
}

.pricing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.pricing-features li.disabled {
  opacity: 0.4;
}

.pricing-features li.disabled::before {
  content: '–';
  color: var(--text-dim);
}

/* ==================== Admin Panel ==================== */
.admin-msg {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.admin-msg.info { background: #e8f4fd; color: #0b5fa5; border: 1px solid #b3d9f2; }
.admin-msg.error { background: #fde8e8; color: #a50b0b; border: 1px solid #f2b3b3; }
.admin-msg.success { background: #e8fde8; color: #0ba50b; border: 1px solid #b3f2b3; }

.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-table tr:hover { background: rgba(255,255,255,0.02); }

.btn-small {
  padding: 4px 12px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-small:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-small.btn-danger { color: #e74c3c; border-color: #e74c3c; }
.btn-small.btn-danger:hover { background: #e74c3c; color: #fff; }

.btn-primary.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}
.btn-secondary.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 4px;
}
.btn-secondary.btn-sm:hover { background: rgba(255,255,255,0.05); }

.form-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.form-input:focus { border-color: var(--accent); }

.empty-msg {
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
  font-size: 14px;
}

.vault-panel {
  padding: 4px;
}
.vault-section {
  margin-bottom: 20px;
}
.vault-section h4 {
  margin-bottom: 10px;
  font-size: 15px;
  color: var(--text);
}

/* Responsive admin table */
@media (max-width: 768px) {
  .tab-bar { gap: 2px; }
  .tab-btn { padding: 8px 10px; font-size: 12px; }
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 8px 6px; }
  .audit-search { flex-direction: column; }
}
