:root {
  --navy: #0f2f4f;
  --blue: #1f6f9f;
  --light: #f4f8fb;
  --card: #ffffff;
  --border: #d8e3ea;
  --danger: #b42318;
  --success: #027a48;
  --warning: #b54708;
  --text: #1f2937;
  --muted: #667085;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Tahoma", "Arial", sans-serif;
  background: linear-gradient(135deg, #eef7fb 0%, #f9fbfd 45%, #edf6f4 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; font-weight: 800; }
a:hover { text-decoration: underline; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px 16px 50px; }
.page.narrow { max-width: 650px; }

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.nav-links { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.hero {
  background: linear-gradient(135deg, var(--navy), #184f78);
  color: white;
  border-radius: 26px;
  padding: 30px;
  box-shadow: 0 18px 45px rgba(15, 47, 79, 0.18);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  left: -70px;
  top: -80px;
}

.hero h1 { margin: 0; font-size: clamp(32px, 5vw, 56px); letter-spacing: 1px; line-height: 1.15; }
.hero p { margin: 12px 0 0; font-size: 18px; color: #e5eef5; max-width: 850px; }
.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 8px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
  font-size: 14px;
}

.top-banner {
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(15, 47, 79, 0.07);
  overflow: hidden;
  margin-bottom: 18px;
}
.top-banner img { display: block; width: 100%; height: auto; }

.layout { display: grid; grid-template-columns: 1fr; gap: 20px; }
.layout.two { grid-template-columns: 0.9fr 1.1fr; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(15, 47, 79, 0.07);
  overflow: hidden;
}
.card-header { padding: 20px 22px; border-bottom: 1px solid var(--border); background: #fbfdff; }
.card-header h2, .card-header h3 { margin: 0; color: var(--navy); font-size: 22px; }
.card-header p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.card-body { padding: 22px; }

form { padding: 22px; }
.card-body form { padding: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { font-weight: 700; color: var(--navy); font-size: 15px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.required { color: var(--danger); }

input, select, textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #cfdbe4;
  border-radius: 14px;
  font-size: 16px;
  outline: none;
  background: white;
  transition: 0.18s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 111, 159, 0.12); }
textarea { min-height: 100px; resize: vertical; }
.phone-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; direction: ltr; }
.prefix {
  background: #eef5f9;
  border: 1px solid #cfdbe4;
  border-radius: 14px;
  padding: 13px 14px;
  text-align: center;
  font-weight: 800;
  color: var(--navy);
  direction: ltr;
}
.radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-tile {
  flex: 1;
  min-width: 130px;
  border: 1px solid #cfdbe4;
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  background: white;
}
.radio-tile input { width: auto; accent-color: var(--blue); }
.error { display: none; color: var(--danger); font-size: 12px; font-weight: 700; }
.field.invalid input, .field.invalid select { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08); }
.field.invalid .error { display: block; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
button, .button {
  border: none;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
.primary { background: var(--navy); color: white; }
.primary:hover { background: #0b233b; }
.secondary { background: #e9f2f7; color: var(--navy); }
.secondary:hover { background: #dcebf2; }
.danger { background: #fff1f0; color: var(--danger); }
.danger:hover { background: #ffe1de; }
.success-btn { background: #ecfdf3; color: var(--success); }

.message { margin-top: 14px; padding: 12px 14px; border-radius: 14px; font-weight: 700; display: none; }
.message.success { display: block; color: var(--success); background: #ecfdf3; border: 1px solid #abefc6; }
.message.fail { display: block; color: var(--danger); background: #fff1f0; border: 1px solid #fecdca; }
.message.warn { display: block; color: var(--warning); background: #fffaeb; border: 1px solid #fedf89; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(15, 47, 79, 0.06);
}
.stat span { color: var(--muted); font-size: 13px; font-weight: 700; }
.stat strong { display: block; color: var(--navy); font-size: 34px; margin-top: 6px; }

.table-wrap { overflow-x: auto; padding: 0 22px 22px; }
.card-body .table-wrap { padding: 0; }
table { width: 100%; border-collapse: collapse; min-width: 850px; direction: rtl; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: right; font-size: 14px; vertical-align: top; }
th { background: #f5f9fc; color: var(--navy); font-weight: 800; position: sticky; top: 0; }
.counter { color: var(--blue); font-weight: 800; }
.status-pill { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-pill.active { color: var(--success); background: #ecfdf3; border: 1px solid #abefc6; }
.status-pill.disabled { color: var(--danger); background: #fff1f0; border: 1px solid #fecdca; }
.status-pill.role { color: var(--navy); background: #e9f2f7; border: 1px solid #cfdbe4; }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.toolbar .field { min-width: 160px; flex: 1; }
.small-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.small-actions button { padding: 9px 11px; border-radius: 12px; font-size: 13px; }

.footer-note { color: var(--muted); font-size: 13px; margin-top: 14px; line-height: 1.8; }

@media (max-width: 900px) {
  .layout.two, .grid.three, .stats { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 24px; }
  .phone-row { grid-template-columns: 95px 1fr; }
}
.mt-20 { margin-top: 20px; }
