/**
 * Cloud EDMS — LIMS package 테마 연동 UI
 */
.cloud-edms-layout {
  min-height: 100vh;
  background: var(--bs-body-bg, #f5f6fa);
}

.cloud-edms-layout .cloud-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.cloud-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bs-card-bg, #fff);
  border-right: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.cloud-sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.06));
}

.cloud-sidebar-brand a {
  text-decoration: none;
  color: inherit;
}

.cloud-sidebar-brand .brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.cloud-sidebar-brand .brand-sub {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}

.cloud-nav-section {
  padding: 0.75rem 0.75rem 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bs-secondary-color);
}

.cloud-nav {
  list-style: none;
  padding: 0 0.65rem;
  margin: 0 0 0.5rem;
}

.cloud-nav li a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--bs-body-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.cloud-nav li a:hover {
  background: rgba(89, 85, 209, 0.08);
  color: #5955d1;
}

.cloud-nav li a.active {
  background: rgba(89, 85, 209, 0.12);
  color: #5955d1;
  font-weight: 600;
}

.cloud-nav li a .nav-icon {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.cloud-sidebar-storage {
  margin-top: auto;
  padding: 1rem 1rem 1.25rem;
  border-top: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.06));
}

.cloud-quota-block + .cloud-quota-block {
  margin-top: 0.85rem;
}

.cloud-quota-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
  color: var(--bs-secondary-color);
}

.cloud-quota-label strong {
  color: var(--bs-body-color);
  font-weight: 600;
}

.cloud-quota-bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(89, 85, 209, 0.12);
  overflow: hidden;
}

.cloud-quota-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #5955d1, #7b77e8);
  transition: width 0.4s ease;
}

.cloud-quota-bar-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.cloud-quota-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.cloud-download-summary {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--bs-border-color, rgba(0, 0, 0, 0.08));
}

.cloud-download-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  margin-bottom: 0.35rem;
}

.cloud-download-row strong {
  color: var(--bs-body-color);
  font-weight: 600;
  white-space: nowrap;
}

.cloud-download-row .fi {
  font-size: 0.7rem;
  opacity: 0.75;
}

.cloud-download-stats-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #5955d1;
  text-decoration: none;
}

.cloud-download-stats-link:hover {
  text-decoration: underline;
}

.cloud-stats-page {
  max-width: 960px;
}

.cloud-stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.cloud-stat-card {
  padding: 1.1rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
  background: var(--bs-body-bg, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cloud-stat-card-skeleton {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cloud-stat-card-label {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  margin-bottom: 0.35rem;
}

.cloud-stat-card-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #4338ca;
  line-height: 1.2;
}

.cloud-stat-card-sub {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  margin-top: 0.25rem;
}

.cloud-stats-tabs .btn.active {
  background: #5955d1;
  border-color: #5955d1;
  color: #fff;
}

.cloud-stats-toolbar {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.06));
}

.cloud-stats-select {
  width: auto;
  min-width: 140px;
}

/* ── Main ── */
.cloud-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cloud-topbar {
  background: var(--bs-card-bg, #fff);
  border-bottom: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.cloud-topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.cloud-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cloud-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5955d1, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.cloud-content {
  padding: 1.25rem 1.5rem 2rem;
  flex: 1;
}

/* ── Drive panel ── */
.cloud-drive-card {
  background: var(--bs-card-bg, #fff);
  border: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.cloud-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.06));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.cloud-toolbar .btn-cloud-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.cloud-search-wrap {
  position: relative;
  margin-left: auto;
  min-width: 220px;
}

.cloud-search-wrap input {
  padding-left: 2.25rem;
  border-radius: 2rem;
  background: var(--bs-body-bg, #f5f6fa);
  border-color: transparent;
}

.cloud-search-wrap input:focus {
  background: #fff;
  border-color: rgba(89, 85, 209, 0.35);
  box-shadow: 0 0 0 3px rgba(89, 85, 209, 0.12);
}

.cloud-search-wrap .search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.45;
  pointer-events: none;
}

.cloud-dropzone {
  margin: 1rem 1.25rem 0;
  padding: 1.75rem 1rem;
  border: 2px dashed rgba(89, 85, 209, 0.25);
  border-radius: 0.65rem;
  text-align: center;
  background: rgba(89, 85, 209, 0.03);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  cursor: pointer;
}

.cloud-dropzone:hover,
.cloud-dropzone.dragover {
  border-color: #5955d1;
  background: rgba(89, 85, 209, 0.07);
}

.cloud-dropzone.dragover {
  transform: scale(1.005);
}

.cloud-dropzone-icon {
  font-size: 2rem;
  color: #5955d1;
  margin-bottom: 0.35rem;
}

.cloud-dropzone p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

.cloud-dropzone p strong {
  color: #5955d1;
}

.cloud-breadcrumb-bar {
  padding: 0.75rem 1.25rem 0;
}

.cloud-breadcrumb-bar .breadcrumb {
  margin: 0;
  font-size: 0.85rem;
}

/* styles.css 는 FA6 구분자(\f054)를 쓰지만 Cloud는 Flaticon만 로드 → uicons로 대체 */
.cloud-edms-layout .breadcrumb-item + .breadcrumb-item {
  padding-left: 0.5rem;
}

.cloud-edms-layout .breadcrumb-item + .breadcrumb-item::before {
  content: "\f155" !important;
  font-family: uicons-regular-rounded !important;
  font-weight: normal !important;
  font-style: normal;
  font-size: 0.7rem;
  line-height: 1.2;
  float: none;
  display: inline-block;
  vertical-align: middle;
  padding-right: 0.4rem;
  padding-left: 0;
  color: var(--bs-secondary-color, #6c757d);
  opacity: 0.75;
}

.cloud-file-table-wrap {
  padding: 0.5rem 0 0;
}

.cloud-file-table {
  margin: 0;
}

.cloud-file-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
  border-bottom-width: 1px;
  padding: 0.65rem 1.25rem;
  background: transparent;
}

.cloud-file-table tbody td {
  padding: 0.75rem 1.25rem;
  vertical-align: middle;
  border-color: rgba(0, 0, 0, 0.04);
}

.cloud-file-table tbody tr {
  transition: background 0.12s;
}

.cloud-file-table tbody tr:hover {
  background: rgba(89, 85, 209, 0.04);
}

.cloud-file-row-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.cloud-file-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.cloud-file-icon i[class*='fi-rr-']::before {
  font-family: uicons-regular-rounded !important;
  display: inline-block;
  line-height: 1;
}

.cloud-file-icon.cloud-icon-folder {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.cloud-file-icon.cloud-icon-file {
  background: rgba(89, 85, 209, 0.12);
  color: #5955d1;
}

.cloud-file-meta {
  min-width: 0;
}

.cloud-file-meta .name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.cloud-file-meta .sub {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}

.cloud-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.cloud-file-table tbody tr:hover .cloud-row-actions {
  opacity: 1;
}

.cloud-row-actions .btn-icon-sm {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.4rem;
  border: none;
  background: transparent;
  color: var(--bs-secondary-color);
}

.cloud-row-actions .btn-icon-sm:hover {
  background: rgba(89, 85, 209, 0.1);
  color: #5955d1;
}

.cloud-row-actions .btn-icon-sm.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.cloud-row-actions .btn-icon-sm.cloud-fav.is-favorited,
.cloud-row-actions .btn-icon-sm.cloud-fav.is-favorited i {
  color: #eab308;
}

.cloud-row-actions .btn-icon-sm.cloud-fav.is-favorited:hover {
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
}

.cloud-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--bs-secondary-color);
}

.cloud-empty-state .empty-icon {
  font-size: 3rem;
  opacity: 0.35;
  margin-bottom: 0.75rem;
}

/* List pages (inbox, trash, …) */
.cloud-list-card {
  background: var(--bs-card-bg, #fff);
  border: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.cloud-list-card .card-header-lite {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.06));
  font-weight: 600;
  font-size: 0.9rem;
}

.cloud-file-table tbody tr.cloud-dragging {
  opacity: 0.55;
}

.cloud-file-table tbody tr.cloud-folder-drop.dragover {
  background: rgba(89, 85, 209, 0.08);
  outline: 2px dashed rgba(89, 85, 209, 0.45);
  outline-offset: -2px;
}

/* 드래그앤드롭 영역 — 텍스트 선택·네이티브 텍스트 드래그 방지 */
.cloud-has-drag-handle,
.cloud-has-drag-handle .cloud-file-row-name,
.cloud-has-drag-handle .cloud-file-meta,
.cloud-folder-drop,
.cloud-folder-drop .cloud-file-row-name,
.cloud-folder-drop .cloud-file-meta,
.cloud-dropzone {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.cloud-has-drag-handle .cloud-file-meta .name,
.cloud-has-drag-handle .cloud-file-meta .sub,
.cloud-folder-drop .cloud-file-meta .name,
.cloud-folder-drop .cloud-file-meta .sub {
  -webkit-user-drag: none;
  user-drag: none;
}

.cloud-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.35rem;
  border-radius: 0.35rem;
  color: var(--bs-secondary-color, #6c757d);
  cursor: grab;
  touch-action: none;
}

.cloud-drag-handle:hover {
  background: rgba(89, 85, 209, 0.1);
  color: #5955d1;
}

.cloud-drag-handle:active {
  cursor: grabbing;
}

.cloud-bulk-bar {
  margin: 0 1.25rem 0.75rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, rgba(89, 85, 209, 0.1), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(89, 85, 209, 0.2);
  border-radius: 0.65rem;
}

.cloud-bulk-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cloud-bulk-count {
  font-size: 0.875rem;
  color: var(--bs-body-color, #212529);
}

.cloud-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cloud-check-col {
  width: 2.5rem;
  text-align: center;
  vertical-align: middle;
}

.cloud-check-cell {
  width: 2.5rem;
  text-align: center;
  vertical-align: middle;
}

.cloud-check-cell .form-check-input,
.cloud-check-col .form-check-input {
  margin: 0;
  cursor: pointer;
}

.cloud-file-table tbody tr.cloud-row-selected {
  background: rgba(89, 85, 209, 0.06);
}

.cloud-file-table tbody tr.cloud-row-selected:hover {
  background: rgba(89, 85, 209, 0.1);
}

/* 이동 대상 폴더 선택 모달 */
.cloud-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cloud-modal[hidden] {
  display: none !important;
}

body.cloud-modal-open {
  overflow: hidden;
}

.cloud-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.cloud-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: min(80vh, 560px);
  display: flex;
  flex-direction: column;
}

.cloud-modal-content {
  background: var(--bs-body-bg, #fff);
  border-radius: 0.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 560px);
  overflow: hidden;
}

.cloud-modal-header,
.cloud-modal-footer {
  padding: 0.85rem 1.15rem;
  flex-shrink: 0;
}

.cloud-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
}

.cloud-modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.cloud-modal-body {
  padding: 0.85rem 1.15rem;
  overflow-y: auto;
  flex: 1;
}

.cloud-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  border-top: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
}

.cloud-move-dest {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 0.65rem;
  border: 2px solid rgba(89, 85, 209, 0.35);
  background: linear-gradient(135deg, rgba(89, 85, 209, 0.08), rgba(139, 92, 246, 0.05));
}

.cloud-move-dest.is-blocked {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

.cloud-move-dest-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5955d1;
  margin-bottom: 0.5rem;
}

.cloud-move-dest.is-blocked .cloud-move-dest-label {
  color: #dc2626;
}

.cloud-move-dest-current {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.cloud-move-dest-icon {
  font-size: 1.5rem;
  color: #d97706;
}

.cloud-move-dest-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--bs-body-color, #212529);
  word-break: break-all;
}

.cloud-move-dest-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.25rem;
  font-size: 0.8rem;
  color: var(--bs-secondary-color, #6c757d);
}

.cloud-move-path-seg.is-target {
  font-weight: 700;
  color: #5955d1;
}

.cloud-move-path-sep {
  font-size: 0.7rem;
  opacity: 0.55;
}

.cloud-move-section {
  margin-top: 0.25rem;
}

.cloud-move-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.cloud-move-section-desc {
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #6c757d);
  margin-bottom: 0.5rem;
}

.cloud-move-nav-path {
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 0.4rem;
}

.cloud-move-folder-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--bs-border-color, rgba(0, 0, 0, 0.08));
  border-radius: 0.5rem;
}

.cloud-move-folder-item {
  cursor: pointer;
  font-size: 0.9rem;
}

.cloud-move-folder-item-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cloud-move-folder-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-move-folder-item-hint {
  font-size: 0.72rem;
  color: var(--bs-secondary-color, #6c757d);
}

.cloud-move-folder-empty {
  font-size: 0.82rem;
  color: var(--bs-secondary-color, #6c757d);
  line-height: 1.5;
  padding: 0.85rem 1rem !important;
}

.cloud-move-folder-item:hover {
  background: rgba(89, 85, 209, 0.06);
}

.cloud-upload-progress {
  margin: 0 1.25rem 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(89, 85, 209, 0.06);
  border-radius: 0.5rem;
  border: 1px solid rgba(89, 85, 209, 0.12);
}

.cloud-dropzone.is-uploading {
  pointer-events: none;
  opacity: 0.55;
}

.cloud-move-folder-list .list-group-item {
  cursor: pointer;
}

/* 내 드라이브 공유 */
.cloud-modal-dialog-wide {
  max-width: 520px;
}

.cloud-shared-access-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: rgba(89, 85, 209, 0.08);
  border: 1px solid rgba(89, 85, 209, 0.2);
  color: #4338ca;
  font-size: 0.875rem;
}

.cloud-share-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  vertical-align: middle;
}

.cloud-share-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cloud-share-target-chip {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(89, 85, 209, 0.1);
  font-size: 0.8rem;
  font-weight: 600;
}

.cloud-share-grantee-list .list-group-item {
  border-left: 0;
  border-right: 0;
}

#cloudShareModal .select2-container {
  width: 100% !important;
}

@media (max-width: 991.98px) {
  .cloud-shell {
    flex-direction: column;
  }
  .cloud-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .cloud-sidebar-storage {
    display: none;
  }
  .cloud-search-wrap {
    width: 100%;
    margin-left: 0;
    margin-top: 0.5rem;
  }
}
