
:root {
  --bg: #f4f5fb;
  --bg-card: #ffffff;
  --bg-toolbar: #ffffff;
  --bg-input: #eef1f7;
  --border-subtle: #d5d8e3;
  --text: #111827;
  --text-soft: #6b7280;
  --primary: #2563eb;
  --primary-soft: #e0ebff;
  --danger: #dc2626;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
}

body.theme-dark {
  --bg: #020617;
  --bg-card: #020617;
  --bg-toolbar: #020617;
  --bg-input: #020617;
  --border-subtle: #1e293b;
  --text: #e5e7eb;
  --text-soft: #9ca3af;
  --primary: #60a5fa;
  --primary-soft: #0f172a;
  --danger: #f97373;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top left, #e0ecff 0, #f4f5fb 40%, #e5e7eb 100%);
  color: var(--text);
}

body.theme-dark {
  background: radial-gradient(circle at top left, #0f172a 0, #020617 40%, #000 100%);
}

.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-root {
  justify-content: center;
}

.dashboard-root {
  padding: 24px 16px 40px;
}

.card {
  background-color: var(--bg-card);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* LOGIN */

.login-card {
  width: 100%;
  max-width: 520px;
  padding: 32px 32px 28px;
}

.login-header h1 {
  margin: 0 0 4px;
  font-size: 26px;
}

.sub {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.login-form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.label {
  font-size: 13px;
  font-weight: 500;
}

.input {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  background: var(--bg-input);
  color: var(--text);
  outline: none;
  font-size: 14px;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.button {
  border-radius: 999px;
  border: none;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.05s ease,
    box-shadow 0.12s ease, color 0.12s ease;
}

.button.primary {
  background: var(--primary);
  color: white;
}

.button.primary:hover {
  transform: translateY(-0.5px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.button.secondary {
  background: var(--bg-input);
  color: var(--text);
}

.button.secondary:hover {
  background: var(--primary-soft);
}

.button.danger {
  background: var(--danger);
  color: #fff;
}

.button[disabled],
.icon-btn[disabled] {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

.login-btn {
  margin-top: 6px;
}

.alert {
  margin-top: 16px;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

.alert-error {
  background: rgba(148, 27, 66, 0.12);
  color: #b91c1c;
}

/* FOOTER */

.footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-soft);
}

/* DASHBOARD */

.dashboard-card {
  width: 100%;
  max-width: 1800px;
  min-height: 520px;
  padding: 16px 16px 18px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-toolbar);
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  gap: 8px;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-center {
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.toolbar-label {
  font-size: 12px;
  color: var(--text-soft);
}

.select {
  border-radius: 999px;
  padding: 5px 28px 5px 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
}

/* tombol icon umum */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

/* light mode (aman, kontras) */
body.theme-light .icon-btn {
  background: #ffffff;
  color: #111827;
}

/* DARK MODE: paksa icon jadi terang dan border lebih jelas */
body.theme-dark .icon-btn {
  background: #020617;                 /* beda sedikit dari bg-card */
  border-color: #4b5563;
  color: #e5e7eb !important;           /* teks / icon jadi terang */
}

/* kalau icon pakai SVG / <i> */
body.theme-dark .icon-btn svg,
body.theme-dark .icon-btn i {
  fill: #e5e7eb;
  stroke: #e5e7eb;
  color: #e5e7eb;
}

.icon-btn:hover {
  background: var(--primary-soft);
}

.split-button {
  position: relative;
  display: inline-flex;
  border-radius: 999px;
  box-shadow: none;
}

.split-button .icon-btn {
  border-radius: 999px 0 0 999px;
}


.split-button .split-caret {
  border-radius: 0 999px 999px 0;
  border-left: none;
}

.split-menu {
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 150px;
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.25);
  border: 1px solid var(--border-subtle);
  padding: 6px 0;
  display: none;
  z-index: 10;
}

.split-menu.open {
  display: block;
}

.menu-item {
  display: block;
  width: 100%;
  border: none;
  padding: 7px 14px;
  background: none;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}

.menu-item:hover {
  background: var(--primary-soft);
}

/* LINK BAR */

.linkbar {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.link-input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 7px 12px;
  background: var(--bg-input);
  font-size: 13px;
  color: var(--text-soft);
}

/* HR */

.hr {
  margin-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
}

/* FILES AREA */

.files-area {
  margin-top: 12px;
  min-height: 320px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding: 10px;
  border-radius: 16px;
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.12), transparent 60%);
}

.files-grid {
  display: grid;
  grid-auto-rows: minmax(100px, auto);
  gap: 12px;
}

.files-grid.view-small {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.files-grid.view-medium {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.files-grid.view-large {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.files-grid.view-list {
  grid-template-columns: minmax(0, 1fr);
}

/* FILE CARD */

.file-card {
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.12s ease,
    border-color 0.12s ease, background 0.12s ease;
}

.file-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
}

.file-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.5);
}

.file-thumb {
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(circle at center, #e5e7eb, #d1d5db);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

.view-small .file-thumb {
  min-height: 70px;
}

.view-large .file-thumb {
  min-height: 150px;
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.file-meta {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-extra {
  color: var(--text-soft);
}

/* List style */

.view-list .file-card {
  flex-direction: row;
  align-items: center;
}

.view-list .file-thumb {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.view-list .file-meta {
  margin-left: 10px;
}

/* MODAL */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  background: var(--bg-card);
  border-radius: 18px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-subtle);
  padding: 16px 18px 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.modal-title {
  font-weight: 600;
  font-size: 15px;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  margin-bottom: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* RESPONSIVE */

@media (max-width: 768px) {
  .dashboard-card {
    padding: 12px 10px 16px;
  }

  .toolbar {
    flex-wrap: wrap;
    border-radius: 14px;
  }

  .toolbar-center {
    order: 3;
    justify-content: flex-start;
  }

  .files-area {
    max-height: calc(100vh - 260px);
  }
}
