* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #0b1f3f;
  --navy-2: #12305e;
  --ink: #0f1b2d;
  --blue: #2f6bff;
  --blue-dark: #1d54e0;
  --blue-soft: #eaf1ff;
  --muted: #64748b;
  --subtle: #94a3b8;
  --line: #e6ecf4;
  --card: #ffffff;
  --bg: #f3f6fb;
  --success: #15803d;
  --success-soft: #e7f7ee;
  --warn: #b45309;
  --error: #d12626;
  --error-soft: #fdecec;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 35, 70, 0.05);
  --shadow: 0 1px 2px rgba(15, 35, 70, 0.04),
    0 12px 32px rgba(15, 35, 70, 0.07);
  --header-h: 70px;
}

html,
body {
  height: 100%;
}

body {
  font-family: Manrope, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.screen {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(
      900px 380px at 85% -10%,
      rgba(47, 107, 255, 0.1),
      transparent 70%
    ),
    var(--bg);
}

/* =========================================================
   MODERN HEADER
   ========================================================= */

.site-header {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  height: var(--header-h);

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
  padding: 0 28px;

  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);

  border-bottom: 1px solid rgba(15, 35, 70, 0.08);

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 8px 24px rgba(15, 35, 70, 0.06);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand,
.header-actions,
.header-chip,
.signout-btn,
.crumb,
.panel-head,
.field-control,
.btn,
.ready-badge,
.file-status,
.filter-tab,
.search-field,
.selected-head {
  display: flex;
  align-items: center;
}

/* Brand */

.brand {
  gap: 12px;
  min-width: 0;
}

.logo,
.logo svg {
  width: 38px;
  height: 38px;
  display: block;
}

.logo {
  flex-shrink: 0;
  border-radius: 11px;
  overflow: hidden;

  box-shadow:
    0 5px 14px rgba(47, 107, 255, 0.2),
    0 1px 2px rgba(15, 35, 70, 0.08);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-text strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #10213f;
}

.brand-text span {
  margin-top: 2px;
  font-size: 11.5px;
  color: #718198;
  font-weight: 600;
}

/* Header actions */

.header-actions {
  gap: 10px;
}

.header-chip,
.signout-btn {
  gap: 8px;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* Document portal badge */

.header-chip {
  color: #2454c7;

  background:
    linear-gradient(
      135deg,
      rgba(47, 107, 255, 0.09),
      rgba(47, 107, 255, 0.04)
    );

  border: 1px solid rgba(47, 107, 255, 0.16);

  padding: 8px 13px;

  box-shadow:
    0 1px 2px rgba(47, 107, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.header-chip:hover {
  background: rgba(47, 107, 255, 0.1);
  border-color: rgba(47, 107, 255, 0.24);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(47, 107, 255, 0.08);
}

/* Header divider */

.header-divider {
  width: 1px;
  height: 24px;
  background: #e3e8f0;
}

/* Sign out */

.signout-btn {
  color: #526176;
  background: rgba(255, 255, 255, 0.8);

  border: 1px solid #e0e6ef;

  padding: 8px 12px;

  cursor: pointer;

  box-shadow:
    0 1px 2px rgba(15, 35, 70, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.signout-btn:hover {
  background: #fff;
  color: #0f1b2d;
  border-color: #cfd8e6;

  transform: translateY(-1px);

  box-shadow:
    0 5px 14px rgba(15, 35, 70, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

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

/* Header icons */

.header-chip svg,
.signout-btn svg,
.crumb svg,
.head-icon svg,
.field-control > svg,
.search-field svg,
.drop-icon,
.btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-chip svg,
.signout-btn svg {
  width: 16px;
  height: 16px;
}

/* =========================================================
   PAGE
   ========================================================= */

.page {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 48px));
  margin: 24px auto 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;

  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 24px;
  flex-wrap: wrap;

  padding: 28px 32px;

  border-radius: 22px;

  color: #fff;

  background:
    radial-gradient(
      600px 260px at 0% 0%,
      rgba(47, 107, 255, 0.35),
      transparent 70%
    ),
    linear-gradient(
      120deg,
      var(--navy) 0%,
      var(--navy-2) 55%,
      #1b4fb8 100%
    );

  box-shadow: 0 18px 40px rgba(11, 31, 63, 0.22);
}

.hero-truck {
  position: absolute;
  inset: 0 0 0 auto;
  width: 46%;
  height: 100%;

  object-fit: cover;
  object-position: center 40%;

  z-index: -1;

  opacity: 0.55;
  mix-blend-mode: luminosity;

  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 55%
  );

  mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 55%
  );
}

.hero-copy {
  max-width: 560px;
}

.crumb {
  gap: 7px;
  color: #a9bcdb;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

.crumb svg {
  width: 15px;
  height: 15px;
}

.crumb-sep {
  color: rgba(255, 255, 255, 0.3);
}

.crumb-current {
  color: #fff;
}

.hero h1 {
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin-bottom: 8px;
}

.lede {
  color: #c4d2ea;
  font-size: 14.5px;
  line-height: 1.55;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(104px, 1fr));
  gap: 10px;
}

.stat {
  padding: 12px 14px;
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.stat dt {
  display: flex;
  align-items: center;
  gap: 6px;

  color: #b9c8e2;

  font-size: 12px;
  font-weight: 700;
}

.stat dd {
  margin-top: 4px;

  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;

  font-variant-numeric: tabular-nums;
}

.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.stat-ready .stat-dot {
  color: #4ade80;
}

.stat-processing .stat-dot {
  color: #7aa7ff;
}

.stat-failed .stat-dot {
  color: #f87171;
}

/* =========================================================
   PANELS
   ========================================================= */

.desk {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}

.desk > .panel:first-child {
  position: sticky;
  top: 20px;
}

.panel-head {
  gap: 12px;
  margin-bottom: 18px;
}

.head-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;

  background: var(--blue-soft);
  color: var(--blue);

  display: grid;
  place-items: center;

  flex-shrink: 0;
}

.head-icon svg {
  width: 19px;
  height: 19px;
}

.panel-head h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel-head p {
  margin-top: 1px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.saved-head > div {
  flex: 1;
  min-width: 0;
}

.ready-badge {
  gap: 6px;
  margin-left: auto;

  padding: 5px 10px;
  border-radius: 999px;

  background: var(--success-soft);
  color: var(--success);

  font-size: 12px;
  font-weight: 800;

  white-space: nowrap;
}

.ready-badge[hidden] {
  display: none;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.ready-badge.is-processing {
  background: var(--blue-soft);
  color: var(--blue);
}

.ready-badge.is-processing .badge-dot {
  animation: pulse 1.4s ease-in-out infinite;
}

/* =========================================================
   UPLOAD FORM
   ========================================================= */

.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.form-row label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
}

.field-control {
  position: relative;
}

.field-control > svg {
  position: absolute;
  left: 12px;
  top: 14px;

  width: 16px;
  height: 16px;

  color: var(--subtle);

  pointer-events: none;
}

.form-row textarea {
  width: 100%;

  font: inherit;
  font-size: 14px;
  font-weight: 500;

  color: var(--ink);
  background: #fff;

  border: 1px solid #dbe3ee;
  border-radius: 12px;

  padding: 11px 13px 11px 38px;

  outline: none;
  resize: vertical;
  min-height: 84px;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.form-row textarea::placeholder {
  color: #9aabbd;
}

.form-row textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12);
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 4px;

  min-height: 220px;
  padding: 24px 16px;
  margin-bottom: 16px;

  border: 1.5px dashed #c5d4ea;
  border-radius: 16px;

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(47, 107, 255, 0.06),
      transparent 65%
    ),
    #fafcff;

  text-align: center;
  cursor: pointer;

  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--blue);
  background-color: #f3f8ff;
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.08);
}

.drop-zone.dragging .drop-badge {
  transform: translateY(-3px) scale(1.05);
}

.drop-zone input[type="file"] {
  display: none;
}

.drop-badge {
  width: 56px;
  height: 56px;

  margin-bottom: 8px;

  border-radius: 16px;

  background: var(--blue);
  color: #fff;

  display: grid;
  place-items: center;

  box-shadow: 0 10px 22px rgba(47, 107, 255, 0.3);

  transition: transform 0.2s ease;
}

.drop-icon {
  width: 26px;
  height: 26px;
}

.drop-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.drop-sub {
  font-size: 13.5px;
  color: var(--muted);
}

.drop-sub strong {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.type-chips {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.mini-type {
  padding: 4px 8px;

  border-radius: 6px;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.mini-type.pdf {
  background: #fdecec;
  color: #dc2626;
}

.mini-type.doc {
  background: #e8f0ff;
  color: #2563eb;
}

.mini-type.xls {
  background: #e6f6ec;
  color: #15803d;
}

.mini-type.img {
  background: #f1ebff;
  color: #7c3aed;
}

.drop-limit {
  margin-top: 8px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 600;
}

.selected-head {
  justify-content: space-between;
  margin-bottom: 8px;

  font-size: 12.5px;
  font-weight: 700;

  color: var(--muted);
}

.selected-head[hidden] {
  display: none;
}

.file-list {
  list-style: none;

  display: flex;
  flex-direction: column;

  gap: 6px;

  max-height: 248px;
  overflow-y: auto;

  margin-bottom: 16px;
  padding-right: 2px;
}

.file-list:empty {
  display: none;
  margin: 0;
}

.file-item {
  display: flex;
  align-items: center;

  gap: 12px;

  padding: 8px 8px 8px 10px;

  border: 1px solid var(--line);
  border-radius: 12px;

  background: #fbfcfe;
}

.file-ext {
  width: 36px;
  height: 36px;

  border-radius: 9px;

  background: var(--blue-soft);
  color: var(--blue);

  font-size: 9.5px;
  font-weight: 800;

  display: grid;
  place-items: center;

  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  font-size: 13.5px;
  font-weight: 700;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size,
.saved-meta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.file-status {
  gap: 6px;

  flex-shrink: 0;

  font-size: 11.5px;
  font-weight: 800;

  padding: 4px 9px;

  border-radius: 999px;

  white-space: nowrap;
}

.file-status:empty {
  display: none;
}

.file-status.uploading,
.file-status.processing {
  background: var(--blue-soft);
  color: #1d4ed8;
}

.file-status.done,
.file-status.ready {
  background: var(--success-soft);
  color: var(--success);
}

.file-status.failed {
  background: var(--error-soft);
  color: var(--error);
}

.file-status.uploading::before,
.file-status.processing::before {
  content: "";

  width: 9px;
  height: 9px;

  border: 1.6px solid currentColor;
  border-right-color: transparent;

  border-radius: 50%;

  animation: spin 0.8s linear infinite;
}

.file-status.ready::before,
.file-status.done::before,
.file-status.failed::before {
  content: "";

  width: 6px;
  height: 6px;

  border-radius: 50%;
  background: currentColor;
}

.remove-btn {
  width: 28px;
  height: 28px;

  border: none;
  background: transparent;

  color: var(--subtle);

  font-size: 18px;
  line-height: 1;

  cursor: pointer;

  border-radius: 8px;

  flex-shrink: 0;
}

.remove-btn:hover {
  background: var(--error-soft);
  color: var(--error);
}

/* =========================================================
   BUTTONS
   ========================================================= */

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

.btn {
  gap: 8px;
  justify-content: center;

  font: inherit;
  font-size: 14px;
  font-weight: 700;

  border-radius: 11px;
  border: 1px solid transparent;

  padding: 10px 16px;

  cursor: pointer;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  flex: 1;

  background: var(--blue);
  color: #fff;

  box-shadow: 0 8px 18px rgba(47, 107, 255, 0.26);
}

.btn-primary:hover:not(:disabled) {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: #d9e2ee;
}

.btn-secondary:hover {
  background: #f6f9fc;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Messages */

.message {
  font-size: 13px;
  font-weight: 700;
}

.message:empty {
  display: none;
}

.message.success,
.message.error {
  display: flex;
  align-items: center;
  gap: 8px;

  margin-top: 14px;
  padding: 10px 12px;

  border-radius: 11px;
}

.message.success::before,
.message.error::before {
  content: "";

  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: currentColor;

  flex-shrink: 0;
}

.message.success {
  color: var(--success);
  background: var(--success-soft);
}

.message.error {
  color: var(--error);
  background: var(--error-soft);
}

/* =========================================================
   SAVED FILES
   ========================================================= */

.saved-panel {
  display: flex;
  flex-direction: column;

  height: clamp(
    520px,
    calc(100vh - var(--header-h) - 40px),
    860px
  );

  padding-bottom: 8px;
}

.saved-tools {
  display: flex;
  flex-wrap: wrap;

  gap: 10px;

  margin-bottom: 12px;
}

.search-field {
  flex: 1 1 200px;

  gap: 8px;

  padding: 0 12px;

  height: 38px;

  border: 1px solid #dbe3ee;
  border-radius: 10px;

  background: #fff;
  color: var(--subtle);

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.search-field:focus-within {
  border-color: var(--blue);

  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.12);
}

.search-field svg {
  width: 16px;
  height: 16px;

  flex-shrink: 0;
}

.search-field input {
  flex: 1;
  min-width: 0;

  border: none;
  outline: none;

  background: transparent;

  font: inherit;
  font-size: 13.5px;
  font-weight: 500;

  color: var(--ink);
}

.search-field input::placeholder {
  color: #9aabbd;
}

.filter-tabs {
  display: flex;

  gap: 2px;

  padding: 3px;

  border-radius: 10px;

  background: #f1f4f9;
}

.filter-tab {
  gap: 6px;

  height: 32px;

  padding: 0 10px;

  border: none;
  border-radius: 8px;

  background: transparent;

  color: var(--muted);

  font: inherit;
  font-size: 12.5px;
  font-weight: 700;

  cursor: pointer;

  white-space: nowrap;
}

.filter-tab span {
  min-width: 20px;

  padding: 1px 6px;

  border-radius: 999px;

  background: #e3e9f2;

  font-size: 11px;

  text-align: center;

  font-variant-numeric: tabular-nums;
}

.filter-tab:hover {
  color: var(--ink);
}

.filter-tab.is-active {
  background: #fff;
  color: var(--ink);

  box-shadow:
    var(--shadow-sm),
    0 0 0 1px var(--line);
}

.filter-tab.is-active span {
  background: var(--blue);
  color: #fff;
}

.saved-empty {
  flex: 1;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 12px;

  color: var(--muted);

  font-size: 13.5px;
  font-weight: 600;

  padding: 28px 16px;

  margin-bottom: 14px;

  text-align: center;

  border: 1px dashed #d5e0ec;
  border-radius: 14px;

  background: #fbfcfe;
}

.saved-empty::before {
  content: "";

  width: 52px;
  height: 52px;

  border-radius: 16px;

  background:
    var(--blue-soft)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f6bff' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z'/%3E%3C/svg%3E")
    center / 26px no-repeat;
}

.saved-empty[hidden] {
  display: none;
}

.saved-list {
  list-style: none;

  flex: 1;
  min-height: 0;

  overflow-y: auto;

  margin: 0 -10px;

  padding: 0 10px 8px;

  display: flex;
  flex-direction: column;
}

.saved-list:empty {
  display: none;
}

.saved-list::-webkit-scrollbar,
.file-list::-webkit-scrollbar {
  width: 8px;
}

.saved-list::-webkit-scrollbar-thumb,
.file-list::-webkit-scrollbar-thumb {
  background: #d6dfeb;

  border-radius: 999px;

  border: 2px solid #fff;
}

.saved-item {
  display: grid;

  grid-template-columns:
    auto
    minmax(0, 1fr)
    auto
    auto;

  align-items: center;

  gap: 12px;

  padding: 10px 8px;

  border-radius: 12px;

  border-bottom: 1px solid #f1f4f8;

  transition: background 0.12s ease;
}

.saved-item:last-child {
  border-bottom: none;
}

.saved-item:hover {
  background: #f6f9ff;
  border-bottom-color: transparent;
}

.saved-meta {
  display: flex;
  align-items: center;

  gap: 6px;

  min-width: 0;
}

.meta-ext {
  font-weight: 700;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-ext.is-error {
  color: var(--error);
}

.saved-time {
  white-space: nowrap;
  color: var(--subtle);
}

.saved-time:not(:empty)::before {
  content: "·";
  margin-right: 6px;
}

.type-badge {
  width: 38px;
  height: 38px;

  border-radius: 10px;

  font-size: 9.5px;
  font-weight: 800;

  letter-spacing: 0.03em;

  display: grid;
  place-items: center;
}

.type-badge.pdf {
  background: #fdecec;
  color: #dc2626;
}

.type-badge.doc {
  background: #e8f0ff;
  color: #2563eb;
}

.type-badge.xls {
  background: #e6f6ec;
  color: #15803d;
}

.type-badge.img {
  background: #f1ebff;
  color: #7c3aed;
}

.type-badge.ppt {
  background: #fef3e2;
  color: var(--warn);
}

.type-badge.txt,
.type-badge.file {
  background: #eef2f7;
  color: #475569;
}

/* =========================================================
   MENU
   ========================================================= */

.row-menu {
  position: relative;
}

.menu-btn {
  width: 30px;
  height: 30px;

  border: none;
  border-radius: 8px;

  background: transparent;

  color: var(--subtle);

  display: grid;
  place-items: center;

  cursor: pointer;
}

.menu-btn svg {
  width: 16px;
  height: 16px;

  fill: currentColor;
}

.menu-btn:hover,
.menu-btn[aria-expanded="true"] {
  background: #e9eef6;
  color: var(--ink);
}

.menu-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.menu-pop {
  position: fixed;

  z-index: 40;

  min-width: 140px;

  padding: 5px;

  background: #fff;

  border: 1px solid var(--line);
  border-radius: 12px;

  box-shadow: 0 14px 32px rgba(15, 35, 70, 0.16);
}

.menu-pop[hidden] {
  display: none;
}

.delete-btn {
  width: 100%;

  border: none;
  background: transparent;

  color: var(--error);

  font: inherit;
  font-size: 13px;
  font-weight: 700;

  text-align: left;

  padding: 8px 10px;

  border-radius: 8px;

  cursor: pointer;
}

.delete-btn:hover {
  background: var(--error-soft);
}

.delete-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================================================
   CONFIRM DIALOG
   ========================================================= */

.btn-danger {
  background: var(--error);
  color: #fff;

  box-shadow: 0 8px 18px rgba(209, 38, 38, 0.22);
}

.btn-danger:hover {
  background: #b91c1c;
}

.confirm-dialog {
  margin: auto;

  width: min(400px, calc(100% - 32px));

  padding: 0;

  border: none;
  border-radius: 20px;

  background: #fff;

  color: var(--ink);

  box-shadow: 0 24px 60px rgba(11, 31, 63, 0.28);
}

.confirm-dialog[open] {
  animation: dialog-in 0.18s ease-out;
}

.confirm-dialog::backdrop {
  background: rgba(11, 31, 63, 0.45);

  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.confirm-body {
  display: flex;
  flex-direction: column;
  align-items: center;

  text-align: center;

  padding: 28px 24px 22px;
}

.confirm-icon {
  width: 52px;
  height: 52px;

  margin-bottom: 14px;

  border-radius: 16px;

  background: var(--error-soft);
  color: var(--error);

  display: grid;
  place-items: center;
}

.confirm-icon svg {
  width: 24px;
  height: 24px;

  fill: none;

  stroke: currentColor;
  stroke-width: 1.8;

  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-body h2 {
  font-size: 18px;
  font-weight: 800;

  letter-spacing: -0.02em;
}

.confirm-body p {
  margin-top: 6px;

  color: var(--muted);

  font-size: 13.5px;
  line-height: 1.5;
}

.confirm-actions {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 10px;

  width: 100%;

  margin-top: 22px;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

button:focus-visible,
.drop-zone:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1080px) {
  .hero {
    align-items: flex-start;
  }

  .hero-stats {
    width: 100%;
  }
}

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

  .desk > .panel:first-child {
    position: static;
  }

  .saved-panel {
    height: auto;
    max-height: none;
  }

  .saved-list {
    overflow: visible;
  }

  .hero-truck {
    width: 70%;
    opacity: 0.3;
  }
}

@media (max-width: 640px) {
  .site-header {
    height: 64px;
    padding: 0 16px;
  }

  .logo,
  .logo svg {
    width: 36px;
    height: 36px;
  }

  .brand {
    gap: 10px;
  }

  .brand-text strong {
    font-size: 14px;
  }

  .brand-text span {
    font-size: 10.5px;
  }

  .header-chip,
  .header-divider {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .signout-btn {
    padding: 7px 9px;
    font-size: 12px;
  }

  .page {
    width: calc(100% - 24px);
    margin-top: 14px;
  }

  .hero {
    padding: 22px 18px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel {
    padding: 18px;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .saved-item {
    grid-template-columns:
      auto
      minmax(0, 1fr)
      auto;
  }

  .saved-item .file-status {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .row-menu {
    grid-row: 1;
    grid-column: 3;
  }

  .actions {
    flex-direction: column-reverse;
  }

  .btn {
    width: 100%;
  }
}

.ai-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 22px 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue) 0%, #7c3aed 100%);
  color: #fff;
  font: 700 15px/1 "Manrope", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(47, 107, 255, 0.35), 0 2px 6px rgba(15, 35, 70, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ai-fab svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(47, 107, 255, 0.45), 0 3px 8px rgba(15, 35, 70, 0.14);
}

.ai-fab:focus-visible {
  outline: 3px solid var(--blue-soft);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .ai-fab {
    right: 18px;
    bottom: 18px;
    height: 52px;
    padding: 0 18px 0 14px;
  }
}

.ai-fab[hidden] {
  display: none;
}

.ai-chat {
  --ai-navy: #1a237e;
  --ai-gold: #f5c542;
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 400px;
  height: min(680px, calc(100vh - 56px));
  overflow: hidden;
  border-radius: 22px;
  background: #f5f5f7;
  box-shadow: 0 24px 60px rgba(15, 35, 70, 0.28), 0 4px 12px rgba(15, 35, 70, 0.12);
  font-family: "Manrope", sans-serif;
  animation: ai-chat-in 0.22s ease;
}

.ai-chat[hidden] {
  display: none;
}

@keyframes ai-chat-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ai-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px;
  background: var(--ai-navy);
  color: #fff;
}

.ai-chat-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.ai-chat-back {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.ai-chat-back:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ai-chat-back svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-chat-spark {
  width: 24px;
  height: 24px;
  fill: var(--ai-gold);
}

.ai-chat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 16px;
}

.ai-hello {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid #e3e6ee;
  border-radius: 18px;
  background: #f8f9fc;
}

.ai-hello h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

.ai-hello h3 span {
  color: var(--blue);
}

.ai-hello p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.ai-avatar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 3px solid var(--ai-gold);
  border-radius: 50%;
  background: var(--ai-navy);
  box-shadow: 0 0 0 4px rgba(245, 197, 66, 0.2);
}

.ai-avatar svg {
  width: 26px;
  height: 26px;
  fill: var(--ai-gold);
}

.ai-online {
  position: absolute;
  right: -2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #22c55e;
}

.ai-suggest[hidden] {
  display: none;
}

.ai-suggest-title {
  margin: 24px 2px 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.ai-suggest-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid #e8eaf0;
  border-radius: 14px;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ai-suggest-item:hover {
  border-color: #c7cdf0;
  box-shadow: 0 4px 14px rgba(26, 35, 126, 0.08);
}

.ai-suggest-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e8eaf6;
  color: var(--ai-navy);
}

.ai-suggest-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-suggest-text {
  flex: 1 1 auto;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.ai-chevron {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ai-navy);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.ai-msg {
  max-width: 85%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
}

.ai-msg-user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--ai-navy);
  color: #fff;
}

.ai-msg-bot {
  align-self: flex-start;
  border: 1px solid #e8eaf0;
  border-bottom-left-radius: 4px;
  background: #fff;
  color: var(--ink);
}

.ai-msg-bot.is-typing {
  color: var(--subtle);
  font-style: italic;
}

.ai-chat-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 16px;
  border-top: 1px solid #ececf0;
  background: #fff;
}

.ai-chat-input input {
  flex: 1 1 auto;
  min-width: 0;
  height: 50px;
  padding: 0 20px;
  border: 1px solid #dcdfe6;
  border-radius: 999px;
  background: #f5f5f7;
  font: 500 15px "Manrope", sans-serif;
  color: var(--ink);
  outline: none;
}

.ai-chat-input input:focus {
  border-color: var(--ai-navy);
  background: #fff;
}

.ai-send {
  flex: none;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ai-navy);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.ai-send:hover {
  transform: scale(1.05);
}

.ai-send svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

@media (max-width: 640px) {
  .ai-chat {
    inset: 0;
    width: auto;
    height: auto;
    border-radius: 0;
  }
}