/* Shared file storage UI (EMS mes-fs) — used by BMS and EMS */
.platform-app,
.platform-app--bms,
.platform-app--mes-light {
  --fs-border: #e2e8f0;
  --fs-muted: #64748b;
  --fs-muted-dim: #94a3b8;
  --fs-mod: #16a34a;
  --fs-mod-soft: rgba(22, 163, 74, 0.1);
  --fs-mod-text: #15803d;
  --fs-mod-border: rgba(22, 163, 74, 0.22);
}

.mes-fs-scope .muted {
  color: var(--fs-muted);
}

.mes-fs-scope .err {
  color: #dc2626;
  font-size: 0.82rem;
}

.mes-fs-scope .btn {
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}

.mes-fs-scope .btn-primary {
  background: linear-gradient(180deg, #16a34a, #15803d);
  color: #fff;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
}

.mes-fs-scope .btn-primary:hover {
  filter: brightness(1.05);
}

.mes-fs-scope .btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.mes-fs-scope .btn-secondary {
  background: #f8fafc;
  color: #334155;
  border: 1px solid var(--fs-border);
}

.mes-fs-scope .btn-secondary:hover {
  background: #f1f5f9;
}

.mes-fs-scope .btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.mes-fs-scope .field__input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--fs-border);
  background: #ffffff;
  color: #0f172a;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
}

.mes-fs-scope .field__input:focus {
  outline: none;
  border-color: rgba(22, 163, 74, 0.45);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.mes-fs-scope .mes-card {
  background: #ffffff;
  border: 1px solid var(--fs-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 0;
}

.mes-fs-scope .mes-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.mes-fs-scope .mes-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mes-fs-scope .mes-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.mes-fs-scope .mes-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.mes-fs-scope .mes-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}

.mes-fs-scope .mes-modal__box {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  margin: 0;
}

.mes-fs-scope .mes-modal__close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.mes-fs-scope .mes-modal__close:hover {
  color: #334155;
}

.mes-fs-scope .mes-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.mes-fs-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  gap: 0;
}

.mes-fs-header {
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--fs-border);
  margin-bottom: 1rem;
}

.mes-fs-header__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.mes-fs-header__hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.mes-fs-error {
  margin: 0 0 0.75rem;
}

.mes-fs-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.mes-fs-loading {
  padding: 2rem;
  text-align: center;
}

.mes-fs-disk-wrap,
.mes-fs-explorer {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.mes-fs-disk-wrap__hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.mes-fs-section-label {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fs-muted-dim);
}

.mes-fs-disk-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 16rem;
  width: 100%;
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--fs-border);
  background: #ffffff;
  color: inherit;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mes-fs-disk-card:hover {
  border-color: var(--fs-mod-border);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.12);
}

.mes-fs-disk-card__icon {
  font-size: 2.75rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.mes-fs-disk-card__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.mes-fs-disk-card__letter {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
}

.mes-fs-disk-card__bar {
  width: 100%;
  height: 8px;
  margin-top: 1rem;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

.mes-fs-disk-card__bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--fs-mod), #8b5cf6);
}

.mes-fs-disk-card__meta {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
}

.mes-fs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--fs-border);
  background: #f8fafc;
}

.mes-fs-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 0.82rem;
}

.mes-fs-breadcrumb__btn {
  border: 0;
  background: transparent;
  color: #475569;
  cursor: pointer;
  padding: 0;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mes-fs-breadcrumb__btn:hover {
  color: var(--fs-mod-text);
}

.mes-fs-breadcrumb__sep {
  color: #94a3b8;
  margin: 0 2px;
}

.mes-fs-delete-btn {
  color: #dc2626 !important;
}

.mes-fs-grid-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.25rem;
}

.mes-fs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.65rem;
}

.mes-fs-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s;
}

.mes-fs-item:hover {
  background: #f1f5f9;
}

.mes-fs-item--active {
  background: var(--fs-mod-soft);
  box-shadow: inset 0 0 0 1px var(--fs-mod-border);
}

.mes-fs-item__icon {
  font-size: 2.5rem;
  line-height: 1;
}

.mes-fs-item__icon--folder {
  filter: saturate(1.2);
}

.mes-fs-item__thumb {
  width: 3rem;
  height: 3rem;
  border-radius: 8px;
  object-fit: cover;
}

.mes-fs-item__name {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}

.mes-fs-item__meta {
  margin-top: 0.2rem;
  font-size: 0.62rem;
}

.mes-fs-empty {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
}

.mes-fs-drop {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.08);
}

.mes-fs-drop--active {
  background: rgba(34, 197, 94, 0.12);
  backdrop-filter: blur(2px);
}

.mes-fs-drop__box {
  max-width: 18rem;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  border: 2px dashed #cbd5e1;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
}

.mes-fs-drop--active .mes-fs-drop__box {
  border-color: var(--fs-mod-border);
}

.mes-fs-drop__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}

.mes-fs-drop__hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
}

.mes-fs-drop__bar {
  width: 12rem;
  height: 6px;
  margin: 0.75rem auto 0;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

.mes-fs-drop__bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--fs-mod);
  transition: width 0.2s;
}

.mes-fs-file-input {
  display: none;
}
