/* =========================
   GLOBAL LAYOUT
   ========================= */

body {
  margin: 0;
  font-family: Arial, sans-serif;
}

/* =========================
   LEFT SIDEBAR
   ========================= */

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;

  width: 240px;
  background: #1f2937;
  color: #ffffff;

  padding: 0;               /* ✅ Remove padding from container */
  box-sizing: border-box;

  z-index: 1000;

  display: flex;
  flex-direction: column;
  height: 100vh;
}


/* ✅ Scroll ONLY the top section */
.sidebar-top {
  flex: 1;
  overflow-y: auto;
  padding: 16px;           /* ✅ move padding here */
}


/* ✅ Fixed footer */
.sidebar-bottom {
  padding: 10px 12px;
  border-top: 1px solid #334155;
  text-align: center;
  background: #1f2937;     /* ✅ keeps consistent color */
}


/* ✅ SMALL COMPACT BUTTON */
.change-password-btn {
  display: inline-block;
  background: #3b82f6;

  color: white;
  font-size: 11px;         /* ✅ smaller text */
  padding: 4px 8px;        /* ✅ smaller padding */

  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
}

.change-password-btn:hover {
  background: #2563eb;
}

#main-content {
  margin-left: 240px;
  padding: 16px;

  width: calc(100% - 240px);
  box-sizing: border-box;

  position: relative;
  z-index: 1;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid #ccc;
}

.sidebar-title {
  font-size: 18px;
  font-weight: bold;
  font-size: 16px;
}


.sidebar-user {
  font-size: 13px;
  color: #dbeafe;
  margin-top: 4px;
}

.logout-btn {
  font-size: 13px;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #374151;
}

.logout-btn:hover {
  background: #e5e7eb;
  text-decoration: none;
  color: #111827;
}

/* =========================
   NAV SECTIONS
   ========================= */

.nav-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 16px;
}

.nav-section {
  margin-bottom: 18px;
  position: relative;
  flex-shrink: 0;
}

.nav-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  opacity: 0.9;
  cursor: pointer;

  margin-bottom: 6px;
}

.nav-icon {
  font-size: 18px;         /* ✅ bigger icon */
  display: inline-block;
}

.nav-text {
  font-size: 13px;
}

.nav-header::after {
  content: "▸";
  margin-left: auto;   /* ✅ pushes arrow to right */
  font-size: 12px;
}

.nav-section.open .nav-header::after {
  transform: rotate(90deg);
}

.nav-sub {
  position: static;   /* ✅ important */
  display: none;
  padding-left: 20px;

}

.nav-sub a {
  display: block;
  text-decoration: none;
  color: #ffffff;

  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
}

.nav-sub a:hover {
  background: #57606f;
}

.nav-section.open .nav-sub {
    display: block;
}

/* Default: no pointer */
.process-cell {
  cursor: default;
}

/* Upload-eligible cells */
.process-cell.upload-allowed {
  cursor: pointer;
}

.upload-error-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.upload-error-box {
  background: #fff;
  padding: 20px 26px;
  border-radius: 6px;
  max-width: 420px;
  text-align: center;
}

.upload-error-box button {
  margin-top: 14px;
  padding: 6px 14px;
}

.upload-success-modal {
  position: fixed;
  top: 0;
  left: 240px;                     /* ✅ sidebar width */
  width: calc(100vw - 240px);      /* ✅ remaining viewport */
  height: 100vh;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.upload-success-box {
  background: #fff;
  padding: 20px 26px;
  border-radius: 6px;
  text-align: center;
}

.delete-icon {
  cursor: pointer;
  color: #b00020;
  font-size: 16px;
}

.delete-icon:hover {
  color: #ff0000;
}

.obsolete-icon {
  cursor: pointer;
  color: #d48806;
  font-size: 16px;
}

.obsolete-icon:hover {
  color: #fa8c16;
}

.qa-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.qa-fields {
  display: flex;
  gap: 16px;
}

.qa-fields .field {
  display: flex;
  flex-direction: column;
}

.qa-fields label {
  font-weight: 600;
  margin-bottom: 4px;
}

.qa-fields input {
  padding: 6px 10px;
  font-size: 14px;
  min-width: 200px;
}

/* --- Button styles --- */
.btn {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background-color: #2563eb;
  color: white;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-secondary {
  background-color: #059669;
  color: white;
}

.btn-secondary:hover {
  background-color: #047857;
}

.replace-banner {
  background-color: #ecfeff;
  border-left: 4px solid #0284c7;
  color: #075985;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 6px;
  font-weight: 600;
}

.qa-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.qa-fields {
  display: flex;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 600;
  margin-bottom: 4px;
}

input, textarea {
  padding: 6px 10px;
  font-size: 14px;
}

/* Buttons */
.btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background-color: #2563eb;
  color: white;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-warning {
  background-color: #d97706;
  color: white;
}

.btn-warning:hover {
  background-color: #b45309;
}

.btn-outline {
  background: white;
  color: #374151;
  border: 1px solid #cbd5f5;
}

.btn-outline:hover {
  background-color: #f8fafc;
}

/* --- Change Request intent radios (match Document Library) --- */
.cr-intent-options {
  display: flex;
  align-items: center;
  gap: 18px;            /* spacing between radio options */
  margin-top: 8px;
  font-size: 13px;
  white-space: nowrap; /* prevents wrapping */
}

.cr-intent-options label {
  display: flex;
  align-items: center;
  gap: 4px;             /* radio-to-text spacing */
  font-weight: normal;
  cursor: pointer;
}

.cr-intent-options input[type="radio"] {
  margin: 0;
  padding: 0;
}

/* =========================
   Combobox – native select look
   ========================= */

.combo-box {
  position: relative;
  width: 50%;
  max-width: 420px;
}

/* Outer control */
.combo-control {
  display: flex;
  height: 28px;                 /* ✅ you control height here */
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
}

/* Text input */
.combo-control input {
  flex: 1;
  height: 100%;
  padding: 0 8px;
  line-height: 28px;            /* MUST match height */
  border: none;
  outline: none;
  font-size: 14px;
}

/* Arrow */
.combo-arrow {
  width: 32px;
  align-self: stretch;

  border-left: 1px solid #999;
  background: #d0d0d0;          /* ✅ darker gray */
  color: #333;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 16px;
  font-weight: bold;

  cursor: pointer;
  pointer-events: auto !important;   /* ✅ override globals */

  margin: 0 !important;
  padding: 0 !important;

  opacity: 1 !important;             /* ✅ override disabled look */
}

.combo-arrow:hover {
  background: #bdbdbd;
}

.combo-control button {
  pointer-events: auto !important;
}

/* Dropdown list */
.combo-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;

  max-height: 220px;
  overflow-y: auto;

  border: 1px solid #999;
  border-top: none;
  background: white;
  z-index: 1000;
  display: none;
}

/* Dropdown options */
.combo-option {
  padding: 6px 8px;
  cursor: pointer;
}

.combo-option:hover {
  background-color: #eef3ff;
}

.combo-name {
  font-size: 14px;
}

.combo-email {
  font-size: 12px;
  color: #666;
}

.action-icon,
button,
.editable {
  cursor: pointer;
}

.action-icon {
  display: inline-block;   /* ✅ REQUIRED */
  float: none;             /* ✅ SAFETY */
  line-height: 1;          /* ✅ prevents vertical drift */  
  cursor: pointer;
  transition: transform 0.1s ease;

}

.action-icon:hover {
  opacity: 0.75;
  transform: scale(1.2);
}

.actions-normal,
.actions-edit {
    display: flex;
    justify-content: center;   /* center in the column */
    align-items: center;
    gap: 10px;                 /* ✅ controls spacing between icons */
}

.process-owner-select {
  width: 100%;
  cursor: pointer;
}

.form-field {
    width: 500px;
    padding: 6px;
  }

  .form-select {
    width: 515px;
    padding: 6px;
  }

.toggle {
  cursor: pointer;
  font-weight: bold;
  margin-right: 6px;
}

.qa-user-select {
  font-size: 1rem;          /* larger text */
  padding: 8px 10px;        /* increases height */
  min-height: 40px;         /* ensures consistent height */
}

td.editable input {
    width: 100%;
    box-sizing: border-box;
}

.library-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.process-cell {
  background: #f8fafc;
}

/* Upload success modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-box {
  background: white;
  padding: 20px 28px;
  border-radius: 6px;
  min-width: 320px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.modal-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 12px;
}

.modal-body {
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: center;
}

.replace-icon {
  cursor: pointer;
}

.replace-icon.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.replace-icon.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.filter-btn.active {
  color: #2e7d32;
  font-weight: bold;
}

td.center {
  text-align: center;
  vertical-align: middle;
}

/* === Form Controls === */

select[readonly] {
  pointer-events: none;
  opacity: 0.6;
}

.action-button {
    display: inline-block;
    padding: 6px 10px;
    background: #2b6cb0;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.cancel-button {
    display: inline-block;
    padding: 1px 3px;           /* slightly bigger clicks */
    background: #e0e0e0;        /* clean neutral gray */
    color: #000000;             /* black text ✅ */
    text-decoration: none;
    border-radius: 3px;
    border: 1px solid #000;  /* subtle edge definition */
    cursor: pointer;
    font-size: 0.75rem;         /* smaller than action-button ✅ */
}

/* 📂 File: document_library.html (Inside your <style> section) */

/* 🚀 Cleans up single-select input behavior */
.ts-wrapper.single.has-items.dropdown-active .ts-control > input {
  opacity: 1 !important;
  position: relative !important;
  left: 0 !important;
  background: #fff !important;
  width: 100% !important;
}

/* Hides the old text value ONLY while the user is actively typing a search */
.ts-wrapper.single.has-items.dropdown-active .ts-control > .item {
  display: none !important;
}

/* Center-aligns the dropdown items neatly matching your clean aesthetic */
.ts-dropdown .option {
  text-align: center;
  padding: 6px 12px;
}

/* Ensures the searchable control input box matches the form field constraints exactly */
#revisionModal .ts-wrapper,
#revisionModal .ts-control {
  width: 100% !important;
  max-width: 100% !important;
  height: 34px !important;
  box-sizing: border-box;
}

/* Centers text formatting inside the active input container when focused */
#revisionModal .ts-control input {
  text-align: center;
}

/* ======================================================================
   💎 GLOBAL STYLING FACTORY: Premium Universal TomSelect Enhancements
   ====================================================================== */
.ts-wrapper .ts-control {
  padding-right: 32px !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px !important;
  background-color: #ffffff !important;
  border-radius: 4px !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  font-size: 14px !important;
  min-height: 36px !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

/* Force dark text and crisp formatting rules inside input writing boxes */
.ts-wrapper .ts-control input {
  color: #1e293b !important;
  font-size: 14px !important;
}
.ts-wrapper .ts-control input::placeholder {
  color: #94a3b8 !important;
}

/* Target and active selection popups container style rules */
.ts-wrapper.focus .ts-control {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='18 15 12 9 6 15'%3e%3c/polyline%3e%3c/svg%3e") !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 1px #2563eb !important;
}

/* Standardize dropdown panels styling spacing dimensions */
.ts-dropdown {
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
  z-index: 10000 !important;
}
.ts-dropdown .active {
  background-color: #f0fdf4 !important; /* Premium soft mint green highlight on hover choice */
  color: #166534 !important;
}