/* =========================================
   SUPABASE-STYLE ADMIN UI
   Thiết kế tối giản, chuyên nghiệp
   ========================================= */

/* =========================================
   1. CSS VARIABLES - SUPABASE PALETTE
   ========================================= */
:root {
  /* Supabase Brand Colors */
  --supabase-green: #3ecf8e;
  --supabase-green-hover: #2ea67a;
  --supabase-green-light: rgba(62, 207, 142, 0.1);

  /* Light Mode (Default) */
  --bg-body: #fcfcfc;
  --bg-surface: #ffffff;
  --bg-surface-100: #f8f8f8;
  --bg-surface-200: #f0f0f0;
  --bg-overlay: rgba(0, 0, 0, 0.5);

  --text-primary: #171717;
  --text-secondary: #707070;
  --text-muted: #a0a0a0;

  --border-default: #e0e0e0;
  --border-strong: #c0c0c0;

  /* Semantic Colors */
  --color-success: #3ecf8e;
  --color-error: #f43f5e;
  --color-warning: #f59e0b;
  --color-info: #3b82f6;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.1);

  /* Spacing & Radius (Rounder & More Delicate) */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  /* Typography */
  --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* Icon Sync Style */
.icon,
.icon-green,
.mac-action-btn i,
.mac-btn.icon-only i,
.nav-tab i,
.close-modal,
.btn-close-abs i,
#btnGenReload i,
#btnGenCopy i {
  color: var(--supabase-green) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

/* Nút login mũi tên cần màu tối để nổi trên nền xanh */
.login-arrow i {
  color: #171717 !important;
}

.mac-action-btn.danger i {
  color: var(--color-error) !important;
}

.mac-btn:hover i,
.nav-tab:hover i,
.mac-action-btn:hover i {
  transform: scale(1.15);
}

/* Dark Mode Overrides */
body.dark {
  --bg-body: #121212;
  --bg-surface: #1c1c1c;
  --bg-surface-100: #232323;
  --bg-surface-200: #2a2a2a;
  --bg-overlay: rgba(0, 0, 0, 0.7);

  --text-primary: #fafafa;
  --text-secondary: #aaaaaa;
  --text-muted: #707070;

  --border-default: #2e2e2e;
  --border-strong: #404040;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* =========================================
   2. GLOBAL RESET & BASE
   ========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-stack);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-body);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  transition: background 0.2s, color 0.2s;
}

/* =========================================
   3. WALLPAPER / BACKGROUND
   ========================================= */
.macos-wallpaper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: var(--bg-body);
  transition: background 0.3s;
}

/* Subtle gradient overlay for visual interest */
.macos-wallpaper::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(62, 207, 142, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
}

body.dark .macos-wallpaper::before {
  background:
    radial-gradient(ellipse at 0% 0%, rgba(62, 207, 142, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
}

/* Liquid Mode - kept for backward compatibility */
body.liquid .macos-wallpaper {
  background: linear-gradient(-45deg, #0d1117, #161b22, #1c2128, #21262d);
  background-size: 400% 400%;
  animation: liquidFlow 15s ease infinite;
}

@keyframes liquidFlow {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* =========================================
   4. LOGIN SCREEN
   ========================================= */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.login-glass {
  width: 360px;
  text-align: center;
  background: var(--bg-surface);
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
}

.user-avatar {
  width: 80px;
  height: 80px;
  background: var(--bg-surface-100);
  border: 1px solid var(--border-default);
  border-radius: 50%;
  margin: 0 auto 20px;
  font-size: 36px;
  line-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.password-wrapper {
  position: relative;
  display: flex;
  gap: 8px;
}

.login-arrow {
  background: var(--supabase-green);
  border: none;
  color: #171717;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.login-arrow:hover {
  background: var(--supabase-green-hover);
}

.login-arrow:active {
  transform: scale(0.95);
}

#loginMsg {
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-error);
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   5. MAIN ADMIN PANEL
   ========================================= */
#admin-panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.mac-window {
  width: 100%;
  max-width: 1200px;
  height: calc(100vh - 48px);
  max-height: 800px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s;
}

/* =========================================
   6. SIDEBAR
   ========================================= */
.mac-sidebar {
  width: 260px;
  background: var(--bg-body);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}


.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-tab {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
  position: relative;
}

.nav-tab:hover {
  background: var(--bg-surface-100);
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--supabase-green-light);
  color: var(--supabase-green);
}

.nav-tab.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--supabase-green);
  border-radius: 0 2px 2px 0;
}

.nav-tab .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mac-action-btn {
  background: var(--bg-surface-100);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: var(--text-secondary);
}

.mac-action-btn:hover {
  background: var(--bg-surface-200);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.mac-action-btn.danger:hover {
  background: rgba(244, 63, 94, 0.1);
  border-color: var(--color-error);
  color: var(--color-error);
}

/* =========================================
   7. CONTENT AREA
   ========================================= */
.mac-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
}

.content-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--bg-surface);
}

.content-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.scrollable-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scroll-behavior: smooth;
}

.scrollable-content::-webkit-scrollbar {
  width: 6px;
}

.scrollable-content::-webkit-scrollbar-track {
  background: transparent;
}

.scrollable-content::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}

.scrollable-content::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* =========================================
   8. CARDS
   ========================================= */
.mac-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}

.mac-card:hover {
  border-color: var(--border-strong);
}

.mac-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.mac-card h4 {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 20px;
  margin-bottom: 12px;
}

/* =========================================
   9. FORM ELEMENTS
   ========================================= */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-secondary);
}

.mac-input,
input,
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-surface-100);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.mac-input:focus,
input:focus,
select:focus,
textarea:focus {
  background: var(--bg-surface);
  border-color: var(--supabase-green);
  box-shadow: 0 0 0 3px var(--supabase-green-light);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

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='%23707070' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.select-wrapper {
  position: relative;
}

/* =========================================
   10. BUTTONS
   ========================================= */
.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.mac-btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}

.mac-btn:active {
  transform: scale(0.98);
}

.mac-btn.primary {
  background: var(--supabase-green);
  color: #171717;
}

.mac-btn.primary:hover {
  background: var(--supabase-green-hover);
}

.mac-btn.secondary {
  background: var(--bg-surface-100);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.mac-btn.secondary:hover {
  background: var(--bg-surface-200);
  border-color: var(--border-strong);
}

.mac-btn.small {
  padding: 6px 12px;
  font-size: 13px;
}

.mac-btn.icon-only {
  padding: 8px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-100);
  border: 1px solid var(--border-default);
}

.mac-btn.icon-only:hover {
  background: var(--bg-surface-200);
}

.mac-btn.full-width {
  width: 100%;
}

.form-actions {
  margin-top: 20px;
}

.form-actions.right {
  display: flex;
  justify-content: flex-end;
}

/* =========================================
   11. TAB CONTENT
   ========================================= */
.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
  animation: fadeIn 0.1s ease-out;
}

/* =========================================
   12. TKB (SCHEDULE) SPECIFIC
   ========================================= */
.tkb-controls-mac {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.control-group-mobile {
  display: flex;
  gap: 12px;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-item label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.control-item select {
  min-width: 120px;
}

.tkb-split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.tkb-column h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-default);
}

.tkb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tkb-period-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface-100);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color 0.15s;
}

.tkb-period-row:hover {
  border-color: var(--border-strong);
}

.tkb-period-row label {
  width: 50px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
}

.tkb-period-row select {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
}

/* =========================================
   13. MOBILE BOTTOM NAV
   ========================================= */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  z-index: 1000;
  justify-content: space-around;
}

.mobile-bottom-nav .nav-tab {
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: transparent !important;
  color: var(--text-muted);
  font-size: 10px;
}

.mobile-bottom-nav .nav-tab::before {
  display: none;
}

.mobile-bottom-nav .nav-tab.active {
  color: var(--supabase-green);
  background: transparent !important;
}

.mobile-bottom-nav .icon {
  font-size: 20px;
}

.mobile-bottom-nav .label {
  font-size: 10px;
  font-weight: 600;
}

.mobile-only {
  display: none;
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* =========================================
   14. MODALS
   ========================================= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  width: 90%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.25s ease-out;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 i,
.user-avatar i {
  color: var(--supabase-green);
}


.close-modal {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}

.close-modal:hover {
  background: var(--bg-surface-100);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: flex-end;
}

.confirm-preview {
  margin-bottom: 16px;
}

.confirm-preview label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.preview-box {
  background: var(--bg-surface-100);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 14px;
}

.preview-box.bold {
  font-weight: 600;
}

/* Shortcut Table */
.shortcut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.shortcut-table th,
.shortcut-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}

.shortcut-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.shortcut-table td:first-child {
  font-family: var(--font-mono);
  color: var(--supabase-green);
}

/* =========================================
   15. TOAST NOTIFICATIONS
   ========================================= */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateX(calc(100% + 40px));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 4000;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 3px solid var(--color-success);
}

.toast.error {
  border-left: 3px solid var(--color-error);
}

/* =========================================
   16. DATA VIEWER
   ========================================= */
.code-block-wrapper {
  margin-top: 16px;
}

.data-viewer {
  background: var(--bg-surface-100);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* =========================================
   17. PWA POPUPS
   ========================================= */
.popup-overlay,
.popup-guide {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}

.popup-overlay.active,
.popup-guide.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.selector-card,
.guide-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-overlay.active .selector-card,
.popup-guide.open .guide-card {
  transform: scale(1) translateY(0);
}

.selector-header {
  padding: 24px 20px 16px;
  text-align: center;
  position: relative;
}

.selector-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.selector-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.btn-close-abs {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: var(--bg-surface-100);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
}

.btn-close-abs:hover {
  background: var(--bg-surface-200);
  color: var(--text-primary);
}

.platform-options {
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.platform-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.platform-option.android {
  background: rgba(62, 207, 142, 0.08);
  color: var(--supabase-green);
}

.platform-option.android:hover {
  background: rgba(62, 207, 142, 0.15);
  border-color: var(--supabase-green);
}

.platform-option.ios {
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-info);
}

.platform-option.ios:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-info);
}

.plat-icon {
  font-size: 24px;
}

.plat-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.plat-text b {
  font-size: 14px;
  margin-bottom: 2px;
}

.plat-text span {
  font-size: 12px;
  opacity: 0.8;
}

/* iOS Guide */
.guide-card.ios-mode {
  max-width: 380px;
}

.guide-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-default);
}

.guide-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.guide-body {
  padding: 20px;
}

.ios-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  background: var(--bg-surface-100);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.step-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--supabase-green);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.step-info b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.btn-text-only {
  background: none;
  border: none;
  color: var(--supabase-green);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
}

.btn-text-only:hover {
  text-decoration: underline;
}

/* =========================================
   18. APP BANNER
   ========================================= */
.app-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  width: 90%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
  opacity: 0;
  pointer-events: none;
}

.app-banner.open {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon-small {
  width: 44px;
  height: 44px;
  background: var(--supabase-green);
  color: #171717;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.banner-text {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-primary);
}

.banner-text strong {
  font-weight: 600;
}

.banner-actions {
  display: flex;
  gap: 8px;
}

.btn-install {
  flex: 1;
  border: none;
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-install.android {
  background: var(--supabase-green-light);
  color: var(--supabase-green);
}

.btn-install.android:hover {
  background: rgba(62, 207, 142, 0.2);
}

.btn-install.ios {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-info);
}

.btn-install.ios:hover {
  background: rgba(59, 130, 246, 0.2);
}

/* =========================================
   19. RESPONSIVE - MOBILE
   ========================================= */
@media (max-width: 768px) {
  body {
    overflow: auto;
  }

  #admin-panel {
    position: relative;
    inset: auto;
    padding: 0;
    display: block;
    padding-bottom: 80px;
  }

  .mac-window {
    width: 100%;
    height: auto;
    min-height: 100vh;
    max-height: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .mac-sidebar,
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: inline-flex;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .content-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    padding: 16px 20px;
  }

  .content-header h1 {
    font-size: 18px;
  }

  .scrollable-content {
    padding: 16px;
    overflow: visible;
  }

  .mac-card {
    padding: 20px;
    margin-bottom: 16px;
  }

  .tkb-split-view {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .tkb-period-row {
    padding: 8px 10px;
    gap: 8px;
  }

  .tkb-period-row label {
    width: 40px;
    font-size: 12px;
  }

  .tkb-period-row select {
    padding: 6px 10px;
    font-size: 12px;
  }

  .tkb-controls-mac {
    flex-direction: column;
    gap: 12px;
  }

  .control-group-mobile {
    width: 100%;
  }

  .control-item {
    flex: 1;
  }

  .full-width-mobile {
    width: 100%;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group .mac-btn {
    width: 100%;
  }
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

/* =========================================
   20. UTILITY CLASSES
   ========================================= */
.auto-expand {
  resize: vertical;
}

pre {
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
}