/*
 * Nurse Notes — application styles
 */

:root {
  --lilac-bg: #ede7f6;
  --lilac-dark: #d1c4e9;
  --text: #1a1a2e;
  --border: #b39ddb;
}

* {
  box-sizing: border-box;
}

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

a {
  color: #5e35b1;
}

a:hover {
  color: #4527a0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* Admin pages */

.admin-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.admin-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

.admin-subtitle {
  margin: 0 0 1.5rem;
  color: #4a4a6a;
}

.admin-actions {
  margin-bottom: 1.5rem;
}

.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #7e57c2;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
}

.button:hover {
  background: #673ab7;
  color: #fff;
}

.devices-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.devices-table th,
.devices-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--lilac-dark);
}

.devices-table th {
  background: var(--lilac-dark);
  font-weight: 600;
}

.devices-table tr:last-child td {
  border-bottom: none;
}

.empty-state {
  color: #4a4a6a;
}

/* Device form */

.device-form {
  max-width: 480px;
  background: #fff;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.form-field {
  margin-bottom: 1.25rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.form-field input[type="text"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}

.form-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #4a4a6a;
}

.form-actions {
  margin-top: 1.5rem;
}

.form-errors {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #ffebee;
  border-radius: 4px;
  color: #b71c1c;
}

.form-errors h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.form-errors ul {
  margin: 0;
  padding-left: 1.25rem;
}

.flash {
  max-width: 960px;
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  border-radius: 4px;
}

.flash-notice {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

/* Public serial monitor */

.serial-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--lilac-bg);
}

.serial-header {
  padding: 1rem 1.5rem;
  background: var(--lilac-dark);
  border-bottom: 1px solid var(--border);
}

.serial-device-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.serial-status {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: #4a4a6a;
}

.serial-live-indicator {
  margin-left: 0.75rem;
  color: #2e7d32;
  font-weight: 600;
}

.serial-output {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  background: #faf8ff;
}

.serial-line {
  margin: 0;
  padding: 0;
}

.serial-line.colour-default { color: #000; }
.serial-line.colour-red     { color: #c62828; }
.serial-line.colour-green   { color: #2e7d32; }
.serial-line.colour-yellow  { color: #f9a825; }
.serial-line.colour-blue    { color: #1565c0; }
.serial-line.colour-magenta { color: #ad1457; }
.serial-line.colour-cyan    { color: #00838f; }
.serial-line.colour-grey    { color: #616161; }
