@font-face {
  font-family: 'Almoni';
  src: url('/static/fonts/almoni-regular-aaa.woff2') format('woff2'),
       url('/static/fonts/almoni-regular-aaa.woff') format('woff');
  font-weight: 400; font-style: normal;
}
@font-face {
  font-family: 'Almoni';
  src: url('/static/fonts/almoni-bold-aaa.woff2') format('woff2'),
       url('/static/fonts/almoni-bold-aaa.woff') format('woff');
  font-weight: 700; font-style: normal;
}
@font-face {
  font-family: 'Almoni';
  src: url('/static/fonts/almoni-ultrabold-aaa.woff2') format('woff2'),
       url('/static/fonts/almoni-ultrabold-aaa.woff') format('woff');
  font-weight: 900; font-style: normal;
}

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

:root {
  --primary: #1E73BE;
  --primary-hover: #0E5A9A;
  --primary-tint: #EBF4FB;
  --danger: #CF2E2E;
  --success: #4CAF50;
  --warning: #FF9800;
  --bg: #F2F2F2;
  --surface: #ffffff;
  --border: #E5E5E5;
  --text: #333333;
  --text-dark: #33373D;
  --text-muted: #71717A;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
}

body {
  font-family: 'Almoni', 'Assistant', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* Nav */
.nav {
  background: var(--surface);
  border-bottom: 2px solid var(--primary);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand img { height: 34px; width: auto; display: block; }
.nav-brand-sub { font-size: 13px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--primary); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--primary-hover); }
.nav-user { color: var(--text-muted); font-size: 14px; }

/* Container */
.container { max-width: 860px; margin: 0 auto; padding: 32px 16px; }

/* Login */
.login-wrap { min-height: calc(100vh - 0px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

/* Fields */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,115,190,0.1); }
.field-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
  resize: vertical;
  min-height: 72px;
}
.field-hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-full { width: 100%; margin-top: 8px; }

/* Alerts */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error   { background: #FFEBEE; border: 1px solid #FFCDD2; color: var(--danger); }
.alert-success { background: #E8F5E9; border: 1px solid #C8E6C9; color: #2E7D32; }
.alert-info    { background: var(--primary-tint); border: 1px solid #90CAED; color: var(--primary); }

/* Page heading */
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; }

/* Upload card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* File input */
.file-input-wrap { position: relative; }
.file-input-wrap input[type="file"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  background: var(--bg);
}

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: right; font-weight: 600; color: var(--text-muted); padding: 10px 12px; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }
.table-link { color: var(--primary); text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 32px; }

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-pending    { background: #FFF3CD; color: #856404; }
.badge-processing { background: var(--primary-tint); color: var(--primary); }
.badge-done       { background: #E8F5E9; color: #2E7D32; }
.badge-failed     { background: #FFEBEE; color: var(--danger); }

/* Call detail */
.call-meta { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.section-title { font-size: 16px; font-weight: 600; margin: 0; border: none; padding: 0; }
.btn-copy {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 10px;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}
.btn-copy:hover { color: var(--primary); border-color: var(--primary); }
.transcript-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  direction: rtl;
  margin-bottom: 28px;
  max-height: 400px;
  overflow-y: auto;
}
.summary-box {
  background: var(--primary-tint);
  border: 1px solid #90CAED;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  direction: rtl;
  margin-bottom: 28px;
}
.summary-box-md {
  white-space: normal;
}
.summary-box-md p { margin-bottom: 10px; }
.summary-box-md p:last-child { margin-bottom: 0; }
.summary-box-md strong { font-weight: 700; }
.summary-box-md ul { padding-right: 20px; padding-left: 0; margin-bottom: 10px; }
.summary-box-md ul:last-child { margin-bottom: 0; }
.summary-box-md li { margin-bottom: 4px; }

/* Processing status */
.processing-msg { text-align: center; padding: 40px; color: var(--text-muted); }
.processing-msg .spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Inline delete button */
.btn-delete-link {
  background: none;
  border: none;
  color: var(--danger);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-delete-link:hover { opacity: .75; }

/* Upload progress bar */
.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .2s ease;
}
.progress-label { font-size: 13px; color: var(--text-muted); text-align: center; }

/* Clickable table rows */
.table-row-link { cursor: pointer; }
.table-row-link:hover td { background: var(--bg); }

/* Call title row (name + rename button) */
.call-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.btn-rename {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.btn-rename:hover { color: var(--primary); }
.rename-input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
}
.rename-input:focus { outline: none; }

/* Export bar */
.export-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.btn-export { font-size: 13px; }

/* Print */
@media print {
  .nav, .export-bar, .btn-copy, p:has(> .btn-secondary) { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .container { max-width: 100%; padding: 16px 0; }
  .transcript-box { max-height: none; overflow: visible; border: none; background: none; padding: 0; }
  .summary-box { border: none; background: none; padding: 0; }
  .section-header { border-bottom: 1px solid #ccc; }
  .page-title { font-size: 16pt; }
  .call-meta { font-size: 10pt; }
}

/* File drop zone */
.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
  color: var(--text-muted);
  font-size: 14px;
}
.file-drop:hover { border-color: var(--primary); background: #eff6ff; color: var(--primary); }
.file-drop-selected { border-color: var(--success); background: #f3faf7; color: var(--success); }
.file-drop-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
