/* ============ BrankasFile — stylesheet ============ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
  --bg: #0e1117;
  --bg-2: #131924;
  --panel: #161c27;
  --panel-2: #1b2231;
  --border: #263043;
  --text: #e7ecf3;
  --muted: #8d99ad;
  --accent: #4f7cff;
  --accent-2: #7b5cff;
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #f59e0b;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --sidebar-w: 258px;
  --topbar-h: 58px;
}
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --border: #e2e8f2;
  --text: #12203a;
  --muted: #64748b;
  --shadow: 0 10px 30px rgba(15, 23, 42, .10);
}
[data-theme="zephyr"] {
  --bg: #fff;
  --bg-2: #f8f9fa;
  --panel: #ffffff;
  --panel-2: #f8f9fa;
  --border: #dee2e6;
  --text: #495057;
  --muted: rgba(73, 80, 87, 0.75);
  --accent: #3459e6;
  --accent-2: #287bb5;
  --danger: #da292e;
  --ok: #2fb380;
  --warn: #f4bd61;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);
}
[data-theme="zephyr"] body {
  font-family: 'Inter', "Segoe UI", system-ui, -apple-system, sans-serif;
  letter-spacing: -0.005em;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
}
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }

/* ============ LOGIN ============ */
.login-screen { position: fixed; inset: 0; display: grid; place-items: center; }
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(79,124,255,.28), transparent 60%),
    radial-gradient(700px 500px at 85% 90%, rgba(123,92,255,.25), transparent 60%),
    var(--bg);
}
.login-card {
  position: relative; width: min(94vw, 420px);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; padding: 26px; box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.login-brand h1 { margin: 0; font-size: 22px; letter-spacing: .3px; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; letter-spacing: .5px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(79,124,255,.35);
}
.logo-mark.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.tabs { display: flex; gap: 6px; background: var(--panel-2); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tab { flex: 1; padding: 8px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tab.active { background: var(--accent); color: #fff; }
.pane { display: none; flex-direction: column; gap: 12px; }
.pane.active { display: flex; }
.pane label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.pane input {
  padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); outline: none;
}
.pane input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,124,255,.18); }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 38px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer; opacity: .7; padding: 6px;
}
.check { flex-direction: row !important; align-items: center; gap: 8px !important; }
.check input { width: 15px; height: 15px; }
.hint { color: var(--muted); font-size: 12px; text-align: center; margin: 4px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); cursor: pointer; font-weight: 600; transition: .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: 0; }
.btn.ghost { background: var(--panel-2); }
.btn.danger { background: var(--danger); color: #fff; border: 0; }
.btn.ok { background: var(--ok); color: #fff; border: 0; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.btn.block { width: 100%; padding: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ============ APP LAYOUT ============ */
.app { height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--topbar-h) 1fr; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px;
  padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .3px; }
.search { flex: 1; max-width: 520px; position: relative; }
.search input {
  width: 100%; padding: 9px 34px 9px 34px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-2); outline: none;
}
.search input:focus { border-color: var(--accent); }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); opacity: .6; }
.clear-search {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer; opacity: .6; padding: 4px 6px;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel-2); cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--accent); }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); cursor: pointer; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; text-transform: uppercase; }
.user-name { font-weight: 600; }
.caret { opacity: .6; font-size: 11px; }
.dropdown {
  position: absolute; right: 0; top: 42px; width: 200px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60;
}
.dropdown-head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; }
.dropdown-head small { color: var(--muted); }
.dropdown button { width: 100%; text-align: left; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; }
.dropdown button:hover { background: var(--panel-2); }
.dropdown button.active { background: var(--panel-2); font-weight: 600; color: var(--accent); }

.sidebar { background: var(--panel); border-right: 1px solid var(--border); padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.new-btn { width: 100%; padding: 11px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  border: 0; background: transparent; cursor: pointer; text-align: left; font-weight: 600; color: var(--muted);
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: rgba(79,124,255,.14); color: var(--accent); }
.nav-item .ic { width: 20px; text-align: center; }
.sidebar-section { display: flex; flex-direction: column; gap: 6px; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding-left: 4px; }
.tree { display: flex; flex-direction: column; gap: 2px; max-height: 34vh; overflow: auto; }
.tree-node { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--muted); }
.tree-node:hover { background: var(--panel-2); color: var(--text); }
.tree-node.active { background: rgba(79,124,255,.14); color: var(--accent); }
.tree-node.drop-target { outline: 2px dashed var(--accent); }
.tree-caret { width: 14px; font-size: 10px; opacity: .8; }
.storage { margin-top: auto; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.storage-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; color: var(--muted); }
.bar { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.storage small { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; }

/* breakdown pemakaian per jenis */
.bd { margin-top: 10px; }
.bd-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--border); }
.bd-seg { height: 100%; flex: none; }
.bd-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bd-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.bd-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bd-lab { flex: 1; color: var(--muted); }
.bd-sz { color: var(--text); font-variant-numeric: tabular-nums; }

.main { display: flex; flex-direction: column; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 180px; }
.crumb { padding: 5px 9px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-weight: 600; }
.crumb:hover { background: var(--panel-2); color: var(--text); }
.crumb.current { color: var(--text); cursor: default; }
.crumb.drop-target { outline: 2px dashed var(--accent); }
.crumb-sep { opacity: .4; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.sep { width: 1px; height: 24px; background: var(--border); }
.select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); }

.selection-bar {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  background: rgba(79,124,255,.12); border-bottom: 1px solid var(--border);
}
.selection-bar .sel-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.content { flex: 1; overflow: auto; padding: 16px; position: relative; }
.content.drop-active { outline: 2px dashed var(--accent); outline-offset: -8px; border-radius: 12px; }

.view-head { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.item {
  border: 1px solid var(--border); border-radius: 14px; background: var(--panel);
  padding: 12px; cursor: pointer; position: relative; transition: .12s; user-select: none;
}
.item:hover { border-color: var(--accent); transform: translateY(-2px); }
.item.selected { border-color: var(--accent); background: rgba(79,124,255,.12); box-shadow: 0 0 0 2px rgba(79,124,255,.25) inset; }
.item.dragging { opacity: .45; }
.item.drop-target { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(34,197,94,.35) inset; }
.thumb { height: 84px; display: grid; place-items: center; font-size: 40px; margin-bottom: 8px; overflow: hidden; border-radius: 10px; background: var(--panel-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-name { font-weight: 600; font-size: 13px; word-break: break-all; display: flex; align-items: center; gap: 5px; }
.item-meta { color: var(--muted); font-size: 11.5px; margin-top: 4px; display: flex; justify-content: space-between; gap: 6px; }
.item-star { position: absolute; top: 8px; right: 8px; opacity: 0; transition: .12s; background: transparent; border: 0; cursor: pointer; font-size: 14px; }
.item:hover .item-star, .item .item-star.on { opacity: 1; }

/* list */
.list { display: flex; flex-direction: column; gap: 2px; }
.list .item { display: grid; grid-template-columns: 34px 1fr 110px 150px 90px; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; }
.list .item:hover { transform: none; }
.list .thumb { height: 28px; width: 28px; font-size: 18px; margin: 0; background: transparent; }
.list .item-meta { margin: 0; }
.col-head {
  display: grid; grid-template-columns: 34px 1fr 110px 150px 90px; gap: 10px;
  padding: 6px 12px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.col-head span { cursor: pointer; }
.col-head span:hover { color: var(--text); }

.empty { display: grid; place-items: center; gap: 8px; padding: 60px 20px; color: var(--muted); text-align: center; }
.empty .big { font-size: 52px; }
.empty h3 { margin: 4px 0 0; color: var(--text); }

/* context menu */
.context-menu {
  position: fixed; z-index: 200; min-width: 200px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px;
}
.context-menu button { width: 100%; text-align: left; padding: 9px 11px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; display: flex; gap: 9px; }
.context-menu button:hover { background: var(--panel-2); }
.context-menu button.danger { color: var(--danger); }
.context-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }

/* modal */
.modal-root { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.modal {
  position: relative; width: min(94vw, 460px); background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); padding: 20px; max-height: 86vh; overflow: auto;
}
.modal h3 { margin: 0 0 14px; }
.modal label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.modal input { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2); outline: none; }
.modal input:focus { border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-all; }
.picker { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.picker .tree-node.picked { background: rgba(79,124,255,.18); color: var(--accent); }

/* upload panel */
.upload-panel {
  position: fixed; right: 18px; bottom: 18px; width: min(92vw, 330px); background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); z-index: 250;
}
.up-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.up-list { max-height: 260px; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.up-item { font-size: 12.5px; }
.up-item .nm { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.up-item .nm span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-item .bar { height: 6px; }

/* preview */
.preview { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.86); display: flex; flex-direction: column; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #fff; }
.pv-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-actions { display: flex; gap: 8px; }
.pv-actions .icon-btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.pv-body { flex: 1; display: grid; place-items: center; padding: 14px; overflow: auto; color: #fff; }
.pv-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.pv-body video, .pv-body audio { max-width: 100%; max-height: 100%; outline: none; }
.pv-body iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 8px; }
.pv-body pre {
  background: #0b0f16; color: #d7e2f2; padding: 16px; border-radius: 10px; max-width: 100%;
  width: min(900px, 100%); overflow: auto; font-size: 12.5px; line-height: 1.5; margin: 0;
}
.pv-nopreview { display: grid; place-items: center; gap: 12px; text-align: center; color: #cbd5e1; }

/* drop overlay */
.drop-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(79,124,255,.18); display: grid; place-items: center; pointer-events: none; }
.drop-inner { padding: 26px 34px; border: 2px dashed var(--accent); border-radius: 16px; background: var(--panel); font-weight: 700; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 600; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 16px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-weight: 600; animation: pop .18s ease-out;
}
.toast.ok { border-left: 4px solid var(--ok); }
.toast.err { border-left: 4px solid var(--danger); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* activity timeline */
.activity-list { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); }
.activity-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; flex: none; background: var(--panel-2); }
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: 13px; font-weight: 600; color: var(--text); }
.activity-detail { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { font-size: 11px; color: var(--muted); margin-top: 2px; }
.activity-empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* responsive */
.only-mobile { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: var(--sidebar-w); z-index: 80; transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: none; }
  .only-mobile { display: grid; }
  .user-name, .lbl { display: none; }
  .toolbar { flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
  .toolbar-actions { flex-wrap: wrap; gap: 6px; }
  .breadcrumb { min-width: 100%; order: -1; margin-bottom: 4px; }
  .list .item { grid-template-columns: 30px 1fr 90px; }
  .list .item .c-size, .list .item .c-date { display: none; }
  .col-head { grid-template-columns: 30px 1fr 90px; }
  .col-head span.c-size, .col-head span.c-date { display: none; }
}

/* rubber-band (hold & drag) selection */
.rubber-band {
  position: fixed;
  z-index: 60;
  border: 1px solid rgba(79,124,255,0.9);
  background: rgba(79,124,255,0.16);
  border-radius: 3px;
  pointer-events: none;
}
.item.rubber-hit {
  outline: 2px dashed rgba(79,124,255,0.9);
  outline-offset: -2px;
}
