* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f4f6f8;
  color: #172638;
  font-family: Arial, sans-serif;
}

header {
  background: #122b47;
  padding: 24px 8%;
  color: white;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1px;
}

main {
  max-width: 480px;
  margin: 70px auto;
  padding: 38px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 36px #17263812;
}

h1 { margin-top: 0; }

p { color: #64748b; line-height: 1.6; }

label {
  display: block;
  margin-top: 20px;
  margin-bottom: 7px;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 16px;
}

button {
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  background: #122b47;
  border: 0;
  border-radius: 6px;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

button:hover { background: #214568; }

.notice {
  margin-top: 20px;
  padding: 16px;
  background: #edf5fc;
  border-radius: 8px;
  line-height: 1.5;
}

#message { color: #a12626; }

[hidden] { display: none !important; }


.secret {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px;
  background: #edf5fc;
  border-radius: 6px;
  font-size: 14px;
  user-select: all;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.qr-frame {
  display: flex;
  justify-content: center;
  margin: 24px auto;
}

.qr-frame img {
  width: 260px;
  height: 260px;
  max-width: 100%;
}

details {
  margin: 20px 0;
}

summary {
  cursor: pointer;
  color: #24496b;
  font-weight: 600;
}


.admin-panel {
  margin-top: 32px;
  padding-top: 25px;
  border-top: 1px solid #e2e8f0;
}

.admin-panel h2 {
  font-size: 21px;
}

.admin-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 25px;
}

.admin-heading h3 {
  margin: 0;
}

.admin-heading span {
  color: #64748b;
  font-size: 12px;
}

.client-card {
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 18px;
  margin-top: 14px;
  background: #fafbfd;
}

.client-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.client-meta {
  margin: 0 0 8px;
  font-size: 13px;
}

.client-folders {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}


/* Customer document browser */
#documents-panel[hidden] { display: none !important; }

.documents-panel {
  margin: 24px 0;
  padding: 24px;
  border: 1px solid #dce2e8;
  border-radius: 12px;
}

.documents-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.documents-heading h2 {
  margin: 0 0 6px;
}

.documents-heading p,
.documents-note {
  color: #65717c;
  font-size: 14px;
}

.documents-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.documents-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #e6eaf0;
}

.document-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.document-kind {
  color: #65717c;
  font-size: 13px;
  flex-shrink: 0;
}


.document-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.document-download {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid #d7dee6;
  border-radius: 6px;
  color: #23425d;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.document-download:hover,
.document-download:focus-visible {
  background: #eef3f7;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .documents-list li {
    flex-wrap: wrap;
  }
}

.documents-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 18px 0;
  font-size: 14px;
}

.documents-breadcrumbs button,
.document-folder {
  border: 0;
  background: none;
  color: #23425d;
  cursor: pointer;
  font: inherit;
  text-align: left;
  padding: 0;
}

.documents-breadcrumbs button:hover,
.document-folder:hover {
  text-decoration: underline;
}

.documents-breadcrumbs [aria-current="page"] {
  font-weight: 600;
}

.breadcrumb-separator {
  color: #89939d;
}

.document-folder {
  font-weight: 600;
}

.document-folder::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 9px;
  margin-right: 9px;
  border: 2px solid #657d96;
  border-radius: 2px;
}

.documents-breadcrumbs button:focus-visible,
.document-folder:focus-visible {
  outline: 2px solid #23425d;
  outline-offset: 4px;
}

/* Improved customer-folder hover and selection contrast */
.documents-list .document-folder {
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #173c55;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.documents-list .document-folder:hover,
.documents-list .document-folder:focus-visible,
.documents-list .document-folder:active {
  background: #173c55;
  color: #ffffff;
  text-decoration: none;
}

.documents-list .document-folder:hover::before,
.documents-list .document-folder:focus-visible::before,
.documents-list .document-folder:active::before {
  border-color: #ffffff;
}

.documents-list .document-folder:focus-visible {
  outline: 2px solid #5d9dca;
  outline-offset: 3px;
}

.documents-list .document-folder::selection {
  background: #173c55;
  color: #ffffff;
}


/* Replace checkbox-looking outline with a folder icon */
.documents-list .document-folder::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 14px;
  flex: 0 0 18px;
  margin-right: 10px;
  background: currentColor;
  border: none;
  border-radius: 0;
  clip-path: polygon(
    0 25%, 32% 25%, 42% 0,
    72% 0, 82% 25%, 100% 25%,
    100% 100%, 0 100%
  );
}


/* File metadata */
.document-info {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.document-meta {
  color: #65717c;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

