:root {
  --bg: #f4f6f8;
  --ink: #172033;
  --muted: #687386;
  --panel: #ffffff;
  --line: #dfe5ed;
  --brand: #1769aa;
  --brand-dark: #0f4f82;
  --accent: #0f766e;
  --danger: #b42318;
  --ok: #13795b;
  --shadow: 0 18px 55px rgba(23, 32, 51, .11);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
.hidden { display: none !important; }

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
}

.cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 44px;
  color: white;
  background:
    linear-gradient(rgba(13, 45, 75, .88), rgba(15, 118, 110, .76)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1300' height='900' viewBox='0 0 1300 900'%3E%3Crect width='1300' height='900' fill='%23132f4c'/%3E%3Cg fill='none' stroke='%23f2c078' stroke-width='3' opacity='.38'%3E%3Cpath d='M80 150 H1220'/%3E%3Cpath d='M80 315 H1220'/%3E%3Cpath d='M80 480 H1220'/%3E%3Cpath d='M80 645 H1220'/%3E%3Cpath d='M180 90 V760'/%3E%3Cpath d='M430 90 V760'/%3E%3Cpath d='M680 90 V760'/%3E%3Cpath d='M930 90 V760'/%3E%3C/g%3E%3Cg fill='%23ffffff' opacity='.13'%3E%3Crect x='210' y='210' width='230' height='95' rx='8'/%3E%3Crect x='720' y='390' width='320' height='105' rx='8'/%3E%3Crect x='500' y='600' width='260' height='90' rx='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.brand {
  width: fit-content;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 8px;
  font-weight: 800;
  background: rgba(255,255,255,.12);
}

.cover h1 {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: clamp(38px, 5vw, 66px);
  line-height: 1.03;
  letter-spacing: 0;
}

.cover p {
  max-width: 620px;
  margin: 0;
  color: rgba(255,255,255,.86);
  font-size: 18px;
  line-height: 1.55;
}

.login-card {
  width: min(440px, calc(100% - 36px));
  margin: auto;
  padding: 30px;
  display: grid;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8fb;
}

.tab {
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
  color: #4b5870;
  font-weight: 900;
}

.tab.active {
  background: var(--panel);
  color: var(--brand-dark);
  box-shadow: 0 8px 18px rgba(23, 32, 51, .09);
}

h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

label {
  display: grid;
  gap: 7px;
  color: #3e4a5f;
  font-size: 13px;
  font-weight: 800;
}

input, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #ccd6e3;
  border-radius: 7px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

input:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, .15);
}

.primary, .ghost, .danger {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  padding: 10px 15px;
  font-weight: 900;
}

.primary { background: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-dark); }
.ghost { background: #edf2f7; color: #253149; }
.danger { background: #fff1f0; color: var(--danger); }
.small { min-height: 34px; padding: 7px 10px; font-size: 12px; }

.message {
  min-height: 20px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
}

.app-view { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar strong { display: block; font-size: 18px; }
.topbar span { color: var(--muted); font-size: 13px; }

.admin-panel, .member-panel, .owner-panel {
  width: min(1200px, calc(100% - 32px));
  margin: 24px auto 44px;
  display: grid;
  gap: 18px;
}

.owner-panel {
  margin-bottom: 18px;
}

.owner-panel + .admin-panel {
  margin-top: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stats-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(23, 32, 51, .06);
}

.stat { padding: 18px; }
.stat span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}
.stat strong {
  display: block;
  font-size: 28px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.grid {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(300px, 1fr);
  gap: 18px;
}

.owner-grid {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(300px, 1fr);
  gap: 18px;
  padding: 18px;
}

.toolbar-panel {
  display: flex;
  justify-content: flex-end;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(23, 32, 51, .06);
}

.toolbar-panel label { width: min(100%, 360px); }

.panel {
  padding: 22px;
  display: grid;
  gap: 15px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.wide {
  padding: 0;
  overflow: hidden;
}

.wide h2 { padding: 22px 22px 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 { padding: 0; }
.section-head input { width: min(320px, 100%); }
.table-wrap { overflow-x: auto; }

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

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: #f8fafc;
  color: #536176;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

td:last-child, th:last-child { text-align: right; }

.action-cell {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.uploads { display: grid; gap: 8px; }

.upload-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfd;
  color: var(--muted);
  font-size: 13px;
}

.number-list { display: grid; gap: 10px; }

.section-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-list { display: grid; gap: 10px; }

.admin-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 360px);
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfd;
}

.admin-item strong,
.admin-item span {
  display: block;
  overflow-wrap: anywhere;
}

.admin-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.reset-admin-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 8px;
}

.number-item {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfd;
}

.number-item strong,
.number-item span {
  display: block;
  overflow-wrap: anywhere;
}

.number-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.active {
  color: var(--ok);
  background: #e9f7ef;
}

.status-pill.passive {
  color: #8a4b00;
  background: #fff4df;
}

.muted { color: var(--muted); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 20, 33, .55);
}

.modal-panel {
  width: min(1060px, 100%);
  max-height: min(820px, calc(100vh - 36px));
  overflow: auto;
  background: var(--bg);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-stats div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.mini-stats span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-stats strong {
  font-size: 22px;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .login-view { grid-template-columns: 1fr; }
  .cover { min-height: 380px; padding: 30px; }
  .stats, .stats-four, .grid, .owner-grid, .detail-grid, .inline-form, .admin-item, .reset-admin-form { grid-template-columns: 1fr; }
  .section-head { align-items: stretch; flex-direction: column; }
  .section-head input { width: 100%; }
}

@media (max-width: 560px) {
  .cover { padding: 22px; }
  .cover h1 { font-size: 34px; }
  .login-card { width: calc(100% - 24px); padding: 22px; }
  .topbar { align-items: stretch; flex-direction: column; padding: 16px; }
  .admin-panel, .member-panel, .owner-panel { width: min(100% - 20px, 1200px); }
  .section-inline { align-items: stretch; flex-direction: column; }
  .panel { padding: 18px; }
  .modal { padding: 10px; }
  th, td { padding: 12px; }
}
