/*
  GUI Lite – "Files" page look-alike
  Goal: match the main GUI Files page vibe (folder bar, file table, cards) while staying pure HTML/CSS.
*/

:root {
  --color-bg: #f6f8ff;
  --color-surface: #ffffff;
  --color-surface-2: #f2f6ff;
  --color-border: rgba(12, 43, 130, 0.16);
  --color-text: #0b1638;
  --color-muted: rgba(11, 22, 56, 0.70);

  /* 11N brand-ish */
  --color-primary: #0c2b82;
  --color-primary-2: #5a7fef;
  --color-accent: #36BDED;
  --color-warn: #FCAF17;

  --shadow: 0 10px 30px rgba(12, 43, 130, 0.10);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--color-text);
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(90, 127, 239, 0.20), transparent 55%),
    radial-gradient(900px 600px at 110% 15%, rgba(54, 189, 237, 0.16), transparent 50%),
    var(--color-bg);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar {
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(12, 43, 130, 0.92);
  backdrop-filter: blur(8px);
  color: #fff;
  box-shadow: 0 8px 30px rgba(12, 43, 130, 0.25);
}

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

.logo-container {
  display: grid;
  place-items: center;
}

.logo {
  height: 42px;
  width: auto;
  display: block;
}

.page-title .title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.page-title .subtitle {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 12px;
  white-space: nowrap;
}

/* Layout */
.main-content {
  padding: 18px;
}

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .content-grid { grid-template-columns: 1fr; }
}

.left-pane {
  background: transparent;
}

.right-pane {
  position: sticky;
  top: 86px;
}

@media (max-width: 1100px) {
  .right-pane { position: static; }
}

/* Folder bar + actions */
.search-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
}

.search-box {
  width: 100%;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(12, 43, 130, 0.18);
  outline: none;
  background: #fff;
  color: var(--color-text);
}

.search-box:focus {
  border-color: rgba(90, 127, 239, 0.65);
  box-shadow: 0 0 0 3px rgba(90, 127, 239, 0.18);
}

.file-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 9px 12px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.file-btn a {
  color: #fff; 
  text-decoration: none;
}

/* buttons inside content (non-topbar) */
.folder-bar .file-btn {
  border: 1px solid rgba(12, 43, 130, 0.18);
  background: #fff;
  color: var(--color-primary);
}

.folder-bar .file-btn:hover {
  background: rgba(90, 127, 239, 0.10);
}

.topbar-right .file-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 2px 2px;
}

.crumb {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(12, 43, 130, 0.06);
  border: 1px solid rgba(12, 43, 130, 0.12);
  color: var(--color-primary);
}

.crumb a { color: var(--color-primary); }

.crumb.active {
  background: rgba(90, 127, 239, 0.16);
  border-color: rgba(90, 127, 239, 0.30);
  font-weight: 800;
}

.sep { color: rgba(11, 22, 56, 0.35); padding: 6px 0; }

/* Tables */
.files-table-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.files-table {
  width: 100%;
  border-collapse: collapse;
}

.files-table thead th {
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  color: rgba(11, 22, 56, 0.75);
  background: linear-gradient(180deg, rgba(90, 127, 239, 0.10), rgba(90, 127, 239, 0.06));
  border-bottom: 1px solid rgba(12, 43, 130, 0.12);
  padding: 12px 14px;
}

.files-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(12, 43, 130, 0.08);
  font-size: 14px;
}

.files-table tbody tr:last-child td { border-bottom: none; }

.right { text-align: right; }

.muted { color: var(--color-muted); }

.hover-highlight:hover {
  background: rgba(54, 189, 237, 0.10);
}

/* Type pill */
.type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(12, 43, 130, 0.14);
}

.type-pill.dir {
  background: rgba(90, 127, 239, 0.14);
  color: var(--color-primary);
}

.type-pill.file {
  background: rgba(12, 43, 130, 0.06);
  color: rgba(11, 22, 56, 0.85);
}

.filelink {
  font-weight: 800;
  color: var(--color-primary);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid rgba(12, 43, 130, 0.16);
  background: #fff;
  color: var(--color-primary);
  font-weight: 800;
  text-decoration: none;
}

.link-btn:hover {
  background: rgba(90, 127, 239, 0.10);
  text-decoration: none;
}

/* Right side cards (grid-item + reports-table mimic) */
.grid-item {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cnTitle {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(12, 43, 130, 0.10);
  background: linear-gradient(180deg, rgba(12, 43, 130, 0.06), rgba(12, 43, 130, 0.03));
}

.cnTitle h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: rgba(11, 22, 56, 0.92);
}

.table-wrap {
  overflow: auto;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
}

.reports-table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 900;
  color: rgba(11, 22, 56, 0.70);
  padding: 10px 12px;
  border-bottom: 1px solid rgba(12, 43, 130, 0.10);
  background: rgba(90, 127, 239, 0.06);
}

.reports-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(12, 43, 130, 0.08);
  font-size: 13px;
}

.reports-table tbody tr:last-child td { border-bottom: none; }

/* key-value */
.kv {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px 10px;
  padding: 12px 14px;
}

.k { color: rgba(11, 22, 56, 0.70); font-weight: 800; font-size: 12px; }
.v { color: rgba(11, 22, 56, 0.92); font-weight: 800; font-size: 13px; }

.subhead {
  padding: 0 14px 8px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(11, 22, 56, 0.70);
}

.callout {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(252, 175, 23, 0.35);
  background: rgba(252, 175, 23, 0.14);
  color: rgba(11, 22, 56, 0.90);
  font-weight: 800;
}

/* Preview modal */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 9999; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.modal-card {
  position: relative;
  width: min(980px, 92vw);
  max-height: 88vh;
  margin: 6vh auto;
  background: rgba(18, 32, 76, 0.95);
  border: 1px solid rgba(90,127,239,0.35);
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(0,0,0,0.45);
  overflow: hidden;
}
.modal-header {
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(90,127,239,0.25);
}
.modal-title { color:#ffffff; font-weight: 800; letter-spacing: 0.2px; }
.modal-body { padding: 14px 16px; }
.preview-video { 
  width: 100%; 
  max-height: 68vh; 
  background: #000; 
  border-radius: 10px; 
}
.preview-image {
  display: none;
  max-width: 100%;
  max-height: 68vh;
  margin: 0 auto;
  border-radius: 10px;
}
.preview-status { color: #ffffff; font-weight: 800; }


/* Login page */
.login-page {
  min-height: 100vh;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(12, 43, 130, 0.14);
  border-radius: 22px;
  box-shadow:
    0 24px 60px rgba(12, 43, 130, 0.16),
    0 8px 24px rgba(12, 43, 130, 0.08);
  padding: 30px 28px 26px;
  backdrop-filter: blur(10px);
}

.login-brand {
  display: grid;
  place-items: center;
}

.login-card img {
  max-width: 50%;
}

.login-subtitle {
  margin: 0;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-label {
  margin-bottom: -6px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(11, 22, 56, 0.82);
}

.login-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(12, 43, 130, 0.16);
  background: rgba(255, 255, 255, 0.96);
  color: var(--color-text);
  font: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.login-input::placeholder {
  color: rgba(11, 22, 56, 0.42);
}

.login-input:focus {
  border-color: rgba(90, 127, 239, 0.68);
  box-shadow: 0 0 0 4px rgba(90, 127, 239, 0.14);
  transform: translateY(-1px);
}

.login-btn {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-2));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(12, 43, 130, 0.20);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(12, 43, 130, 0.24);
}

.login-btn:active {
  transform: translateY(0);
}

.login-error {
  min-height: 20px;
  margin: 2px 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: #b42318;
}

@media (max-width: 560px) {
  .login-wrap {
    padding: 16px;
  }

  .login-card {
    padding: 22px 18px 18px;
    border-radius: 18px;
  }

  .login-card h1 {
    font-size: 25px;
  }
}