body {
  margin: 0;
  padding: 40px 20px;
  background-color: #e8f2fb;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #22303f;
  line-height: 1.5;
}

.import-form-container {
  max-width: 720px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 12px;
  padding: 32px 40px;
  box-shadow: 0 4px 16px rgba(20, 60, 100, 0.08);
  text-align: left;
  box-sizing: border-box;
}

h1 {
  margin-top: 0;
  color: #14395c;
  font-size: 1.6rem;
  border-bottom: 2px solid #cfe4f7;
  padding-bottom: 12px;
}

a {
  color: #1d6fb8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

label[for] {
  font-weight: 600;
  display: inline-block;
  margin-top: 12px;
}

label:not([for]) {
  font-weight: normal;
  display: inline-block;
  margin: 2px 0;
}

input[type="checkbox"] {
  margin-right: 6px;
  vertical-align: middle;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  max-width: 400px;
  padding: 8px 10px;
  border: 1px solid #c3d4e3;
  border-radius: 6px;
  font-size: 0.95rem;
  box-sizing: border-box;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: #1d6fb8;
  box-shadow: 0 0 0 3px rgba(29, 111, 184, 0.15);
}

button {
  background-color: #1d6fb8;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

button[type="submit"] {
  margin: 0 6px 10px 0;
}

button:hover {
  background-color: #155a94;
}

button[type="button"] {
  background-color: #eef5fb;
  color: #14395c;
  border: 1px solid #c3d4e3;
  padding: 4px 10px;
  font-size: 0.8rem;
  margin-left: 6px;
}

button[type="button"]:hover {
  background-color: #dcebf7;
}

fieldset {
  border: 1px solid #d7e6f2;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
}

legend {
  font-weight: 600;
  color: #14395c;
  padding: 0 6px;
}

.dropzone {
  border: 2px dashed #9cc0e0;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  color: #4a6478;
  background-color: #f7fbfe;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dropzone:hover {
  border-color: #1d6fb8;
}

.dropzone.dragover {
  border-color: #1d6fb8;
  background-color: #eaf4fc;
}

.visually-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-list {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #33475a;
}

.result-card,
.result-error {
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 10px;
}

.result-error,
.result-failure {
  background-color: #fdecec;
  border: 1px solid #f3b6b6;
  color: #8a2323;
}

.result-success {
  background-color: #eaf7ee;
  border: 1px solid #a9dcb5;
  color: #1e6b34;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f5f8fb;
  padding: 8px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.import-form-container ul {
  padding-left: 20px;
}

.import-form-container li {
  margin-bottom: 10px;
}

.export-view-container {
  max-width: 1400px;
}

.export-table-wrap {
  overflow-x: auto;
}

.export-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}

.export-table th,
.export-table td {
  border: 1px solid #d7e6f2;
  padding: 6px 10px;
  text-align: left;
  white-space: nowrap;
}

.export-table thead th {
  background-color: #14395c;
  color: #ffffff;
  position: sticky;
  top: 0;
}

.export-table .row-date td {
  font-weight: 700;
  background-color: #cfe4f7;
  color: #14395c;
}

.export-table .row-person td {
  font-weight: 700;
  background-color: #eef5fb;
  padding-left: 24px;
}

.login-container {
  max-width: 420px;
  margin: 60px auto;
  background: #ffffff;
  border-radius: 12px;
  padding: 32px 40px;
  box-shadow: 0 4px 16px rgba(20, 60, 100, 0.08);
  text-align: center;
}

.login-btn {
  display: inline-block;
  min-width: 240px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: #ffffff;
}

.login-btn:hover {
  text-decoration: none;
  opacity: 0.92;
}

.login-btn-google {
  background-color: #1d6fb8;
}

.login-btn-microsoft {
  background-color: #14395c;
}

.tool-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  max-width: 1010px;
  margin: 0 auto;
}

.tool-layout .import-form-container {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.tool-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tool-nav {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 4px 16px rgba(20, 60, 100, 0.08);
  box-sizing: border-box;
}

.tool-nav h3 {
  margin: 0 0 10px 0;
  font-size: 1.05rem;
  border-bottom: 2px solid #cfe4f7;
  padding-bottom: 8px;
}

.tool-nav h3 a {
  color: #14395c;
}

.tool-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tool-nav li {
  margin: 6px 0;
  font-size: 0.9rem;
}

.tool-nav-current {
  font-weight: 700;
  color: #14395c;
}

.signed-in {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #d7e6f2;
  font-size: 0.8rem;
  color: #4a6478;
  word-break: break-all;
}

.tool-nav-category {
  display: block;
  margin-top: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4a6478;
}

.tool-nav ul {
  margin-bottom: 4px;
}

.tool-nav li {
  padding-left: 8px;
}

.tool-category-heading {
  color: #14395c;
  font-size: 1.15rem;
  margin: 20px 0 6px 0;
  border-bottom: 1px solid #cfe4f7;
  padding-bottom: 4px;
}

.credentials-panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 4px 16px rgba(20, 60, 100, 0.08);
  box-sizing: border-box;
}

.credentials-panel h3 {
  margin: 0 0 10px 0;
  color: #14395c;
  font-size: 1.05rem;
  border-bottom: 2px solid #cfe4f7;
  padding-bottom: 8px;
}

.credentials-panel input {
  width: 100%;
}

.credentials-note {
  font-size: 0.78rem;
  color: #4a6478;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .tool-layout {
    flex-direction: column;
  }

  .tool-sidebar {
    position: static;
    width: 100%;
  }
}

.tree-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.tree-main {
  flex: 1;
  min-width: 0;
}

.tree-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  background: #f7fbfe;
  border: 1px solid #d7e6f2;
  border-radius: 8px;
  padding: 16px;
}

.tree-sidebar h3 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  color: #14395c;
}

.tree-sidebar h3 + label {
  margin-top: 0;
}

.tree-sidebar h3:not(:first-child) {
  margin-top: 18px;
}

.level-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 0.9rem;
}

.level-row select {
  padding: 3px 6px;
  border: 1px solid #c3d4e3;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  background: #ffffff;
  color: #22303f;
}

.filter-hint {
  font-size: 0.8rem;
  color: #4a6478;
  margin: 0 0 6px 0;
}

.filter-dropdown {
  position: relative;
  margin: 6px 0;
}

.filter-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  color: #22303f;
  border: 1px solid #c3d4e3;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
  text-align: left;
}

.filter-toggle:hover {
  background: #f0f6fc;
}

.filter-toggle .filter-summary {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1d6fb8;
  font-weight: 600;
}

.filter-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: #ffffff;
  border: 1px solid #c3d4e3;
  border-radius: 6px;
  padding: 6px 10px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(20, 60, 100, 0.15);
}

.filter-dropdown.open .filter-panel {
  display: block;
}

.filter-panel label {
  display: block;
  margin: 2px 0;
  font-size: 0.85rem;
  white-space: nowrap;
}

#clearFilters {
  margin-top: 10px;
}

.dual-list {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dual-list-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dual-list-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #14395c;
  margin-bottom: 4px;
}

.dual-list select {
  width: 100%;
  border: 1px solid #c3d4e3;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 2px;
}

.dual-list-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dual-list-buttons button {
  padding: 4px 10px;
  font-size: 0.9rem;
}

.tree-group {
  margin: 6px 0;
}

.tree-group-header {
  cursor: pointer;
  font-weight: 600;
  padding: 6px 12px;
  background-color: #eef5fb;
  border: 1px solid #d7e6f2;
  border-radius: 6px;
  color: #14395c;
  user-select: none;
}

.tree-group-header:hover {
  background-color: #dcebf7;
}

.tree-arrow {
  display: inline-block;
  width: 1em;
}

.tree-records {
  margin-top: 6px;
  margin-bottom: 10px;
}

@media (max-width: 480px) {
  body {
    padding: 20px 10px;
  }

  .import-form-container {
    padding: 20px 16px;
  }
}
