.ssd-directory {
  --ssd-accent: #087f5b;
  --ssd-accent-dark: #056447;
  --ssd-border: #dce4e1;
  --ssd-muted: #66736f;
  --ssd-surface: #fff;
  --ssd-soft: #f4f8f6;
  position: relative;
  width: 100%;
  margin: 1.5rem 0;
  color: #17221f;
  font-family: inherit;
  line-height: 1.7;
}

.ssd-directory *,
.ssd-directory *::before,
.ssd-directory *::after { box-sizing: border-box; }

.ssd-directory__title {
  margin: 0 0 1rem;
  color: #173d31;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 800;
}

.ssd-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) repeat(4, minmax(135px, 1fr)) auto;
  gap: .75rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid var(--ssd-border);
  border-radius: 14px;
  background: var(--ssd-soft);
}

.ssd-field { display: grid; gap: .3rem; min-width: 0; margin: 0; }
.ssd-field > span { color: #344d45; font-size: .82rem; font-weight: 700; }
.ssd-field input,
.ssd-field select {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: .48rem .7rem;
  border: 1px solid #c7d4cf;
  border-radius: 9px;
  background: #fff;
  color: #182722;
  font: inherit;
  font-size: .9rem;
  outline: none;
}
.ssd-field input:focus,
.ssd-field select:focus { border-color: var(--ssd-accent); box-shadow: 0 0 0 3px rgba(8,127,91,.13); }
.ssd-field select:disabled { opacity: .65; }

.ssd-reset {
  min-height: 42px;
  padding: .5rem .9rem;
  border: 1px solid #b9c9c3;
  border-radius: 9px;
  background: #fff;
  color: #2b4940;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ssd-reset:hover:not(:disabled) { border-color: var(--ssd-accent); color: var(--ssd-accent-dark); }
.ssd-reset:disabled { cursor: default; opacity: .55; }

.ssd-feedback {
  display: flex;
  gap: .55rem;
  align-items: center;
  margin: .8rem 0;
  padding: .65rem .85rem;
  border-radius: 9px;
  background: #eef7f3;
  color: #285b4b;
  font-size: .9rem;
}
.ssd-feedback[hidden] { display: none; }
.ssd-feedback.is-error { background: #fff1f1; color: #9d2626; }
.ssd-spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 2px solid rgba(8,127,91,.2);
  border-top-color: var(--ssd-accent);
  border-radius: 50%;
  animation: ssd-spin .75s linear infinite;
}
.ssd-feedback.is-error .ssd-spinner { display: none; }
@keyframes ssd-spin { to { transform: rotate(360deg); } }

.ssd-table-scroll {
  width: 100%;
  max-height: 72vh;
  overflow: auto;
  border: 1px solid var(--ssd-border);
  border-radius: 12px;
  background: var(--ssd-surface);
  box-shadow: 0 5px 18px rgba(20,55,44,.05);
  scrollbar-width: thin;
}

.ssd-table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  margin: 0;
  background: #fff;
  font-size: .89rem;
}

.ssd-table th,
.ssd-table td {
  padding: .72rem .8rem;
  border: 0;
  border-bottom: 1px solid #e5ebe8;
  border-left: 1px solid #edf1ef;
  text-align: right;
  vertical-align: middle;
  white-space: normal;
}
.ssd-table th:last-child,
.ssd-table td:last-child { border-left: 0; }
.ssd-table thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 0;
  background: #eaf4f0;
  color: #153d31;
  font-weight: 800;
  box-shadow: inset 0 -1px 0 #cbdad4;
}
.ssd-sort-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: flex-start;
  padding: .65rem .8rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: right;
  cursor: pointer;
}
.ssd-sort-button:hover,
.ssd-sort-button:focus-visible { background: #dcece6; outline: none; }
.ssd-sort-button.is-sorted { color: var(--ssd-accent-dark); background: #dcece6; }
.ssd-sort-marker { margin-right: .25rem; font-weight: 900; }
.ssd-table tbody tr:nth-child(even) { background: #fbfcfc; }
.ssd-table tbody tr:hover { background: #f1f8f5; }
.ssd-table tbody tr:last-child td { border-bottom: 0; }
.ssd-table td a { color: var(--ssd-accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.ssd-table td:nth-child(n+4) { max-width: 420px; }
.ssd-empty-cell { padding: 2rem !important; color: var(--ssd-muted); text-align: center !important; }

.ssd-skeleton {
  display: block;
  width: 60%;
  height: 15px;
  border-radius: 8px;
  background: linear-gradient(90deg,#eef2f0 25%,#dce7e2 45%,#eef2f0 65%);
  background-size: 300% 100%;
  animation: ssd-skeleton 1.2s ease infinite;
}
@keyframes ssd-skeleton { to { background-position: -100% 0; } }

.ssd-footer {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: .85rem;
}
.ssd-summary { color: var(--ssd-muted); font-size: .88rem; }
.ssd-pagination { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.ssd-pagination button {
  min-width: 36px;
  min-height: 36px;
  padding: .32rem .58rem;
  border: 1px solid var(--ssd-border);
  border-radius: 8px;
  background: #fff;
  color: #24443a;
  font: inherit;
  cursor: pointer;
}
.ssd-pagination button:hover:not(:disabled) { border-color: var(--ssd-accent); }
.ssd-pagination button.is-current { border-color: var(--ssd-accent); background: var(--ssd-accent); color: #fff; }
.ssd-pagination button:disabled { cursor: default; opacity: .45; }

.ssd-source-meta { margin-top: .65rem; color: #71807b; font-size: .78rem; }
.ssd-source-meta a { color: #526d64; }
.ssd-backup-warning { color: #a05b00; font-weight: 700; }
.ssd-notice { margin: 1rem 0; padding: .8rem 1rem; border-radius: 8px; }
.ssd-notice-error { background: #fff0f0; color: #962a2a; }

@media (max-width: 1150px) {
  .ssd-toolbar { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .ssd-field--search { grid-column: span 2; }
}

@media (max-width: 680px) {
  .ssd-toolbar { grid-template-columns: 1fr 1fr; padding: .8rem; }
  .ssd-field--search { grid-column: 1 / -1; }
  .ssd-reset { width: 100%; }
  .ssd-table-scroll { max-height: 68vh; border-radius: 9px; }
  .ssd-table { min-width: 780px; font-size: .84rem; }
  .ssd-table th, .ssd-table td { padding: .6rem .65rem; }
  .ssd-footer { align-items: flex-start; flex-direction: column; }
  .ssd-pagination { width: 100%; justify-content: flex-start; }
}

