:root {
  --bg: #edf3f8;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --line: #dbe5ef;
  --text: #132238;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #e6fffb;
  --blue-soft: #eff6ff;
  --shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #f0f2f5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 0.85rem 1.9rem;
}
.shell-wide {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.1rem 0.85rem 1.8rem;
}
.shell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.panel {
  background: #fff;
  border: 1px solid #e5e9ef;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
}
.eyebrow {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.panel-header,
.section-header {
  display: grid;
  gap: 0.45rem;
}
.panel-title,
.section-title {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.panel-title {
  font-size: clamp(1.45rem, 2.05vw, 1.95rem);
  line-height: 1.12;
}
.section-title {
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  line-height: 1.2;
}
.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
.header-description {
  margin: 0;
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.45;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}
input[type="text"],
input[type="password"],
input[type="file"],
input[type="url"],
textarea,
select {
  width: 100%;
  border: 1px solid #c9d7e5;
  border-radius: 12px;
  padding: 0.68rem 0.8rem;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
}
input[type="file"] {
  padding: 0.58rem;
}
form p {
  margin: 0 0 0.75rem;
}
.submit-btn,
.open-link,
.nav-link,
.logout-btn,
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.submit-btn,
.tool-btn.primary-btn,
.primary-btn {
  border: 0;
  padding: 0.68rem 1rem;
  background: #0f766e;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.18);
}
.submit-btn {
  width: 100%;
}
.submit-btn:hover,
.open-link:hover,
.nav-link:hover,
.tool-btn:hover {
}
.logout-form {
  margin: 0;
}
.nav-link {
  border: 1px solid #d1d9e4;
  background: #fff;
  color: #334155;
  padding: 0.5rem 0.85rem;
  font-size: 0.84rem;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.nav-link:hover {
  background: #f8fafc;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.nav-link:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  pointer-events: none;
}
.nav-link-current {
  background: #0f766e;
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.2);
}
.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid #d1d9e4;
  background: #fff;
  color: #475569;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.logout-user-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.logout-btn-separator {
  display: inline-flex;
  align-items: center;
  padding: 0 0.15rem;
  color: rgba(15, 118, 110, 0.45);
  font-weight: 700;
}
.logout-btn-copy {
  white-space: nowrap;
}
.back-link {
  color: #5b21b6;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover {
  text-decoration: underline;
}
.field-errors,
.errorlist,
.login-error {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  color: #b91c1c;
  font-size: 0.84rem;
}

/* Signature management styles */
.signature-upload {
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.signature-preview {
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

.signature-display {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0;
  padding: 0.85rem;
  background: var(--blue-soft);
  border-radius: 12px;
}

.signature-display img {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.header-actions .nav-link,
.header-actions .logout-btn {
  border: 1px solid #d1d9e4;
  background: #fff;
  color: #475569;
  padding: 0.5rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.header-actions .nav-link:hover,
.header-actions .logout-btn:hover {
  background: #f8fafc;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.header-actions .nav-link-current,
.header-actions .nav-link-current:hover {
  background: #0f766e;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.2);
  transform: none;
}
.header-actions .logout-btn {
  gap: 0.55rem;
  color: var(--text);
  margin-left: auto;
  white-space: nowrap;
}
.header-actions .logout-user-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: inherit;
}
.header-actions .logout-btn-separator {
  color: #94a3b8;
}
@media (max-width: 860px) {
  .shell-header {
    align-items: stretch;
  }
  .header-actions {
    justify-content: flex-start;
  }
  .header-nav {
    width: 100%;
  }
  .header-actions .logout-btn {
    margin-left: 0;
  }
}
