:root {
  --gd-blue: #1a73e8;
  --gd-blue-dark: #185abc;
  --gd-green: #188038;
  --gd-green-dark: #13672f;
  --gd-bg: #ffffff;
  --gd-main-bg: #f9fbfd;
  --gd-border: #d5d9e0;
  --gd-text: #202124;
  --gd-muted: #5f6368;
  --gd-hover: #e8eaed;
  --gd-select-bg: #e8f0fe;
  --gd-icon: #5f6368;
  --gd-shadow: 0 2px 6px rgba(60, 64, 67, .15);
  --gd-shadow-big: 0 8px 30px rgba(60, 64, 67, .2);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Google Sans", "Product Sans", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--gd-text);
  background: #fff;
  font-size: 14px;
}

a { color: var(--gd-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
input { font-family: inherit; }

/* ================= TOP BAR ================= */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--gd-border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 40;
}

.drive-logo { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.drive-logo svg { display: block; }
.drive-logo img { display: block; flex-shrink: 0; }
.drive-logo .wordmark { font-size: 22px; color: var(--gd-text); letter-spacing: .2px; }

.search-box {
  flex: 1;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  background: #f1f3f4;
  border-radius: 8px;
  padding: 0 14px;
  height: 46px;
  transition: background .2s, box-shadow .2s;
}

.search-box:focus-within { background: #fff; box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.1); }

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 10px 8px;
  color: var(--gd-text);
}

.search-box .clear { cursor: pointer; color: var(--gd-icon); border: none; background: none; font-size: 18px; padding: 4px; }

.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gd-icon);
  transition: background .2s;
}

.icon-btn:hover { background: var(--gd-hover); }
.icon-btn.active { background: var(--gd-hover); }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7986cb, #5c6bc0);
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  cursor: default;
}

.avatar-menu {
  position: fixed;
  right: 12px;
  top: 56px;
  background: #fff;
  border: 1px solid var(--gd-border);
  border-radius: 8px;
  box-shadow: var(--gd-shadow-big);
  padding: 8px 0;
  min-width: 260px;
  z-index: 90;
  display: none;
}

.avatar-menu.show { display: block; }
.avatar-menu .who { padding: 8px 24px 12px; border-bottom: 1px solid var(--gd-border); margin-bottom: 6px; }
.avatar-menu .who b { display: block; }
.avatar-menu .who span { color: var(--gd-muted); font-size: 13px; }
.avatar-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 24px;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--gd-text);
  cursor: pointer;
}
.avatar-menu button:hover { background: var(--gd-hover); }

/* ================= LAYOUT ================= */
.layout { display: flex; min-height: calc(100vh - 65px); }

/* ================= SIDEBAR ================= */
.sidebar {
  width: 256px;
  min-width: 256px;
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  background: #fff;
  z-index: 35;
  transition: margin-left .25s ease, transform .25s ease;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background: rgba(0,0,0,.3);
  z-index: 30;
}

body.sidebar-collapsed .sidebar {
  margin-left: -256px;
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    height: calc(100vh - 64px);
    transform: translateX(-100%);
    box-shadow: 0 8px 30px rgba(60,64,67,.2);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-open .sidebar-overlay {
    display: block;
  }
  /* Topbar muat di layar sempit: tanpa pan horizontal */
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar .drive-logo { min-width: 0; gap: 6px; }
  .topbar .drive-logo .wordmark { display: none; }
  .search-box { min-width: 0; max-width: none; padding: 0 10px; height: 44px; }
  .search-box input { min-width: 0; font-size: 16px; }
}

.sidebar .new-btn {
  margin: 4px 0 18px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 40px;
  padding: 0 12px;
  border-radius: 0 20px 20px 0;
  color: var(--gd-text);
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 2px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--gd-hover); }
.nav-item.active { background: var(--gd-select-bg); color: var(--gd-blue-dark); font-weight: 600; }
.nav-item.active .nav-icon { color: var(--gd-blue); }
.nav-item .nav-icon { width: 24px; height: 24px; display: inline-flex; }

.storage {
  margin-top: auto;
  padding: 12px 12px 4px;
  border-top: 1px solid var(--gd-border);
}

.storage .usage-bar {
  height: 4px;
  background: #e8eaed;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.storage .usage-bar .fill { height: 100%; background: var(--gd-blue); }

.storage .usage-text { font-size: 12px; color: var(--gd-muted); margin-bottom: 10px; }

/* ================= DASHBOARD ================= */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.dash-card { background: #fff; border: 1px solid #dadce0; border-radius: 12px; padding: 20px; box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); }
.dash-card h3 { margin: 0 0 14px; font-size: 16px; font-weight: 500; color: var(--gd-text); }
.dash-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #7986cb, #5c6bc0); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; flex-shrink: 0; }
.dash-users { max-height: 320px; overflow: auto; }

/* ===== Kapasitas Disk (admin) ===== */
.disk-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; margin: 2px 0 8px; }
.disk-title b { font-weight: 600; color: var(--gd-text); }
.disk-title .disk-path { color: var(--gd-muted); font-size: 12px; }
.disk-title .disk-pct { margin-left: auto; font-weight: 600; color: var(--gd-text); }
.disk-bar { display: flex; height: 22px; border-radius: 11px; overflow: hidden; background: #e8eaed; border: 1px solid #dadce0; margin-bottom: 8px; }
.disk-seg { height: 100%; min-width: 0; transition: width .4s ease; }
.disk-seg[data-v]:not([data-v="0"]) { min-width: 4px; }
.disk-seg.free { background: #fff; box-shadow: inset 1px 0 0 #dadce0; }
.disk-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--gd-muted); margin-bottom: 10px; }
.disk-stats b { color: var(--gd-text); font-weight: 600; }
.disk-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--gd-muted); }
.disk-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.disk-legend i.free { background: #fff; border: 1px solid #dadce0; }
.disk-sep { border-top: 1px solid #e8eaed; margin: 16px 0 12px; }
.disk-user { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f1f3f4; }
.disk-user:last-child { border-bottom: none; }
.disk-user .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.disk-user .du-name { font-weight: 500; font-size: 13px; min-width: 90px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.disk-user .du-bar { flex: 1; min-width: 90px; height: 8px; background: #e8eaed; border-radius: 4px; overflow: hidden; }
.disk-user .du-bar > div { height: 100%; border-radius: 4px; transition: width .4s ease; }
.disk-user .du-meta { font-size: 12px; color: var(--gd-muted); text-align: right; white-space: nowrap; }
.disk-user .du-meta b { color: var(--gd-text); font-weight: 600; }
@media (max-width: 720px) { .disk-user { flex-wrap: wrap; } .disk-user .du-meta { white-space: normal; text-align: left; width: 100%; padding-left: 22px; } }
.dash-user-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #edf0f3; gap: 12px; }
.dash-user-row:last-child { border-bottom: none; }
.type-grid { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 12px; }
.type-card { background: #fff; border: 1px solid #dadce0; border-radius: 12px; padding: 16px; text-align: center; box-shadow: 0 1px 2px rgba(60,64,67,.15); width: 160px; flex: 0 0 160px; }
.type-card .circle-wrap { width: 72px; height: 72px; margin: 0 auto 10px; position: relative; }
.type-card .circle-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.type-card .circle-bg { fill: none; stroke: #e8eaed; stroke-width: 8; }
.type-card .circle-fg { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.type-card .circle-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--gd-text); }
.type-card .type-name { font-size: 13px; font-weight: 500; color: var(--gd-text); }
.type-card .type-meta { font-size: 11px; color: var(--gd-muted); margin-top: 2px; }

/* ================= MAIN ================= */
.main {
  flex: 1;
  background: var(--gd-main-bg);
  border-radius: 16px 0 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content { padding: 0 28px 40px; flex: 1; overflow-y: auto; }

.page-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 14px; }

.crumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.crumb a { font-size: 18px; color: var(--gd-text); font-weight: 500; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.crumb a:hover { background: var(--gd-hover); text-decoration: none; }
.crumb .sep { color: var(--gd-muted); }
.crumb .curr { font-size: 18px; font-weight: 500; padding: 6px 8px; }

.head-actions { margin-left: auto; display: flex; gap: 8px; }

/* New button */
.new-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: none;
  border-radius: 24px;
  box-shadow: var(--gd-shadow-big);
  padding: 0 24px 0 14px;
  height: 56px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gd-text);
  transition: box-shadow .2s, background .2s;
}

.new-btn:hover { background: #fafafb; box-shadow: var(--gd-shadow-big), 0 0 0 1px var(--gd-border); }
.new-btn .plus {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gd-green); margin-right: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px;
}
.new-btn .plus svg { fill: #fff; }

.menu-pop {
  position: fixed;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--gd-shadow-big);
  border: 1px solid var(--gd-border);
  padding: 10px 0;
  min-width: 240px;
  z-index: 100;
  display: none;
}

.menu-pop.show { display: block; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gd-text);
}

.menu-item:hover { background: var(--gd-hover); }
.menu-item .mi { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }

/* selection actions (inline in page-head, no layout jump) */
.head-actions .count { margin: 0 10px; font-size: 15px; }

/* ================= TABLE ================= */
.list-table {
  width: 100%;
  background: var(--gd-bg);
  border-radius: 12px;
  border: 1px solid #dadce0;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}

.list-table th {
  text-align: left;
  font-weight: 500;
  color: var(--gd-muted);
  font-size: 13px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gd-border);
  background: #fff;
  white-space: nowrap;
}

.list-table th.check-col, .list-table td.check-col { width: 46px; padding-right: 0; }

.list-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #edf0f3;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-table tr:hover td { background: #f6f8fc; }
.list-table tr.selected td { background: var(--gd-select-bg); }
.list-table tr:last-child td { border-bottom: none; }

.cell-name { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; }
.file-ico { width: 22px; height: 22px; flex-shrink: 0; font-size: 18px; line-height: 1; }
.name-text { font-weight: 500; cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.folder .name-text { color: var(--gd-text); }

.row-check {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border: 2px solid var(--gd-icon);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  background: #fff;
  display: inline-block;
  vertical-align: middle;
}

tr:hover .row-check, .row-check:checked, .check-head .row-check, tr.selected .row-check { opacity: 1; }
.row-check:checked {
  background: var(--gd-blue);
  border-color: var(--gd-blue);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="white" d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');
  background-size: contain;
}

.kebab {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gd-icon);
  padding: 8px;
  border-radius: 50%;
  width: 34px; height: 34px;
  opacity: 0;
}

tr:hover .kebab { opacity: 1; }
.kebab.open { opacity: 1; background: var(--gd-hover); }

/* rename */
.rename-input {
  border: 2px solid var(--gd-blue);
  border-radius: 4px;
  font-size: 14px;
  padding: 2px 6px;
  outline: none;
  width: 60%;
}

/* ================= GRID ================= */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px; }

.grid-tile {
  position: relative;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--gd-text);
  background: #fff;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  transition: box-shadow .2s, background .2s;
}

.grid-tile:hover { background: #f8f9fa; box-shadow: 0 2px 6px rgba(60,64,67,.3), 0 1px 2px rgba(60,64,67,.15); }
.grid-tile.selected { background: var(--gd-select-bg); border-color: var(--gd-blue); box-shadow: 0 1px 2px rgba(26,115,232,.3), 0 1px 3px 1px rgba(26,115,232,.15); }

/* Drive: folders & files like screenshot */
.drive-section-label { font-size: 13px; color: var(--gd-text); font-weight: 500; margin: 18px 0 10px; }
.drive-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.drive-header h2 { font-size: 18px; font-weight: 400; margin: 0; }
.view-toggle { display: inline-flex; border: 1px solid #dadce0; border-radius: 20px; overflow: hidden; }
.view-toggle button { border: none; background: #fff; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--gd-text); }
.view-toggle button.active { background: #e8f0fe; color: var(--gd-blue); font-weight: 500; }
.folders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 8px; }
.folder-card { background: #f8f9fa; border: 1px solid #e8eaed; border-radius: 8px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: background .15s; position: relative; }
.folder-card:hover { background: #f1f3f4; }
.folder-card.selected { background: var(--gd-select-bg); border-color: var(--gd-blue); }
.folder-card .folder-ico { font-size: 20px; color: #5f6368; }
.folder-card .grid-check, .file-card .grid-check { position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; margin: 0; cursor: pointer; accent-color: var(--gd-blue); display: none; z-index: 3; background: #fff; border-radius: 4px; border: 1px solid #5f6368; }
.folder-card:hover .grid-check, .folder-card.selected .grid-check, .file-card:hover .grid-check, .file-card.selected .grid-check { display: block; }
.folder-card.selected .grid-check, .file-card.selected .grid-check { background: var(--gd-blue); border-color: var(--gd-blue); }
.file-card.selected { border-color: var(--gd-blue); box-shadow: 0 1px 3px rgba(26,115,232,.3); }
.file-card-thumb::before { content: ''; position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,0.9); border: 1px solid #dadce0; display: none; z-index: 2; }
.file-card.selected .file-card-thumb::before { display: block; background: var(--gd-blue); border-color: var(--gd-blue); }
.file-card.selected .file-card-thumb::after { content: '✓'; position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: bold; z-index: 3; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.file-card { background: #fff; border: 1px solid #dadce0; border-radius: 8px; overflow: hidden; cursor: pointer; transition: box-shadow .2s; position: relative; }
.file-card:hover { box-shadow: 0 1px 3px rgba(60,64,67,.3); }
.file-card-thumb { height: 140px; background: #f8f9fa; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.file-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-card-thumb .placeholder { font-size: 48px; color: #5f6368; }
.file-card-info { padding: 10px 12px; display: flex; align-items: center; gap: 8px; background: #f8f9fa; border-top: 1px solid #e8eaed; }
.file-card-info .name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.grid-tile.selected::after {
  content: '';
  position: absolute;
  top: 8px; left: 8px;
  width: 18px; height: 18px;
  background: var(--gd-blue);
  border-radius: 3px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="white" d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');
  background-size: contain;
}
.grid-tile .tile-icon { font-size: 60px; text-align: center; padding: 12px 0 8px; word-break: break-word; }
.grid-tile .tile-name { text-align: center; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= EMPTY ================= */
.empty-state { text-align: center; padding: 80px 20px; color: var(--gd-muted); }
.empty-state .big { font-size: 96px; }
.empty-state h2 { font-size: 22px; font-weight: 400; color: var(--gd-text); margin: 12px 0 4px; }
.empty-state p { font-size: 14px; }

/* ================= DRAG OVERLAY ================= */
.drag-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 115, 232, .08);
  border: 4px dashed var(--gd-blue);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drag-overlay.show { display: flex; }
.drag-overlay span { background: #fff; padding: 18px 28px; border-radius: 8px; box-shadow: var(--gd-shadow-big); color: var(--gd-blue); font-size: 18px; }

/* ================= UPLOAD PANEL ================= */
.upload-box {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 350px;
  max-width: calc(100vw - 32px);
  background: var(--gd-bg);
  border: 1px solid var(--gd-border);
  border-radius: 10px;
  box-shadow: var(--gd-shadow-big);
  z-index: 400;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.upload-box.show { opacity: 1; transform: none; pointer-events: auto; }

/* pill mini hasil minimize panel upload — klik untuk memunculkan panel lagi */
.upload-min {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--gd-border);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--gd-shadow-big);
  z-index: 400;
  font-size: 13px;
  color: var(--gd-text);
  cursor: pointer;
  max-width: calc(100vw - 32px);
}
.upload-min.show { display: inline-flex; }
.upload-min:hover { background: var(--gd-hover); }
.upload-min .min-ico { flex: 0 0 auto; font-size: 15px; }
.upload-min .min-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 14px;
  background: var(--gd-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.upload-box.done .ub-head { background: var(--gd-green); }
.upload-box.hasfail .ub-head { background: #d93025; }
.upload-box.cancelled .ub-head { background: var(--gd-muted); }
.upload-box.cancelled .ub-gfill { background: var(--gd-muted); }

.ub-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.ub-cancel {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .55);
  color: #fff;
  border-radius: 4px;
  padding: 3px 11px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.5;
}
.ub-cancel:hover { background: rgba(255, 255, 255, .32); }
.ub-cancel[hidden] { display: none; }

.ub-x {
  background: none; border: none; color: #fff; cursor: pointer;
  font-size: 17px; line-height: 1; padding: 0 3px; opacity: .85;
}
.ub-x:hover { opacity: 1; }

.ub-gbar { height: 4px; background: var(--gd-hover); }
.ub-gfill { height: 100%; width: 0; background: var(--gd-blue); transition: width .2s; }
.upload-box.done .ub-gfill { background: var(--gd-green); }
.upload-box.hasfail .ub-gfill { background: #d93025; }

.ub-list { max-height: 232px; overflow-y: auto; padding: 4px 0; }

.ub-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
.ub-ico { flex: 0 0 auto; font-size: 16px; }
.ub-info { flex: 1 1 auto; min-width: 0; }

.ub-name {
  font-size: 13px;
  color: var(--gd-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ub-bar { height: 4px; background: var(--gd-hover); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.ub-fill { height: 100%; width: 0; background: var(--gd-blue); transition: width .15s linear; }
.ub-item.ok .ub-fill { background: var(--gd-green); }
.ub-item.err .ub-fill { background: #d93025; }
.ub-item.err .ub-name { color: #d93025; }

.ub-item.cancel .ub-fill { background: #9aa0a6; }
.ub-item.cancel .ub-name { color: var(--gd-muted); text-decoration: line-through; }
.ub-item.cancel .ub-pct { color: #9aa0a6; }

.ub-pct {
  flex: 0 0 52px;
  text-align: right;
  font-size: 12px;
  color: var(--gd-muted);
  font-variant-numeric: tabular-nums;
}

.ub-foot {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--gd-muted);
  border-top: 1px solid var(--gd-border);
}
.ub-foot[hidden] { display: none; }

/* ================= DIALOGS ================= */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  z-index: 300;
}

.modal-back.show { display: flex; align-items: center; justify-content: center; padding: 20px; }

.drive-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--gd-shadow-big);
  width: 100%;
  max-width: 420px;
  animation: pop .18s ease;
}

@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.drive-dialog h3 { font-size: 18px; font-weight: 400; margin: 0; padding: 22px 24px 0; }
.drive-dialog .sub { padding: 6px 24px 0; color: var(--gd-muted); font-size: 13px; }
.drive-dialog .body { padding: 18px 24px; }
.drive-dialog .foot { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 8px; }

.gd-input {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--gd-border);
  padding: 10px 2px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

.gd-input:focus { border-color: var(--gd-blue); }

.gd-btn {
  border: none;
  background: none;
  color: var(--gd-blue);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 4px;
  cursor: pointer;
}

.gd-btn:hover { background: rgba(26,115,232,.1); }
.gd-btn.primary { background: var(--gd-blue); color: #fff; }
.gd-btn.primary:hover { background: var(--gd-blue-dark); }

/* Settings */
.settings-wrap { max-width: 560px; }
.settings-wrap h2 { font-size: 22px; font-weight: 500; margin: 4px 0 16px; }
.set-card { background: #fff; border: 1px solid var(--gd-border); border-radius: 8px; padding: 4px 20px; margin-bottom: 16px; }
.set-card h3 { font-size: 14px; font-weight: 500; margin: 16px 0 4px; color: var(--gd-muted); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.set-row + .set-row { border-top: 1px solid #edf0f3; }
.set-info b { font-size: 14px; font-weight: 500; }
.set-info p { margin: 2px 0 0; font-size: 12px; color: var(--gd-muted); }
.num-inp { width: 80px; border-bottom-color: var(--gd-border); text-align: center; }
.set-foot { display: flex; justify-content: flex-end; }
.user-row { border: 1px solid #edf0f3; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: #fafafa; transition: border-color .15s, background .15s; }
.user-row:hover { border-color: #c2c8d0; }
.user-row.selected { border-color: var(--gd-blue); background: #e8f0fe; box-shadow: 0 1px 2px rgba(26,115,232,.2); }
.user-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.user-perms { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: #fff; border: 1px solid #dadce0; border-radius: 16px; padding: 4px 10px; cursor: pointer; user-select: none; }
.perm-chip input { accent-color: var(--gd-blue); }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #b7bdc4; border-radius: 22px; transition: .2s;
}
.switch .slider::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--gd-blue); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* Toast */
#toastMsg {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(16px);
  background: #202124; color: #fff; padding: 12px 20px; border-radius: 8px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,.3); max-width: 80vw;
}
#toastMsg.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Share dialog */
.share-people { display: flex; gap: 8px; margin-bottom: 8px; }
.share-people .gd-input { border-bottom-color: var(--gd-border); }

.access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid #edf0f3;
}

.enabled-chip {
  background: #e6f4ea;
  color: #137333;
  border-radius: 16px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.person .p-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbc04, #ea4335);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.person .p-name { font-weight: 500; }
.person .p-role { color: var(--gd-muted); font-size: 12px; }

/* pemilih peran: Bisa edit / Tidak bisa edit */
.access-controls { display: flex; align-items: center; gap: 8px; }
.role-select {
  border: 1px solid var(--gd-border);
  border-radius: 16px;
  background: #fff;
  color: var(--gd-text);
  font-size: 13px;
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
}
.role-select:focus { border-color: var(--gd-blue); box-shadow: 0 0 0 1px var(--gd-blue); }
.share-people .role-select { flex-shrink: 0; }
.person .p-role-sel { font-size: 12px; padding: 3px 8px; margin-top: 3px; }
.person .p-x {
  margin-left: auto;
  border: none; background: none; cursor: pointer;
  color: var(--gd-muted); font-size: 18px; padding: 6px;
}
.person .p-x:hover { color: #c5221f; }

.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .gd-input { border-bottom: none; background: #f1f3f4; border-radius: 4px; padding: 10px 12px; }

/* dialog tujuan (Move to / Copy to) — pohon folder + path lengkap */
.tgt-hint { color: var(--gd-muted); font-size: 12.5px; margin-bottom: 10px; text-align: left; line-height: 1.5; }
.tgt-list {
  width: 100%; height: 210px; padding: 6px 8px; font-size: 13px;
  border: 1px solid var(--gd-border); border-radius: 8px; background: #fff;
  white-space: pre; text-align: left; outline: none;
}
.tgt-list option { padding: 4px 6px; border-radius: 4px; }
.tgt-list option:hover { background: var(--gd-hover); }
.tgt-list option:disabled { color: #bdc1c6; }
.tgt-list option:checked { background: #d2e3fc; color: #174ea6; }
.tgt-path {
  margin-top: 10px; font-size: 12.5px; background: #f1f3f4; border-radius: 6px;
  padding: 8px 10px; text-align: left; word-break: break-word;
}
.tgt-path b { font-weight: 600; }

/* ================= AUTH ================= */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: #fff; }

.auth-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.auth-card .drive-logo { justify-content: center; min-width: 0; }
.auth-card .drive-logo .wordmark { font-size: 28px; margin-bottom: 16px; }

.auth-card .sub { color: var(--gd-muted); font-size: 15px; margin: 6px 0 26px; }

.auth-card input[type=text],
.auth-card input[type=password] {
  width: 100%;
  border: 1px solid var(--gd-border);
  border-radius: 4px;
  padding: 14px;
  font-size: 15px;
  outline: none;
  margin-bottom: 14px;
}

.auth-card input:focus { border-color: var(--gd-blue); box-shadow: inset 0 0 0 1px var(--gd-blue); }

.alert { padding: 0 0 12px; font-size: 13px; display: none; }
.alert.error { color: #c5221f; display: block; }
.alert.ok { color: #137333; display: block; }

.switch { margin-top: 18px; color: var(--gd-muted); font-size: 14px; }

/* ================= SHARE PAGE ================= */
.share-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f8f9fa; padding: 20px; }

.share-card {
  background: #fff;
  border: 1px solid var(--gd-border);
  border-radius: 12px;
  box-shadow: var(--gd-shadow);
  padding: 40px;
  max-width: 460px;
  width: 100%;
  text-align: center;
}

.share-card .file-icon { font-size: 72px; }
.share-card h1 { font-size: 20px; font-weight: 500; word-break: break-word; }
.share-card .meta { color: var(--gd-muted); font-size: 14px; margin-bottom: 24px; }
.share-card .owner-tag { display: inline-block; margin-top: 12px; font-size: 12px; color: var(--gd-muted); }
.share-card .share-files { display: flex; flex-direction: column; gap: 6px; width: 100%; max-height: 300px; overflow: auto; margin-top: 14px; text-align: left; }
.share-file-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--gd-border); border-radius: 10px; font-size: 13px; color: var(--gd-text); }
.share-file-row:hover { background: var(--gd-hover); }
.share-file-row .sf-ico { flex-shrink: 0; }
.share-file-row .sf-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: inherit; text-decoration: none; }
.share-file-row .sf-name:hover { text-decoration: underline; }
.share-file-row .sf-size { flex-shrink: 0; font-size: 12px; color: var(--gd-muted); }

/* mode edit halaman share: ubah nama + tambah file */
.share-file-row .sf-edit,
.sf-edit {
  border: none; background: none; cursor: pointer;
  font-size: 13px; padding: 2px 5px; border-radius: 4px; flex-shrink: 0;
}
.share-file-row .sf-edit:hover, .sf-edit:hover { background: #e8eaed; }
.share-card h1 + .sf-edit { font-size: 15px; vertical-align: middle; }
.share-upload { display: flex; gap: 8px; margin-top: 10px; position: relative; }
.share-upbar { position: absolute; left: 0; right: 0; bottom: -7px; height: 4px; background: #e8eaed; border-radius: 4px; overflow: hidden; }
.share-upfill { height: 100%; width: 0; background: var(--gd-blue); transition: width .15s; }
.share-msg { margin-top: 12px; font-size: 13px; border-radius: 8px; padding: 8px 10px; text-align: left; }
.share-msg.ok { background: #e6f4ea; color: #137333; }
.share-msg.err { background: #fce8e6; color: #c5221f; }

/* ================= PREVIEW ================= */
.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  z-index: 400;
  display: none;
  flex-direction: column;
}

.preview-overlay.show { display: flex; }

.preview-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  color: #fff;
  min-height: 56px;
}

.preview-top .p-file-ico { font-size: 20px; }

.preview-top .p-file-name {
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-top .p-actions { margin-left: auto; display: flex; gap: 4px; }

.preview-top .p-actions .icon-btn { color: #e8eaed; }
.preview-top .p-actions .icon-btn:hover { background: rgba(255,255,255,.15); }

.preview-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px 24px;
  overflow: auto;
  min-height: 0;
}

.pv-img {
  max-width: 92vw;
  max-height: calc(92vh - 64px);
  object-fit: contain;
  border-radius: 4px;
}

.pv-frame {
  width: 92vw;
  height: calc(92vh - 64px);
  border: none;
  border-radius: 6px;
  background: #fff;
}

.pv-media { max-width: 92vw; max-height: calc(92vh - 64px); }

/* layar loading pratinjau + keterangan */
.pv-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; height: 100%; min-height: 240px; }
.pv-note { color: var(--gd-muted); font-size: 13px; text-align: center; max-width: 420px; line-height: 1.5; }
.pv-note.err { color: #c5221f; }

.pv-text {
  background: #202124;
  color: #e8eaed;
  border-radius: 8px;
  padding: 20px 24px;
  font-family: "Roboto Mono", "Ubuntu Mono", Consolas, monospace;
  font-size: 13px;
  max-width: 92vw;
  max-height: calc(92vh - 64px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.pv-fallback {
  background: #fff;
  border-radius: 12px;
  padding: 48px 56px;
  text-align: center;
  max-width: 92vw;
}

.pv-fallback .fb-icon { font-size: 64px; }
.pv-fallback h3 { font-weight: 500; color: var(--gd-text); margin: 12px 0 4px; word-break: break-word; }
.pv-fallback .fb-meta { color: var(--gd-muted); font-size: 13px; margin-bottom: 20px; }

/* ================= MISC ================= */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--gd-border);
  border-top-color: var(--gd-blue);
  border-radius: 50%;
  margin: 60px auto;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn-gd {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: var(--gd-blue);
  color: #fff;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}

.btn-gd:hover { background: var(--gd-blue-dark); }
.btn-gd.green { background: var(--gd-green); }
.btn-gd.green:hover { background: var(--gd-green-dark); }

.search-info { padding: 12px 0; color: var(--gd-muted); font-size: 14px; }

@media (max-width: 860px) {
  .content { padding: 0 12px 30px; }
  .list-table th:nth-child(3), .list-table td:nth-child(3),
  .list-table th:nth-child(4), .list-table td:nth-child(4) { display: none; }
}