:root {
  --ink: #17212b;
  --muted: #687583;
  --line: #e3e8ec;
  --soft: #f4f7f8;
  --panel: #ffffff;
  --brand: #246b5b;
  --brand-dark: #174d42;
  --brand-soft: #e9f4f1;
  --danger: #c34545;
  --shadow: 0 18px 50px rgba(22, 39, 47, .10);
  font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--soft);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(36, 107, 91, .22); outline-offset: 2px; }
[hidden] { display: none !important; }

.primary-button, .secondary-button {
  min-height: 44px; border-radius: 10px; padding: 0 18px; border: 1px solid transparent;
  font-weight: 700; cursor: pointer; transition: .18s ease;
}
.primary-button { background: var(--brand); color: white; box-shadow: 0 7px 18px rgba(36, 107, 91, .20); }
.primary-button:hover { background: var(--brand-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.primary-button.compact { min-height: 40px; padding-inline: 15px; }
.secondary-button { background: white; border-color: #d8e0e4; }
.secondary-button:hover { background: #f8fafb; border-color: #c2cdd2; }
.eyebrow { color: var(--brand); letter-spacing: .15em; font-size: 11px; font-weight: 800; }
.muted { color: var(--muted); }
.form-error { color: #ae3434; background: #fff0f0; border-radius: 8px; padding: 10px 12px; font-size: 13px; }

/* Login */
.login-page { min-height: 100vh; background: #edf2f1; display: grid; place-items: center; padding: 28px; }
.login-shell { width: min(100%, 980px); min-height: 590px; display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border-radius: 24px; background: white; box-shadow: var(--shadow); }
.login-brand { position: relative; overflow: hidden; padding: 76px 70px; background: #153f38; color: white; }
.login-brand::before, .login-brand::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); }
.login-brand::before { width: 480px; height: 480px; left: 180px; top: 230px; }
.login-brand::after { width: 330px; height: 330px; left: 260px; top: 305px; }
.brand-mark { width: 44px; height: 44px; display: flex; gap: 4px; align-items: end; margin-bottom: 78px; }
.brand-mark span, .logo-symbol i { display: block; width: 9px; border-radius: 2px 2px 0 0; transform: skewY(-16deg); background: #75c7b4; }
.brand-mark span:nth-child(1) { height: 23px; }.brand-mark span:nth-child(2) { height: 34px; }.brand-mark span:nth-child(3) { height: 44px; }
.login-brand .eyebrow { color: #8fd4c4; }
.login-brand h1 { font-size: clamp(42px, 5vw, 60px); line-height: 1.16; letter-spacing: -.055em; margin: 18px 0 25px; }
.login-brand > p:last-child { color: #c0d3ce; line-height: 1.75; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 64px 58px; }
.login-card h2 { margin: 8px 0 5px; font-size: 31px; letter-spacing: -.04em; }
.login-card form { margin-top: 38px; display: grid; gap: 18px; }
.login-card label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; color: #3f4d57; }
.login-card input, #prompt-input { width: 100%; height: 48px; border: 1px solid #d6dfe3; border-radius: 10px; padding: 0 14px; background: #fbfcfc; }
.login-card input:focus, #prompt-input:focus { border-color: var(--brand); background: white; outline: 3px solid rgba(36,107,91,.12); }
.login-card form button { margin-top: 7px; display: flex; align-items: center; justify-content: space-between; width: 100%; }
.login-help { margin-top: 28px; color: #859099; font-size: 12px; line-height: 1.6; }
.login-mode-button { align-self: flex-start; margin-top: 20px; padding: 4px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--brand); font-size: 12px; font-weight: 700; cursor: pointer; }

/* Application shell */
.app-page { background: #f4f6f7; min-height: 100vh; }
.app-layout { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 30; display: flex; flex-direction: column; padding: 26px 18px 20px; background: #173d37; color: white; }
.logo { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; text-decoration: none; color: white; font-size: 18px; letter-spacing: -.02em; }
.logo-symbol { height: 27px; display: flex; align-items: end; gap: 3px; }
.logo-symbol i { width: 6px; height: 15px; }.logo-symbol i:nth-child(2){height:21px}.logo-symbol i:nth-child(3){height:27px}
.sidebar nav { display: grid; gap: 6px; }
.nav-item { width: 100%; min-height: 46px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 10px; padding: 0 13px; color: #bad0ca; background: transparent; cursor: pointer; font-weight: 600; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: rgba(126, 205, 187, .15); color: white; }
.nav-icon { width: 19px; color: #87cbbb; font-size: 20px; text-align: center; }
.sidebar-bottom { position: relative; margin-top: auto; }
.capacity { padding: 15px 11px 19px; font-size: 11px; color: #a9c0ba; }
.capacity > div:first-child { display: flex; justify-content: space-between; gap: 8px; }
.capacity strong { color: #dce9e6; font-weight: 600; }
.capacity-track { height: 5px; overflow: hidden; margin-top: 10px; background: rgba(255,255,255,.12); border-radius: 5px; }
.capacity-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #78c7b5; transition: width .5s ease; }
.profile { border: 0; border-top: 1px solid rgba(255,255,255,.10); background: transparent; color: white; width: 100%; min-height: 64px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 12px 9px 8px; text-align: left; cursor: pointer; border-radius: 8px; }
.profile:hover, .profile[aria-expanded="true"] { background: rgba(255,255,255,.06); }
.profile > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.profile strong { overflow: hidden; text-overflow: ellipsis; font-size: 13px; }.profile small { color: #9ab4ae; font-size: 10px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #d9eee9; color: var(--brand-dark); font-weight: 800; }
.logout-button { width: 100%; border: 0; background: transparent; color: #9fb8b2; padding: 8px; cursor: pointer; font-size: 11px; text-align: left; }
.logout-button:hover { color: white; }
.profile-menu { position: absolute; z-index: 55; left: 7px; right: 7px; bottom: 65px; display: grid; padding: 6px; border: 1px solid #dce5e2; border-radius: 10px; background: white; box-shadow: 0 12px 30px rgba(8,25,21,.28); }
.profile-menu button { min-height: 38px; border: 0; border-radius: 7px; padding: 0 10px; background: transparent; color: var(--ink); text-align: left; font-size: 12px; font-weight: 650; cursor: pointer; }
.profile-menu button:hover { background: var(--soft); color: var(--brand); }
.main-panel { min-width: 0; }
.topbar { height: 76px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 0 clamp(22px,4vw,52px); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }
.search-wrap { width: min(440px, 45vw); height: 40px; display: flex; align-items: center; gap: 9px; border-radius: 10px; background: #f2f5f6; padding: 0 13px; color: #819099; }
.search-wrap input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.top-actions { display: flex; gap: 9px; white-space: nowrap; }
.content { padding: 34px clamp(22px,4vw,52px) 100px; }
.content-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.content-head h1 { margin: 8px 0 0; font-size: 26px; letter-spacing: -.04em; }
.breadcrumbs { min-height: 17px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: #7a8790; font-size: 12px; }
.breadcrumbs button { border: 0; background: transparent; color: inherit; padding: 0; cursor: pointer; }.breadcrumbs button:hover { color: var(--brand); }
.view-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.view-meta button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; font-size: 17px; }
.drop-zone { display: none; height: 128px; margin-bottom: 16px; border: 2px dashed #7eb9ab; border-radius: 14px; background: #eff8f5; color: var(--brand-dark); place-items: center; align-content: center; gap: 4px; }
.drop-zone.visible { display: grid; }.drop-zone span { color: var(--muted); font-size: 12px; }.drop-icon { font-size: 25px; }
.table-card { position: relative; min-height: 290px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 4px 18px rgba(27,43,51,.035); }
.table-toolbar { min-height: 52px; display: flex; align-items: center; gap: 18px; padding: 0 18px; background: #edf6f3; border-bottom: 1px solid #d8e9e4; font-size: 12px; }
.table-toolbar button { border: 0; background: transparent; color: var(--brand); cursor: pointer; font-weight: 700; }.table-toolbar .danger-text { color: var(--danger); }
.file-row { min-height: 61px; display: grid; grid-template-columns: 42px minmax(190px,1fr) 120px 165px 42px; align-items: center; padding: 0 18px; border-bottom: 1px solid #edf0f2; font-size: 13px; transition: background .15s ease; }
.file-row:not(.file-header):hover { background: #fafcfc; }
.file-row.selected { background: #f0f7f5; }
.file-header { min-height: 45px; color: #81909a; background: #fafbfb; font-size: 11px; font-weight: 700; }
.file-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.file-name { min-width: 0; display: flex; align-items: center; gap: 12px; font-weight: 600; cursor: default; }
.file-name.openable { cursor: pointer; }.file-name.openable:hover .entry-label { color: var(--brand); }
.entry-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-icon { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #edf3f2; color: #397567; font-size: 16px; }
.file-icon.folder { background: #fff4d9; color: #b17a18; }
.file-size, .file-date { color: #6f7c85; font-size: 12px; }
.row-menu { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #7e8a91; cursor: pointer; font-size: 18px; }.row-menu:hover { background: #edf2f2; }
.entry-actions { position: fixed; z-index: 50; min-width: 145px; display: grid; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 12px 35px rgba(20,35,42,.16); }
.entry-actions button { border: 0; background: transparent; border-radius: 7px; text-align: left; padding: 9px 10px; cursor: pointer; font-size: 12px; }.entry-actions button:hover { background: var(--soft); }.entry-actions .danger { color: var(--danger); }
.empty-state { min-height: 290px; display: grid; place-items: center; align-content: center; gap: 5px; color: #89959c; text-align: center; }
.empty-state div { font-size: 35px; color: #8eb9ae; }.empty-state h2 { margin: 4px 0 0; color: #34434b; font-size: 17px; }.empty-state p { margin: 4px 0; font-size: 12px; }

/* Transfers, dialogs, toasts */
.transfer-panel { position: fixed; right: 24px; bottom: 20px; z-index: 40; width: min(400px, calc(100vw - 48px)); overflow: hidden; border: 1px solid #dce3e6; border-radius: 13px; background: white; box-shadow: 0 16px 50px rgba(20,35,42,.18); }
.transfer-panel > header { min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; background: #173d37; color: white; }
.transfer-panel > header div { display: flex; align-items: baseline; gap: 8px; }.transfer-panel > header span { color: #abc4be; font-size: 10px; }
.transfer-panel > header button { border: 0; background: transparent; color: white; cursor: pointer; font-size: 18px; }
.transfer-panel > header .transfer-header-actions { align-items: center; gap: 5px; }
.transfer-panel > header .transfer-clear { padding: 5px 7px; border-radius: 6px; color: #cde0dc; font-size: 10px; font-weight: 700; }
.transfer-panel > header .transfer-clear:hover { background: rgba(255,255,255,.1); color: white; }
.transfer-panel.collapsed #transfer-list { display: none; }
#transfer-list { max-height: 285px; overflow: auto; }
.transfer-item { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid #edf0f2; }
.transfer-item:last-child { border: 0; }.transfer-item .file-icon { width: 30px; height: 30px; }
.transfer-copy { min-width: 0; }.transfer-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }.transfer-copy small { color: #7d8991; font-size: 10px; }
.progress { height: 4px; overflow: hidden; margin-top: 7px; border-radius: 4px; background: #e8edee; }.progress i { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.transfer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.transfer-action { min-height: 30px; padding: 4px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--brand); cursor: pointer; font-size: 11px; font-weight: 700; white-space: nowrap; }.transfer-action:hover { background: var(--soft); }.transfer-action.cancel { color: #89949a; }.transfer-action:focus-visible { outline: 2px solid #6eb29f; outline-offset: 1px; }
dialog { width: min(430px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 15px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(17,28,32,.42); backdrop-filter: blur(2px); }
#prompt-form { padding: 26px; }#prompt-form h2 { margin: 0 0 8px; font-size: 20px; }#prompt-form > p:not(.form-error) { color: var(--muted); font-size: 13px; margin: 0 0 19px; }
.wide-dialog { width: min(620px, calc(100% - 32px)); }
.account-dialog-form { padding: 26px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dialog-heading h2 { margin: 0 0 6px; font-size: 20px; }.dialog-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.dialog-close { flex: 0 0 auto; width: 34px; height: 34px; border: 0; border-radius: 8px; background: var(--soft); color: #728087; cursor: pointer; font-size: 21px; }
.account-dialog-form > label, .create-user-form label { display: grid; gap: 7px; margin-bottom: 15px; color: #3f4d57; font-size: 12px; font-weight: 700; }
.account-dialog-form input { width: 100%; height: 44px; border: 1px solid #d6dfe3; border-radius: 9px; padding: 0 12px; background: #fbfcfc; }
.account-dialog-form input:focus { border-color: var(--brand); background: white; outline: 3px solid rgba(36,107,91,.12); }
.create-user-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding: 15px; border-radius: 11px; background: var(--soft); }.create-user-form label { margin: 0; }.create-user-form button { height: 44px; }
.setup-code-card { margin-top: 15px; padding: 15px; border: 1px solid #b9ddd4; border-radius: 11px; background: #eef8f5; }
.setup-code-card > div:first-child { display: flex; justify-content: space-between; gap: 10px; color: var(--brand-dark); font-size: 12px; }.setup-code-card > div:first-child span { color: var(--muted); font-size: 10px; }
.setup-code-card p { margin: 7px 0 12px; color: #566b66; font-size: 11px; line-height: 1.5; }
.setup-code-row { display: flex; gap: 8px; }.setup-code-row code { min-width: 0; flex: 1; display: flex; align-items: center; padding: 0 12px; border: 1px dashed #83b9ac; border-radius: 8px; background: white; color: var(--ink); font-size: 15px; font-weight: 800; letter-spacing: .08em; user-select: all; overflow-wrap: anywhere; }
.users-list-head { display: flex; justify-content: space-between; margin: 22px 0 8px; font-size: 12px; }.users-list-head span { color: var(--muted); }
.users-list { max-height: min(330px, 40vh); overflow: auto; border-block: 1px solid var(--line); }
.user-row { min-height: 64px; display: grid; grid-template-columns: 34px minmax(110px,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #edf0f2; }.user-row:last-child { border: 0; }
.user-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 800; }.user-row > div { display: grid; gap: 2px; }.user-row strong { font-size: 12px; }.user-row small { color: var(--muted); font-size: 10px; }
.user-status { padding: 4px 7px; border-radius: 20px; background: #eef4f2; color: var(--brand); font-size: 10px; font-weight: 700; }.user-status.pending { background: #fff5dd; color: #916817; }.user-status.disabled { background: #f4eeee; color: #966060; }
.user-row-actions { display: flex !important; grid-auto-flow: column; align-items: center; justify-content: end; gap: 8px !important; }
.user-role-select { min-width: 112px; height: 36px; border: 1px solid #d6dfe3; border-radius: 8px; padding: 0 28px 0 10px; background: white; color: var(--ink); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.user-role-select:focus-visible { outline: 3px solid rgba(36,107,91,.12); border-color: var(--brand); }
.user-role-select:disabled { color: #87938f; background: #f2f5f4; cursor: not-allowed; }
.users-loading { color: var(--muted); font-size: 12px; }
.dialog-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.toast-stack { position: fixed; right: 22px; top: 92px; z-index: 80; display: grid; gap: 9px; }
.toast { max-width: min(360px, calc(100vw - 44px)); padding: 12px 15px; border: 1px solid #dce4e6; border-left: 4px solid var(--brand); border-radius: 9px; background: white; box-shadow: 0 9px 25px rgba(20,35,42,.13); font-size: 12px; animation: toast-in .25s ease; }.toast.error { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px); } }

@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 244px; transition: transform .22s ease; box-shadow: 14px 0 40px rgba(0,0,0,.15); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: block; cursor: pointer; }
  .topbar { padding-inline: 22px; }
  .search-wrap { flex: 1; width: auto; }
  .file-row { grid-template-columns: 42px minmax(180px,1fr) 110px 42px; }
  .file-date, .file-header span:nth-child(4) { display: none; }
  .login-shell { grid-template-columns: .9fr 1.1fr; }.login-brand { padding: 58px 42px; }.login-card { padding: 54px 42px; }
}

@media (max-width: 650px) {
  .login-page { padding: 0; background: white; }.login-shell { min-height: 100vh; grid-template-columns: 1fr; border-radius: 0; box-shadow: none; }.login-brand { min-height: 245px; padding: 35px 28px; }.brand-mark { width: 30px; height: 30px; margin-bottom: 27px; }.brand-mark span:nth-child(1){height:16px}.brand-mark span:nth-child(2){height:23px}.brand-mark span:nth-child(3){height:30px}.login-brand h1 { font-size: 35px; margin: 10px 0; }.login-brand > p:last-child { display: none; }.login-card { padding: 38px 28px 48px; justify-content: start; }
  .topbar { height: auto; min-height: 70px; padding: 13px 16px; gap: 10px; flex-wrap: wrap; }.search-wrap { order: 3; flex-basis: 100%; height: 38px; }.top-actions { margin-left: auto; }.top-actions .secondary-button { width: 40px; padding: 0; font-size: 0; }.top-actions .secondary-button::after { content: "+"; font-size: 20px; }.primary-button.compact { padding-inline: 12px; }
  .content { padding: 24px 14px 96px; }.content-head h1 { font-size: 23px; }.view-meta > span { display: none; }
  .table-card { border-radius: 11px; }.file-row { grid-template-columns: 34px minmax(0,1fr) 36px; min-height: 66px; padding: 0 10px; }.file-header { min-height: 42px; }.file-size, .file-date, .file-header span:nth-child(3), .file-header span:nth-child(4) { display: none; }.file-name { gap: 9px; }.file-icon { width: 34px; height: 34px; }.table-toolbar { gap: 9px; padding: 0 12px; }.table-toolbar button { padding: 5px; }.drop-zone { height: 105px; }
  .transfer-panel { right: 10px; bottom: 10px; width: calc(100vw - 20px); }.toast-stack { right: 12px; top: 82px; }.toast { max-width: calc(100vw - 24px); }
  .transfer-item { grid-template-columns: 30px minmax(0,1fr); gap: 8px; padding: 11px 12px; }.transfer-actions { grid-column: 2; justify-content: flex-start; }
  .account-dialog-form { padding: 21px 18px; }.create-user-form { grid-template-columns: 1fr; }.create-user-form button { width: 100%; }.setup-code-card > div:first-child { display: grid; }.setup-code-row { align-items: stretch; }.setup-code-row code { min-height: 44px; }.users-list { max-height: 34vh; }
  .user-row { grid-template-columns: 32px minmax(0,1fr); padding: 10px 0; }.user-row-actions { grid-column: 2; justify-content: space-between; }.user-role-select { min-width: 120px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
