/* Layout */
:root {
  --arkii-font: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--arkii-font);
  background: #ffffff;
  color: #0d0d0d;
}

html {
  height: 100%;
}

body {
  height: 100%;
  overflow: hidden;
}

.page {
  max-width: 100%;
  margin: 0 auto;
  padding: 14px 24px 16px;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page-header {
  margin-bottom: 14px;
  width: 100%;
}

.page-header .header-content {
  width: 100%;
  min-height: 48px;
  align-items: center;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-spacer {
  flex: 1 1 auto;
  min-width: 12px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
}

.theme-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.theme-toggle-icon svg {
  display: block;
  flex-shrink: 0;
}

.theme-toggle .theme-icon-sun {
  display: none;
}

.theme-toggle .theme-icon-moon {
  display: flex;
}

[data-theme="dark"] .theme-toggle .theme-icon-sun {
  display: flex;
}

[data-theme="dark"] .theme-toggle .theme-icon-moon {
  display: none;
}

.header-logo {
  height: 32px;
  width: auto;
  max-width: 120px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  /* White logo on light background: show as dark silhouette */
  filter: brightness(0);
}

.page-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
  color: #0d0d0d;
}

.page-subtitle {
  margin: 6px 0 0;
  color: #a3a3a3;
  font-size: 0.9rem;
}

.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: var(--arkii-font);
  font-weight: 500;
  color: #0d0d0d;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.user-menu__trigger:hover {
  background: #f5f5f5;
  border-color: #e5e5e5;
}

.user-menu__arrow {
  font-size: 0.65rem;
  color: #737373;
  transition: transform 0.2s ease;
}

.user-menu[data-open="true"] .user-menu__arrow {
  transform: rotate(-180deg);
}

.user-menu__dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 160px;
  padding: 6px 0;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 100;
}

.user-menu__dropdown[hidden] {
  display: none;
}

.user-menu__item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-family: var(--arkii-font);
  color: #0d0d0d;
  text-align: right;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.12s ease;
  box-sizing: border-box;
}

.user-menu__item:hover {
  background: #f5f5f5;
}

.user-menu__item--logout {
  color: #991b1b;
}

.user-menu__item--logout:hover {
  background: #fef2f2;
}

.page-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Dashboard split layout (Drafts + Recordings) */
.dashboard-grid {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.drafts-panel {
  flex: 0 0 33.333%;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.recordings-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.recordings-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #a3a3a3 #e5e5e5;
}

.recordings-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.recordings-scroll::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 0.5rem;
}

.recordings-scroll::-webkit-scrollbar-thumb {
  background: #a3a3a3;
  border-radius: 0.5rem;
  border: 2px solid #f5f5f5;
}

.recordings-scroll::-webkit-scrollbar-thumb:hover {
  background: #737373;
}

.recordings-scroll::-webkit-scrollbar-corner {
  background: #f5f5f5;
  border-radius: 0 0 0.5rem 0;
}

.drafts-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #a3a3a3 #e5e5e5;
}

.drafts-body::-webkit-scrollbar {
  width: 10px;
}

.drafts-body::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 0.5rem;
}

.drafts-body::-webkit-scrollbar-thumb {
  background: #a3a3a3;
  border-radius: 0.5rem;
  border: 2px solid #f5f5f5;
}

.drafts-body::-webkit-scrollbar-thumb:hover {
  background: #737373;
}

.drafts-file-field {
  margin-bottom: 4px;
}

.drafts-file-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drafts-file-control .drafts-dropdown {
  flex: 1 1 auto;
  min-width: 0;
}

.drafts-refresh-btn {
  flex-shrink: 0;
}

.draft-refresh-btn {
  flex-shrink: 0;
  color: #d4d4d4;
  opacity: 0.8;
}

.draft-refresh-btn:hover {
  color: #a3a3a3;
  opacity: 1;
}

[data-theme="dark"] .draft-refresh-btn {
  color: #525252;
  opacity: 0.8;
}

[data-theme="dark"] .draft-refresh-btn:hover {
  color: #737373;
  opacity: 1;
}

.drafts-dropdown {
  border: 1px solid #e5e5e5;
  background: #fcfcfc;
  color: #0d0d0d;
  padding: 8px 36px 8px 10px;
  font-size: 0.85rem;
  border-radius: 0.5rem;
  font-family: var(--arkii-font);
  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='%23a3a3a3' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.drafts-dropdown:hover {
  background-color: #f5f5f5;
  border-color: #e5e5e5;
}

.drafts-dropdown:focus {
  outline: none;
  border-color: #262626;
}

.drafts-dropdown option {
  font-family: var(--arkii-font);
}

.draft-textarea-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 6px;
}

.draft-align-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.draft-align-btn {
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid #e5e5e5;
  background: #fcfcfc;
  color: #a3a3a3;
}

.draft-align-btn:hover {
  background: #f5f5f5;
  border-color: #a3a3a3;
  color: #0d0d0d;
}

.draft-align-btn.is-active {
  background: #262626;
  border-color: #262626;
  color: #ffffff;
}

.draft-align-btn svg {
  display: block;
}

.draft-textarea {
  min-height: 260px;
  resize: none;
  font-family: var(--arkii-font);
  line-height: 1.35;
}

.drafts-editor {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.drafts-editor .field-draft-content {
  margin-top: 8px;
}

.field-draft-content {
  flex: 1 1 auto;
  min-height: 0;
}

.field-draft-content .draft-textarea-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.field-draft-content .draft-textarea {
  flex: 1 1 auto;
  min-height: 0;
}

.draft-textarea {
  flex: 1 1 auto;
  min-height: 180px;
  resize: none;
  scrollbar-width: thin;
  scrollbar-color: #a3a3a3 #e5e5e5;
}

.draft-textarea::-webkit-scrollbar {
  width: 10px;
}

.draft-textarea::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 0.5rem;
}

.draft-textarea::-webkit-scrollbar-thumb {
  background: #a3a3a3;
  border-radius: 0.5rem;
  border: 2px solid #f5f5f5;
}

.draft-textarea::-webkit-scrollbar-thumb:hover {
  background: #737373;
}

.drafts-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #e5e5e5;
}

.drafts-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Card */
.card {
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e5e5e5;
  box-shadow: none;
  padding: 16px 20px 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e5e5;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.draft-actions {
  gap: 4px;
}

.draft-action-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.draft-action-btn .draft-action-icon {
  display: block;
  flex-shrink: 0;
}

.draft-action-btn .draft-enhance-icon {
  width: 22px;
  height: 22px;
}

.draft-bottom-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.recordings-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.recording-action-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recording-action-btn .recording-action-icon {
  display: block;
  flex-shrink: 0;
}

.card-title {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.recordings-total {
  color: #a3a3a3;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
}

.card-description {
  margin: 4px 0 0;
  color: #a3a3a3;
  font-size: 0.85rem;
}

/* Buttons – pills */
.btn {
  border: 1px solid #e5e5e5;
  border-radius: 9999px;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 400;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  font-family: var(--arkii-font);
}

.btn-primary {
  background: #0d0d0d;
  color: #ffffff;
  border-color: #0d0d0d;
  box-shadow: none;
}

.btn-primary:hover {
  background: #262626;
  border-color: #262626;
}

.btn-secondary {
  background: #fafafa;
  color: #0d0d0d;
  border: 1px solid #e5e5e5;
}

.btn-secondary:hover {
  background: #f5f5f5;
  border-color: #a3a3a3;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  padding: 4px 8px;
  color: #0d0d0d;
}

.btn-ghost:hover {
  background: #f5f5f5;
  color: #0d0d0d;
  border-color: #e5e5e5;
}

.btn-danger {
  background: #ffffff;
  color: #262626;
  padding: 4px 8px;
  border: 1px solid #e5e5e5;
}

.btn-danger:hover {
  background: #f5f5f5;
  border-color: #262626;
  color: #0d0d0d;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.icon-button {
  border: 1px solid transparent;
  background: transparent;
  color: #0d0d0d;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
}

.icon-button:hover {
  background: #f5f5f5;
  border-color: #e5e5e5;
  color: #0d0d0d;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #a3a3a3 #e5e5e5;
}

.table-wrapper::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 0.5rem;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: #a3a3a3;
  border-radius: 0.5rem;
  border: 2px solid #f5f5f5;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #737373;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid #e5e5e5;
  font-size: 0.82rem;
}

.pagination-info {
  color: #737373;
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pagination-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: auto;
  padding: 2px 6px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #737373;
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.pagination-btn:hover {
  color: #171717;
  background: #f0f0f0;
}

.pagination-btn--current {
  color: #171717;
  font-weight: 500;
  cursor: default;
  pointer-events: none;
}

.pagination-btn--nav {
  color: #737373;
}

.pagination-ellipsis {
  padding: 0 4px;
  color: #737373;
  font-size: 0.82rem;
}

[data-theme="dark"] .pagination {
  border-top-color: #262626;
}

[data-theme="dark"] .pagination-info {
  color: #a3a3a3;
}

[data-theme="dark"] .pagination-btn {
  background: transparent;
  color: #a3a3a3;
}

[data-theme="dark"] .pagination-btn:hover {
  color: #fafafa;
  background: #404040;
}

[data-theme="dark"] .pagination-btn--current {
  color: #fafafa;
}

[data-theme="dark"] .pagination-ellipsis {
  color: #a3a3a3;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-family: var(--arkii-font);
}

.table thead {
  background: #fcfcfc;
}

.table th,
.table td {
  padding: 8px 8px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid #e5e5e5;
}

.table th {
  font-weight: 600;
  color: #a3a3a3;
  border-bottom: 1px solid #e5e5e5;
}

.sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Prevent default browser link colors (blue/purple) in sortable table headers */
.table th .sort-link,
.table th .sort-link:any-link,
.table th .sort-link:link,
.table th .sort-link:visited,
.table th .sort-link:hover,
.table th .sort-link:active,
.table th .sort-link:focus,
.table th .sort-link:focus-visible {
  color: inherit !important;
  text-decoration: none !important;
}

.sort-link:hover {
  text-decoration: none;
}

.sort-link .sort-indicator {
  font-size: 0.75rem;
  color: #a3a3a3;
  opacity: 0.75;
}

.sort-link.is-active .sort-indicator {
  color: #0d0d0d;
  opacity: 1;
}

.table tbody tr:nth-child(even) {
  background: #fcfcfc;
}

.table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.table tbody tr:hover {
  background: #f5f5f5;
}

.col-transcript {
  max-width: 420px;
}

.col-audio {
  vertical-align: middle;
  min-width: 180px;
  padding-left: 8px;
}

.col-audio .row-audio-wrap {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.col-audio audio.row-audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.col-actions {
  text-align: right;
  width: 170px;
}

.empty-state {
  text-align: center;
  padding: 24px 8px;
  color: #a3a3a3;
}

.inline-form {
  display: inline-block;
  margin-left: 4px;
}

.row-audio-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  position: relative;
}

.row-audio-play {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.row-audio-play:hover {
  background: #f0f0f0;
}

[data-theme="dark"] .row-audio-play:hover {
  background: #404040;
}

.row-audio-progress {
  flex: 1 1 auto;
  min-width: 60px;
  height: 4px;
  margin: 0;
  background: #e5e5e5;
  border-radius: 2px;
  overflow: hidden;
}

.row-audio-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: currentColor;
  border-radius: 2px;
  transition: width 0.15s linear;
}

[data-theme="dark"] .row-audio-progress {
  background: #404040;
}

.transcript-preview {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.muted {
  color: #a3a3a3;
  font-size: 0.78rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.4);
  backdrop-filter: none;
}

.modal-dialog {
  position: relative;
  max-width: 640px;
  width: 100%;
  margin: 0 16px;
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e5e5e5;
  box-shadow: none;
  padding: 12px 12px 10px;
}

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

.modal-title {
  margin: 0;
  font-size: 1rem;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.76rem;
  color: #a3a3a3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field-input {
  border-radius: 0.5rem;
  border: 1px solid #e5e5e5;
  background: #fcfcfc;
  color: #0d0d0d;
  padding: 8px 9px;
  font-size: 0.82rem;
  outline: none;
  resize: vertical;
  font-family: var(--arkii-font);
}

.draft-textarea,
#recording-transcript,
.transcript-preview {
  font-family: var(--arkii-font);
}

.field-input:focus {
  border-color: #262626;
  box-shadow: none;
}

textarea.field-input {
  min-height: 120px;
}

/* Draft textarea: no resize handle (override .field-input) */
.field-draft-content textarea.draft-textarea,
textarea.field-input.draft-textarea {
  resize: none !important;
}

/* Recorder – phone-like experience */
.recorder {
  border-radius: 0.75rem;
  border: 1px solid #e5e5e5;
  background: #fcfcfc;
  padding: 10px 10px 10px;
}

.recorder-time-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rec-timer {
  font-family: var(--arkii-font);
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}

.rec-status {
  font-size: 0.78rem;
}

.rec-main-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.rec-main-button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid #e5e5e5;
  position: relative;
  background: #ffffff;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.rec-main-button:hover {
  border-color: #a3a3a3;
  background: #fafafa;
}

.rec-main-button:active {
  background: #f5f5f5;
}

.rec-main-inner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0d0d0d;
  transition: border-radius 0.15s ease, width 0.15s ease, height 0.15s ease,
    background 0.15s ease;
}

.rec-main-button.is-recording .rec-main-inner {
  border-radius: 50%;
  width: 22px;
  height: 22px;
  background: #262626;
}

.rec-hint {
  font-size: 0.78rem;
}

.audio-preview {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed #e5e5e5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audio-preview audio {
  width: 100%;
}

.audio-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rec-error {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #262626;
}

/* Waveform */
.waveform-container {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e5e5e5;
  width: 100%;
}

.waveform {
  width: 100%;
  min-height: 100px;
  height: 100px;
  background: #f5f5f5;
  border-radius: 0.5rem;
  position: relative;
  margin-bottom: 8px;
  overflow: hidden;
}

.waveform canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.waveform-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crop-handles {
  position: relative;
  width: 100%;
  height: 2px;
  background: #e5e5e5;
  margin: 4px 0;
}

.crop-handle {
  position: absolute;
  top: -7px;
  width: 14px;
  height: 14px;
  background: #0d0d0d;
  cursor: ew-resize;
  border-radius: 50%;
  z-index: 10;
  transition: background 0.15s ease;
}

.crop-handle:hover {
  background: #262626;
}

.crop-handle-start {
  left: 0%;
}

.crop-handle-end {
  right: 0%;
}

.crop-handle-label {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: #262626;
  white-space: nowrap;
  pointer-events: none;
}

.waveform-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  justify-content: center;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
  .page {
    padding-top: 14px;
  }

  .dashboard-grid {
    flex-direction: column;
  }

  .drafts-panel {
    flex: 1 1 auto;
    min-width: 0;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .col-actions {
    width: 140px;
  }

  .modal-dialog {
    margin: 0 10px;
  }
}

/* Night mode (dark theme) */
[data-theme="dark"] html,
[data-theme="dark"] body {
  background: #0d0d0d;
  color: #fafafa;
}

[data-theme="dark"] .page-title {
  color: #fafafa;
}

[data-theme="dark"] .page-subtitle {
  color: #a3a3a3;
}

[data-theme="dark"] .header-logo {
  filter: none;
}

[data-theme="dark"] .theme-toggle {
  color: #a3a3a3;
}

[data-theme="dark"] .theme-toggle:hover {
  background: #262626;
  border-color: #262626;
  color: #fafafa;
}

[data-theme="dark"] .card {
  background: #171717;
  border-color: #262626;
}

[data-theme="dark"] .card-title {
  color: #fafafa;
}

[data-theme="dark"] .card-description {
  color: #a3a3a3;
}

[data-theme="dark"] .card-header {
  border-bottom-color: #262626;
}

[data-theme="dark"] .btn-primary {
  background: #fafafa;
  color: #0d0d0d;
  border-color: #fafafa;
}

[data-theme="dark"] .btn-primary:hover {
  background: #e5e5e5;
  border-color: #e5e5e5;
}

[data-theme="dark"] .btn-ghost {
  color: #fafafa;
}

[data-theme="dark"] .btn-ghost:hover {
  background: #262626;
  color: #fafafa;
  border-color: #262626;
}

[data-theme="dark"] .user-menu__trigger {
  color: #fafafa;
}

[data-theme="dark"] .user-menu__trigger:hover {
  background: #262626;
  border-color: #262626;
}

[data-theme="dark"] .user-menu__arrow {
  color: #a3a3a3;
}

[data-theme="dark"] .user-menu__dropdown {
  background: #171717;
  border-color: #262626;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .user-menu__item {
  color: #fafafa;
}

[data-theme="dark"] .user-menu__item:hover {
  background: #262626;
}

[data-theme="dark"] .user-menu__item--logout {
  color: #fca5a5;
}

[data-theme="dark"] .user-menu__item--logout:hover {
  background: #450a0a;
}

[data-theme="dark"] .btn-danger {
  background: #262626;
  color: #fafafa;
  border-color: #262626;
}

[data-theme="dark"] .btn-danger:hover {
  background: #404040;
  border-color: #404040;
  color: #fafafa;
}

[data-theme="dark"] .icon-button {
  color: #fafafa;
}

[data-theme="dark"] .icon-button:hover {
  background: #262626;
  border-color: #262626;
  color: #fafafa;
}

[data-theme="dark"] .icon-button--circle {
  background: #fafafa;
  border-color: #525252;
  color: #0d0d0d;
}

[data-theme="dark"] .icon-button--circle:hover {
  background: #ffffff;
  border-color: #737373;
  color: #0d0d0d;
}

[data-theme="dark"] .drafts-dropdown,
[data-theme="dark"] .field-input {
  border-color: #262626;
  background: #262626;
  color: #fafafa;
}

[data-theme="dark"] .drafts-dropdown:hover,
[data-theme="dark"] .field-input:hover {
  background: #404040;
  border-color: #404040;
}

[data-theme="dark"] .field-input:focus,
[data-theme="dark"] .drafts-dropdown:focus {
  border-color: #a3a3a3;
}

[data-theme="dark"] .field-label {
  color: #a3a3a3;
}

[data-theme="dark"] .drafts-actions {
  border-top-color: #262626;
}

[data-theme="dark"] .table thead {
  background: #171717;
}

[data-theme="dark"] .table th,
[data-theme="dark"] .table td {
  border-bottom-color: #262626;
}

[data-theme="dark"] .table th {
  color: #a3a3a3;
}

[data-theme="dark"] .table tbody tr:nth-child(even) {
  background: #171717;
}

[data-theme="dark"] .table tbody tr:nth-child(odd) {
  background: #0d0d0d;
}

[data-theme="dark"] .table tbody tr:hover {
  background: #262626;
}

[data-theme="dark"] .sort-link.is-active .sort-indicator {
  color: #fafafa;
}

[data-theme="dark"] .sort-link .sort-indicator {
  color: #a3a3a3;
}

[data-theme="dark"] .empty-state,
[data-theme="dark"] .muted {
  color: #a3a3a3;
}

[data-theme="dark"] .table-wrapper {
  scrollbar-color: #404040 #262626;
}

[data-theme="dark"] .table-wrapper::-webkit-scrollbar-thumb {
  background: #525252;
  border-color: #262626;
}

[data-theme="dark"] .table-wrapper::-webkit-scrollbar-track {
  background: #262626;
}

[data-theme="dark"] .table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #737373;
}

[data-theme="dark"] .table-wrapper::-webkit-scrollbar-corner {
  background: #262626;
  border-radius: 0 0 0.5rem 0;
}

[data-theme="dark"] .recordings-scroll {
  scrollbar-color: #404040 #262626;
}

[data-theme="dark"] .recordings-scroll::-webkit-scrollbar-track {
  background: #262626;
  border-radius: 0.5rem;
}

[data-theme="dark"] .recordings-scroll::-webkit-scrollbar-thumb {
  background: #525252;
  border-radius: 0.5rem;
  border-color: #262626;
}

[data-theme="dark"] .recordings-scroll::-webkit-scrollbar-thumb:hover {
  background: #737373;
}

[data-theme="dark"] .recordings-scroll::-webkit-scrollbar-corner {
  background: #262626;
  border-radius: 0 0 0.5rem 0;
}

[data-theme="dark"] .drafts-body {
  scrollbar-color: #404040 #262626;
}

[data-theme="dark"] .drafts-body::-webkit-scrollbar-track {
  background: #262626;
  border-radius: 0.5rem;
}

[data-theme="dark"] .drafts-body::-webkit-scrollbar-thumb {
  background: #525252;
  border-radius: 0.5rem;
  border-color: #262626;
}

[data-theme="dark"] .drafts-body::-webkit-scrollbar-thumb:hover {
  background: #737373;
}

[data-theme="dark"] .draft-textarea {
  scrollbar-color: #404040 #262626;
}

[data-theme="dark"] .draft-textarea::-webkit-scrollbar-track {
  background: #262626;
  border-radius: 0.5rem;
}

[data-theme="dark"] .draft-textarea::-webkit-scrollbar-thumb {
  background: #525252;
  border-radius: 0.5rem;
  border-color: #262626;
}

[data-theme="dark"] .draft-textarea::-webkit-scrollbar-thumb:hover {
  background: #737373;
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .modal-dialog {
  background: #171717;
  border-color: #262626;
}

[data-theme="dark"] .modal-title {
  color: #fafafa;
}

[data-theme="dark"] .recorder {
  border-color: #262626;
  background: #262626;
}

[data-theme="dark"] .rec-main-button {
  border-color: #404040;
  background: #262626;
}

[data-theme="dark"] .rec-main-button:hover {
  border-color: #a3a3a3;
  background: #404040;
}

[data-theme="dark"] .rec-main-button:active {
  background: #404040;
}

[data-theme="dark"] .rec-main-inner {
  background: #fafafa;
}

[data-theme="dark"] .rec-main-button.is-recording .rec-main-inner {
  background: #a3a3a3;
}

[data-theme="dark"] .audio-preview {
  border-top-color: #404040;
}

[data-theme="dark"] .rec-error {
  color: #a3a3a3;
}

[data-theme="dark"] .waveform {
  background: #262626;
}

/* Live recording bars: invert so light bars on dark in night mode */
[data-theme="dark"] .waveform-container.is-live canvas {
  filter: invert(1);
}

[data-theme="dark"] .waveform-container {
  border-top-color: #404040;
}

[data-theme="dark"] .crop-handles {
  background: #404040;
}

[data-theme="dark"] .crop-handle {
  background: #fafafa;
}

[data-theme="dark"] .crop-handle:hover {
  background: #e5e5e5;
}

[data-theme="dark"] .crop-handle-label {
  color: #fafafa;
}

