/* ==============================================================================
   APDE TOOLS WORKSPACE & PORTAL - PREMIUM INSTITUTIONAL STYLESHEET
   ============================================================================== */

:root {
  /* Brand Tokens (Customizable via Theme Lab) */
  --apde-navy: #0A2540;
  --apde-navy-dark: #07131F;
  --apde-navy-light: #133357;
  --apde-gold: #D4AF37;
  --apde-gold-glow: rgba(212, 175, 55, 0.35);
  --apde-gold-light: #FDE68A;
  --apde-blue-accent: #38BDF8;

  /* Surfaces & Glassmorphism */
  --bg-main: #050E18;
  --surface-card: rgba(13, 29, 49, 0.7);
  --surface-card-hover: rgba(19, 42, 70, 0.9);
  --surface-glass: rgba(10, 37, 64, 0.45);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(212, 175, 55, 0.4);

  /* Typography Colors */
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  /* Status Colors */
  --status-online: #10B981;
  --status-warning: #F59E0B;
  --status-danger: #EF4444;

  /* Misc */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.workspace-mode {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==============================================================================
   1. NAVBAR & WORKSPACE TAB BAR
   ============================================================================== */
.apde-navbar {
  height: 60px;
  background: rgba(7, 19, 31, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  z-index: 100;
}

.nav-container {
  max-width: 100%;
  height: 100%;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  padding-right: 0.75rem;
  border-right: 1px solid var(--border-subtle);
}

.brand-logo {
  width: 34px;
  height: 34px;
}

.shield-icon {
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #FFFFFF;
  line-height: 1;
}

.brand-subtitle {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--apde-gold);
}

.domain-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Tabs Bar */
.workspace-tabs-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 0.5rem;
}

.workspace-tabs-container::-webkit-scrollbar {
  display: none;
}

.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.tab-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.tab-item.active {
  background: linear-gradient(135deg, var(--apde-navy) 0%, #153A60 100%);
  border-color: var(--apde-gold);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 10px rgba(212, 175, 55, 0.15);
}

.tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.65rem;
  margin-left: 0.3rem;
  opacity: 0.6;
  transition: var(--transition);
}

.tab-close:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #EF4444;
  opacity: 1;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--apde-gold);
  color: var(--apde-gold);
}

.dev-tools-btn {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--apde-gold);
  color: var(--apde-gold);
}

.role-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(10, 37, 64, 0.5);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.role-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.role-select {
  background: transparent;
  border: none;
  color: var(--apde-gold);
  font-size: 0.78rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.role-select option {
  background: var(--apde-navy-dark);
  color: #fff;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, rgba(10, 37, 64, 0.6) 0%, rgba(19, 51, 87, 0.4) 100%);
  border: 1px solid rgba(212, 175, 55, 0.25);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.avatar-ring {
  position: relative;
  width: 26px;
  height: 26px;
}

.user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid var(--apde-gold);
}

.online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 7px;
  height: 7px;
  background: var(--status-online);
  border-radius: 50%;
  border: 1px solid var(--bg-main);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.user-role {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.sso-chip {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-online);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 700;
}

/* ==============================================================================
   2. WORKSPACE VIEWPORT & EMBEDDED FRAMES
   ============================================================================== */
.workspace-viewport {
  flex: 1;
  height: calc(100vh - 60px);
  position: relative;
  overflow: hidden;
}

.viewport-view {
  width: 100%;
  height: 100%;
  display: none;
  position: absolute;
  inset: 0;
}

.viewport-view.active {
  display: flex;
  flex-direction: column;
}

#view-hub {
  overflow-y: auto;
  padding: 2rem 2rem 4rem;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(10, 37, 64, 0.6) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(212, 175, 55, 0.08) 0%, transparent 45%);
}

#view-embedded-workspace {
  background: #03080F;
}

.app-viewport-toolbar {
  height: 42px;
  background: #07131F;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  flex-shrink: 0;
}

.active-app-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.active-app-icon { font-size: 1.15rem; }
.active-app-name { font-size: 0.9rem; font-weight: 800; color: #FFFFFF; }
.active-app-subdomain {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.sso-status-badge {
  font-size: 0.7rem;
  color: var(--status-online);
  font-weight: 600;
}

.viewport-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tool-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.tool-action-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--apde-gold);
  color: var(--apde-gold);
}

.tool-action-btn.btn-close-app:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #EF4444;
  color: #EF4444;
}

.frames-stage {
  flex: 1;
  display: flex;
  width: 100%;
  height: calc(100% - 42px);
  position: relative;
}

.app-pane {
  flex: 1;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.secondary-pane {
  border-left: 2px solid var(--apde-navy);
}

.secondary-pane-header {
  height: 36px;
  background: #091929;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.75rem;
}

.split-app-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  outline: none;
}

.app-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #FFFFFF;
}

.frame-loader {
  position: absolute;
  inset: 0;
  background: var(--apde-navy-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.frame-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--apde-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==============================================================================
   3. THEME LAB MODAL
   ============================================================================== */
.theme-lab-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.theme-lab-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.theme-lab-panel {
  background: #07131F;
  border: 1.5px solid var(--apde-gold);
  box-shadow: 0 24px 48px rgba(0,0,0,0.7), 0 0 32px var(--apde-gold-glow);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  overflow: hidden;
}

.lab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.lab-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lab-title h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
}

.lab-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.lab-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.color-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.color-control-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.color-control-item label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.color-picker-wrap input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
}

.color-picker-wrap span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #FFFFFF;
}

.lab-presets {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preset-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.preset-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--apde-gold);
  color: var(--apde-gold);
}

.lab-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-reset-theme {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
}

.btn-save-theme {
  background: linear-gradient(135deg, var(--apde-navy) 0%, #154575 100%);
  border: 1px solid var(--apde-gold);
  color: var(--apde-gold);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}

/* ==============================================================================
   4. HERO, CATALOG & MISC (REMAINING STYLES)
   ============================================================================== */
.hero-section {
  text-align: center;
  position: relative;
  padding: 1.5rem 0 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--apde-gold);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.gradient-text {
  background: linear-gradient(135deg, #FFFFFF 30%, var(--apde-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 1.75rem;
}

.search-container {
  max-width: 640px;
  margin: 0 auto 2rem;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(13, 29, 49, 0.85);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 20px rgba(10, 37, 64, 0.5);
  border-radius: var(--radius-lg);
  padding: 0.55rem 1.15rem;
  gap: 0.75rem;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--apde-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2), 0 12px 36px rgba(0, 0, 0, 0.5);
}

.search-icon { color: var(--apde-gold); }

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 0.95rem;
  outline: none;
}

.search-kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.metrics-strip {
  display: inline-flex;
  align-items: center;
  background: rgba(10, 37, 64, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.5rem 1.5rem;
  gap: 1.25rem;
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric-value { font-size: 1.05rem; font-weight: 800; color: #FFFFFF; }
.metric-value.text-success { color: var(--status-online); }
.metric-value.text-gold { color: var(--apde-gold); }

.metric-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.metric-divider { width: 1px; height: 20px; background: var(--border-subtle); }

.category-nav {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(13, 29, 49, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.filter-pill:hover { background: rgba(19, 42, 70, 0.8); color: #FFFFFF; }

.filter-pill.active {
  background: linear-gradient(135deg, var(--apde-navy) 0%, var(--apde-navy-light) 100%);
  border-color: var(--apde-gold);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(10, 37, 64, 0.4), 0 0 12px rgba(212, 175, 55, 0.2);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.tool-card {
  background: var(--surface-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-3px);
  background: var(--surface-card-hover);
  border-color: var(--border-active);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(10, 37, 64, 0.3);
}

.card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.tool-badge-wrap { display: flex; align-items: center; gap: 0.75rem; }

.tool-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: rgba(10, 37, 64, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-meta { display: flex; flex-direction: column; }
.tool-name { font-size: 1.05rem; font-weight: 800; color: #FFFFFF; line-height: 1.2; }
.tool-author { font-size: 0.72rem; color: var(--text-dim); }
.tool-stars {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--apde-gold);
  font-family: var(--font-mono);
}

.tool-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; flex-grow: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.tag-audience {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.12);
  color: var(--apde-blue-accent);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.tag-cat {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.status-indicator { display: flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; color: var(--text-muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status-online); box-shadow: 0 0 6px var(--status-online); }

.btn-launch-embed {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--apde-navy) 0%, #154575 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #FFFFFF;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-launch-embed:hover {
  background: linear-gradient(135deg, #113860 0%, #1D63A8 100%);
  border-color: var(--apde-gold);
  color: var(--apde-gold);
}

.tool-card.restricted { opacity: 0.4; filter: grayscale(0.6); }
.tool-card.restricted .btn-launch-embed { background: rgba(255, 255, 255, 0.05); border-color: transparent; color: var(--text-dim); cursor: not-allowed; pointer-events: none; }

/* Quick tools section */
.quick-tools-section {
  background: rgba(10, 37, 64, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  margin-bottom: 2.5rem;
}

.section-header { text-align: center; margin-bottom: 1.5rem; }
.section-tag { font-size: 0.7rem; font-weight: 800; letter-spacing: 1.5px; color: var(--apde-gold); }
.section-title { font-size: 1.5rem; font-weight: 800; color: #FFFFFF; }
.section-sub { color: var(--text-muted); font-size: 0.85rem; }

.quick-tools-container { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .quick-tools-container { grid-template-columns: 1fr; } }

.quick-tool-card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.card-top { display: flex; align-items: center; gap: 0.85rem; }
.tool-icon-circle { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.bg-purple { background: rgba(168, 85, 247, 0.2); border: 1px solid rgba(168, 85, 247, 0.4); }
.bg-blue { background: rgba(59, 130, 246, 0.2); border: 1px solid rgba(59, 130, 246, 0.4); }
.card-top h3 { font-size: 0.95rem; font-weight: 700; }
.tool-subtitle { font-size: 0.75rem; color: var(--text-muted); }
.widget-body { display: flex; flex-direction: column; gap: 0.75rem; }
.voice-recorder-zone { display: flex; gap: 0.5rem; }
.record-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); color: #FCA5A5; padding: 0.5rem 0.85rem; border-radius: var(--radius-md); font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.record-btn.recording { background: rgba(239, 68, 68, 0.4); border-color: #EF4444; color: #FFFFFF; }
.upload-audio-btn { display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-subtle); color: var(--text-muted); padding: 0.5rem 0.85rem; border-radius: var(--radius-md); font-size: 0.8rem; cursor: pointer; }
.transcription-output-box, .docling-output-box { background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 0.75rem; font-size: 0.8rem; color: var(--text-muted); min-height: 80px; }
.drop-zone { border: 2px dashed rgba(212, 175, 55, 0.35); border-radius: var(--radius-md); padding: 1rem; text-align: center; background: rgba(10, 37, 64, 0.2); cursor: pointer; }
.drop-icon { font-size: 1.35rem; }
.drop-zone p { font-size: 0.82rem; font-weight: 600; }
.drop-hint { font-size: 0.7rem; color: var(--text-dim); }

/* App Drawer */
.app-drawer-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: var(--transition); }
.app-drawer-overlay.open { opacity: 1; pointer-events: auto; }
.app-drawer { background: var(--apde-navy-dark); border: 1.5px solid rgba(212, 175, 55, 0.4); box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), 0 0 32px var(--apde-gold-glow); border-radius: var(--radius-lg); width: 90%; max-width: 640px; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.drawer-title-group { display: flex; align-items: center; gap: 0.65rem; }
.drawer-title-group h3 { font-size: 1.05rem; font-weight: 800; }
.drawer-close { background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.drawer-content { padding: 1.25rem; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.85rem; }
.drawer-app-item { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0.85rem 0.5rem; background: rgba(13, 29, 49, 0.6); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); color: var(--text-main); cursor: pointer; transition: var(--transition); }
.drawer-app-item:hover { background: rgba(19, 42, 70, 0.9); border-color: var(--apde-gold); transform: translateY(-2px); }
.drawer-app-icon { font-size: 1.5rem; margin-bottom: 0.35rem; }
.drawer-app-name { font-size: 0.75rem; font-weight: 700; }

.apde-footer { border-top: 1px solid var(--border-subtle); padding: 2.5rem 1rem 1rem; margin-top: 2rem; }
.footer-container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1.5rem; }
.footer-brand p { font-size: 0.78rem; color: var(--text-dim); max-width: 400px; }
.footer-logo-text { font-size: 1.15rem; font-weight: 900; color: #fff; letter-spacing: 1px; }
.footer-links { display: flex; gap: 2.5rem; }
.footer-col h4 { font-size: 0.8rem; font-weight: 800; color: var(--apde-gold); text-transform: uppercase; margin-bottom: 0.65rem; }
.footer-col a, .footer-col span { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.35rem; text-decoration: none; }
.footer-bottom { text-align: center; font-size: 0.7rem; color: var(--text-dim); border-top: 1px solid rgba(255, 255, 255, 0.05); padding-top: 1rem; }
