:root {
  --irm-navy:      #061626;
  --irm-navy-light:#0a2240;
  --irm-blue:      #1b75bc;
  --irm-blue-dark: #14477d;
  --irm-blue-light:#e8f3fb;
  --irm-magenta:   #a2115e;
  --irm-magenta-d: #7d0d49;
  --irm-silver:    #e8ecf0;
  --irm-border:    #dde3ea;
  --irm-text:      #1a2a3a;
  --irm-muted:     #64748b;
  --ftp-toolbar-h: 54px;
  --ftp-navbar-h:  62px;
}

*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; margin: 0; color: var(--irm-text); }

/* ── SCROLLBAR ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1cdd9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0adb8; }

/* ══════════════════════════════════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════════════════════════════════ */
.ftp-navbar {
  background: var(--irm-navy) !important;
  height: var(--ftp-navbar-h);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 1px solid rgba(27,117,188,.25);
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.ftp-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.ftp-brand img {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.3));
}
.ftp-brand-divider {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.2);
}
.ftp-brand-host {
  font-size: .72rem;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  display: flex;
  align-items: center;
  gap: .35rem;
  letter-spacing: .2px;
}
.ftp-brand-host .bi-circle-fill { color: #22c55e; font-size: .4rem; }

/* Navbar lang buttons */
.ftp-navbar .btn-light {
  background: var(--irm-blue);
  border-color: var(--irm-blue);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: .25rem .6rem;
  border-radius: 4px;
  letter-spacing: .3px;
}
.ftp-navbar .btn-outline-light {
  border-color: rgba(255,255,255,.25);
  color: rgba(255,255,255,.6);
  font-size: .72rem;
  padding: .25rem .6rem;
  border-radius: 4px;
}
.ftp-navbar .btn-outline-light:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(255,255,255,.4);
}

/* ══════════════════════════════════════════════════════════════════════════
   CONNECT PAGE
══════════════════════════════════════════════════════════════════════════ */
.ftp-body-connect {
  background: var(--irm-navy);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Subtle geometric background */
.ftp-body-connect::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(27,117,188,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(162,17,94,.12) 0%, transparent 55%),
    linear-gradient(160deg, #061626 0%, #0c2440 45%, #0a1e36 100%);
  z-index: 0;
}

/* Grid overlay */
.ftp-body-connect::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(27,117,188,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27,117,188,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
}

.connect-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--ftp-navbar-h));
  padding: 2rem 1rem;
}

/* Company tagline above card */
.connect-tagline {
  text-align: center;
  margin-bottom: 1.75rem;
}
.connect-tagline-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-bottom: .3rem;
}
.connect-tagline-sub {
  font-size: .75rem;
  color: rgba(255,255,255,.2);
  letter-spacing: 1px;
}

/* Card */
.connect-card {
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.06),
    0 32px 80px rgba(0,0,0,.55),
    0 8px 24px rgba(0,0,0,.3);
  position: relative;
  overflow: hidden;
}

/* Top accent bar */
.connect-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--irm-blue) 0%, var(--irm-magenta) 100%);
}

/* Logo section */
.connect-logo {
  text-align: center;
  margin-bottom: 1.75rem;
  padding-top: .5rem;
}
.connect-logo img {
  height: 100px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(27,117,188,.2));
}
.connect-logo-divider {
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--irm-blue), var(--irm-magenta));
  margin: 1rem auto 0;
  border-radius: 1px;
}

/* Heading */
.connect-title {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: .3rem;
  color: var(--irm-navy);
  letter-spacing: -.2px;
}
.connect-subtitle {
  text-align: center;
  color: var(--irm-muted);
  font-size: .82rem;
  margin-bottom: 1.75rem;
}

/* Protocol toggle */
.protocol-toggle {
  display: flex;
  background: var(--irm-silver);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.25rem;
}
.protocol-toggle .btn-check + label {
  flex: 1;
  border-radius: 7px;
  border: none;
  font-size: .8rem;
  font-weight: 600;
  padding: .45rem .5rem;
  color: var(--irm-muted);
  background: transparent;
  transition: all .2s;
  text-align: center;
}
.protocol-toggle .btn-check:checked + label {
  background: #fff;
  color: var(--irm-blue);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.protocol-toggle .btn-check + label:hover {
  color: var(--irm-blue);
}

/* Form fields */
.ftp-field-group {
  margin-bottom: 1rem;
}
.ftp-field-group label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--irm-text);
  margin-bottom: .35rem;
  letter-spacing: .15px;
}
.ftp-field-group label i {
  color: var(--irm-blue);
  margin-right: .3rem;
}
.ftp-input {
  border-radius: 8px;
  border: 1.5px solid var(--irm-border);
  font-size: .875rem;
  color: var(--irm-text);
  background: #fafbfc;
  transition: border-color .15s, box-shadow .15s;
  height: 40px;
}
.ftp-input:focus {
  border-color: var(--irm-blue);
  box-shadow: 0 0 0 3px rgba(27,117,188,.12);
  background: #fff;
  outline: none;
}
.ftp-input::placeholder { color: #b0bec5; }
.input-group .ftp-input { border-right: none; }
.input-group .btn-outline-secondary {
  border: 1.5px solid var(--irm-border);
  border-left: none;
  color: var(--irm-muted);
  background: #fafbfc;
  border-radius: 0 8px 8px 0;
  height: 40px;
}
.input-group .btn-outline-secondary:hover {
  background: var(--irm-silver);
  color: var(--irm-text);
}

/* Connect button */
.ftp-btn-primary {
  background: linear-gradient(135deg, var(--irm-blue) 0%, var(--irm-blue-dark) 100%);
  border: none;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: .9rem;
  padding: .7rem 1.5rem;
  letter-spacing: .3px;
  transition: all .2s;
  box-shadow: 0 4px 12px rgba(27,117,188,.35);
}
.ftp-btn-primary:hover {
  background: linear-gradient(135deg, #2080d0 0%, var(--irm-blue) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(27,117,188,.45);
  transform: translateY(-1px);
}
.ftp-btn-primary:active { transform: translateY(0); }

/* Footer note */
.connect-footer-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: .72rem;
  color: rgba(255,255,255,.2);
  letter-spacing: .3px;
}
.connect-footer-note a {
  color: rgba(255,255,255,.35);
  text-decoration: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   MANAGER PAGE
══════════════════════════════════════════════════════════════════════════ */
.ftp-body-manager {
  background: #f0f4f8;
  min-height: 100vh;
}

/* ── TOOLBAR ─────────────────────────────────────────────────────────────── */
.ftp-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--irm-border);
  height: var(--ftp-toolbar-h);
  display: flex;
  align-items: center;
  position: sticky;
  top: var(--ftp-navbar-h);
  z-index: 1020;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.ftp-toolbar .container-fluid { padding: 0 1.25rem; }
.ftp-breadcrumb { font-size: .85rem; }
.ftp-breadcrumb .breadcrumb-item a {
  color: var(--irm-blue);
  text-decoration: none;
  font-weight: 500;
}
.ftp-breadcrumb .breadcrumb-item a:hover { text-decoration: underline; }
.ftp-breadcrumb .breadcrumb-item.active { color: #64748b; }

.ftp-btn-action {
  background: var(--irm-blue);
  border-color: var(--irm-blue);
  color: #fff;
  border-radius: 7px;
  font-size: .8rem;
  font-weight: 600;
  padding: .35rem .85rem;
  letter-spacing: .1px;
  transition: all .15s;
}
.ftp-btn-action:hover {
  background: var(--irm-blue-dark);
  border-color: var(--irm-blue-dark);
  color: #fff;
}

/* ── MAIN ────────────────────────────────────────────────────────────────── */
.ftp-main {
  padding: 1.25rem;
  min-height: calc(100vh - var(--ftp-navbar-h) - var(--ftp-toolbar-h));
}

/* ── FILE TABLE ──────────────────────────────────────────────────────────── */
.ftp-table-wrap {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 8px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.04);
  overflow: hidden;
}
.ftp-table { font-size: .875rem; margin: 0; }
.ftp-table thead th {
  background: var(--irm-navy);
  color: rgba(255,255,255,.7);
  border-bottom: none;
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: .8rem 1.1rem;
}
.ftp-table thead th:first-child { padding-left: 1.25rem; }
.ftp-table tbody tr {
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid #f2f5f7;
}
.ftp-table tbody tr:last-child { border-bottom: none; }
.ftp-table tbody tr:hover { background: var(--irm-blue-light); }
.ftp-table tbody tr.selected { background: #dbeafe; }
.ftp-table td { padding: .65rem 1.1rem; vertical-align: middle; }
.ftp-table td:first-child { padding-left: 1.25rem; }

.ftp-name-cell { display: flex; align-items: center; gap: .65rem; }
.ftp-icon-dir  { color: #f59e0b; font-size: 1.1rem; }
.ftp-icon-file { color: #94a3b8; font-size: 1rem; }
.ftp-name-link {
  color: var(--irm-text);
  text-decoration: none;
  font-weight: 500;
}
.ftp-name-link:hover { color: var(--irm-blue); }

/* ── CONTEXT MENU / DROPDOWN ─────────────────────────────────────────────── */
.ftp-menu-btn {
  padding: .2rem .45rem;
  line-height: 1;
  color: #94a3b8;
  border-color: transparent;
  background: transparent;
  border-radius: 5px;
}
.ftp-menu-btn:hover { background: #f0f4f8; color: var(--irm-text); border-color: var(--irm-border); }
.dropdown-menu {
  font-size: .83rem;
  min-width: 175px;
  z-index: 2000;
  border: 1px solid var(--irm-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: .35rem;
}
.dropdown-item {
  padding: .45rem .8rem;
  border-radius: 6px;
  font-weight: 500;
}
.dropdown-item:hover { background: var(--irm-blue-light); color: var(--irm-blue); }
.dropdown-item.text-danger:hover { background: #fff0f0; color: #dc3545; }
.font-monospace { font-family: 'Consolas', monospace; font-size: .85rem; }

/* ── SELECTION BAR ───────────────────────────────────────────────────────── */
.ftp-selection-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--irm-navy);
  color: #fff;
  border-radius: 50px;
  padding: .65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
  font-size: .85rem;
  z-index: 1010;
  min-width: 300px;
  border: 1px solid rgba(27,117,188,.3);
}

/* ── DROP ZONE ───────────────────────────────────────────────────────────── */
.ftp-drop-zone {
  position: fixed;
  inset: 0;
  background: rgba(27,117,188,.08);
  border: 3px dashed var(--irm-blue);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--irm-blue);
  font-size: 1.25rem;
  font-weight: 600;
  pointer-events: none;
}
.ftp-drop-zone.d-none { display: none !important; }

/* ── UPLOAD AREA ─────────────────────────────────────────────────────────── */
.ftp-upload-area {
  border: 2px dashed var(--irm-border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fafbfc;
}
.ftp-upload-area:hover,
.ftp-upload-area.drag-over {
  border-color: var(--irm-blue);
  background: var(--irm-blue-light);
}
.ftp-upload-file-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .6rem;
  background: #f8f9fa;
  border-radius: 6px;
  margin-top: .4rem;
  font-size: .8rem;
  border: 1px solid var(--irm-border);
}
.ftp-upload-file-item .remove-file {
  cursor: pointer;
  color: #dc3545;
  border: none;
  background: none;
  padding: 0;
  margin-left: auto;
}

/* ── MODALS ──────────────────────────────────────────────────────────────── */
.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 16px 48px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.06);
}
.modal-header {
  border-bottom: 1px solid #f0f2f5;
  padding: 1.1rem 1.4rem;
}
.modal-footer {
  border-top: 1px solid #f0f2f5;
  padding: .8rem 1.4rem;
}
.modal .btn-primary {
  background: var(--irm-blue);
  border-color: var(--irm-blue);
  border-radius: 7px;
  font-weight: 600;
}
.modal .btn-primary:hover {
  background: var(--irm-blue-dark);
  border-color: var(--irm-blue-dark);
}
.modal .form-control:focus {
  border-color: var(--irm-blue);
  box-shadow: 0 0 0 3px rgba(27,117,188,.12);
}

/* ── TOAST ───────────────────────────────────────────────────────────────── */
.toast {
  min-width: 280px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.toast.bg-success { color: #fff; }
.toast.bg-danger  { color: #fff; }
