/* Sarmont admin */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #111827; background: #f3f4f6; }

/* --- Login --- */
.wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #f3f4f6; }
.card { width: 100%; max-width: 420px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08); padding: 32px 28px; }
.card .logo { display: block; margin: 0 auto 20px; max-width: 200px; height: auto; }
.card h1 { font-size: 20px; margin: 0 0 20px; text-align: center; }
label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"] { width: 100%; border: 1px solid #e5e7eb; border-radius: 6px; background: #fafafa; padding: 10px 12px; font-size: 14px; color: #111827; margin-bottom: 16px; }
input:focus { outline: 2px solid #602d8d33; border-color: #602d8d; }
.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px; }
.admin-hint { margin-top: 16px; text-align: center; font-size: 13px; }
.admin-hint a { color: #6b7280; text-decoration: none; }
.admin-hint a:hover { color: #602d8d; }

button, .btn { display: inline-block; border: 0; border-radius: 999px; background: #602d8d; color: #fff; font-size: 15px; font-weight: 600; padding: 10px 18px; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: #4e2473; }
.btn-sm { font-size: 13px; padding: 6px 12px; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

/* Единый размер всех action-кнопок (и на списке, и в редакторе) */
.btn-action { padding: 4px 12px; font-size: 13px; line-height: 1.2; }

/* --- Shell --- */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.content { max-width: 960px; width: 100%; margin: 0 auto; padding: 28px 24px 60px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h2 { margin: 0; font-size: 20px; }
.form-card { max-width: 920px; margin: 0 auto; }

/* --- Верхний ряд: название / email / пароль + кнопка сохранения --- */
.form-row-top { display: grid; grid-template-columns: 1.5fr 1.15fr 0.9fr auto; gap: 16px; align-items: end; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; }
.field label { margin-bottom: 6px; }
.field input { margin-bottom: 0; }
.save-cell { display: flex; align-items: center; }

/* Кнопка «Сохранить» неактивна, пока не внесены изменения */
.btn[disabled], .btn:disabled { background: #d3cde0; color: #fff; cursor: not-allowed; box-shadow: none; }

/* --- Многострочные поля вкладки (название / URL) --- */
.tab-row textarea { width: 100%; border: 1px solid #e5e7eb; border-radius: 6px; background: #fafafa; padding: 10px 12px; font-size: 14px; font-family: inherit; color: #111827; min-height: 76px; resize: vertical; margin-bottom: 0; }
.tab-row textarea:focus { outline: 2px solid #602d8d33; border-color: #602d8d; }

/* --- Table --- */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06); }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f3f4f6; }
.table th { background: #fafafa; font-size: 13px; color: #6b7280; }
.table .center { text-align: center; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; margin-left: 8px; }
.empty-td { text-align: center; color: #9ca3af; padding: 28px; }

/* --- Tabs editor --- */
.tabs-editor { margin: 8px 0 20px; padding: 16px; background: #fafafa; border: 1px solid #e5e7eb; border-radius: 10px; }
.tabs-title { font-size: 13px; color: #374151; margin-bottom: 10px; font-weight: 600; }
.tabs-head { display: grid; grid-template-columns: 1fr 1.6fr 150px; gap: 8px; margin-bottom: 6px; }
.tabs-head span { font-size: 12px; color: #9ca3af; }
.tab-row { display: grid; grid-template-columns: 1fr 1.6fr 150px; gap: 8px; margin-bottom: 8px; align-items: start; }
.tab-row input { margin-bottom: 0; }
/* Кнопки в строках вкладок: заполняют колонку (размер задаёт .btn-action) */
.tab-row .btn { width: 100%; box-sizing: border-box; text-align: center; white-space: normal; }
.tab-row .btn .delete-label { white-space: nowrap; }
.inline { display: inline; }

/* --- Удаление с отменой (градиентный отсчёт 5с) --- */
.delete-form { position: relative; display: inline-block; margin-left: 8px; vertical-align: middle; }
.delete-btn { position: relative; overflow: hidden; }
.del-progress { position: absolute; inset: 0; width: 0%; background: linear-gradient(90deg, #fecaca, #dc2626); z-index: 0; }
.delete-label { position: relative; z-index: 1; }
.delete-btn.arming { background: #fff; color: #dc2626; box-shadow: inset 0 0 0 1px #fecaca; }
.delete-btn.arming .del-progress { animation: del-fill 5s linear forwards; }
@keyframes del-fill { to { width: 100%; } }

/* --- Модальное окно «Смена пароля» --- */
.modal-backdrop[hidden] { display: none !important; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.modal { background: #fff; border-radius: 14px; max-width: 420px; width: 100%; padding: 24px; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-close { border: 0; background: transparent; font-size: 24px; line-height: 1; color: #6b7280; cursor: pointer; padding: 0; border-radius: 0; }
.modal-close:hover { color: #111827; background: transparent; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.btn-ghost { background: #fff; color: #602d8d; box-shadow: inset 0 0 0 1px #d8cfe8; }
.btn-ghost:hover { background: #f5f2fa; color: #602d8d; }
