:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --bg-page: #f8fafc;
  --bg-sidebar: #0f172a;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  
  --primary: #f43f5e;
  --primary-hover: #e11d48;
  --primary-subtle: #fff1f2;
  --primary-border: #fecdd3;
  
  --sidebar-active: #881337;
  --sidebar-active-text: #ffffff;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  
  --border-card: #e2e8f0;
  --border-light: #f1f5f9;
  
  --success: #16a34a;
  --success-bg: #dcfce7;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* APP 3-COLUMN LAYOUT */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* -------------------------------------------------------------
   LEFT SIDEBAR
   ------------------------------------------------------------- */
.sidebar {
  width: 240px;
  background-color: var(--bg-sidebar);
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #f43f5e, #be123c);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.4);
  margin-bottom: 12px;
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #f43f5e;
}

.brand-info h2 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.brand-info p {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.sidebar-nav {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  background-color: var(--sidebar-active);
  color: var(--sidebar-active-text);
  box-shadow: 0 2px 8px rgba(136, 19, 55, 0.4);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.active-voice-card {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
}

.av-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.av-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.av-badge {
  font-size: 11px;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.av-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin: 6px 0 10px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.av-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.bal-label {
  font-size: 11px;
  color: #94a3b8;
}

.bal-value {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  font-family: var(--font-mono);
}

/* -------------------------------------------------------------
   MAIN CONTENT AREA
   ------------------------------------------------------------- */
.main-content {
  flex-grow: 1;
  padding: 32px 36px;
  max-width: 980px;
}

.content-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-header {
  margin-bottom: 4px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.6px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* SELECTED VOICE BANNER */
.selected-voice-banner {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.sv-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sv-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid var(--primary-border);
}

.sv-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.6px;
}

.sv-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 2px 0 1px 0;
}

.sv-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.ready-badge {
  background-color: var(--success-bg);
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* SECTION CARDS */
.section-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

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

.sh-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.sh-hint {
  font-size: 13px;
  color: var(--text-subtle);
}

/* TOOLBAR & TABS */
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.library-tabs {
  display: flex;
  gap: 6px;
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
}

.lib-tab {
  border: none;
  background: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.lib-tab:hover {
  color: var(--text-main);
}

.lib-tab.active {
  background-color: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tab-count {
  background-color: #fee2e2;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.search-box {
  position: relative;
  width: 240px;
}

.search-box input {
  width: 100%;
  padding: 8px 32px 8px 34px;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  font-size: 13px;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px;
  display: none;
}

/* FILTERS ROW */
.filters-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 110px;
}

.filter-col label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.filter-col select {
  padding: 7px 10px;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-main);
  background-color: #ffffff;
  outline: none;
  cursor: pointer;
}

.reset-col {
  flex: 0 0 auto;
  min-width: auto;
}

.btn-reset {
  padding: 7px 14px;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  background-color: #ffffff;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-reset:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.catalogue-statusbar {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

/* VOICE CARDS GRID */
.voice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
}

/* Custom Scrollbar */
.voice-grid::-webkit-scrollbar {
  width: 6px;
}
.voice-grid::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}

.voice-card {
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 14px 16px;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.15s ease;
  position: relative;
}

.voice-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.voice-card.selected {
  border: 2px solid var(--primary);
  background-color: var(--primary-subtle);
}

.vc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.vc-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vc-fav-btn {
  border: none;
  background: none;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
  transition: color 0.15s ease;
}

.vc-fav-btn:hover, .vc-fav-btn.active {
  color: var(--primary);
}

.vc-tags {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vc-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.btn-preview {
  border: 1px solid var(--border-card);
  background-color: #ffffff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-preview:hover {
  background-color: #f8fafc;
}

.btn-preview.playing {
  background-color: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary-border);
}

.btn-select-voice {
  border: 1px solid var(--border-card);
  background-color: #ffffff;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-select-voice:hover {
  background-color: #f1f5f9;
}

.voice-card.selected .btn-select-voice {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* CUSTOM CLONE PANEL */
.custom-clone-panel {
  padding: 30px 20px;
  text-align: center;
}

.uploader-box {
  max-width: 480px;
  margin: 0 auto;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 28px 24px;
}

.uploader-icon {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 12px;
}

.upload-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.upload-inputs input[type="text"] {
  padding: 10px;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  font-size: 14px;
}

.btn-primary {
  padding: 10px 16px;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

/* -------------------------------------------------------------
   SCRIPT SECTION & TIMESTAMP SYNC
   ------------------------------------------------------------- */
.script-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.script-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
}

.mode-tab {
  border: none;
  background: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.mode-tab.active {
  background-color: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.counts-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* TIMESTAMP OPTIONS PANEL */
.timestamp-options-panel {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 8px;
}

.to-header {
  margin-bottom: 12px;
}

.to-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.to-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.to-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.to-option label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  display: block;
  margin-bottom: 6px;
}

.radio-pill-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px 10px;
  background-color: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 6px;
}

.radio-pill input[type="radio"] {
  accent-color: var(--primary);
}

/* SCRIPT INPUT */
.script-input-wrap textarea {
  width: 100%;
  min-height: 180px;
  padding: 16px;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s ease;
}

.script-input-wrap textarea:focus {
  border-color: var(--primary);
}

.script-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.script-helper-note {
  font-size: 12px;
  color: var(--text-subtle);
}

.generate-action-row {
  display: flex;
  justify-content: flex-start;
}

.btn-generate {
  background-color: #f43f5e;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.btn-generate:hover {
  background-color: #e11d48;
  transform: translateY(-1px);
}

.btn-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* GENERATION RESULT BOX */
.generation-result {
  margin-top: 18px;
  background-color: #ffffff;
  border: 2px solid var(--primary-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.rh-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rh-left h4 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
}

.rh-left p {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-download {
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-download.primary-dl {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
}

.btn-download.primary-dl:hover {
  background-color: var(--primary-hover);
}

.custom-audio-player audio {
  width: 100%;
  border-radius: 8px;
}

.timestamp-download-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.tdb-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tdb-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-sub-dl {
  background-color: #f1f5f9;
  border: 1px solid var(--border-card);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-sub-dl:hover {
  background-color: #e2e8f0;
}

/* -------------------------------------------------------------
   RIGHT SIDEBAR (COMMUNITY & CONNECT)
   ------------------------------------------------------------- */
.right-sidebar {
  width: 290px;
  padding: 32px 24px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.community-card, .connect-card {
  background-color: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.comm-tag {
  font-size: 10px;
  font-weight: 800;
  color: #ef4444;
  letter-spacing: 0.6px;
}

.comm-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin: 6px 0 8px 0;
}

.comm-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.whatsapp-banner {
  background-color: #042f2e;
  border-radius: 12px;
  padding: 16px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #2dd4bf;
}

.wa-icon {
  font-size: 18px;
  color: #2dd4bf;
}

.wa-sub {
  font-size: 11px;
  color: #99f6e4;
  line-height: 1.4;
}

.btn-whatsapp {
  background-color: #f43f5e;
  color: #ffffff;
  text-decoration: none;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.wa-free-badge {
  font-size: 10px;
  color: #5eead4;
  text-align: center;
}

.connect-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}

.connect-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.connect-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-main);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.connect-link:hover {
  background-color: #f8fafc;
  border-color: var(--border-light);
}

.cl-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.cl-icon.yt { background-color: #fee2e2; color: #ef4444; }
.cl-icon.fb { background-color: #dbeafe; color: #2563eb; }
.cl-icon.tt { background-color: #f1f5f9; color: #0f172a; }

.cl-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.cl-name {
  font-size: 13px;
  font-weight: 700;
}

.cl-handle {
  font-size: 11px;
  color: var(--text-muted);
}

.cl-arrow {
  font-size: 12px;
  color: var(--text-subtle);
}

.connect-footer {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 14px;
  text-align: center;
}

/* TAB VIEWS */
.tab-view {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}
.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.btn-refresh-history {
  padding: 8px 14px;
  background-color: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-refresh-history:hover {
  background-color: #f1f5f9;
}

/* HISTORY CARDS */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.history-empty i {
  font-size: 36px;
  color: #cbd5e1;
  margin-bottom: 12px;
}
.history-card-item {
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 16px 18px;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s ease;
}
.history-card-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}
.hci-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hci-voice {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}
.hci-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.hci-script {
  font-size: 13px;
  color: var(--text-main);
  background-color: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
  line-height: 1.5;
}
.hci-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hci-player audio {
  height: 36px;
}

/* PRICING GRID */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 10px;
}
.pricing-card {
  background-color: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}
.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pricing-card.featured {
  border: 2px solid var(--primary);
  box-shadow: 0 10px 25px -5px rgba(244, 63, 94, 0.2);
}
.featured-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}
.pc-tier {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.pc-price {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  margin: 6px 0;
}
.pc-price span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}
.free-strike {
  font-size: 16px !important;
  color: #ef4444 !important;
  text-decoration: line-through;
  margin-left: 6px;
}
.pc-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.pc-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pc-features li {
  font-size: 13px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pc-features li i.fa-check {
  color: var(--success);
}
.pc-features li.disabled {
  color: #94a3b8;
}
.pc-features li.disabled i.fa-xmark {
  color: #cbd5e1;
}
.btn-pricing {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn-pricing.outline {
  background-color: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-card);
}
.btn-pricing.primary-active {
  background-color: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* SETTINGS GRID */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.settings-card {
  background-color: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.sc-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.engine-status-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.engine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.er-left {
  display: flex;
  flex-direction: column;
}
.er-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.er-detail {
  font-size: 11px;
  color: var(--text-muted);
}
.status-pill.online {
  background-color: var(--success-bg);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-pill.online i {
  font-size: 6px;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sf-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sf-row label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}
.sf-row select {
  padding: 8px 12px;
  border: 1px solid var(--border-card);
  border-radius: 8px;
  font-size: 13px;
  background-color: #ffffff;
  outline: none;
}
.btn-save-settings {
  margin-top: 8px;
  padding: 10px 16px;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.btn-save-settings:hover {
  background-color: var(--primary-hover);
}

/* USER PROFILE CARD (REPLACED BALANCE CARD) */
.user-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.15s ease;
}

.user-profile-card:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.up-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.up-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #be123c);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(244, 63, 94, 0.4);
}

.up-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.up-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.up-badge {
  font-size: 10px;
  font-weight: 700;
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}

.btn-logout {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-logout:hover {
  color: #f43f5e;
  background-color: rgba(244, 63, 94, 0.15);
}

/* -------------------------------------------------------------
   AUTH MODAL (LOGIN & SIGNUP)
   ------------------------------------------------------------- */
.is-authenticated .auth-modal-overlay {
  display: none !important;
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.auth-modal-card {
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 440px;
  padding: 32px 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid #e2e8f0;
}

.auth-brand {
  text-align: center;
}

.auth-brand h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.auth-brand p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.auth-toggle {
  display: flex;
  background-color: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.auth-toggle-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-toggle-btn.active {
  background-color: #ffffff;
  color: var(--text-main);
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrap i {
  position: absolute;
  left: 14px;
  color: var(--text-subtle);
  font-size: 14px;
}

.input-icon-wrap input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--border-card);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-main);
  font-family: var(--font-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.input-icon-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

.auth-error-msg {
  background-color: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
}

.btn-auth-submit {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.btn-auth-submit:hover {
  background: linear-gradient(135deg, #e11d48, #be123c);
  transform: translateY(-1px);
}

.auth-footer-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
  .right-sidebar { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { width: 72px; padding: 16px 8px; }
  .brand-info, .nav-item span, .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .voice-grid { grid-template-columns: repeat(2, 1fr); }
  .to-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; }
  .voice-grid { grid-template-columns: 1fr; }
}
