/* -- Auth / login -------------------------------------------------------- */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1a1a1a 0%, #1e3a5f 55%, #2383e2 100%);
}

.login-page {
  width: 100%;
  max-width: 380px;
  padding: 1.5rem 1rem;
}

.login-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-brand-icon {
  width: 50px;
  height: 50px;
  background: #2383e2;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  box-shadow: 0 6px 20px rgba(35, 131, 226, 0.4);
}

.login-brand-icon svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.login-brand h1 {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  letter-spacing: -0.02em;
}

.login-brand p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
  margin: 0;
}

.login-card {
  padding: 1.75rem;
  border: none;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.07),
    0 20px 50px rgba(0, 0, 0, 0.22);
}

.login-card .field {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.login-card .field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #37352f;
  letter-spacing: 0.01em;
}

.login-card .field input {
  width: 100%;
  border: 1px solid #e9e8e3;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.92rem;
  background: #f7f6f3;
  color: #37352f;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.login-card .field input::placeholder {
  color: #c0bfbb;
}

.login-card .field input:focus {
  outline: none;
  border-color: #2383e2;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.15);
}

.login-card .field [type="submit"] {
  width: 100%;
  justify-content: center;
  padding: 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  margin-top: 0.25rem;
  box-shadow: 0 2px 8px rgba(35, 131, 226, 0.28);
  transition: background-color 0.12s ease, box-shadow 0.12s ease, transform 0.1s ease;
}

.login-card .field [type="submit"]:hover {
  background: #1a6fc9;
  box-shadow: 0 4px 14px rgba(35, 131, 226, 0.38);
  transform: translateY(-1px);
}

/* -- General form field -------------------------------------------------- */

.field {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #37352f;
}

.field input:not([type="submit"]),
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #e9e8e3;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  background: #f7f6f3;
  color: #37352f;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.field input:not([type="submit"]):focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #2383e2;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.15);
}

.field-hint {
  margin: 0.15rem 0 0;
  font-size: 0.77rem;
  color: #9b9a97;
}

.form-card {
  max-width: 640px;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: normal;
  color: inherit;
}

/* ----------------------------------------------------------------------- */

.template-definition-settings {
  max-width: 640px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-grid > div label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #37352f;
}

.form-grid > div input,
.form-grid > div select,
.form-grid > div textarea {
  width: 100%;
  border: 1px solid #e9e8e3;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  background: #f7f6f3;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form-grid > div input:focus,
.form-grid > div select:focus,
.form-grid > div textarea:focus {
  outline: none;
  border-color: #2383e2;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.15);
}

.form-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.form-field-full {
  grid-column: 1 / -1;
}

/* ============================================================
   Cell dialog
   ============================================================ */

dialog.cell-dialog {
  border: none;
  border-radius: 10px;
  padding: 0;
  width: min(720px, 95vw);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.16), 0 4px 16px rgba(0, 0, 0, 0.07),
              0 0 0 1px rgba(0,0,0,0.06);
  background: #ffffff;
  animation: dialog-pop 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dialog-pop {
  from { opacity: 0; transform: scale(0.96) translateY(-6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

dialog.cell-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}

dialog.cell-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem 0.7rem;
  border-bottom: 1px solid #e9e8e3;
  font-weight: 600;
  font-size: 0.88rem;
  color: #37352f;
}

dialog.cell-dialog header button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9b9a97;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.1s ease, background 0.1s ease;
}

dialog.cell-dialog header button:hover {
  color: #37352f;
  background: #f1f0ed;
}

dialog.cell-dialog .dialog-body {
  padding: 0.9rem 1.1rem;
}

dialog.cell-dialog .dialog-body textarea {
  width: 100%;
  min-height: 18rem;
  resize: vertical;
  border: 1px solid #e9e8e3;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.55;
  background: #f7f6f3;
  transition: border-color 0.12s ease, background 0.12s ease;
}

dialog.cell-dialog .dialog-body textarea:focus {
  outline: none;
  border-color: #2383e2;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.15);
}

dialog.cell-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem 0.9rem;
  border-top: 1px solid #e9e8e3;
}

dialog.cell-dialog footer button[type="button"] {
  padding: 0.35rem 0.75rem;
  border: 1px solid #e9e8e3;
  border-radius: 6px;
  background: transparent;
  color: #37352f;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.1s ease;
}

dialog.cell-dialog footer button[type="button"]:hover {
  background: #f7f6f3;
}

dialog.cell-dialog footer button[type="submit"] {
  padding: 0.35rem 0.75rem;
  border: 0;
  border-radius: 6px;
  background: #2383e2;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
}

dialog.cell-dialog footer button[type="submit"]:hover {
  background: #1a6fc9;
}
