*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif; background: #f0fbfa; color: #123b38; min-height: 100vh; }
.hidden { display: none !important; }

/* ===== NAV ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 24px;
  padding: 0 32px; height: 56px;
  background: #006a64; color: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.nav-brand { font-size: 16px; font-weight: 800; white-space: nowrap; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 6px 18px; border-radius: 999px;
  color: rgba(255,255,255,.75); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.18); color: #fff; }
.btn-logout {
  padding: 6px 18px; border-radius: 999px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.28); }

/* ===== LOGIN ===== */
.page-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8f8f7 0%, #f0fbfa 100%);
}
.login-card {
  width: 380px; background: #fff; border-radius: 24px;
  padding: 48px 40px; box-shadow: 0 8px 40px rgba(0,106,100,.12);
  text-align: center;
}
.login-logo { font-size: 32px; font-weight: 900; color: #006a64; }
.login-title { font-size: 20px; font-weight: 700; color: #123b38; margin-top: 6px; }
.login-subtitle { font-size: 13px; color: #78908c; margin-top: 4px; margin-bottom: 32px; }
.login-input {
  width: 100%; height: 48px; border: 1.5px solid #cdecea; border-radius: 12px;
  padding: 0 16px; font-size: 15px; outline: none;
  background: #f8fdfd; transition: border-color .15s;
}
.login-input:focus { border-color: #006a64; }
.login-btn {
  display: block; width: 100%; height: 48px; margin-top: 16px;
  background: #006a64; color: #fff; border: none; border-radius: 999px;
  font-size: 16px; font-weight: 700; cursor: pointer; letter-spacing: 2px;
  transition: opacity .15s;
}
.login-btn:hover { opacity: .88; }
.login-err { margin-top: 12px; color: #e53935; font-size: 13px; }

/* ===== MAIN CONTENT ===== */
#main { max-width: 1100px; margin: 0 auto; padding: 32px 24px 80px; }
.page-header { margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 900; color: #123b38; }
.page-hint { font-size: 13px; color: #78908c; margin-top: 4px; }

/* ===== SCHOOLS GRID ===== */
.school-search-panel {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: -6px 0 10px;
}
.school-search-input {
  flex: 1;
  height: 46px;
  border: 1.5px solid #cdecea;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 14px;
  color: #123b38;
  background: #fff;
  outline: none;
  box-shadow: 0 4px 16px rgba(0,106,100,.04);
  transition: border-color .15s, box-shadow .15s;
}
.school-search-input:focus {
  border-color: #006a64;
  box-shadow: 0 6px 20px rgba(0,106,100,.09);
}
.school-search-input::placeholder { color: #91a6a2; }
.school-search-clear {
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1.5px solid #cdecea;
  background: #fff;
  color: #006a64;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.school-search-clear:hover {
  background: #eef9f4;
  border-color: #9edbd6;
}
.schools-count {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: #78908c;
}
.schools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.school-empty {
  grid-column: 1 / -1;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cdecea;
  border-radius: 16px;
  background: rgba(255,255,255,.65);
  color: #78908c;
  font-size: 14px;
  font-weight: 700;
}
.school-card {
  background: #fff; border-radius: 16px; padding: 20px;
  border: 1px solid rgba(0,128,128,.08);
  display: flex; flex-direction: column; gap: 8px;
}
.school-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.school-name { font-size: 18px; font-weight: 900; color: #123b38; }
.school-loc { font-size: 12px; color: #78908c; margin-top: 2px; }
.school-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag-badge {
  padding: 3px 12px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: #eef9f4; color: #006a64;
}
.tag-price {
  padding: 3px 12px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: #f0f8ff; color: #1e88e5;
}
.tag-cat {
  padding: 3px 12px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: #f5f5f5; color: #555;
}
.school-card-footer { display: flex; justify-content: flex-end; margin-top: 4px; }
.btn-edit {
  padding: 6px 20px; border-radius: 999px;
  border: 1.5px solid #cdecea; background: #fff;
  color: #006a64; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.btn-edit:hover { background: #f0fbfa; }

/* ===== HOME CONFIG ===== */
.config-card {
  background: #fff; border-radius: 16px; padding: 24px;
  border: 1px solid rgba(0,128,128,.08); margin-bottom: 16px;
}
.config-section-title { font-size: 15px; font-weight: 800; color: #006a64; margin-bottom: 14px; }
.config-field-label { font-size: 13px; font-weight: 700; color: #78908c; margin-bottom: 6px; }
.config-hint { font-size: 12px; color: #a0b0ae; margin-bottom: 10px; }
.toggle-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 12px; }
.config-input {
  width: 100%; height: 44px; border: 1.5px solid #cdecea; border-radius: 10px;
  padding: 0 14px; font-size: 14px; background: #f8fdfd; outline: none;
  transition: border-color .15s;
}
.config-input:focus { border-color: #006a64; }
.config-textarea {
  width: 100%; border: 1.5px solid #cdecea; border-radius: 10px;
  padding: 10px 14px; font-size: 14px; background: #f8fdfd; outline: none;
  resize: vertical; line-height: 1.6; transition: border-color .15s;
}
.config-textarea:focus { border-color: #006a64; }
.btn-save-home { margin-top: 8px; }
.save-msg { margin-top: 12px; font-size: 13px; }
.save-msg.ok { color: #006a64; }
.save-msg.err { color: #e53935; }

/* ===== USERS ===== */
.search-bar { display: flex; gap: 8px; margin-top: 12px; }
.search-input {
  flex: 1; height: 40px; border: 1.5px solid #cdecea; border-radius: 999px;
  padding: 0 16px; font-size: 14px; background: #fff; outline: none;
}
.search-input:focus { border-color: #006a64; }
.btn-search, .btn-reset {
  height: 40px; padding: 0 20px; border-radius: 999px;
  font-size: 13px; font-weight: 700; cursor: pointer; border: none;
  transition: opacity .15s;
}
.btn-search { background: #006a64; color: #fff; }
.btn-reset { background: #f0f0f0; color: #555; }
.btn-search:hover, .btn-reset:hover { opacity: .85; }
.users-count { font-size: 13px; color: #78908c; margin: 12px 0 8px; }
.table-wrap { background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid rgba(0,128,128,.08); }
.user-table { width: 100%; border-collapse: collapse; }
.user-table th {
  padding: 12px 16px; font-size: 12px; font-weight: 700; color: #78908c;
  background: #f8fdfd; text-align: left; border-bottom: 1px solid #eef9f4;
}
.user-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid #f5f5f5; }
.user-table tr:last-child td { border-bottom: none; }
.user-table tbody tr:hover { background: #f8fdfd; }
.user-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 999px;
  background: #006a64; color: #fff; font-size: 12px; font-weight: 700;
  margin-right: 8px; vertical-align: middle;
}
.load-more { text-align: center; margin-top: 20px; }
.btn-more {
  padding: 10px 36px; border-radius: 999px;
  border: 1.5px solid #cdecea; background: #fff;
  color: #006a64; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-more:hover { background: #f0fbfa; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(6,28,28,.38);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal {
  width: 100%; max-width: 600px; max-height: 90vh;
  background: #fff; border-radius: 24px;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 64px rgba(0,0,0,.2);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid #eef9f4; flex-shrink: 0;
}
.modal-title-text { font-size: 18px; font-weight: 900; color: #123b38; }
.modal-close {
  width: 32px; height: 32px; border-radius: 999px;
  border: none; background: #f0f0f0; color: #555;
  font-size: 18px; cursor: pointer; line-height: 1;
}
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.modal-footer {
  display: flex; gap: 12px; padding: 16px 24px;
  border-top: 1px solid #eef9f4; flex-shrink: 0;
}
.modal-section-title {
  font-size: 13px; font-weight: 800; color: #006a64;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid #eef9f4;
}
.modal-field-label { font-size: 12px; font-weight: 700; color: #78908c; margin: 14px 0 6px; }
.modal-input {
  width: 100%; height: 44px; border: 1.5px solid #cdecea; border-radius: 10px;
  padding: 0 14px; font-size: 14px; background: #f8fdfd; outline: none;
  transition: border-color .15s;
}
.modal-input:focus { border-color: #006a64; }
.modal-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.cat-chip {
  padding: 6px 16px; border-radius: 999px;
  border: 1.5px solid #cdecea; background: #fff;
  color: #78908c; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  user-select: none;
}
.cat-chip.on { background: #006a64; color: #fff; border-color: #006a64; }
.price-grid { display: flex; flex-direction: column; gap: 8px; }
.price-row { display: flex; align-items: center; gap: 10px; }
.price-row-label { flex: 1; font-size: 13px; color: #456360; min-width: 0; }
.price-row-name {
  flex: 1; height: 38px; border: 1.5px solid #cdecea; border-radius: 8px;
  padding: 0 10px; font-size: 13px; background: #f8fdfd; outline: none;
  transition: border-color .15s; min-width: 0;
}
.price-row-name:focus { border-color: #006a64; }
.price-row-input {
  width: 100px; height: 38px; border: 1.5px solid #cdecea; border-radius: 8px;
  padding: 0 10px; font-size: 14px; text-align: right; background: #f8fdfd; outline: none;
  transition: border-color .15s; flex-shrink: 0;
}
.price-row-input:focus { border-color: #006a64; }

.formula-card {
  margin-top: 22px;
  padding: 16px;
  border: 1.5px solid #cdecea;
  border-radius: 14px;
  background: #fbfefd;
}
.formula-lines {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #456360;
}
.formula-lines.special {
  color: #244f4a;
}
.formula-special {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff8e8;
  border: 1px solid #ffe0a3;
  color: #6f4d00;
  font-size: 13px;
  line-height: 1.55;
}
.formula-special strong {
  color: #006a64;
}
.formula-current {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef9f4;
  color: #006a64;
  font-size: 13px;
  font-weight: 800;
}
.formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.formula-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #78908c;
}
.formula-field-full {
  margin-top: 12px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  height: 44px; padding: 0 28px; border-radius: 999px;
  background: #006a64; color: #fff; border: none;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: opacity .15s;
}
.btn-primary:hover { opacity: .88; }
.btn-cancel {
  flex: 1; height: 44px; border-radius: 999px;
  border: 1.5px solid #cdecea; background: #fff;
  color: #78908c; font-size: 15px; font-weight: 700; cursor: pointer;
}
.modal-footer .btn-primary { flex: 1; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: #123b38; color: #fff; font-size: 14px; font-weight: 600;
  padding: 10px 28px; border-radius: 999px;
  box-shadow: 0 4px 20px rgba(0,0,0,.2); z-index: 9999;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
