/* ── LZ Hanse — Global Stylesheet ─────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #F4F6F9;
  min-height: 100vh;
  color: #1A1A2E;
}

/* ── Navigation header ────────────────────────────────────────────────────── */

.app-header {
  background: #fff;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  border-bottom: 3px solid #C89A1A;
  box-shadow: 0 2px 12px rgba(30,61,110,0.08);
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-header.static { position: static; }

.header-left  { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; gap: 10px; align-items: center; }
.header-logo img { height: 44px; width: auto; }

.app-header h1 {
  color: #1E3D6E;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.app-header a {
  color: #64748B;
  font-size: 13px;
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid #D1D9E6;
  border-radius: 6px;
  transition: all 0.2s;
}
.app-header a:hover    { color: #1E3D6E; border-color: #C89A1A; }
.app-header a.back-link { border-color: transparent; }

/* ── Page layout ──────────────────────────────────────────────────────────── */

.page-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}
.page-main.narrow  { max-width: 680px; }
.page-main.wide    { max-width: 960px; }
.page-main.centered { max-width: 560px; text-align: center; margin-top: 64px; }

.page-title {
  font-size: 22px;
  color: #1E3D6E;
  margin-bottom: 6px;
}
.page-sub {
  color: #64748B;
  font-size: 14px;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */

.card {
  background: #fff;
  border-radius: 12px;
  padding: 36px;
  box-shadow: 0 2px 16px rgba(30,61,110,0.08);
}

.section-card {
  background: #fff;
  border-radius: 10px;
  padding: 24px 28px;
  box-shadow: 0 1px 10px rgba(30,61,110,0.07);
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #E2E8F0;
}
.section-header h3 {
  font-size: 13px;
  color: #1E3D6E;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Form elements ────────────────────────────────────────────────────────── */

label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  border: 1.5px solid #D1D9E6;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  color: #1A1A2E;
  background: #FAFBFD;
  transition: border-color 0.2s;
  appearance: auto;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #1E3D6E;
  background: #fff;
}
textarea { resize: vertical; }

.hint {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-group {
  display: grid;
  gap: 14px;
}
.field-group.cols-2 { grid-template-columns: 1fr 1fr; }
.field-group.cols-3 { grid-template-columns: 2fr 1fr 2fr; }

@media (max-width: 580px) {
  .field-group.cols-2,
  .field-group.cols-3 { grid-template-columns: 1fr; }
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn-primary {
  background: #1E3D6E;
  border: none;
  border-radius: 8px;
  padding: 11px 28px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-primary:hover    { background: #2E5090; }
.btn-primary:disabled { background: #8BA3C4; cursor: not-allowed; }

.btn-secondary {
  background: none;
  border: 1.5px solid #D1D9E6;
  border-radius: 8px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: #1E3D6E; color: #1E3D6E; }

/* ── Fixed bottom action bar ──────────────────────────────────────────────── */

.form-actions {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid #E2E8F0;
  padding: 16px 32px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  box-shadow: 0 -4px 20px rgba(30,61,110,0.08);
  z-index: 40;
}

/* ── Flash messages ───────────────────────────────────────────────────────── */

.flash-error {
  background: #FEE2E2;
  color: #991B1B;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 20px;
}

/* ── Info / markup hint box ───────────────────────────────────────────────── */

.info-box {
  background: #EEF2F8;
  border-left: 3px solid #C89A1A;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}
.info-box strong { color: #1E3D6E; }

/* ── Toggle switches ──────────────────────────────────────────────────────── */

.toggles { display: flex; flex-direction: column; gap: 12px; }

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
  background: #FAFBFD;
}
.toggle-row:hover { border-color: #1E3D6E; }
.toggle-row input[type="checkbox"] { display: none; }

.toggle-switch {
  width: 38px;
  height: 22px;
  background: #D1D9E6;
  border-radius: 11px;
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
  transition: background 0.2s;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-row input:checked ~ .toggle-switch             { background: #1E3D6E; }
.toggle-row input:checked ~ .toggle-switch::after      { transform: translateX(16px); }

.toggle-label { display: flex; flex-direction: column; gap: 2px; }
.toggle-label strong { font-size: 13px; color: #1E3D6E; font-weight: 600; }
.toggle-label span   { font-size: 12px; color: #64748B; line-height: 1.4; }

/* ── Honorar / segmented tabs ─────────────────────────────────────────────── */

.seg-tabs {
  display: flex;
  border: 1.5px solid #D1D9E6;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
}
.seg-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  background: #FAFBFD;
  border: none;
  transition: all 0.2s;
}
.seg-tab.active { background: #1E3D6E; color: #fff; }
.seg-tab:hover:not(.active) { background: #EEF2F8; color: #1E3D6E; }

/* ── Readonly block ───────────────────────────────────────────────────────── */

.readonly-block {
  background: #EEF2F8;
  border-radius: 8px;
  padding: 14px 16px;
  border-left: 3px solid #C89A1A;
}
.readonly-block p     { font-size: 13px; color: #1E3D6E; line-height: 1.7; }
.readonly-block .label {
  font-size: 11px; font-weight: 700; color: #C89A1A;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}

/* ── Entry list (profile edit) ────────────────────────────────────────────── */

.entry-list { display: flex; flex-direction: column; gap: 10px; }
.entry {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  padding: 14px 16px;
  position: relative;
}
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.entry-grid.three { grid-template-columns: 1.5fr 1fr 2fr; }
@media (max-width: 600px) {
  .entry-grid, .entry-grid.three { grid-template-columns: 1fr; }
}
.entry-field { display: flex; flex-direction: column; gap: 4px; }
.entry-field label {
  font-size: 11px; color: #64748B;
  margin-bottom: 0; text-transform: none; letter-spacing: 0;
}
.entry-field input { font-size: 12px; padding: 7px 10px; }

.remove-btn {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none;
  color: #94A3B8; cursor: pointer;
  font-size: 16px; padding: 2px 6px;
  border-radius: 4px; transition: color 0.2s;
}
.remove-btn:hover { color: #DC2626; }

.add-btn {
  margin-top: 10px;
  background: none;
  border: 1.5px dashed #8BA3C4;
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 12px;
  color: #1E3D6E;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}
.add-btn:hover { border-color: #C89A1A; color: #C89A1A; }

/* ── Tabs (profile edit) ──────────────────────────────────────────────────── */

.tabs {
  display: flex;
  border-bottom: 2px solid #E2E8F0;
  margin-bottom: 0;
}
.tab-btn {
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: #64748B;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn.active       { color: #1E3D6E; border-bottom-color: #C89A1A; }
.tab-btn:hover:not(.active) { color: #1E3D6E; }

.tab-panel         { display: none; }
.tab-panel.active  { display: block; }

/* ── Loading overlay ──────────────────────────────────────────────────────── */

.loading-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(30,61,110,0.88);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.loading-overlay.active { display: flex; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #C89A1A;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p     { font-size: 16px; font-weight: 600; }
.loading-overlay small { color: #8BA3C4; font-size: 13px; margin-top: 6px; }
