:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #d7deea;
  --text: #223041;
  --muted: #58667a;
  --brand: #006d77;
  --brand-soft: #d6eef0;
  --warn: #a21212;
  --ok: #0c7a34;
  --shadow: 0 14px 34px rgba(18, 41, 73, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, #f8fcff, var(--bg) 45%), linear-gradient(180deg, #eef3fb, #f9fbff);
  min-height: 100%;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  z-index: 0;
  pointer-events: none;
}

.bg-shape-1 {
  width: 260px;
  height: 260px;
  background: rgba(0, 109, 119, 0.09);
  top: -40px;
  right: -50px;
}

.bg-shape-2 {
  width: 220px;
  height: 220px;
  background: rgba(48, 115, 173, 0.1);
  bottom: -40px;
  left: -40px;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 96vw);
  margin: 14px auto;
  background: transparent;
}

.tabs-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tabs {
  margin: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs-row .inline-form {
  margin-left: auto;
}

.tab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 0.92rem;
}

.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.card {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.login-card {
  max-width: 480px;
  margin-inline: auto;
}

h2 {
  margin-top: 0;
}

.alerts {
  margin-top: 10px;
}

.alert {
  border-radius: 10px;
  border: 1px solid;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.alert.success {
  background: #ecfaf0;
  border-color: #9bd4ad;
  color: var(--ok);
}

.alert.danger {
  background: #fff1f1;
  border-color: #e3b3b3;
  color: var(--warn);
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.grid-form.two-col {
  grid-template-columns: 280px 1fr;
  align-items: center;
}

.grid-form.compact {
  margin-top: 14px;
}

label {
  font-weight: 600;
  font-size: 0.92rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  color: var(--text);
  background: #fff;
}

.form-actions {
  width: 100% !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-actions.full {
  grid-column: 1 / -1;
}

.btn {
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
}

.btn-secondary {
  background: #eef5fb;
  color: #173e5f;
  border-color: #cdddeb;
}

.inline-form {
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 10px;
}

.stat {
  border: 1px solid var(--line);
  background: #fcfdff;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat.full {
  grid-column: 1 / -1;
}

.stat span {
  font-size: 0.82rem;
  color: var(--muted);
}

.status {
  display: inline-block;
  margin-left: 6px;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.status.online {
  color: var(--ok);
}

.status.offline {
  color: var(--warn);
}

.payments {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
}

.pay-form {
  border: 1px dashed #b8cad8;
  border-radius: 10px;
  padding: 10px;
}

.pay-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.linked {
  margin-top: 14px;
}

.linked ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

thead th {
  background: var(--brand-soft);
  color: #194146;
  font-size: 0.86rem;
}

th,
td {
  border-bottom: 1px solid #e4e9f2;
  padding: 8px 9px;
  text-align: left;
  font-size: 0.86rem;
}

.empty {
  text-align: center;
  color: var(--muted);
}

.summary {
  font-size: 0.9rem;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 900px) {
  .tabs-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tabs-row .inline-form {
    margin-left: 0;
  }

  .tabs-row .inline-form .btn {
    width: 100%;
  }

  .grid-form.two-col {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .payments {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: 97vw;
    margin: 10px auto;
  }
}
