:root {
  /* Sirocco brand palette */
  --bg: #efe9de;
  --card: #fbf9f5;
  --text: #2a211a;
  --muted: #8a7967;
  --border: #ddd2c0;
  --accent: #5b4a3d;
  --accent-dark: #3a2417;
  --danger: #7a2e22;
  --sidebar-bg: #14100d;
  --sidebar-text: #c9bcac;
  --sidebar-active: #5b4a3d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Tahoma", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 20px 0;
}

.sidebar .brand {
  padding: 18px 20px;
  background: #c6bbb3;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 10px;
}

.sidebar .brand img {
  display: block;
  width: 100%;
  height: auto;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-inline-start: 10px;
}

.status-row .status-dot:first-child { margin-inline-start: 0; }

.status-dot.ok { background: #2e7d46; box-shadow: 0 0 0 2px rgba(46,125,70,.15); }
.status-dot.fail { background: #b3413a; box-shadow: 0 0 0 2px rgba(179,65,58,.15); }
.status-dot.off { background: #b8ab9c; box-shadow: 0 0 0 2px rgba(184,171,156,.15); }

.sidebar nav a {
  display: block;
  padding: 12px 20px;
  color: var(--sidebar-text);
  border-right: 3px solid transparent;
}

.sidebar nav a:hover { background: rgba(255,255,255,.05); }

.sidebar nav a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-right-color: var(--sidebar-active);
}

.main { flex: 1; padding: 24px 32px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.topbar h1 { font-size: 20px; margin: 0; }

.user-chip {
  font-size: 13px;
  color: var(--muted);
}

.user-chip a { color: var(--danger); margin-right: 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}

.stat .label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stat .value { font-size: 22px; font-weight: bold; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

th { color: var(--muted); font-weight: 600; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn:hover { background: var(--accent-dark); }

.btn.danger { background: var(--danger); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }

form .field { margin-bottom: 14px; }
form label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }

input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.form-row { display: flex; gap: 14px; }
.form-row .field { flex: 1; }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert.error { background: #fdecea; color: #7a2b25; border: 1px solid #f3c8c4; }
.alert.success { background: #e9f5ee; color: #1e5c3f; border: 1px solid #bfe4cf; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.online { background: #ded0b8; color: #3a2417; }
.badge.physical { background: #f1eee6; color: #6b5a2e; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
}

.login-card {
  background: #fff;
  width: 360px;
  padding: 32px;
  border-radius: 12px;
}

.login-card h1 { text-align: center; margin-bottom: 24px; font-size: 20px; }

.muted { color: var(--muted); font-size: 13px; }
