@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap");

:root {
  --bg: #f2f5fb;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --ink: #142033;
  --muted: #667a93;
  --line: #d5dfeb;
  --accent: #0d8ecf;
  --accent-2: #14b789;
  --accent-3: #1a5cff;
  --danger: #c03a2b;
  --sidebar: #0f1728;
  --sidebar-2: #18233a;
  --shadow: 0 18px 40px rgba(12, 33, 60, 0.12);
  --ring: 0 0 0 4px rgba(13, 142, 207, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Sora", "Segoe UI", sans-serif;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 12% 12%, rgba(20, 183, 137, 0.12), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(26, 92, 255, 0.14), transparent 34%),
    linear-gradient(180deg, #f7f9fd 0%, #edf2f9 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

label {
  display: grid;
  gap: 8px;
  color: #344961;
  font-size: 13px;
  font-weight: 600;
}

button {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  min-height: 42px;
  padding: 0 15px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(13, 142, 207, 0.24);
}

button.secondary {
  background: #29415f;
}

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

button.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: none;
}

button.icon {
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: #ecf2fb;
  color: #29415f;
}

input,
select,
textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #8cc8e8;
  box-shadow: var(--ring);
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(130deg, rgba(12, 35, 68, 0.95), rgba(18, 85, 136, 0.9)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='900' viewBox='0 0 1200 900'%3E%3Cg fill='none' stroke='%23ffffff' opacity='.16'%3E%3Cpath d='M70 180h1060v540H70z'/%3E%3Cpath d='M70 310h1060M70 440h1060M70 570h1060M320 180v540M570 180v540M820 180v540'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.login-layout {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
  align-items: stretch;
}

.login-showcase {
  color: #e9f4ff;
  padding: 34px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(140deg, rgba(8, 33, 59, 0.9), rgba(15, 94, 147, 0.74));
  box-shadow: var(--shadow);
  display: grid;
  align-content: center;
  gap: 14px;
  animation: rise .4s ease;
}

.login-showcase h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: -.03em;
}

.lead {
  margin: 0;
  color: #c8def4;
  line-height: 1.6;
  max-width: 62ch;
}

.showcase-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.showcase-grid article {
  display: grid;
  gap: 4px;
  border-radius: 12px;
  border: 1px solid rgba(176, 223, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
}

.showcase-grid strong {
  font-size: 17px;
}

.showcase-grid span {
  font-size: 12px;
  color: #c8def4;
}

.login-panel {
  width: min(430px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 30px;
  display: grid;
  gap: 18px;
  animation: rise .4s ease;
}

.login-panel h1,
.topbar h2 {
  margin: 0;
}

.login-panel h2 {
  font-size: 28px;
  letter-spacing: -.03em;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

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

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  position: relative;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #fff;
  padding: 24px 20px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  box-shadow: 8px 0 24px rgba(5, 16, 32, 0.18);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(20, 183, 137, 0.28);
}

.brand strong {
  font-size: 19px;
}

.brand small {
  display: block;
  color: #90a4c2;
}

nav {
  display: grid;
  gap: 9px;
}

nav button {
  min-height: 44px;
  background: rgba(255, 255, 255, 0.02);
  color: #d7e2f3;
  text-align: left;
  border: 1px solid transparent;
  box-shadow: none;
}

nav button.active {
  background: linear-gradient(90deg, rgba(13, 142, 207, 0.22), rgba(26, 92, 255, 0.08));
  border-color: rgba(128, 198, 243, 0.42);
}

nav button:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.09);
}

.content {
  padding: 26px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 255, 0.92));
  border: 1px solid #dce7f3;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 22px rgba(8, 29, 58, 0.08);
}

.view {
  min-width: 0;
  animation: rise .25s ease;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.stat,
.item {
  background: var(--panel);
  border: 1px solid #d9e5f2;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.stat {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
}

.stat strong {
  display: block;
  font-size: 34px;
  letter-spacing: -.03em;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  background: var(--panel-soft);
  border: 1px solid #dce6f4;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15, 43, 78, 0.08);
}

.domain-toolbar {
  grid-template-columns: minmax(180px, 1.3fr) minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(130px, .8fr) minmax(110px, .6fr) minmax(100px, .6fr) auto;
}

.hint {
  margin: 0 0 14px;
  padding: 13px 14px;
  border: 1px solid #b9ddf2;
  border-radius: 14px;
  background: linear-gradient(90deg, #f4fbff, #edf7ff);
  color: #1f4d66;
  line-height: 1.45;
}

.check {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  min-height: auto;
}

.list {
  display: grid;
  gap: 12px;
}

.item {
  padding: 17px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  transition: transform .2s ease, box-shadow .2s ease;
}

.item:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(14, 39, 71, 0.14);
}

.item h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.item p {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.file-manager {
  min-height: calc(100vh - 132px);
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 14px;
}

.file-pane,
.editor-pane {
  min-width: 0;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #dce6f4;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.file-pane {
  display: grid;
  grid-template-rows: auto 1fr;
}

.file-toolbar,
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #d9e4f1;
}

.file-toolbar {
  flex-wrap: wrap;
}

.zip-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #3f5876;
  background: #eef6ff;
  border: 1px solid #d2e5f9;
  border-radius: 999px;
  padding: 0 12px;
  min-height: 38px;
}

.zip-check input {
  min-height: auto;
}

.file-toolbar input {
  flex: 1 1 180px;
}

.editor-toolbar {
  justify-content: space-between;
}

.editor-toolbar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list {
  overflow: auto;
  padding: 8px;
}

.file-row {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.file-row:hover {
  background: #eef6ff;
  border-color: #d1e3f8;
}

.file-kind {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.file-row small,
.empty-file {
  color: var(--muted);
}

.empty-file {
  padding: 14px;
}

.editor-pane {
  display: grid;
  grid-template-rows: auto 1fr;
}

#fileEditor {
  width: 100%;
  height: 100%;
  min-height: 520px;
  resize: none;
  border: 0;
  padding: 16px;
  background: #0c1727;
  color: #d8e6f7;
  font: 14px/1.6 "JetBrains Mono", Consolas, monospace;
  outline: 0;
}

#fileEditor:disabled {
  background: #f7f9fb;
  color: var(--muted);
}

dialog {
  width: min(860px, calc(100vw - 28px));
  border: 0;
  border-radius: 14px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(8, 22, 40, 0.45);
  backdrop-filter: blur(3px);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #dbe6f4;
}

pre {
  margin: 0;
  padding: 16px;
  max-height: 70vh;
  overflow: auto;
  background: #0c1727;
  color: #d7e9ff;
  white-space: pre-wrap;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-showcase {
    padding: 22px;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-rows: auto auto auto;
    gap: 16px;
    padding: 16px;
  }

  .stats,
  .toolbar,
  .domain-toolbar {
    grid-template-columns: 1fr;
  }

  .item {
    grid-template-columns: 1fr;
  }

  .file-manager {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 14px;
  }

  .topbar h2 {
    font-size: 22px;
  }

  .actions {
    justify-content: flex-start;
  }
}

.run-now-label {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  user-select: none;
}
.run-now-label input[type="checkbox"] {
  min-height: auto;
  margin: 0;
  cursor: pointer;
}

/* File Manager Layout Overrides */
.file-manager {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  min-height: 550px;
}

.file-pane {
  background: var(--panel);
  border: 1px solid #d9e5f2;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}

.file-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 2px solid var(--line);
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}

.header-name {
  flex-grow: 1;
}

.file-row-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-bottom: 1px solid #edf3fa;
  transition: background 0.15s ease;
  border-radius: 8px;
}

.file-row-wrapper:hover {
  background: var(--bg);
}

.file-row-select {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.file-row-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.file-kind-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.file-row-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.file-row-size {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}

/* Batch Action Bar */
.batch-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sidebar-2);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  animation: slideUp 0.25s ease;
}

.batch-action-bar button {
  min-height: 32px;
  font-size: 12px;
  padding: 0 12px;
  border-radius: 6px;
}

.batch-action-bar div {
  display: flex;
  gap: 8px;
}

/* Properties & Actions Panel */
.properties-panel {
  background: var(--panel);
  border: 1px solid #d9e5f2;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}

.properties-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.properties-icon {
  font-size: 36px;
}

.properties-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
}

.properties-header small {
  color: var(--muted);
  font-size: 11px;
  word-break: break-all;
}

.properties-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  color: var(--ink);
}

.meta-row strong {
  color: var(--muted);
}

.properties-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.properties-actions button {
  min-height: 36px;
  font-size: 12px;
  border-radius: 8px;
  padding: 0 10px;
}

/* Editor Container */
.editor-container {
  background: var(--panel);
  border: 1px solid #d9e5f2;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
  margin-top: 14px;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-toolbar strong {
  font-size: 14px;
  color: var(--ink);
}

.editor-toolbar button {
  min-height: 36px;
  font-size: 12px;
  border-radius: 8px;
}

#fileEditor {
  width: 100%;
  height: 320px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f7f9fd;
  color: #1a2c42;
  resize: vertical;
  line-height: 1.5;
}

@keyframes slideUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Breadcrumbs Styling */
.file-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.breadcrumb-item {
  color: var(--accent);
  cursor: pointer;
  transition: color 0.15s ease;
  user-select: none;
}

.breadcrumb-item:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--muted);
  user-select: none;
}

/* File Selected Row Highlight */
.file-selected-row {
  background: #eef4fc !important;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
}



