/* ============================================================
   NexusDrive — Complete Stylesheet
   JD Development 2025  |  Dark Command Center UI
   ============================================================ */

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

:root {
  --bg:         #0f1117;
  --bg2:        #161821;
  --bg3:        #1e2130;
  --bg4:        #252840;
  --bg5:        #2d3152;
  --border:     #2a2d3e;
  --border2:    #353852;
  --border3:    #404466;
  --text:       #e8eaf6;
  --text2:      #9094b0;
  --text3:      #565a78;
  --accent:     #6c63ff;
  --accent2:    #8b84ff;
  --accent3:    #a89fff;
  --accent-bg:  rgba(108,99,255,.12);
  --accent-bdr: rgba(108,99,255,.35);
  --green:      #22c55e;
  --green-bg:   rgba(34,197,94,.12);
  --amber:      #f59e0b;
  --amber-bg:   rgba(245,158,11,.12);
  --red:        #ef4444;
  --red-bg:     rgba(239,68,68,.12);
  --blue:       #3b82f6;
  --blue-bg:    rgba(59,130,246,.12);
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --sidebar-w:  228px;
  --topbar-h:   56px;
  --detail-w:   284px;
  --font:       'DM Sans', system-ui, sans-serif;
  --mono:       'Space Mono', monospace;
  --shadow:     0 8px 32px rgba(0,0,0,.45);
  --shadow-lg:  0 20px 60px rgba(0,0,0,.55);
}

html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; overflow: hidden; }

/* ── Scrollbars ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border3); }

/* ── Auth ───────────────────────────────────────────────────── */
.auth-screen { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 9000; }
.auth-card { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-xl); padding: 36px 32px; width: 400px; max-width: 96vw; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--accent2); margin-bottom: 26px; }
.auth-logo-icon { width: 36px; height: 36px; background: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 20px; background: var(--bg3); border-radius: var(--radius); padding: 4px; }
.auth-tab { flex: 1; padding: 8px; border-radius: 6px; border: none; background: transparent; color: var(--text2); font-size: 13.5px; cursor: pointer; font-family: var(--font); font-weight: 500; transition: all .15s; }
.auth-tab.active { background: var(--bg5); color: var(--text); }
.form-group { margin-bottom: 13px; }
.form-group label { display: block; font-size: 11.5px; color: var(--text3); margin-bottom: 5px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.form-group input { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; color: var(--text); font-size: 14px; font-family: var(--font); outline: none; transition: border .18s; }
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,.1); }
.form-error { color: var(--red); font-size: 13px; margin-bottom: 10px; padding: 8px 12px; background: var(--red-bg); border-radius: var(--radius); border: 1px solid rgba(239,68,68,.2); }
.btn-auth { width: 100%; background: var(--accent); border: none; border-radius: var(--radius); padding: 11px; color: #fff; font-size: 14.5px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: background .15s; display: flex; align-items: center; justify-content: center; gap: 7px; }
.btn-auth:hover { background: var(--accent2); }
.auth-hint { font-size: 11.5px; color: var(--text3); text-align: center; margin-top: 14px; }

/* ── App Layout ─────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar { height: var(--topbar-h); background: var(--bg2); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 14px; gap: 12px; flex-shrink: 0; z-index: 200; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--accent2); white-space: nowrap; min-width: var(--sidebar-w); cursor: default; }
.logo-icon { width: 28px; height: 28px; background: var(--accent); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: #fff; }
.search-wrap { flex: 1; max-width: 560px; position: relative; }
.search-input { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 22px; padding: 8px 36px 8px 38px; color: var(--text); font-size: 13.5px; font-family: var(--font); outline: none; transition: border .2s, box-shadow .2s; }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,.1); }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 16px; pointer-events: none; }
.search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text3); cursor: pointer; font-size: 16px; padding: 2px; display: flex; }
.topbar-right { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.btn-icon { width: 34px; height: 34px; border-radius: 50%; background: transparent; border: none; color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: background .12s, color .12s; }
.btn-icon:hover { background: var(--bg3); color: var(--text); }
.btn-icon.sm { width: 26px; height: 26px; font-size: 15px; }
.btn-icon.danger:hover { background: var(--red-bg); color: var(--red); }
.avatar-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 22px; transition: background .12s; }
.avatar-wrap:hover { background: var(--bg3); }
.topbar-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #a855f7); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; font-family: var(--mono); color: #fff; }
.topbar-username { font-size: 13px; font-weight: 500; color: var(--text2); }

/* ── Layout Body ─────────────────────────────────────────────── */
.layout { display: flex; flex: 1; overflow: hidden; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar { width: var(--sidebar-w); background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; overflow-x: hidden; padding-bottom: 16px; }
.new-btn { margin: 12px 10px 6px; background: var(--accent); border: none; border-radius: var(--radius-lg); padding: 10px 16px; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background .12s; font-family: var(--font); }
.new-btn:hover { background: var(--accent2); }
.new-btn i { font-size: 17px; }
.nav-section { padding: 2px 0; }
.nav-label { font-size: 10px; color: var(--text3); padding: 8px 16px 3px; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 7px 12px; border-radius: var(--radius); margin: 1px 8px; cursor: pointer; color: var(--text2); font-size: 13.5px; transition: all .12s; }
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent2); }
.nav-item i { font-size: 17px; width: 20px; flex-shrink: 0; }
.nav-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { background: var(--bg4); color: var(--text3); font-size: 10px; padding: 1px 6px; border-radius: 20px; min-width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-divider { height: 1px; background: var(--border); margin: 7px 12px; }
.storage-section { padding: 10px 12px; margin-top: auto; }
.storage-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.storage-used { font-size: 10.5px; color: var(--text3); }
.storage-bar { height: 3px; background: var(--bg4); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.storage-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #a855f7); border-radius: 2px; transition: width .5s; }
.btn-upgrade { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px; color: var(--text2); font-size: 12px; cursor: pointer; font-family: var(--font); transition: all .12s; display: flex; align-items: center; justify-content: center; }
.btn-upgrade:hover { border-color: var(--accent); color: var(--accent2); background: var(--accent-bg); }

/* ── Main Content ───────────────────────────────────────────── */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── Selection Bar ──────────────────────────────────────────── */
.sel-bar { background: var(--accent-bg); border-bottom: 1px solid var(--accent-bdr); padding: 8px 16px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.sel-info { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--accent2); }
.cb-all { width: 16px; height: 16px; border-radius: 3px; background: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.cb-all::after { content: '✓'; color: #fff; font-size: 11px; }
.sel-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.sel-actions button { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 11px; font-size: 12.5px; color: var(--text2); cursor: pointer; display: flex; align-items: center; gap: 5px; font-family: var(--font); transition: all .12s; }
.sel-actions button:hover { color: var(--text); border-color: var(--border2); background: var(--bg4); }
.sel-actions button.danger:hover { background: var(--red-bg); color: var(--red); border-color: rgba(239,68,68,.3); }
.sel-close { margin-left: auto; background: none; border: none; color: var(--text3); cursor: pointer; font-size: 18px; display: flex; padding: 4px; border-radius: 50%; transition: background .12s; }
.sel-close:hover { background: var(--bg3); color: var(--text); }

/* ── Toolbar ────────────────────────────────────────────────── */
.toolbar { padding: 9px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); background: var(--bg2); flex-shrink: 0; }
.breadcrumb { display: flex; align-items: center; gap: 4px; flex: 1; font-size: 13.5px; flex-wrap: wrap; min-width: 0; }
.bc-item { color: var(--text2); cursor: pointer; transition: color .12s; padding: 2px 5px; border-radius: 5px; white-space: nowrap; }
.bc-item:hover { color: var(--text); background: var(--bg3); }
.bc-current { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-sep { color: var(--text3); font-size: 12px; display: flex; }
.toolbar-right { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.sort-btn { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 11px; color: var(--text2); font-size: 12.5px; cursor: pointer; display: flex; align-items: center; gap: 5px; font-family: var(--font); transition: all .12s; white-space: nowrap; }
.sort-btn:hover { border-color: var(--border2); color: var(--text); }
.view-toggle { display: flex; gap: 2px; background: var(--bg3); border-radius: var(--radius); padding: 3px; }
.view-btn { padding: 4px 9px; border-radius: 5px; background: transparent; border: none; color: var(--text3); cursor: pointer; font-size: 15px; transition: all .12s; display: flex; }
.view-btn.active { background: var(--bg4); color: var(--text); }

/* ── Content Row ────────────────────────────────────────────── */
.content-row { display: flex; flex: 1; overflow: hidden; }

/* ── File Area ──────────────────────────────────────────────── */
.file-area { flex: 1; overflow-y: auto; padding: 16px 18px; position: relative; min-width: 0; }
.drop-overlay { position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: var(--radius-xl); background: var(--accent-bg); display: flex; align-items: center; justify-content: center; z-index: 50; pointer-events: none; }
.drop-inner { text-align: center; color: var(--accent2); }
.drop-inner i { font-size: 52px; display: block; margin-bottom: 10px; }
.drop-inner p { font-size: 16px; font-weight: 500; }

/* ── Section ────────────────────────────────────────────────── */
.section-block { margin-bottom: 24px; }
.section-title { font-size: 10.5px; color: var(--text3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; font-weight: 500; }

/* ── Grid ───────────────────────────────────────────────────── */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 9px; }

/* ── Folder Card ────────────────────────────────────────────── */
.folder-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 13px 12px; cursor: pointer; transition: all .16s; position: relative; user-select: none; }
.folder-card:hover { border-color: var(--border2); background: var(--bg3); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.folder-card.selected { border-color: var(--accent); background: var(--accent-bg); }
.folder-icon { font-size: 30px; margin-bottom: 7px; display: flex; }
.folder-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.folder-meta { font-size: 11px; color: var(--text3); }

/* ── File Card ──────────────────────────────────────────────── */
.file-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: all .16s; position: relative; overflow: hidden; user-select: none; }
.file-card:hover { border-color: var(--border2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.file-card.selected { border-color: var(--accent); background: var(--accent-bg); }
.file-preview { height: 88px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 36px; border-bottom: 1px solid var(--border); }
.file-info { padding: 8px 10px; }
.file-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.file-size { font-size: 11px; color: var(--text3); }

/* ── Card overlays ──────────────────────────────────────────── */
.card-menu-btn-wrap { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity .12s; z-index: 2; }
.folder-card:hover .card-menu-btn-wrap,
.file-card:hover .card-menu-btn-wrap,
.folder-card.selected .card-menu-btn-wrap,
.file-card.selected .card-menu-btn-wrap { opacity: 1; }
.card-menu-btn { background: var(--bg4); border: 1px solid var(--border2); border-radius: 5px; color: var(--text2); width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; transition: all .1s; }
.card-menu-btn:hover { background: var(--bg5); color: var(--text); border-color: var(--border3); }
.card-cb { position: absolute; top: 7px; left: 8px; opacity: 0; transition: opacity .12s; z-index: 2; }
.folder-card:hover .card-cb,
.file-card:hover .card-cb,
.folder-card.selected .card-cb,
.file-card.selected .card-cb { opacity: 1; }

/* ── Checkbox ───────────────────────────────────────────────── */
.cb { width: 15px; height: 15px; border-radius: 3px; border: 1.5px solid var(--border2); cursor: pointer; display: flex; align-items: center; justify-content: center; background: var(--bg3); flex-shrink: 0; transition: all .12s; }
.cb.checked { background: var(--accent); border-color: var(--accent); }
.cb.checked::after { content: '✓'; color: #fff; font-size: 10px; line-height: 1; }
.cb:hover { border-color: var(--accent); }

/* ── List View ──────────────────────────────────────────────── */
.file-list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.file-list thead th { text-align: left; padding: 8px 10px; color: var(--text3); font-size: 11.5px; font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap; }
.file-list thead th.sortable { cursor: pointer; }
.file-list thead th.sortable:hover { color: var(--text2); }
.file-list tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.file-list tbody tr:hover { background: var(--bg2); }
.file-list tbody tr.selected { background: var(--accent-bg); }
.file-list td { padding: 9px 10px; color: var(--text2); vertical-align: middle; }
.file-list td:first-child { width: 34px; }
.file-list td:last-child { width: 44px; }
.name-cell { display: flex; align-items: center; gap: 8px; color: var(--text); }
.name-cell i { font-size: 18px; flex-shrink: 0; }
.name-cell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Trash extras ───────────────────────────────────────────── */
.trash-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 10px 12px; background: var(--red-bg); border: 1px solid rgba(239,68,68,.2); border-radius: var(--radius-lg); }
.trash-card { opacity: .8; }
.trash-card:hover { opacity: 1; }
.trash-actions { display: flex; gap: 5px; margin-top: 9px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { font-size: 10.5px; padding: 2px 7px; border-radius: 20px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-accent { background: var(--accent-bg); color: var(--accent2); }
.badge-gray   { background: var(--bg3); color: var(--text3); border: 1px solid var(--border); }

/* ── Detail Panel ───────────────────────────────────────────── */
.detail-panel { width: var(--detail-w); background: var(--bg2); border-left: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; display: flex; flex-direction: column; }
.detail-header { padding: 13px 14px 11px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.detail-header span { font-size: 14px; font-weight: 500; }
#detailContent { flex: 1; overflow-y: auto; }
.empty-detail { padding: 48px 16px; text-align: center; color: var(--text3); }
.empty-detail i { font-size: 38px; display: block; margin-bottom: 10px; }
.empty-detail p { font-size: 13px; }
.detail-preview { height: 110px; background: var(--bg3); margin: 12px; border-radius: var(--radius-lg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 44px; }
.detail-info { padding: 0 14px 10px; }
.detail-name { font-size: 14px; font-weight: 500; margin-bottom: 2px; word-break: break-word; line-height: 1.4; }
.detail-type { font-size: 11.5px; color: var(--text3); margin-bottom: 12px; }
.detail-section { margin-bottom: 12px; }
.detail-section-title { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .09em; margin-bottom: 6px; font-weight: 600; }
.detail-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; color: var(--text2); border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-row span:last-child { color: var(--text); text-align: right; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-actions { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.detail-btn { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; color: var(--text2); font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all .12s; font-family: var(--font); width: 100%; text-align: left; }
.detail-btn:hover { border-color: var(--border2); background: var(--bg4); color: var(--text); }
.detail-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.detail-btn.primary:hover { background: var(--accent2); }
.detail-btn.danger { color: var(--red); }
.detail-btn.danger:hover { background: var(--red-bg); border-color: rgba(239,68,68,.3); }

/* ── Context Menu ───────────────────────────────────────────── */
.ctx-menu { position: fixed; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 5px; z-index: 700; min-width: 196px; box-shadow: var(--shadow); }
.ctx-item { padding: 7px 11px; border-radius: 6px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 9px; color: var(--text2); transition: all .1s; }
.ctx-item:hover { background: var(--bg3); color: var(--text); }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger:hover { background: var(--red-bg); }
.ctx-item i { font-size: 15px; width: 17px; flex-shrink: 0; }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: 800; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-xl); padding: 24px; max-width: 96vw; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.modal-title i { font-size: 20px; }
.modal-label { font-size: 11px; color: var(--text3); margin-bottom: 5px; display: block; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.modal input, .modal select, .modal textarea { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; color: var(--text); font-size: 14px; font-family: var(--font); outline: none; margin-bottom: 12px; transition: border .18s; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,.1); }
.modal select option { background: var(--bg3); }
.modal textarea { resize: vertical; min-height: 80px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn { padding: 8px 18px; border-radius: var(--radius); border: none; font-size: 13.5px; cursor: pointer; font-family: var(--font); font-weight: 500; transition: all .12s; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn-ghost { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border2); background: var(--bg4); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,.25); }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger-ghost { background: transparent; color: var(--red); border: 1px solid rgba(239,68,68,.25); }
.btn-danger-ghost:hover { background: var(--red-bg); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Upload ─────────────────────────────────────────────────── */
.upload-zone { border: 2px dashed var(--border2); border-radius: var(--radius-lg); padding: 28px; text-align: center; cursor: pointer; transition: all .2s; margin-bottom: 6px; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: var(--accent-bg); }
.upload-zone i { font-size: 38px; color: var(--text3); display: block; margin-bottom: 8px; }
.uz-title { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.uz-sub { font-size: 12px; color: var(--text3); }
.upload-item { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; margin-bottom: 6px; }
.upload-item-name { font-size: 13px; font-weight: 500; margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.upload-item-bar { height: 3px; background: var(--border2); border-radius: 2px; overflow: hidden; }
.upload-item-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .2s; }

/* ── Share ──────────────────────────────────────────────────── */
.share-user { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.share-user:last-child { border-bottom: none; }
.share-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; font-family: var(--mono); }
.share-info { flex: 1; min-width: 0; }
.share-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-email { font-size: 11px; color: var(--text3); }
.share-link-section { margin-top: 14px; background: var(--bg3); border-radius: var(--radius); border: 1px solid var(--border); padding: 12px; }

/* ── Color Grid ─────────────────────────────────────────────── */
.color-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.color-dot { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform .12s, border .12s; flex-shrink: 0; }
.color-dot:hover { transform: scale(1.15); border-color: rgba(255,255,255,.35); }
.color-dot.selected { border-color: #fff; transform: scale(1.1); box-shadow: 0 0 0 3px rgba(255,255,255,.15); }

/* ── New Type Grid ──────────────────────────────────────────── */
.new-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.new-type-btn { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 7px; transition: all .15s; font-family: var(--font); color: var(--text2); font-size: 12.5px; }
.new-type-btn:hover { border-color: var(--border2); background: var(--bg4); color: var(--text); transform: translateY(-1px); }
.new-type-btn i { font-size: 28px; }

/* ── Sort options ───────────────────────────────────────────── */
.sort-opt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius); cursor: pointer; font-size: 13.5px; color: var(--text2); transition: all .1s; margin-bottom: 2px; }
.sort-opt:hover { background: var(--bg3); color: var(--text); }
.sort-opt.active { background: var(--accent-bg); color: var(--accent2); }
.sort-opt i { font-size: 17px; }

/* ── Folder tree (Move modal) ───────────────────────────────── */
.folder-tree-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius); cursor: pointer; font-size: 13.5px; color: var(--text2); transition: all .1s; }
.folder-tree-item:hover { background: var(--bg3); color: var(--text); }
.folder-tree-item.selected { background: var(--accent-bg); color: var(--accent2); }
.folder-tree-item i { font-size: 16px; flex-shrink: 0; }

/* ── Version ────────────────────────────────────────────────── */
.version-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.version-info { flex: 1; }
.version-tag { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.version-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── Profile ────────────────────────────────────────────────── */
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #a855f7); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; font-family: var(--mono); margin: 0 auto 12px; color: #fff; }

/* ── Settings ───────────────────────────────────────────────── */
.settings-section { background: var(--bg3); border-radius: var(--radius); padding: 14px; border: 1px solid var(--border); margin-bottom: 12px; }
.settings-section-title { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .09em; margin-bottom: 12px; font-weight: 600; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 13.5px; color: var(--text2); }
.settings-row + .settings-row { border-top: 1px solid var(--border); }

/* ── Activity ───────────────────────────────────────────────── */
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.activity-text { font-size: 13px; color: var(--text2); line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── Upgrade Plans ──────────────────────────────────────────── */
.upgrade-plan { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 14px; cursor: pointer; transition: all .15s; }
.upgrade-plan:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* ── Preview ────────────────────────────────────────────────── */
.preview-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; }
.preview-inner { background: var(--bg2); border-radius: var(--radius-xl); overflow: hidden; max-width: min(92vw, 1000px); max-height: 92vh; display: flex; flex-direction: column; min-width: 400px; width: 100%; }
.preview-topbar { padding: 12px 16px; background: var(--bg3); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 12px; }
.preview-topbar button { background: var(--bg4); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px; color: var(--text2); font-size: 13px; cursor: pointer; font-family: var(--font); display: flex; align-items: center; gap: 5px; }
.preview-topbar button:hover { color: var(--text); border-color: var(--border2); }
.preview-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 20px; min-height: 240px; }
.preview-img { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: var(--radius); }
.preview-media { max-width: 100%; max-height: 72vh; border-radius: var(--radius); }
.preview-text { font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; color: var(--text2); background: var(--bg3); padding: 16px; border-radius: var(--radius); width: 100%; max-height: 66vh; overflow: auto; word-break: break-all; line-height: 1.7; }
.preview-unsupported { text-align: center; color: var(--text3); padding: 24px; }

/* ── Empty States ───────────────────────────────────────────── */
.empty-state { padding: 64px 20px; text-align: center; color: var(--text3); }
.empty-state i { font-size: 52px; display: block; margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; color: var(--text2); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 12px 16px; font-size: 13.5px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); animation: slideIn .25s ease; }
.toast i { font-size: 18px; flex-shrink: 0; }
.toast.success i { color: var(--green); }
.toast.info    i { color: var(--accent2); }
.toast.warning i { color: var(--amber); }
.toast.error   i { color: var(--red); }
@keyframes slideIn  { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(110%); opacity: 0; } }
.toast.out { animation: slideOut .25s ease forwards; }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner { width: 36px; height: 36px; border: 3px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .7s linear infinite; display: inline-block; }

/* ── Utilities ──────────────────────────────────────────────── */
.hidden       { display: none !important; }
.text-muted   { color: var(--text3); }
.monospace    { font-family: var(--mono); font-size: 12px; }
.ml-auto      { margin-left: auto; }

/* ── Admin Panel ─────────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table thead th { text-align: left; padding: 7px 10px; color: var(--text3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
.admin-table tbody tr:hover { background: var(--bg3); }
.admin-table td { padding: 9px 10px; color: var(--text2); vertical-align: middle; }
.admin-table td:first-child { color: var(--text); font-weight: 500; }

.admin-team-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg3); margin-bottom: 7px; }
.admin-team-row:last-child { margin-bottom: 0; }

.admin-btn { color: var(--accent2) !important; }
.admin-btn:hover { background: var(--accent-bg) !important; }

/* ── Team nav delete button ──────────────────────────────────── */
.team-nav-item:hover .team-del-btn { opacity: 1 !important; }
.team-del-btn:hover { color: var(--red) !important; }
