:root{
  --bg:#e5e7eb; --surface:#fff; --text:#111827; --border:#d1d5db; --muted:#6b7280;
}
html[data-theme="dark"]{
  --bg:#0b0f14; --surface:#121823; --text:#e5e7eb; --border:#253041; --muted:#9ca3af;
}
body{ background-color:var(--bg); color:var(--text); }

/* ========================================
   Background Images (Light/Dark)
   ======================================== */
body {
  background-image: url('/assets/images/light_bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

html[data-theme="dark"] body {
  background-color: var(--bg);
  background-image: url('/assets/images/dark_bg.jpg');
}

.surface{ background:var(--surface); border:1px solid var(--border); border-radius:14px; }
.muted{ color:var(--muted); }

/* Theme toggle button with icons */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
}

.theme-divider {
  opacity: 0.5;
  font-size: 0.875rem;
  margin: 0 0.125rem;
}

/* Inputs integrados con tema */
.form-control, .input-group-text, .btn-outline-secondary{
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.form-control::placeholder{ color: var(--muted); }

.btn-outline-secondary:hover{
  border-color: var(--border);
}

/* Navbar toggler icon visible en dark */
html[data-theme="dark"] .navbar-toggler{
  border-color: var(--border);
}
html[data-theme="dark"] .navbar-toggler-icon{
  filter: invert(1);
}

/* Navbar links - always white */
.navbar-nav .nav-link {
  color: #ffb088 !important;
}

.navbar-nav .nav-link:hover {
  color: #ffffff !important;
}

.navbar-nav .nav-link.active {
  color: #ffffff !important;
  font-weight: 600;
}

.navbar-brand {
  color: #ffffff !important;
}

/* Extra large modal for Work Orders */
.modal-xlish .modal-dialog {
  max-width: 85vw;
  width: 85vw;
}

@media (max-width: 992px) {
  .modal-xlish .modal-dialog {
    max-width: 95vw;
    width: 95vw;
  }
}

.modal-xlish .modal-content {
  max-height: 90vh;
}

.modal-xlish .modal-body {
  overflow-y: auto;
}

/* ========================================
   Work Order Modal - Edit Controls
   ======================================== */
/* Order number input (inline, subtle) */
.wo-order-number-wrapper {
  display: inline-block;
}

.wo-order-number-wrapper.d-none {
  display: none !important;
}

.wo-order-number-input {
  border: 1px dashed var(--border);
  background: transparent;
  color: #ff5300;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  width: 90px;
  text-align: center;
  transition: all 0.2s;
}

.wo-order-number-input:hover,
.wo-order-number-input:focus {
  border-style: solid;
  border-color: #ff5300;
  color: #ff5300;
  outline: none;
  background: var(--surface);
}

.wo-order-number-input::placeholder {
  color: #ff5300;
  opacity: 0.4;
  font-size: 0.875rem;
}

/* Order number readonly for non-admin users */
.wo-order-number-input.wo-readonly {
  pointer-events: none;
  cursor: default;
  border-color: transparent;
}

.wo-order-number-input.wo-readonly:hover,
.wo-order-number-input.wo-readonly:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

/* Title input (editable) */
.wo-title-input {
  border: 1px dashed transparent;
  background: transparent;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.wo-title-input:hover {
  border-style: solid;
  border-color: #ff5300;
  outline: none;
  background: var(--surface);
}

.wo-title-input:focus {
  border-style: solid;
  border-color: var(--text);
  outline: none;
  background: var(--surface);
}

.wo-title-input::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

html[data-theme="dark"] .wo-title-input:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Metadata line styling */
.wo-metadata-line {
  color: var(--muted);
  font-size: 0.875rem;
}

.wo-metadata-line .muted {
  color: var(--muted) !important;
}

/* Status select in header */
.wo-status-select {
  min-width: 130px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.wo-status-select.d-none {
  display: none !important;
}

/* Status label - ensure visibility in both themes */
.wo-status-label {
  color: #6b7280;
}

html[data-theme="dark"] .wo-status-label {
  color: #d1d5db !important;
}

/* btn-close visibility in dark mode */
html[data-theme="dark"] .modal-header .btn-close {
  filter: invert(1) brightness(2);
  opacity: 0.8;
}

html[data-theme="dark"] .modal-header .btn-close:hover {
  opacity: 1;
}

/* ========================================
   New Work Order modal - Compact
   ======================================== */
.modal-new .modal-dialog {
  max-width: 600px;
  width: 90%;
}

@media (max-width: 768px) {
  .modal-new .modal-dialog {
    width: 95%;
  }
}

/* Remove border around modal */
.modal-new .modal-content {
  border: none !important;
}

/* New WO Modal - Orange header */
.modal-new .modal-header {
  background: #ff5300;
  color: white;
  border-bottom: none;
  padding: 1rem 1.25rem;
  border-radius: 14px 14px 0 0;
}

.modal-new .modal-title {
  color: white;
  font-weight: 600;
}

.modal-new .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.modal-new .btn-close:hover {
  opacity: 1;
}

/* Company select in header */
.modal-new-company-label {
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  margin-right: 0.5rem;
  white-space: nowrap;
}

.modal-new-company-select {
  background: white url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.75rem center/12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #111827;
  font-size: 0.875rem;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  min-width: 140px;
  max-width: 180px;
  appearance: none;
  cursor: pointer;
}

.modal-new-company-select:focus {
  background-color: white;
  border-color: white;
  color: #111827;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
  outline: 0;
}

.modal-new-company-select option {
  background: white;
  color: #111827;
}

/* Dark mode - Company select with visible arrow */
html[data-theme="dark"] .modal-new-company-select {
  background: #1f2937 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d1d5db' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.75rem center/12px 10px;
  color: #e5e7eb;
  border-color: #374151;
}

html[data-theme="dark"] .modal-new-company-select:focus {
  background-color: #1f2937;
  border-color: #4b5563;
  color: #e5e7eb;
}

html[data-theme="dark"] .modal-new-company-select option {
  background: #1f2937;
  color: #e5e7eb;
}

.modal-backdrop {
  --bs-backdrop-opacity: 0.35;
}

/* ---- Layout polish ---- */
:root{
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,.06);
  --shadow-dark: 0 10px 30px rgba(0,0,0,.35);
}

/* Consistencia de cards/surfaces */
.surface{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Inputs y selects coherentes */
.form-control, .form-select, .input-group-text{
  border-radius: var(--radius-sm);
}

.table{
  margin-bottom: 0;
}
.table thead th{
  border-bottom: 1px solid var(--border);
}
.table tbody tr:hover{
  background: rgba(127,127,127,.06);
}

/* Botones más “neat” */
.btn{
  border-radius: var(--radius-sm);
}
.btn-primary{
  border-color: var(--border);
}

/* Texto muted consistente */
.muted{ color: var(--muted); }

/* Work-order style modal sizing */
.modal-xlish .modal-dialog{
  max-width: 85vw;
  width: 85vw;
}
@media (max-width: 992px){
  .modal-xlish .modal-dialog{ max-width: 95vw; width: 95vw; }
}
.modal-xlish .modal-content{
  max-height: 90vh;
  border-radius: 18px;
}
.modal-xlish .modal-header,
.modal-xlish .modal-footer{
  border-color: var(--border);
}

/* Fondo del modal un poco más suave */
.modal-content.surface{
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .modal-content.surface{
  box-shadow: var(--shadow-dark);
}

/* ---- STATUS BADGES (solid + equal width) ---- */
.status-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 95px;
  width: 95px;
  height: 25px;
  padding: 0 10px;

  border-radius: 5px;
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .02em;
  text-align: center;
  white-space: nowrap;

  color: #fff;
  border: none;
}

/* Muted solid palette */
.status-new{
  background-color: #ec4899; /* Rosa chicle / Magenta vibrante */
}

/* PROCESSING - Púrpura/Violeta */
.status-processing{
  background-color: #8b5cf6; /* Púrpura */
}

/* PENDING - Naranja (MOKSHA debe actuar) */
.status-pending-moksha{
  background-color: #ff5300; /* Naranja Moksha */
}

/* PENDING - Azul (Cliente debe actuar) */
.status-pending-client{
  background-color: #3b82f6; /* Azul */
}

/* PENDING - Default (sin pending_on específico) */
.status-pending{
  background-color: #6b7280; /* Gris */
}

.status-hold{
  background-color: #eab308; /* Amarillo */
}

.status-done{
  background-color: #22c55e; /* Verde */
}

.status-closed{
  background-color: #1f2937; /* Gris oscuro */
}

.status-canc{
  background-color: #ef4444; /* Rojo */
}

/* Make rows feel clickable and clean */
.wo-row td{
  padding-top: 10px;
  padding-bottom: 10px;
}
.wo-row:hover{
  cursor: pointer;
}

/* Compact header */
.table thead th{
  padding-top: 15px;
  padding-bottom: 15px;
}

/* Moksha Orange */
.bg-orange{
  background-color: #ff5300 !important;
}

/* ---- Navbar: fixed theme (not affected by dark mode) ---- */
.navbar-surface{
  --surface: #ffffff;
  --text: #111111;
  --muted: #6c757d;
  --border: #e5e7eb;
  --chip-bg: #f3f4f6;
  --chip-text: #374151;

  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid #ff5300 !important;
}

/* Table base: make it follow your theme vars (fixes white table in dark mode) */
.table-moksha{
  background: var(--surface);
  color: var(--text);
}

.table-moksha td, .table-moksha th{
  border-color: var(--border);
}

/* Grey header (light) */
.table-moksha thead.table-head th{
  background: #d2d1d1 !important;
  color: #ffffff;
  font-weight: 600;
}

/* Row hover */
.table-moksha tbody tr:hover{
  background: rgba(255, 255, 255, 0);
}

/* Centered columns stay visually centered */
.table-moksha .text-center{
  text-align: center !important;
}

/* Fix: Bootstrap table background staying white in dark mode */
.table-moksha{
  --bs-table-bg: var(--surface);
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);

  background-color: var(--surface) !important;
  color: var(--text) !important;
}

/* Force cells to follow the table background */
.table-moksha > :not(caption) > * > *{
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* Table text - 80% opacity (grayish) */
.table-moksha tbody td {
  opacity: 0.8;
}

/* First column - Orange and bold */
.table-moksha tbody td:first-child {
  color: #ff5300 !important;
  font-weight: 600 !important;
  opacity: 1 !important;
  font-size: 0.875rem !important;
}




/* Grey header (dark) */
html[data-theme="dark"] .table-moksha thead.table-head th{
  background: #36414f !important;
  color: #cbd5e1;
}

.wo-filters-line{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.wo-ig{
  width: 260px;
}

.wo-ig-search{
  width: 420px;
}

.wo-actions{
  margin-left: auto;
}

/* dark mode: input-group text */
html[data-theme="dark"] .wo-ig .input-group-text{
  background: #1f2328;
  color: var(--text);
  border-color: var(--border);
}

/* mobile stacking */
@media (max-width: 768px){
  .wo-ig,
  .wo-ig-search{
    width: 100%;
  }
  .wo-actions{
    margin-left: 0;
    width: 100%;
  }
  .wo-actions .btn{
    width: 100%;
  }
}

/* ---- Work Order modal: 2-column layout ---- */
.wo-modal-body{
  padding: 16px;
}

.wo-modal-grid{
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 16px;
  align-items: start;
}

/* Left column */
.wo-modal-left{
  min-height: 100%;
}

/* Right column (comments) */
.wo-modal-right{
  display: flex;
  flex-direction: column;
  height: 100%;
}

.wo-comments-box{
  flex: 1;
  overflow-y: auto;
  max-height: calc(90vh - 220px);
}

/* Mobile: stack */
@media (max-width: 992px){
  .wo-modal-grid{
    grid-template-columns: 1fr;
  }
  .wo-comments-box{
    max-height: none;
  }
}

/* Right side: comments panel takes full height and scrolls inside */
.wo-comments-panel{
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;          /* CRÍTICO para que el overflow funcione en flex */
}

.wo-comments-scroll{
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;          /* CRÍTICO */
  padding-right: 6px;
}

/* Dropzone */
.wo-dropzone{
  border: 1px dashed rgba(120,120,120,.45);
  border-radius: 12px;
  padding: 18px;
  background: rgba(120,120,120,.06);
}
.wo-dropzone.dragover{
  border-style: solid;
  background: rgba(120,120,120,.10);
}

/* Files list rows (similar vibe to your screenshot) */
.wo-file-row{
  border: 1px solid rgba(120,120,120,.18);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.wo-file-ico{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(120,120,120,.10);
  flex: 0 0 auto;
}
.wo-file-meta{
  flex: 1 1 auto;
  min-width: 0;
}
.wo-file-name{
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wo-file-sub{
  font-size: .75rem;
  color: var(--muted, #6c757d);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.wo-file-actions{
  flex: 0 0 auto;
}

/* Thumbnail for images */
.wo-thumb{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

/* Dark mode table/background compatibility (in case surface uses vars) */
:root[data-theme="dark"] .wo-file-row{
  border-color: rgba(255,255,255,.12);
}
:root[data-theme="dark"] .wo-dropzone{
  border-color: rgba(255,255,255,.20);
  background: rgba(255,255,255,.06);
}
:root[data-theme="dark"] .wo-dropzone.dragover{
  background: rgba(255,255,255,.10);
}

/* Make the modal use a fixed height so internal panels can scroll */
.modal-xlish .modal-dialog{
  max-width: 1200px; /* o lo que ya uses */
}

.modal-xlish .modal-content{
  height: 88vh;            /* modal alto pero no full */
  overflow: hidden;        /* evita scroll del modal */
}

.modal-xlish .modal-body{
  overflow: hidden;        /* clave: el body no scrollea */
}

/* Let the two columns fill the available height */
.wo-modal-body .row{
  height: 100%;
}

.wo-modal-body .col-lg-6{
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Modal layout: header + body + footer */
.modal-xlish .modal-content{
  display: flex;
  flex-direction: column;
  height: 88vh;       /* ajustá si querés */
  overflow: hidden;   /* evita scroll del modal entero */
}

.modal-xlish .modal-body{
  flex: 1 1 auto;
  overflow: hidden;   /* el scroll NO va acá */
  min-height: 0;      /* clave */
}

.modal-xlish .modal-footer{
  flex: 0 0 auto;
}

/* Body internal grid must stretch and allow inner scroll */
.wo-modal-body{
  height: 100%;
  min-height: 0;
}

.wo-modal-body > .row{
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

/* Both columns: flex containers so inner panels can fill height */
.wo-modal-body .col-lg-6{
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.modal-xlish .modal-footer{
  padding-top: 10px;
  padding-bottom: 10px;
}

/* Attachments list scroll inside modal */
#woFilesList{
  overflow: auto;
  padding-right: 6px;
}

/* Scrollbars (Chromium / Safari) */
:root{
  --scrollbar-thumb: rgba(0,0,0,.25);
  --scrollbar-track: rgba(0,0,0,.06);
}
html[data-theme="dark"]{
  --scrollbar-thumb: rgba(255,255,255,.22);
  --scrollbar-track: rgba(255,255,255,.08);
}

*::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track{
  background: var(--scrollbar-track);
}
*::-webkit-scrollbar-thumb{
  background: var(--scrollbar-thumb);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Firefox */
*{
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* =========================================
   Attachments: unified thumbnail/icon box
========================================= */
.wo-file-thumb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;

  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--surface);
}

.wo-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Icon inside the same box */
.wo-file-thumb .wo-file-ico {
  font-size: 22px;           /* <- más grande */
  line-height: 1;
  color: var(--muted);
}

/* Optional: subtle tint per type (muted, not bright) */
.wo-file-thumb[data-kind="pdf"]  { background: rgba(220, 53, 69, .08); }   /* muted red */
.wo-file-thumb[data-kind="xls"]  { background: rgba(25, 135, 84, .08); }   /* muted green */
.wo-file-thumb[data-kind="doc"]  { background: rgba(13, 110, 253, .08); }  /* muted blue */
.wo-file-thumb[data-kind="zip"]  { background: rgba(255, 193, 7, .08); }   /* muted amber */

.wo-file-preview {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.wo-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
}

.wo-file-icon {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wo-file-icon i {
  font-size: 22px;
}

/* =========================================
   Attachment Preview Modal
========================================= */
.att-preview-wrap{
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}

.att-preview-img{
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform .15s ease;
}

.att-preview-img.is-zoomed{
  transform: scale(1.7);
  cursor: zoom-out;
}

.att-preview-iframe{
  width: 100%;
  height: 78vh;
  border: 0;
  background: #111;
}

#attPreviewModal .modal-body{
  padding: 0;
  background: rgba(60, 63, 72, 0.92);
}

#attPreviewBody{
  min-height: 70vh;
  display:flex;
  align-items:center;
  justify-content:center;
}

#attPreviewBody img{
  max-width: 96%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}


#attPreviewModal .btn-close{
  filter: invert(1) grayscale(100%) !important;
  opacity: .6;
}

#attPreviewModal .btn-close:hover{
  opacity: 1;
}

/* Preview modal: remove header separator line */
#attPreviewModal .modal-header{
  border-bottom: none !important;
  background: #ff5300;
  color: white !important;
}

/* ========================================
   Comments Panel
   ======================================== */
.wo-comments-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.wo-comments-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 300px;
  max-height: 500px;
  padding-right: 8px;
}

/* Comments - Conversation style */
.wo-comment-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 16px 0;
  margin-bottom: 0;
  transition: background 0.15s ease;
}

.wo-comment-card:hover {
  background: rgba(0, 0, 0, 0.025);
  border-radius: 10px;
}

html[data-theme="dark"] .wo-comment-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.wo-comment-card:last-child {
  border-bottom: none;
}

/* Comment author colors */
.comment-author-admin {
  color: #ff5300 !important;
}

.comment-author-user {
  color: var(--text);
}

/* Comment timestamp */
.comment-timestamp {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Comment menu button - hidden by default, visible on hover */
.comment-menu-btn {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  text-decoration: none;
  color: var(--muted) !important;
}

/* Show menu button on card hover */
.wo-comment-card:hover .comment-menu-btn {
  opacity: 1;
  visibility: visible;
}

/* Keep visible when menu is open */
.comment-menu-btn.show,
.comment-menu-btn:focus,
.dropdown.show .comment-menu-btn {
  opacity: 1 !important;
  visibility: visible !important;
}

.comment-menu-btn:hover {
  color: var(--text) !important;
}

/* Note: Dropdown styling handled by .dropdown-compact global class */

/* Comment edit mode */
.comment-body-edit .form-control {
  font-size: 0.875rem;
}

.comment-edit-textarea:focus {
  border-color: #ff5300;
  box-shadow: 0 0 0 0.2rem rgba(255, 132, 0, 0.15);
}

/* Scrollbar styling */
.wo-comments-scroll::-webkit-scrollbar {
  width: 6px;
}

.wo-comments-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.wo-comments-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.wo-comments-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ========================================
   Dark mode improvements
   ======================================== */
/* Date input calendar icon white in dark mode */
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* Select dropdowns adapt to dark mode */
html[data-theme="dark"] select.form-select,
html[data-theme="dark"] select.form-control {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] select.form-select option,
html[data-theme="dark"] select.form-control option {
  background-color: var(--surface);
  color: var(--text);
}

/* ========================================
   Global Dropdown Styling (Compact)
   ======================================== */
/* ========================================
   Global Dropdown Styling (Compact) - USER MENU & DIRECTORY
   ======================================== */
.dropdown-compact .dropdown-menu {
  min-width: 160px !important;
  max-width: 180px !important;
  font-size: 0.8rem !important;
  padding: 0.25rem 0 !important;
  background-color: #ffffff !important;
  border: 1px solid #dee2e6 !important;
}

.dropdown-compact .dropdown-item {
  padding: 0.4rem 0.75rem !important;
  font-size: 0.8rem !important;
  white-space: nowrap !important;
  color: #212529 !important;
}

.dropdown-compact .dropdown-item:hover {
  background-color: #f8f9fa !important;
  color: #212529 !important;
}

/* Active state - naranja oscuro */
.dropdown-compact .dropdown-item.active {
  background-color: #c44800 !important;
  color: #ffffff !important;
}

.dropdown-compact .dropdown-item i {
  font-size: 0.8rem !important;
  width: 16px;
}

.dropdown-compact .dropdown-header {
  padding: 0.4rem 0.75rem !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: #6c757d !important;
}

.dropdown-compact .dropdown-divider {
  margin: 0.25rem 0 !important;
  border-top-color: #dee2e6 !important;
}

/* Dark mode dropdown styling */
html[data-theme="dark"] .dropdown-compact .dropdown-menu {
  background-color: #1f2937 !important;
  border-color: #374151 !important;
}

html[data-theme="dark"] .dropdown-compact .dropdown-item {
  color: #e5e7eb !important;
}

html[data-theme="dark"] .dropdown-compact .dropdown-item:hover {
  background-color: #374151 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .dropdown-compact .dropdown-item.active {
  background-color: #be3f00 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .dropdown-compact .dropdown-header {
  color: #9ca3af !important;
}

html[data-theme="dark"] .dropdown-compact .dropdown-divider {
  border-top-color: #374151 !important;
}

/* Dark mode for delete item specifically */
html[data-theme="dark"] .dropdown-compact .dropdown-item.text-danger {
  color: #ef4444 !important;
}

html[data-theme="dark"] .dropdown-compact .dropdown-item.text-danger:hover {
  background-color: #7f1d1d !important;
  color: #fca5a5 !important;
}

/* Botones sólidos en tablas */
.table-moksha .btn-outline-primary {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
  color: #ffffff !important;
}

.table-moksha .btn-outline-primary:hover {
  background-color: #0b5ed7 !important;
  border-color: #0a58ca !important;
  color: #ffffff !important;
}

.table-moksha .btn-outline-danger {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
  color: #ffffff !important;
}

.table-moksha .btn-outline-danger:hover {
  background-color: #bb2d3b !important;
  border-color: #b02a37 !important;
  color: #ffffff !important;
}

/* Botones pequeños con rounded corners y separación */
.table-moksha .btn-sm,
.table-moksha .btn-group-sm > .btn {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  border-radius: 0.375rem !important;
}

/* Separación entre botones (no usar btn-group) */
.table-moksha .btn-sm + .btn-sm {
  margin-left: 0.375rem !important;
}

/* Modal header naranja para edit */
.modal-header-edit {
  background: linear-gradient(135deg, #ff5300 0%, #ff9d42 100%) !important;
  color: white !important;
  border-bottom: none !important;
}

.modal-header-edit .modal-title {
  color: white !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-header-edit .btn-close {
  filter: brightness(0) invert(1);
}

/* ========================================
   Assigned Users Section (in header)
   ======================================== */
#woAssignedListHeader .badge {
  font-weight: 500;
  font-size: 0.7rem !important;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

#woAssignBtn {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

#woAssignBtn:hover {
  color: var(--text);
}

#woAssignUsersList .form-check {
  padding-left: 1.5rem;
}

#woAssignUsersList .form-check-input {
  margin-top: 0.15rem;
}

#woAssignUsersList .form-check-label {
  line-height: 1.6;
}

/* Assign modal header - Blue like primary button */
#woAssignModal .assign-modal-header {
  background-color: #0d6efd !important; /* Bootstrap primary blue */
  color: white !important;
  border-bottom: none !important;
}

#woAssignModal .assign-modal-header .modal-title {
  color: white !important;
  font-weight: 600;
}

#woAssignModal .assign-modal-header .modal-title i {
  font-size: 1.1rem;
}

#woAssignModal .assign-modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: 1;
}

#woAssignModal .assign-modal-header .btn-close:hover {
  opacity: 0.8;
}

/* ========================================
   Theme Toggle Button (Luna | Sol)
   ======================================== */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.theme-divider,
.theme-separator {
  opacity: 0.5;
  font-weight: 300;
}

/* ========================================
   Login Page Styling
   ======================================== */
.login-card {
  width: 360px;
  padding: 0 !important;
  overflow: hidden;
}

.login-header {
  background: #ff5300;
  padding: 1.25rem 1.5rem;
  border-radius: 0;
  margin: 0;
}

.login-body {
  padding: 1.5rem;
}

.login-icon {
  color: white;
  font-size: 1.75rem;
}

.login-title {
  color: white;
  font-weight: 400;
}

.login-title strong {
  font-weight: 700;
}

.login-theme-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  transition: all 0.2s;
  padding: 0.375rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.login-theme-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.login-theme-btn i {
  font-size: 0.875rem;
}

/* ========================================
   Delete Comment Modal
   ======================================== */
.delete-comment-modal .modal-header {
  background-color: #dc3545 !important;
  color: white !important;
  border-bottom: none;
}

.delete-comment-modal .modal-header .modal-title {
  font-weight: 600;
}

.delete-comment-modal .modal-header .modal-title i {
  font-size: 1.1rem;
}

.delete-comment-modal .modal-footer {
  border-top: none;
}

.delete-comment-body {
  opacity: 0.8;
  font-size: 0.9rem;
  padding: 1.25rem 1rem;
}

.delete-comment-body p {
  line-height: 1.5;
}

/* ========================================
   Delete Attachment Modal
   ======================================== */
.delete-attachment-modal .modal-header {
  background-color: #dc3545 !important;
  color: white !important;
  border-bottom: none;
}

.delete-attachment-modal .modal-header .modal-title {
  font-weight: 600;
}

.delete-attachment-modal .modal-header .modal-title i {
  font-size: 1.1rem;
}

.delete-attachment-modal .modal-footer {
  border-top: none;
}

.delete-attachment-body {
  opacity: 0.8;
  font-size: 0.9rem;
  padding: 1.25rem 1rem;
}

.delete-attachment-body p {
  line-height: 1.5;
}

/* ========================================
   Delete Work Order Modal
   ======================================== */
.delete-wo-modal .modal-header {
  background-color: #dc3545 !important;
  color: white !important;
  border-bottom: none;
}

.delete-wo-modal .modal-header .modal-title {
  font-weight: 600;
}

.delete-wo-modal .modal-header .modal-title i {
  font-size: 1.1rem;
}

.delete-wo-modal .modal-footer {
  border-top: none;
}

.delete-wo-body {
  padding: 1.25rem 1rem;
}

.delete-wo-body p {
  line-height: 1.5;
}

.delete-wo-body .alert-warning {
  font-size: 0.875rem;
  padding: 0.75rem;
}

/* =========================================================
   MOKSHA HUB - Proofs Module Complete Styles
   ========================================================= */

#woPreviewModal .modal-header {
  background-color: rgb(230, 230, 230);
}

[data-theme="dark"] #woPreviewModal .modal-header  {
  background-color: rgb(0, 0, 0, 0.15);
}

[data-theme="dark"] #woPreviewModal .modal-body  {
  background-color: #1d232e;
}

/* =========================================================
   Work Order Modal View Buttons (ambos naranjas)
   ========================================================= */

/* Botones de vista - más padding lateral */
.wo-view-btn {
  font-weight: 500;
  transition: all 0.2s ease;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

/* Ambos botones naranjas - outline cuando no está activo */
.wo-view-btn:not(.active) {
  background: transparent;
  color: #ff5300;
  border-color: #ff5300;
}

.wo-view-btn:not(.active):hover {
  background: rgba(255, 83, 0, 0.1);
}

/* Ambos botones - solid naranja cuando está activo (con borde) */
.wo-view-btn.active {
  background: #ff5300;
  color: white;
  border-color: #ff5300 !important;
}

/* Metadata bar */
.wo-metadata-bar {
  background: var(--surface);
}

[data-theme="dark"] .wo-metadata-bar {
  background: rgba(255,255,255,0.02);
}

/* Title input - ancho para 40 caracteres */
.wo-title-input {
  max-width: 320px !important;
}

/* Modal body para views */
.wo-modal-body {
  padding: 0;
  overflow-x: hidden;
}

.wo-view-panel {
  max-height: calc(90vh - 250px);
  overflow-y: auto;
  overflow-x: hidden;
}

#woInfoPanel {
  padding: 1rem;
}

#woProofsPanel {
  padding: 0.75rem 1rem;
}

/* =========================================================
   Proofs List & Detail Styles
   ========================================================= */

/* Proof cards - grid layout compacto */
.proof-card {
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 0.375rem;
}

.proof-card:hover {
  border-color: #ff9500;
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.2);
  transform: translateY(-2px);
}

.proof-card-image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* Aspect ratio 1:1 */
  overflow: hidden;
  background: #f8f9fa;
}

.proof-card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proof-card-status-badge {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 10;
}

.proof-card-body {
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.proof-card-title {
  font-size: 0.7rem;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.proof-card-meta {
  font-size: 0.65rem;
  color: rgba(108, 117, 125, 0.6); /* Más tenue */
  line-height: 1.1;
}

[data-theme="dark"] .proof-card-meta {
  color: rgba(173, 181, 189, 0.5); /* Más tenue en dark mode */
}

/* Proof list view - table format (2 columns) */
.proof-list-table {
  margin-bottom: 0;
}

.proof-list-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 0.5rem 0.5rem;
  color: var(--text);
}

.proof-list-table tbody td {
  font-size: 0.85rem;
  padding: 0.5rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.proof-list-row {
  transition: background-color 0.2s ease;
}

.proof-list-row:hover td {
  background-color: rgba(255, 149, 0, 0.05);
}

[data-theme="dark"] .proof-list-table thead th {
  background: var(--surface);
  color: var(--text);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .proof-list-table tbody td {
  background: var(--surface);
  color: var(--text);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .proof-list-row:hover td {
  background-color: rgba(255, 149, 0, 0.1);
}

/* Dark mode for sort label and select */
[data-theme="dark"] .proof-sort-label {
  color: rgba(255, 255, 255, 0.8) !important;
}

[data-theme="dark"] .proof-sort-select {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

[data-theme="dark"] .proof-sort-select option {
  background-color: var(--surface);
  color: var(--text);
}

/* Dark mode - general fixes for proofs panel */
[data-theme="dark"] #proofSortSelect {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

[data-theme="dark"] #woProofsPanel .small.text-muted {
  color: rgba(255, 255, 255, 0.6) !important;
}

[data-theme="dark"] #woProofsPanel label {
  color: rgba(255, 255, 255, 0.9) !important;
}

.proof-list-thumbnail {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 0.25rem;
  border: 1px solid var(--border);
  display: block;
}

.proof-list-icon {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.proof-list-icon-label {
  font-size: 0.5rem;
  font-weight: 600;
  margin-top: -2px;
  color: var(--text-muted);
}

.proof-list-name-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cursor-pointer {
  cursor: pointer;
}

/* Surface hover effect */
.surface-hover {
  background: var(--surface);
}

[data-theme="dark"] .surface-hover:hover {
  background: rgba(255,255,255,0.05);
}

[data-theme="light"] .surface-hover:hover {
  background: rgba(0,0,0,0.02);
}

/* Proof preview placeholder */
.proof-preview-placeholder {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .proof-preview-placeholder {
  background: rgba(255,255,255,0.03) !important;
}

/* Proof comments */
.proof-comments-list {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.proof-comment {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.proof-comment:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.proof-comment:hover .comment-actions-btn {
  opacity: 1 !important;
}

.comment-actions-btn {
  transition: opacity 0.2s;
  color: var(--text-muted) !important;
}

.comment-actions-btn:hover {
  color: var(--text) !important;
}

[data-theme="dark"] .comment-actions-btn {
  color: rgba(255, 255, 255, 0.6) !important;
}

[data-theme="dark"] .comment-actions-btn:hover {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Status button group - Radio buttons styled as toggle */
.btn-group .proof-status-btn {
  display: none;
}

.btn-group label {
  margin-bottom: 0;
}

.btn-group label.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* =========================================================
   File Selector Cards
   ========================================================= */
.file-selector-card {
  border: 2px solid var(--border);
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.file-selector-card:hover {
  border-color: var(--bs-primary);
}

.file-checkbox-input {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 10;
  cursor: pointer;
  width: 1rem;
  height: 1rem;
}

.file-checkbox-input:checked ~ .file-selector-card-label {
  background: rgba(13, 110, 253, 0.1);
}

.file-selector-card-label {
  display: block;
  cursor: pointer;
  margin: 0;
  transition: background 0.2s ease;
}

.file-selector-image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
  background: #f8f9fa;
}

.file-selector-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-selector-card-body {
  padding: 0.4rem;
}

.file-selector-name {
  font-size: 0.7rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.15rem;
  line-height: 1.2;
}

.file-selector-size {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1;
}
/* =========================================================
/* =========================================================
   Comment Attachments Styles (Using wo-file-row base)
   Agregar estos estilos al archivo app.css existente
   ========================================================= */

/* Comment attachment rows - inherit from wo-file-row */
.comment-attachment-row {
  /* Already inherits all styles from .wo-file-row */
  margin-bottom: 0.5rem;
}

.pending-file-row {
  /* Already inherits all styles from .wo-file-row */
  margin-bottom: 0.5rem;
}

/* Attachments container spacing */
.comment-attachments-list {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(120,120,120,.18);
}

.comment-attachments-list:empty {
  display: none;
}

/* Dark mode for comment attachments separator */
:root[data-theme="dark"] .comment-attachments-list {
  border-top-color: rgba(255,255,255,.12);
}

/* Compact Drag & Drop zone */
#woCommentDropzone {
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.02);
  border: 2px dashed rgba(120,120,120,.18);
  padding: 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

#woCommentDropzone:hover {
  border-color: var(--bs-primary);
  background: rgba(0, 0, 0, 0.04);
}

#woCommentDropzone.drag-over {
  background: var(--bs-primary-bg-subtle) !important;
  border-style: solid !important;
  border-color: var(--bs-primary) !important;
  transform: scale(1.02);
}

/* Dark mode for drag & drop */
:root[data-theme="dark"] #woCommentDropzone {
  border-color: rgba(255,255,255,.20);
  background: rgba(255,255,255,.06);
}

:root[data-theme="dark"] #woCommentDropzone:hover {
  border-color: var(--bs-primary);
  background: rgba(255,255,255,.10);
}

/* Attachment zone animation */
#woCommentAttachmentZone {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pending files list scrollbar */
#woPendingFilesList::-webkit-scrollbar {
  width: 6px;
}

#woPendingFilesList::-webkit-scrollbar-track {
  background: transparent;
}

#woPendingFilesList::-webkit-scrollbar-thumb {
  background: rgba(120,120,120,.3);
  border-radius: 3px;
}

#woPendingFilesList::-webkit-scrollbar-thumb:hover {
  background: rgba(120,120,120,.5);
}

/* Delete buttons in comment attachments */
.comment-att-delete-btn,
.remove-pending-file-btn {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.comment-att-delete-btn:hover,
.remove-pending-file-btn:hover {
  opacity: 1;
}

/* File input (hidden) */
#woCommentFileInput {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #woCommentAttachmentZone .row {
    flex-direction: column;
  }
  
  #woCommentAttachmentZone .col-5,
  #woCommentAttachmentZone .col-7 {
    width: 100%;
    max-width: 100%;
  }
  
  #woCommentDropzone {
    min-height: 80px !important;
    padding: 1rem !important;
  }
  
  #woCommentDropzone i {
    font-size: 1.25rem !important;
  }
}

/* =========================================================================
   Work Order Modal - Sidebar Layout (35% / 65%)
   ========================================================================= */

/* Modal structure */
#woModal.modal .modal-dialog.modal-dialog-scrollable {
  max-height: 90vh !important;
}

#woModal.modal .modal-dialog.modal-dialog-scrollable .modal-content {
  max-height: 90vh !important;
  overflow: hidden !important;
}

#woModal.modal .modal-dialog.modal-dialog-scrollable .modal-body {
  overflow: hidden !important;
}

#woModal .modal-content {
  max-height: 90vh !important;
  height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#woModal .modal-header {
  flex-shrink: 0 !important;
  background-color: rgb(236, 236, 236);
}

/* Dark mode */
html[data-theme="dark"] #woModal .modal-header {
  flex-shrink: 0 !important;
   background-color: rgb(19, 21, 25);
}


#woModal .modal-body {
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.wo-modal-body {
  padding: 0 !important;
  overflow: hidden !important;
  height: 100% !important;
  max-height: 100% !important;
}

.wo-view-panel {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

.wo-view-panel > .row {
  height: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* LEFT COLUMN (35%) */
.wo-left-column {
  width: 40% !important;
  max-width: 40% !important;
  flex: 0 0 40% !important;
  background: var(--surface-elevation-1, #f9fafb);
  border-right: 2px solid var(--border-color, #e5e5e7);
  overflow: hidden !important;
  padding: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
}

.wo-left-scroll {
  height: 100% !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 20px;
}

/* RIGHT COLUMN (65%) */
.wo-right-column {
  width: 60% !important;
  max-width: 60% !important;
  flex: 0 0 60% !important;
  overflow: hidden !important;
  padding: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
}

.wo-comments-panel {
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  background: var(--surface-elevation-0, white);
  overflow: hidden !important;
}

.wo-comment-input-area {
  flex-shrink: 0 !important;
  padding: 20px;
  border-bottom: 2px solid var(--border-color, #e5e5e7);
  background: var(--surface-elevation-0, white);
}

.wo-comments-scroll {
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 20px;
  min-height: 0 !important;
}

.wo-section {
  margin-bottom: 24px;
}

.wo-section:last-child {
  margin-bottom: 0;
}

.wo-section-header {
  display: flex;
  justify-content: space-between;
  align-items-center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color, #e5e5e7);
}

#woFilesList {
  /* Sin restricciones - scroll lo maneja .wo-left-scroll */
}

/* Scrollbars */
.wo-left-scroll::-webkit-scrollbar,
.wo-comments-scroll::-webkit-scrollbar {
  width: 8px;
}

.wo-left-scroll::-webkit-scrollbar-track,
.wo-comments-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.wo-left-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
}

.wo-comments-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 4px;
}

.wo-left-scroll::-webkit-scrollbar-thumb:hover,
.wo-comments-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.25);
}

/* Dark mode */
html[data-theme="dark"] .wo-left-column {
  background: rgba(255, 255, 255, 0.02);
  border-right-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .wo-left-column {
  background: rgba(255, 255, 255, 0.02);
  border-right-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .wo-comments-panel {
  background: rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .wo-comments-panel {
  background: rgba(0, 0, 0, 0.2) !important;
}

html[data-theme="dark"] .wo-comment-input-area {
  background: rgba(0, 0, 0, 0.15) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .wo-comment-input-area {
  background: rgba(0, 0, 0, 0.15) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .wo-comments-scroll {
  background: rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .wo-comments-scroll {
  background: rgba(0, 0, 0, 0.2) !important;
}

html[data-theme="dark"] .wo-section-header,
[data-bs-theme="dark"] .wo-section-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .wo-comment-card {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .wo-comment-card {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .wo-comment-card:hover,
[data-bs-theme="dark"] .wo-comment-card:hover {
  background: #121823 !important;
  border-radius: 10px;
}

html[data-theme="dark"] .comment-author-admin,
[data-bs-theme="dark"] .comment-author-admin {
  color: #ff6b35 !important;
}

html[data-theme="dark"] .comment-author-user,
[data-bs-theme="dark"] .comment-author-user {
  color: rgba(255, 255, 255, 0.9) !important;
}

html[data-theme="dark"] .comment-timestamp,
[data-bs-theme="dark"] .comment-timestamp {
  color: rgba(255, 255, 255, 0.5) !important;
}

html[data-theme="dark"] .comment-menu-btn,
[data-bs-theme="dark"] .comment-menu-btn {
  color: rgba(255, 255, 255, 0.5) !important;
}

html[data-theme="dark"] .comment-menu-btn:hover,
[data-bs-theme="dark"] .comment-menu-btn:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

html[data-theme="dark"] .badge.bg-warning,
[data-bs-theme="dark"] .badge.bg-warning {
  background: rgba(251, 191, 36, 0.2) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(251, 191, 36, 0.3) !important;
}

html[data-theme="dark"] .wo-left-scroll::-webkit-scrollbar-thumb,
html[data-theme="dark"] .wo-comments-scroll::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] .wo-left-scroll::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] .wo-comments-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 991px) {
  .wo-left-column,
  .wo-right-column {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }
  
  .wo-left-column {
    border-right: none;
    border-bottom: 2px solid var(--border-color, #e5e5e7);
    max-height: 40vh;
  }
  
  .wo-right-column {
    max-height: 60vh;
  }
}

/* ===================================
   LINKED EXCEL SECTION
   =================================== */

.linked-excel-empty {
  padding: 1rem;
  background: var(--surface-secondary, #f8f9fa);
  border: 1px solid var(--border-color, #e5e5e7);
  border-radius: 6px;
}

/* Dark mode for empty state */
[data-bs-theme="dark"] .linked-excel-empty {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .linked-excel-empty {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .linked-excel-empty p {
  color: var(--bs-gray-400, #adb5bd);
}

.linked-excel-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border-color, #e5e5e7);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

/* Remove hover effect */
.linked-excel-file:hover {
  /* No border change or shadow on hover */
}

/* Dark mode for file display */
[data-bs-theme="dark"] .linked-excel-file {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .linked-excel-file {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.1);
}

.linked-excel-icon {
  font-size: 2rem;
  color: #217346;
  flex-shrink: 0;
  line-height: 1;
}

.linked-excel-info {
  flex: 1;
  min-width: 0;
  max-width: 300px;
}

.linked-excel-filename {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-primary, #1d1d1f);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

/* Dark mode for filename - CRITICAL FIX */
[data-bs-theme="dark"] .linked-excel-filename {
  color: #f8f9fa !important;
}

html[data-theme="dark"] .linked-excel-filename {
  color: #f8f9fa !important;
}

.linked-excel-meta {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  padding-left: 2.75rem;
  font-size: 0.8125rem;
  color: var(--bs-gray-600, #6c757d);
  line-height: 1.5;
}

/* Dark mode for meta */
[data-bs-theme="dark"] .linked-excel-meta {
  color: var(--bs-gray-400, #adb5bd);
}

.linked-excel-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Badge styling */
#woLinkedExcelBadge.bg-success {
  background-color: #198754 !important;
}

/* Select from RESOURCES Modal */
.list-group-item input[type="radio"] {
  cursor: pointer;
}

.list-group-item:has(input[type="radio"]:checked) {
  background-color: #e7f3ff;
  border-color: #0d6efd;
}

/* Dark mode for modal list items */
[data-bs-theme="dark"] .list-group-item:has(input[type="radio"]:checked) {
  background-color: #0a3a5e;
  border-color: #0d6efd;
}

.list-group-item:hover:not(:has(.text-muted)) {
  background-color: #f8f9fa;
  cursor: pointer;
}

[data-bs-theme="dark"] .list-group-item:hover:not(:has(.text-muted)) {
  background-color: var(--bs-gray-800, #343a40);
}

