:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --border: #d8e0ea;
  --text: #142033;
  --muted: #5e6b7a;
  --primary: #1f5faa;
  --primary-dark: #16457d;
  --accent: #dce8f8;
  --success-bg: #edf9f0;
  --success-text: #17633a;
  --error-bg: #fff1f0;
  --error-text: #a12a1f;
  --warning-bg: #fff8e8;
  --warning-text: #8c5a00;
  --shadow: 0 10px 30px rgba(20, 32, 51, 0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(31,95,170,.08), transparent 22%),
    var(--bg);
  color: var(--text);
}
img { max-width: 100%; height: auto; }
a { color: inherit; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 14px 40px;
}

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

.hero {
  background: linear-gradient(135deg, rgba(31,95,170,.08), rgba(255,255,255,1) 55%);
}

.hero-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-wrap {
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

.logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 4.2vw, 2.1rem);
  line-height: 1.08;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.section-head h2,
.card h2,
.card h3 {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.grid .full { grid-column: 1 / -1; }

label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(31,95,170,.15);
  border-color: var(--primary);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 0;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
}
button:hover,
.button:hover { background: var(--primary-dark); }
button.secondary,
.button.secondary {
  background: #eef3f9;
  color: var(--text);
  border: 1px solid var(--border);
}
button.secondary:hover,
.button.secondary:hover { background: #e5edf7; }
button.danger,
.button.danger { background: #b02a37; color: #fff; }

.note {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
}
.note.success { background: var(--success-bg); color: var(--success-text); }
.note.error { background: var(--error-bg); color: var(--error-text); }
.note.warning { background: var(--warning-bg); color: var(--warning-text); }

.summary-list {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 10px 18px;
}
.summary-list dt {
  font-weight: 700;
  color: var(--muted);
}
.summary-list dd { margin: 0; }

.small {
  color: var(--muted);
  font-size: .96rem;
  line-height: 1.5;
}
.muted-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
th { background: #eff5fc; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef3f9;
  font-size: .92rem;
  font-weight: 700;
}
.badge.warning {
  background: #fff1cf;
  color: #815600;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px,1fr));
  gap: 14px;
}
.stat {
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.stat span { color: var(--muted); }
.stat strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 6px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.overview-card {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 16px;
  padding: 14px;
}
.overview-card h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}
.overview-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.form-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: .92rem;
}

@media (max-width: 760px) {
  .container { padding: 12px 12px 32px; }
  .card { padding: 16px; border-radius: 16px; }
  .hero-head { align-items: flex-start; }
  .logo-wrap { width: 64px; height: 64px; flex-basis: 64px; border-radius: 14px; }
  .grid,
  .summary-list { grid-template-columns: 1fr; }
  .actions > * { flex: 1 1 100%; }
  .section-head { flex-direction: column; }
  .table-wrap.mobile-cards table,
  .table-wrap.mobile-cards thead,
  .table-wrap.mobile-cards tbody,
  .table-wrap.mobile-cards th,
  .table-wrap.mobile-cards td,
  .table-wrap.mobile-cards tr {
    display: block;
    min-width: 0;
  }
  .table-wrap.mobile-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .table-wrap.mobile-cards table { min-width: 0; }
  .table-wrap.mobile-cards tr {
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(20,32,51,.03);
  }
  .table-wrap.mobile-cards td {
    border: 0;
    border-bottom: 1px solid #eef2f7;
    padding: 10px 12px 10px 44%;
    position: relative;
    min-height: 48px;
  }
  .table-wrap.mobile-cards td:last-child { border-bottom: 0; }
  .table-wrap.mobile-cards td::before {
    content: attr(data-label);
    position: absolute;
    left: 12px;
    top: 10px;
    width: calc(44% - 18px);
    font-weight: 700;
    color: var(--muted);
  }
}
