:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2fc6f6;
  --primary-dark: #0ea5d7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.readonly-banner {
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: #065f46;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}

.write-banner {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

h1, h2 {
  margin: 0;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  line-height: 1;
}

.stat-small {
  font-size: 16px;
}

.panel-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.stat-success .stat-value { color: var(--success); }
.stat-warning .stat-value { color: var(--warning); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

th {
  background: #f9fafb;
  color: var(--muted);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

.muted {
  color: var(--muted);
}

.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
}

.btn:hover {
  background: #f9fafb;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

.btn-success:disabled,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.inline-form {
  display: flex;
  gap: 8px;
}

input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 140px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-online { background: #dcfce7; color: #166534; }
.badge-away { background: #fef3c7; color: #92400e; }
.badge-offline { background: #e5e7eb; color: #374151; }
.badge-unknown { background: #ede9fe; color: #5b21b6; }
.badge-yes { background: #fee2e2; color: #991b1b; }
.badge-no { background: #ecfdf5; color: #065f46; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-ready { background: #dcfce7; color: #166534; }
.badge-assigned { background: #dbeafe; color: #1d4ed8; }

.auto-assign-status {
  padding: 16px 20px 0;
  font-size: 14px;
}

.auto-assign-status p {
  margin: 0 0 8px;
}

.error-text {
  color: var(--danger);
}

.logs-note {
  padding: 0 20px 12px;
}

.panel-head-secondary {
  border-top: 1px solid var(--border);
}

#equipmentReportTable th,
#equipmentReportTable td {
  text-align: center;
}

#equipmentReportTable th:first-child,
#equipmentReportTable td:first-child {
  text-align: left;
}

.log-row {
  cursor: pointer;
}

.log-row:hover td {
  background: #f9fafb;
}

.table-block-compact {
  padding-top: 0;
}

.table-block-title {
  padding: 12px 20px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.table-expand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px 14px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.table-expand-bar.hidden {
  display: none;
}

.table-count {
  font-size: 12px;
}

.btn-link {
  border: none;
  background: transparent;
  color: var(--primary-dark);
  padding: 0;
  font-size: 13px;
  font-weight: 600;
}

.btn-link:hover {
  background: transparent;
  text-decoration: underline;
}

.reports-toggle-bar {
  border-top: 1px solid var(--border);
  border-bottom: none;
}

.collapsible-section.hidden {
  display: none;
}

.auto-assign-status p {
  margin: 0 0 6px;
}

.evaluation-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.evaluation-details {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  background: #f9fafb;
  font-size: 14px;
}

.evaluation-details ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.hidden {
  display: none;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #111827;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-width: 360px;
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
}
