:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #1a73e8;
  --accent-hover: #1557b0;
  --danger: #d93025;
  --danger-hover: #b3261e;
  --selected: #e8f0fe;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 12px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.login-body {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(26,115,232,0.12), transparent 40%),
    radial-gradient(circle at bottom right, rgba(26,115,232,0.08), transparent 35%),
    var(--bg);
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.brand { text-align: center; margin-bottom: 24px; }
.brand h1 { margin: 12px 0 6px; font-size: 28px; letter-spacing: -0.02em; }
.brand p { margin: 0; color: var(--muted); font-size: 14px; }

.brand-mark {
  width: 48px; height: 48px; margin: 0 auto;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #1a73e8 0%, #0b57d0 55%, #174ea6 100%);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 12px 10px 10px 14px;
  border: 2px solid rgba(255,255,255,0.95);
  border-radius: 4px 4px 6px 6px;
  border-top-width: 6px;
}
.brand-mark.sm { width: 28px; height: 28px; margin: 0; border-radius: 8px; }
.brand-mark.sm::after { inset: 7px 6px 5px 8px; border-top-width: 4px; }

.login-form { display: grid; gap: 14px; }
.login-form label, #form-password label {
  display: grid; gap: 6px; font-size: 13px; color: var(--muted);
}
input[type="text"], input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
}
input:focus {
  outline: 2px solid rgba(26,115,232,0.25);
  border-color: var(--accent);
}
.remember {
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: var(--text) !important;
  font-size: 14px !important;
}
.hint { margin: 16px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.alert {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 14px;
}
.alert-error { background: #fce8e6; color: #c5221f; }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: #f8fafc; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger {
  background: #fff;
  border-color: #f5c2c0;
  color: var(--danger);
}
.btn-danger:hover { background: #fce8e6; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #eef2f7; }
.btn-block { width: 100%; border-radius: 10px; padding: 12px; }

.app-body { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 20px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-left, .topbar-actions, .toolbar-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.user-chip {
  font-size: 13px; color: var(--muted);
  background: #f1f5f9; border-radius: 999px; padding: 6px 10px;
}

.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 20px 8px; flex-wrap: wrap;
}
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.crumbs a, .crumbs button.linkish {
  background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit;
}
.crumbs span.sep { color: var(--muted); }

.content { padding: 8px 20px 28px; flex: 1; }
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}
.file-table { width: 100%; border-collapse: collapse; }
.file-table th, .file-table td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-size: 14px; white-space: nowrap;
}
.file-table th { color: var(--muted); font-weight: 600; background: #fafbfc; }
.file-table tr:last-child td { border-bottom: 0; }
.file-table tbody tr { cursor: pointer; }
.file-table tbody tr:hover { background: #f8fafc; }
.file-table tbody tr.selected { background: var(--selected); }
.file-table tbody tr.selected:hover { background: #d2e3fc; }

.name-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.icon {
  width: 28px; height: 28px; border-radius: 6px; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
}
.icon.dir { background: #fbbc04; color: #3c4043; }
.icon.img { background: #34a853; }
.icon.pdf { background: #ea4335; }
.icon.file { background: #5f6368; }

.status {
  min-height: 22px; margin-bottom: 8px; color: var(--muted); font-size: 13px;
}
.status.error { color: var(--danger); }
.status.ok { color: #137333; }

.drop-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(26,115,232,0.12);
  display: grid; place-items: center;
  pointer-events: none;
}
.drop-overlay.hidden { display: none; }
.drop-panel {
  background: #fff; border: 2px dashed var(--accent);
  border-radius: 16px; padding: 28px 36px; font-weight: 600; color: var(--accent);
}

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  width: min(420px, calc(100% - 24px));
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(15, 23, 42, 0.35); }
dialog form, dialog > form { display: grid; gap: 12px; padding: 20px; }
dialog h3 { margin: 0 0 4px; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.file-btn { display: inline-flex; align-items: center; }

@media (max-width: 720px) {
  .file-table th:nth-child(3),
  .file-table td:nth-child(3),
  .file-table th:nth-child(4),
  .file-table td:nth-child(4) { display: none; }
}

.search-input {
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  background: #fff;
}
.search-input:focus {
  outline: 2px solid rgba(26,115,232,0.25);
  border-color: var(--accent);
}
th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable:hover { color: var(--accent); }
.sort-ind {
  font-size: 11px;
  color: var(--accent);
  margin-left: 4px;
}
.muted { color: var(--muted); font-size: 13px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* === Fitur tambahan 2026-08-13 === */
.btn-sm { padding: 5px 9px; font-size: 12px; border-radius: 8px; line-height: 1.2; }
.btn { transition: background .15s, border-color .15s; }
.path-chip {
  margin-left: 8px; font-size: 11px; color: var(--muted);
  background: #f3f4f6; border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px;
}
.page-size-wrap { display: inline-flex; align-items: center; }
.page-size {
  font-size: 12px; padding: 4px 6px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
.search-input { font-size: 12px; padding: 6px 8px; max-width: 160px; }
.toolbar-actions { gap: 6px; flex-wrap: wrap; }
.file-table th, .file-table td { padding: 6px 8px; font-size: 13px; }
.file-table .icon { width: 28px; height: 22px; font-size: 10px; }
.pager {
  display: flex; gap: 6px; align-items: center; justify-content: center;
  padding: 10px 0 4px; flex-wrap: wrap;
}
.pager button {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  padding: 3px 8px; font-size: 12px; cursor: pointer;
}
.pager button.active { background: var(--selected); border-color: #c5d8f8; font-weight: 600; }
.pager button:disabled { opacity: .45; cursor: default; }
.backtop-wrap { text-align: center; padding: 8px 0 20px; }
.back-to-top { color: var(--text); text-decoration: none; font-size: 13px; }
.back-to-top:hover { color: var(--accent); }
.clip-status { font-size: 12px; margin: 0 0 8px; min-height: 1em; }
.muted { color: var(--muted); }

.editor-dock { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.editor-win {
  position: absolute; pointer-events: auto;
  background: #1e1e1e; color: #d4d4d4;
  border: 1px solid #333; border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  display: flex; flex-direction: column; min-width: 360px; min-height: 240px;
  overflow: hidden;
}
.editor-win.maximized { inset: 12px !important; width: auto !important; height: auto !important; }
.editor-win.minimized { display: none; }
.editor-title {
  display: flex; align-items: center; gap: 8px;
  background: #2d2d2d; padding: 6px 8px; cursor: move;
  border-bottom: 1px solid #3a3a3a; font-size: 12px;
}
.editor-title .title-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-title button {
  border: 0; background: #3a3a3a; color: #ddd; border-radius: 4px;
  width: 22px; height: 22px; font-size: 11px; cursor: pointer;
}
.editor-toolbar {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 6px 8px; background: #252526; border-bottom: 1px solid #333; font-size: 12px;
}
.editor-toolbar input {
  background: #1e1e1e; border: 1px solid #444; color: #ddd;
  border-radius: 4px; padding: 3px 6px; font-size: 12px;
}
.editor-toolbar button {
  border: 1px solid #444; background: #3c3c3c; color: #eee;
  border-radius: 4px; padding: 3px 7px; font-size: 11px; cursor: pointer;
}
.editor-body { display: flex; flex: 1; min-height: 0; position: relative; }
.editor-gutter {
  width: 48px; background: #1e1e1e; color: #858585;
  text-align: right; padding: 8px 6px; overflow: hidden;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  user-select: none; border-right: 1px solid #333; white-space: pre;
}
.editor-textarea {
  flex: 1; border: 0; resize: none; outline: none;
  background: #1e1e1e; color: #d4d4d4; padding: 8px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre; overflow: auto; tab-size: 3;
}
.editor-resize {
  position: absolute; right: 0; bottom: 0; width: 14px; height: 14px;
  cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, #666 50%);
}
.editor-tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; gap: 6px; padding: 6px 8px; pointer-events: none;
  justify-content: flex-start; flex-wrap: wrap;
}
.editor-tray button {
  pointer-events: auto; border: 1px solid #444; background: #2d2d2d; color: #eee;
  border-radius: 8px 8px 0 0; padding: 6px 10px; font-size: 12px; cursor: pointer;
}
