/* DVC — Dental Voice Card styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --bg-body: #F9FAFB;
  --bg-card: #FFFFFF;
  --text-main: #111827;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1);
  --radius: 12px;
  --green: #059669;
  --red: #DC2626;
  --orange: #D97706;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 0 16px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all .15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-item:hover { background: #F3F4F6; color: var(--text-main); }
.sidebar-item.active { background: #EFF6FF; color: var(--primary); }

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-email {
  font-size: .8rem;
  color: var(--text-secondary);
}

.sub-pill {
  background: #ECFDF5;
  color: var(--green);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  border: 1px solid #D1FAE5;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}
.btn-icon:hover { background: #F3F4F6; }

/* ── Content ── */
.content { padding: 24px; max-width: 960px; }

/* ── Login ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-body);
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 400px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-card h2 { font-size: 1.25rem; font-weight: 700; }

/* ── Buttons ── */
button { cursor: pointer; border: none; font-family: inherit; transition: all .15s; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: .875rem;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .8rem;
}
.btn-secondary:hover { background: #F3F4F6; }

.btn-danger {
  background: #FEF2F2;
  color: var(--red);
  border: 1px solid #FEE2E2;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .8rem;
}
.btn-danger:hover { background: #FEE2E2; }

.btn-full { width: 100%; padding: 12px; font-size: 1rem; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; text-align: left; width: 100%; }
.form-group label { display: block; margin-bottom: 6px; font-size: .8rem; font-weight: 500; }
.form-group input, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-family: inherit;
  background: #fff;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.error-msg { color: var(--red); font-size: .85rem; min-height: 20px; }

/* ── Upload ── */
.upload-area {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 24px;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary);
  background: #EFF6FF;
}
.upload-area h3 { margin-bottom: 8px; font-size: 1rem; }
.upload-area p { color: var(--text-secondary); font-size: .85rem; }

input[type="file"] { display: none; }

/* ── Jobs table ── */
.table-wrap {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; font-size: .85rem; }

th {
  background: #F9FAFB;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .05em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #F9FAFB; }

.status-queued { color: var(--orange); font-weight: 500; }
.status-processing { color: var(--primary); font-weight: 500; }
.status-done { color: var(--green); font-weight: 500; }
.status-failed { color: var(--red); font-weight: 500; }

/* ── Card view ── */
.card-view {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  white-space: pre-wrap;
  font-size: .85rem;
  line-height: 1.7;
  max-height: 70vh;
  overflow-y: auto;
}

.card-actions { display: flex; gap: 10px; margin-bottom: 16px; }

/* ── Spinner ── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Admin tables ── */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: .9rem;
}

.inline-edit {
  font-size: .85rem;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  width: 100%;
  font-family: inherit;
}
.inline-edit:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}
