/* === MinFiles - Refined Minimal === */

:root {
  /* Colors - 섬세한 회색 계조 */
  --bg: #fafaf9;
  --bg-elevated: #ffffff;
  --bg-subtle: #f4f4f3;
  --bg-hover: #efefed;
  --bg-selected: #ebeae6;

  --border: #e8e7e4;
  --border-strong: #d4d2cd;

  --text: #1a1a19;
  --text-muted: #6b6a65;
  --text-subtle: #9a9892;

  --accent: #1a1a19;
  --accent-hover: #2c2c2a;
  --accent-text: #ffffff;

  --danger: #c44536;
  --success: #3a7d3a;
  --warning: #b8830a;

  /* Typography */
  --font-sans: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Pretendard', 'Noto Sans KR', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* Spacing & Sizing */
  --radius: 6px;
  --radius-lg: 10px;
  --radius-sm: 4px;
  --header-h: 52px;
  --sidebar-w: 240px;
  --row-h: 40px;

  /* Shadows - 미묘하게 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 120ms var(--ease);
  --t: 180ms var(--ease);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0e;
    --bg-elevated: #181817;
    --bg-subtle: #1e1e1c;
    --bg-hover: #252523;
    --bg-selected: #2e2e2b;
    --border: #2a2a28;
    --border-strong: #3a3a37;
    --text: #ececea;
    --text-muted: #9a9892;
    --text-subtle: #6b6a65;
    --accent: #ececea;
    --accent-hover: #ffffff;
    --accent-text: #0f0f0e;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss03';
  letter-spacing: -0.005em;
}

.hidden { display: none !important; }
.muted { color: var(--text-muted); font-weight: normal; }

/* === Brand === */
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--text);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 6px 6px 6px 10px;
  background: var(--bg-elevated);
  border-radius: 2px;
}
.brand-mark.small { width: 22px; height: 22px; border-radius: 5px; }
.brand-mark.small::after { inset: 4px 4px 4px 8px; }

.install-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.install-brand h1 {
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em;
}

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit; font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  user-select: none;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent); color: var(--accent-text); border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost {
  background: transparent; border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); }

.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(196, 69, 54, 0.08); border-color: rgba(196, 69, 54, 0.3); }

.btn-block { width: 100%; height: 38px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon { width: 30px; padding: 0; }

/* === Forms === */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

input[type=text], input[type=password], input[type=email], select, textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 26, 25, 0.08);
}

/* 비밀번호 보기 토글 */
.pw-wrap {
  position: relative;
}
.pw-wrap input[type=password],
.pw-wrap input[type=text] {
  padding-right: 40px;
}
.pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  padding: 0;
  transition: all var(--t-fast);
}
.pw-toggle:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.pw-toggle svg {
  width: 16px; height: 16px;
}

/* === Alerts === */
.alert {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-error {
  background: rgba(196, 69, 54, 0.06);
  border-color: rgba(196, 69, 54, 0.2);
  color: var(--danger);
}

/* === Install/Login Page === */
.install-page, .login-container {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.install-container {
  width: 100%; max-width: 420px;
}
.install-card, .login-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}
.install-card h2, .login-card h2 {
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.install-desc, .login-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}
.install-form .btn { margin-top: 8px; }
#guest-btn { margin-top: 8px; }
.install-success { text-align: center; padding: 12px 0; }
.install-success h2 { margin-bottom: 8px; }
.install-success p { color: var(--text-muted); margin-bottom: 20px; }
.install-success .btn { display: inline-flex; }
.install-footer {
  text-align: center;
  color: var(--text-subtle);
  font-size: 12px;
  margin-top: 20px;
}

/* === Main Layout === */
#main-view {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
}
.sidebar-header {
  height: var(--header-h);
  padding: 0 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.brand-text {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}
.nav-section {
  padding: 8px 8px 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast);
  user-select: none;
}
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--bg-selected); font-weight: 500; }
.nav-item .ico { opacity: 0.7; }
.nav-item .nav-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.65;
  color: var(--text);
}
.nav-item:hover .nav-ico,
.nav-item.active .nav-ico { opacity: 1; }

.fav-item { gap: 6px; }
.fav-remove {
  width: 18px; height: 18px;
  border: none;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
  border-radius: 3px;
  display: none;
  align-items: center; justify-content: center;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.fav-item:hover .fav-remove { display: flex; }
.fav-remove:hover { background: var(--bg-hover); color: var(--danger); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t-fast);
}
.user-chip:hover { background: var(--bg-hover); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-size: 11px; color: var(--text-subtle);
}

/* === Content === */
.content {
  flex: 1;
  display: flex; flex-direction: column;
  min-width: 0;
  position: relative;
  background: var(--bg-elevated);
}

.content-header {
  height: var(--header-h);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.breadcrumb {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px;
  overflow-x: auto;
  scrollbar-width: none;
}
.breadcrumb::-webkit-scrollbar { display: none; }
.bc-item {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.bc-item:hover { background: var(--bg-hover); color: var(--text); }
.bc-item:last-child { color: var(--text); font-weight: 500; }
.bc-sep { color: var(--text-subtle); font-size: 11px; }

.header-actions {
  display: flex; align-items: center; gap: 8px;
}

/* 검색창 */
.search-wrap {
  position: relative;
  display: flex; align-items: center;
}
.search-input {
  width: 240px;
  height: 32px;
  padding: 0 32px 0 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  transition: all var(--t-fast);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px rgba(26, 26, 25, 0.06);
  width: 280px;
}
.search-input::placeholder {
  color: var(--text-subtle);
}
.search-wrap::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9892' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  transition: opacity var(--t-fast);
}
/* 입력값이 있으면 돋보기 숨김 */
.search-wrap.has-value::before {
  opacity: 0;
}
.search-clear {
  position: absolute;
  right: 6px;
  width: 20px; height: 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  line-height: 1;
}
.search-clear:hover { background: var(--bg-hover); color: var(--text); }

/* 검색 결과 위치 표시 */
.file-row .fl-location {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 1px;
}
.fl-name-wrap {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 0;
  line-height: 1.3;
}

/* 검색 모드 표시 */
.search-banner {
  padding: 10px 20px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between;
}
.search-banner strong { color: var(--text); }

.toolbar {
  padding: 10px 20px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
  min-height: 48px;
}
.toolbar .spacer { flex: 1; }
.selection-info {
  font-size: 12px; color: var(--text-muted);
  margin-right: 8px;
}

/* === File List === */
.file-area {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.file-list-header {
  display: grid;
  grid-template-columns: 1fr 100px 160px 40px;
  gap: 12px;
  padding: 0 20px;
  height: 36px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-subtle);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--bg-elevated);
  position: sticky; top: 0;
  z-index: 2;
  white-space: nowrap;
}
.fl-col.sortable {
  cursor: pointer;
  user-select: none;
  display: flex; align-items: center; gap: 4px;
  transition: color var(--t-fast);
}
.fl-col.sortable:hover { color: var(--text); }
.fl-col.sorted { color: var(--text); }
.sort-indicator::before { content: ''; font-size: 9px; }
.fl-col.sorted.asc .sort-indicator::before { content: '↑'; }
.fl-col.sorted.desc .sort-indicator::before { content: '↓'; }

.file-row {
  display: grid;
  grid-template-columns: 1fr 100px 160px 40px;
  gap: 12px;
  padding: 0 20px;
  height: var(--row-h);
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--t-fast);
  user-select: none;
}
.file-row:hover { background: var(--bg-subtle); }
.file-row.selected { background: var(--bg-selected); }
.file-row.selected:hover { background: var(--bg-selected); }

.fl-name {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.file-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.file-icon svg {
  width: 22px; height: 22px;
  flex-shrink: 0;
}
.file-icon.thumb {
  width: 24px; height: 24px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border);
}
.file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 450;
}
.fl-size, .fl-modified {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.fl-actions {
  display: flex; align-items: center; justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.file-row:hover .fl-actions,
.file-row.selected .fl-actions { opacity: 1; }
.row-action {
  width: 24px; height: 24px;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.row-action:hover { background: var(--bg-hover); color: var(--text); }

/* 터치 기기: ⋯ 버튼 항상 표시 (hover 없으므로) */
@media (hover: none) {
  .fl-actions { opacity: 1; }
}

.empty-state {
  padding: 80px 20px;
  text-align: center;
  color: var(--text-subtle);
}
.empty-icon {
  font-size: 40px; opacity: 0.3; margin-bottom: 12px;
}

/* === Drop Overlay === */
/* 드래그 이동 */
.file-row.drag-over {
  background: var(--bg-selected);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.file-row.dragging { opacity: 0.4; }

/* 폴더 선택 트리 (이동 다이얼로그) */
.folder-tree {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-subtle);
}
.tree-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  cursor: pointer; font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  user-select: none;
}
.tree-item:last-child { border-bottom: none; }
.tree-item:hover { background: var(--bg-hover); }
.tree-item.selected { background: var(--bg-selected); font-weight: 500; }
.tree-item .tree-ico { opacity: 0.7; font-size: 14px; }
.tree-item .tree-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-expand {
  width: 18px; height: 18px; border: none; background: transparent;
  cursor: pointer; color: var(--text-muted); font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px; flex-shrink: 0;
}
.tree-expand:hover { background: var(--bg-hover); }
.selected-dest {
  margin-top: 10px; padding: 8px 12px;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--text-muted);
}
.selected-dest strong { color: var(--text); font-family: var(--font-mono); }

.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 25, 0.04);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  pointer-events: none;
  animation: fadeIn 150ms var(--ease);
}
.drop-inner {
  padding: 48px 72px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.drop-icon {
  font-size: 32px;
  margin-bottom: 12px;
  color: var(--accent);
}
.drop-inner p {
  font-size: 14px;
  font-weight: 500;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === Upload Progress === */
.upload-progress {
  position: fixed;
  bottom: 16px; right: 16px;
  width: 340px; max-height: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.up-header {
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 500;
}
.up-close {
  border: none; background: transparent; cursor: pointer;
  color: var(--text-muted); font-size: 16px;
  width: 24px; height: 24px; border-radius: var(--radius-sm);
}
.up-close:hover { background: var(--bg-hover); }
.up-list {
  overflow-y: auto;
  max-height: 340px;
}
.up-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.up-item:last-child { border-bottom: none; }
.up-name {
  font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 6px;
}
.up-bar {
  height: 3px;
  background: var(--bg-subtle);
  border-radius: 2px;
  overflow: hidden;
}
.up-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 200ms var(--ease);
}
.up-item.done .up-bar-fill { background: var(--success); }
.up-item.error .up-bar-fill { background: var(--danger); }
.up-status {
  font-size: 11px; color: var(--text-muted);
  margin-top: 4px;
}

/* === Context Menu === */
.context-menu {
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  min-width: 180px;
  z-index: 1000;
  animation: ctxIn 100ms var(--ease);
}
@keyframes ctxIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.ctx-item {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  transition: background var(--t-fast);
}
.ctx-item:hover { background: var(--bg-hover); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(196, 69, 54, 0.08); }
.ctx-sep {
  height: 1px; background: var(--border);
  margin: 4px 0;
}
.ctx-icon { opacity: 0.6; width: 16px; }

/* === Modal === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  animation: fadeIn 150ms var(--ease);
  padding: 16px;
}
.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%; max-width: 440px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 200ms var(--ease);
}
.modal.modal-lg {
  max-width: 720px;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal h3 {
  font-size: 16px; font-weight: 600;
  margin-bottom: 6px; letter-spacing: -0.01em;
}
.modal .modal-desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* 관리자 모달 내부 */
.admin-modal-head {
  margin: 0 -24px 16px;
  padding: 0 24px 0;
  border-bottom: 1px solid var(--border);
}
.admin-tabs {
  display: flex; gap: 4px;
  margin-top: 16px;
  margin-bottom: -1px;
}
.admin-tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.admin-content {
  max-height: 60vh;
  overflow-y: auto;
  margin: 0 -24px;
  padding: 0 24px;
}

/* === Toasts === */
.toast-container {
  position: fixed;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 200ms var(--ease);
  pointer-events: auto;
  max-width: 400px;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

/* === Admin Panel === */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-table tr:hover td { background: var(--bg-subtle); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.badge.admin { background: var(--text); color: var(--bg); border-color: var(--text); }

/* === Responsive === */
@media (max-width: 900px) {
  :root {
    --sidebar-w: 220px;
  }
  .search-input { width: 180px; }
  .search-input:focus { width: 220px; }
}

@media (max-width: 768px) {
  /* 사이드바는 오버레이로 */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 200ms var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 49;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms var(--ease);
  }
  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-btn {
    display: flex !important;
  }

  .file-list-header, .file-row {
    grid-template-columns: 1fr 72px 32px;
    padding: 0 12px;
    gap: 6px;
  }
  /* 수정일 컬럼 완전히 제거 - 그리드 셀에서도 빠지도록 */
  .fl-modified { display: none !important; }
  /* 헤더 높이 조정 */
  .file-list-header { height: 32px; }
  /* 파일 행 높이 조정 */
  .file-row { height: 44px; }
  .content-header { padding: 0 12px; gap: 8px; height: 48px; }
  .toolbar { padding: 8px 12px; flex-wrap: wrap; }
  .search-input {
    width: 100%;
    min-width: 0;
  }
  .search-input:focus { width: 100%; }
  .search-wrap { flex: 1; }

  .breadcrumb { font-size: 12px; }
  .bc-item { padding: 3px 6px; }

  .modal { padding: 20px 16px; }
  .admin-modal-head { margin: 0 -16px 12px; padding: 0 16px; }
  .admin-content { margin: 0 -16px; padding: 0 16px; }
  .admin-table th, .admin-table td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .upload-progress {
    width: calc(100vw - 32px);
    right: 16px;
    max-width: 340px;
  }
}

@media (max-width: 480px) {
  .file-list-header, .file-row {
    grid-template-columns: 1fr 64px;
  }
  .fl-actions { display: none !important; }
  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) { display: none; }
}

/* 햄버거 메뉴 버튼 - 기본은 숨김 */
.menu-btn {
  display: none;
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text);
  flex-shrink: 0;
}
.menu-btn:hover { background: var(--bg-hover); }
.menu-btn svg { width: 18px; height: 18px; }

/* === Scrollbars === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }
