:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-dark: #0b5c56;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --success: #047857;
  --success-bg: #ecfdf5;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--primary);
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header h1 {
  font-size: 18px;
  margin: 0;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

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

.field label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

input[type="date"],
input[type="email"],
input[type="password"],
input[type="search"],
select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  min-width: 0;
}

select {
  width: 100%;
}

input[type="search"] {
  min-width: 240px;
}

button {
  font: inherit;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

button:hover {
  background: #eef2f7;
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

button.primary:hover {
  background: var(--primary-dark);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spacer {
  flex: 1;
}

.status-line {
  color: var(--muted);
  font-size: 14px;
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.alert.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.section-title {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 28px 0 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.slot {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
}

.slot:first-of-type {
  border-top: none;
}

.slot-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  min-width: 68px;
}

.slot-doctor {
  flex: 1;
  min-width: 0;
}

.slot-doctor .name {
  font-weight: 600;
}

.slot-doctor .phone {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #eef2f7;
  color: var(--primary);
  text-decoration: none;
  flex: none;
}

.icon-btn:hover {
  background: #dbe4ee;
}

.icon-btn.wa {
  background: #25d366;
  color: #fff;
}

.icon-btn.wa:hover {
  background: #1eb955;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
}

.editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
}

.editor-row:first-of-type {
  border-top: none;
}

.editor-row .slot-label {
  min-width: 68px;
}

.editor-row select {
  flex: 1;
}

.editor-row.has-error {
  background: var(--danger-bg);
  border-radius: var(--radius);
  padding-left: 8px;
  padding-right: 8px;
}

.editor-row.has-error select {
  border-color: #f87171;
  background: #fff;
}

.login-wrap {
  max-width: 380px;
  margin: 48px auto;
}

.login-wrap .card {
  padding: 24px;
}

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

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}

.center {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}
