:root {
  --sy-ink: #123047;
  --sy-navy: #0f3554;
  --sy-cyan: #00a8b5;
  --sy-bg: #eff4f8;
  --sy-panel: #ffffff;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

html,
body {
  min-height: 100%;
}

/* Prevent blinking text caret on non-editable UI text. */
*:not(input):not(textarea):not([contenteditable="true"]) {
  caret-color: transparent;
}

input,
textarea,
[contenteditable="true"] {
  caret-color: auto;
}

body {
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top right, #d8eef7 0%, var(--sy-bg) 35%, #f8fbfd 100%);
  color: var(--sy-ink);
}

.utility-nav {
  background: linear-gradient(90deg, #11415f, #0f3554 60%, #0d2e4a);
}

.utility-link,
.utility-nav .navbar-text {
  color: rgba(255, 255, 255, 0.9) !important;
}

.main-nav {
  background: linear-gradient(90deg, #00a8b5, #008ca7 55%, #007696);
  box-shadow: 0 6px 18px rgba(4, 35, 57, 0.18);
}

.main-nav .navbar-brand,
.main-nav .nav-link {
  color: #fff !important;
}

.main-nav .nav-link {
  font-weight: 500;
  border-radius: 0.5rem;
  padding: 0.4rem 0.75rem;
}

.main-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.backup-nav-dropdown {
  min-width: 300px;
  padding: 0.6rem;
  border: 0;
  background: transparent;
}

.backup-nav-dropdown .card {
  margin: 0;
  border: 1px solid #d2e3f2;
  box-shadow: 0 14px 34px rgba(8, 37, 60, 0.24);
}

.backup-nav-dropdown .panel-card-header {
  padding: 0.65rem 1.1rem !important;
}

.notes-nav-dropdown {
  min-width: 520px;
  padding: 0.6rem;
  border: 0;
  background: transparent;
}

.notes-nav-dropdown .card {
  margin: 0;
  border: 1px solid #d2e3f2;
  box-shadow: 0 14px 34px rgba(8, 37, 60, 0.24);
}

.notes-nav-dropdown .panel-card-header {
  padding: 0.65rem 1.1rem !important;
}

.notes-nav-dropdown .notes-content {
  padding: 2rem 2rem 1.8rem !important;
}

.notes-nav-dropdown .notes-content .fw-semibold {
  color: #0d5c8c;
}

.backup-nav-dropdown .backup-content .fw-semibold {
  color: #0d5c8c;
}

.notes-close-btn {
  background-color: #0f6ca6 !important;
  border-color: #fff !important;
  color: #fff !important;
}

.notes-close-btn:hover,
.notes-close-btn:focus {
  background-color: #0d5c8c !important;
  border-color: #fff !important;
  color: #fff !important;
}

.navbar-brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 700;
}

.navbar-brand small {
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-left: 0.5rem;
}

.hero-panel {
  background: linear-gradient(125deg, #0f3554 0%, #135581 55%, #00a8b5 100%);
  border-radius: 1rem;
  color: #fff;
  padding: 2rem;
  box-shadow: 0 14px 30px rgba(8, 42, 69, 0.28);
}

.hero-kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  opacity: 0.85;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-top: 0.4rem;
  margin-bottom: 0.6rem;
  line-height: 1.05;
}

.hero-subtitle {
  max-width: 700px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
}

.card {
  border: 0;
  border-radius: 1rem;
  background: var(--sy-panel);
}

.card-elevated {
  box-shadow: 0 8px 22px rgba(16, 43, 68, 0.12);
}

.card.card-elevated .card-body {
  padding: 0.9rem !important;
}

/* Ensure Notes dropdown keeps larger internal spacing than generic cards. */
.notes-nav-dropdown .card.card-elevated .card-body.notes-content {
  padding: 2.35rem 2.35rem 2.1rem !important;
}

.backup-nav-dropdown .card.card-elevated .card-body.backup-content {
  padding: 2.35rem 2.35rem 2.1rem !important;
}

.table thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.explorer-shell {
  border-radius: 0.55rem;
  overflow: hidden;
}

.explorer-shell-header {
  border-bottom: 1px solid #e0e0e0 !important;
}

.panel-card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
  background: linear-gradient(125deg, #0f3554 0%, #135581 55%, #00a8b5 100%);
  color: #fff;
}

.panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel-header-title {
  font-size: 0.92rem;
  color: #fff;
  font-weight: 600;
}

.panel-breadcrumb {
  margin-top: 0.35rem;
}

.panel-card-header .breadcrumb-item,
.panel-card-header .breadcrumb-item.active {
  color: rgba(255, 255, 255, 0.9);
}

.panel-card-header .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.7);
}

.panel-card-header .breadcrumb-item a {
  color: #fff;
  text-decoration: none;
}

.panel-card-header .breadcrumb-item a:hover {
  text-decoration: underline;
}

.panel-header-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: 500;
}

.panel-card-header .panel-action-btn {
  border: 1px solid #fff;
}

.panel-card-header .panel-action-btn:hover,
.panel-card-header .panel-action-btn:focus {
  border-color: #fff;
}

.download-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 35, 53, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.download-overlay-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #d9e6f2;
  box-shadow: 0 16px 34px rgba(10, 29, 47, 0.24);
  padding: 1rem 1rem 0.9rem;
}

.download-spinner {
  display: inline-block;
  font-size: 1.35rem;
  color: #0f6ca6;
  animation: sy-spin 0.85s linear infinite;
}

@keyframes sy-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.upload-queue-list-wrapper {
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.upload-queue-list-scroller {
  min-height: 170px;
  max-height: 300px;
  overflow: auto;
  background: #ffffff;
}

.upload-queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.8rem 0.6rem;
  background: #e9ecef;
}

.upload-queue-actions-top {
  border-bottom: 1px solid #c8ced6;
  background: #e9ecef;
}

.upload-queue-actions-bottom {
  border-top: 1px solid #c8ced6;
  background: #e9ecef;
}

.upload-queue-list-wrapper.drag-active {
  border-color: #79aef7;
  background: #dbeafe;
}

.upload-queue-empty {
  padding: 0.8rem 0.65rem;
  color: #6c757d;
  font-size: 0.82rem;
}

.upload-queue-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #eef2f7;
}

.upload-queue-item:last-child {
  border-bottom: 0;
}

.upload-queue-main {
  min-width: 0;
  flex: 1;
}

.upload-queue-name {
  font-size: 0.84rem;
  color: #1f2937;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.upload-queue-meta {
  font-size: 0.75rem;
  color: #6b7280;
}

.upload-queue-failures {
  font-size: 0.74rem;
}

.upload-queue-failure-item {
  color: #a61c1c;
}

.upload-queue-progress {
  margin-top: 0.2rem;
  height: 4px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.upload-queue-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: #0f6ca6;
}

.upload-integrity-report {
  border: 1px solid #dbe7f3;
  border-radius: 0.5rem;
  background: #f8fbff;
  padding: 0.6rem 0.65rem;
  color: #1f3550;
}

.upload-integrity-report details summary {
  cursor: pointer;
}

.explorer-title-row .breadcrumb-item + .breadcrumb-item::before {
  content: ">";
}

.explorer-surface {
  background: #fff;
  min-height: 480px;
}

.explorer-surface,
.explorer-surface * {
  caret-color: transparent !important;
}

.windows-list-view thead th {
  background: #e9ecef;
  border-bottom: 1px solid #d7d7d7;
  font-size: 0.78rem;
  color: #495057;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.windows-list-view tbody tr {
  cursor: default;
}

.select-col {
  width: 34px;
  text-align: center;
}

.windows-list-view .form-check-input {
  accent-color: #0f6ca6;
}

.windows-list-view .form-check-input:checked {
  background-color: #0f6ca6;
  border-color: #0f6ca6;
}

.windows-list-view .form-check-input:focus {
  border-color: #0f6ca6;
  box-shadow: 0 0 0 0.16rem rgba(15, 108, 166, 0.22);
}

.windows-list-view tbody td {
  padding-top: 0.34rem;
  padding-bottom: 0.34rem;
  border-top: 0;
  border-bottom: 1px solid #f2f2f2;
  font-size: 0.92rem;
  user-select: none;
  caret-color: transparent;
}

.windows-list-view tbody tr:hover {
  background-color: #eef6ff;
}

.windows-list-view tbody tr.selected {
  background-color: #d9ebff !important;
}

.windows-list-view tbody tr:hover > td {
  background-color: #eef6ff;
}

.windows-list-view tbody tr.selected > td {
  background-color: #d9ebff !important;
}

.folder-icon {
  color: #d1a313;
}

.file-icon {
  color: #1e6fb8;
}

.explorer-context-menu {
  position: absolute;
  z-index: 1300;
  min-width: 200px;
  background: #fff;
  border: 1px solid #cfcfcf;
  border-radius: 0.25rem;
  box-shadow: 0 10px 24px rgba(15, 15, 15, 0.18);
  padding: 0.2rem 0;
}

.explorer-context-menu .dropdown-item {
  font-size: 0.88rem;
  padding: 0.32rem 0.7rem;
}

.explorer-context-menu .dropdown-item:hover {
  background-color: #e5f1ff;
}

.diagram-card {
  border-top: 4px solid #0f6ca6;
}

.diagram-wrap {
  background: linear-gradient(180deg, #f7fbff 0%, #edf6fb 100%);
  border: 1px solid #d9e8f4;
  border-radius: 0.85rem;
  padding: 0.75rem;
}

.diagram-node {
  stroke-width: 2;
}

.node-user {
  fill: #eef7ff;
  stroke: #4d9be6;
}

.node-auth {
  fill: #f3f8ff;
  stroke: #5d88d6;
}

.node-app {
  fill: #f0fcff;
  stroke: #29a2c2;
}

.node-cloud {
  fill: #ecfbf6;
  stroke: #35ad88;
}

.node-observe {
  fill: #fff6ec;
  stroke: #e09b4b;
}

.diagram-title {
  font-size: 16px;
  font-weight: 700;
  fill: #123047;
}

.diagram-text {
  font-size: 13px;
  fill: #355269;
}

.diagram-line {
  stroke: #0f6ca6;
  stroke-width: 2.5;
}

.diagram-line-soft {
  stroke: #4b87b3;
  stroke-width: 2;
  stroke-dasharray: 6 5;
}

.diagram-arrow {
  fill: #0f6ca6;
}

.diagram-label {
  font-size: 12px;
  font-weight: 600;
  fill: #2f5878;
}

@media (max-width: 1200px) {
  .diagram-wrap {
    overflow-x: auto;
  }

  .diagram-wrap svg {
    min-width: 1000px;
  }
}

.site-footer {
  background: #0d2e4a;
  color: rgba(255, 255, 255, 0.88);
}

.site-footer a {
  color: #8be8f0;
  text-decoration: none;
}

.site-footer a:hover {
  color: #b7f4f8;
  text-decoration: underline;
}

.btn-primary {
  background-color: #0f6ca6;
  border-color: #0f6ca6;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #0d5c8c;
  border-color: #0d5c8c;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.12rem white, 0 0 0 0.25rem rgba(15, 108, 166, 0.35);
}

@media (max-width: 991.98px) {
  .main-nav .navbar-collapse {
    margin-top: 0.75rem;
  }

  .backup-nav-dropdown {
    min-width: min(92vw, 320px);
  }

  .notes-nav-dropdown {
    min-width: min(96vw, 560px);
  }
}
