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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
}

/* Topbar */
.topbar {
  background: #1a1a2e;
  color: #fff;
  padding: 0 20px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.nav-links a { color: #ccc; text-decoration: none; margin-left: 20px; font-size: 13px; }
.nav-links a:hover { color: #fff; }

.subnav {
  background: #16213e;
  padding: 0 20px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.subnav-label { color: #8892b0; font-size: 13px; }
.subnav a { color: #ccd6f6; text-decoration: none; font-size: 13px; }
.subnav a:hover { color: #fff; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }

/* Page headers */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
h1 { font-size: 22px; margin-bottom: 8px; }
h2 { font-size: 17px; margin: 24px 0 8px; }
.subtitle { color: #666; margin-bottom: 12px; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
th { background: #f0f0f0; text-align: left; padding: 8px 12px; font-size: 12px; text-transform: uppercase; color: #666; }
td { padding: 8px 12px; border-top: 1px solid #eee; }
tr:hover td { background: #fafafa; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.truncate { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: #999; text-align: center; padding: 24px; }
.detail-table { max-width: 600px; }
.detail-table th { width: 120px; }

/* Status badges */
[class*="status-"] { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.status-new, .status-pending { background: #e0e7ff; color: #3730a3; }
.status-running, .status-in_progress { background: #fef3c7; color: #92400e; }
.status-completed, .status-success, .status-called { background: #d1fae5; color: #065f46; }
.status-failed, .status-failure { background: #fee2e2; color: #991b1b; }
.status-voicemail { background: #ede9fe; color: #5b21b6; }
.status-dnc, .status-no_answer { background: #f3f4f6; color: #374151; }
.status-partial { background: #fef3c7; color: #92400e; }

/* Stats */
.stats-row { display: flex; gap: 16px; margin: 16px 0; }
.stat-card { background: #fff; padding: 16px; border-radius: 6px; min-width: 150px; }
.stat-num { font-size: 28px; font-weight: 700; }
.stat-label { color: #666; font-size: 13px; margin-bottom: 4px; }
.stat-card small { color: #888; }

/* Cards */
.card { background: #fff; padding: 16px; border-radius: 6px; margin-bottom: 16px; }
pre { font-size: 13px; overflow-x: auto; }
pre.wrap { white-space: pre-wrap; word-wrap: break-word; }

/* Buttons */
button, .btn { background: #2563eb; color: #fff; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 13px; }
button:hover { background: #1d4ed8; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.action-bar { margin-bottom: 12px; }

/* Filter bar */
.filter-bar { margin-bottom: 12px; display: flex; gap: 8px; }
.filter-bar a { padding: 4px 12px; border-radius: 12px; background: #e5e7eb; color: #333; font-size: 12px; }
.filter-bar a.active { background: #2563eb; color: #fff; }

/* Forms */
form label { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 500; }
form input[type="text"], form input[type="password"], form textarea, form select {
  display: block; width: 100%; margin-top: 4px; padding: 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 13px; font-family: inherit;
}
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.form-actions button:last-child { background: #6b7280; }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form input { margin: 0; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-content { background: #fff; padding: 24px; border-radius: 8px; width: 480px; max-width: 90vw; max-height: 90vh; overflow-y: auto; }

/* Flash */
.flash { padding: 10px 16px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.flash-info { background: #dbeafe; color: #1e40af; }
.flash-error { background: #fee2e2; color: #991b1b; }

/* Transcript */
.transcript { background: #fff; border-radius: 6px; padding: 16px; }
.msg { margin-bottom: 12px; }
.msg-role { display: inline-block; width: 70px; font-size: 11px; text-transform: uppercase; color: #666; font-weight: 600; vertical-align: top; }
.msg-text { display: inline-block; max-width: calc(100% - 80px); }
.msg-user .msg-role { color: #2563eb; }
.msg-assistant .msg-role { color: #059669; }
.msg-tool .msg-role { color: #7c3aed; }
.tool-call { font-family: monospace; font-size: 12px; background: #f3f4f6; padding: 2px 6px; border-radius: 3px; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1a1a2e; }
.login-box { background: #fff; padding: 40px; border-radius: 8px; width: 360px; }
.login-box h1 { text-align: center; margin-bottom: 24px; }
.login-box .error { background: #fee2e2; color: #991b1b; padding: 8px; border-radius: 4px; margin-bottom: 16px; text-align: center; font-size: 13px; }
.login-box button { width: 100%; }

/* Pagination */
.pagination { text-align: center; padding: 12px; }
