/* dashboard.css */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* CSS Variables - Single source of truth for dashboard colors */
:root {
    --btn-primary-bg: #6b7280;
    --btn-primary-color: #ffffff;
    --btn-primary-hover-bg: #4b5563;
    --btn-primary-hover-color: #ffffff;
}

/* ==========================================================================
   Sidebar Toggle & Close Buttons - Hidden by default on desktop
   ========================================================================== */
.toggle-sidebar,
.sidebar-close-btn,
.hamburger-menu {
  display: none !important;
}

/* Delete Modal Styles */
.delete-modal-overlay { 
  position: fixed; 
  inset: 0; 
  background: rgba(0, 0, 0, 0.15); 
  z-index: 12000; 
  display: flex; 
  align-items: center; 
  justify-content: center;
}
.delete-modal { 
  background: white; 
  border-radius: 16px; 
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05); 
  max-width: 420px; 
  width: 90%; 
  animation: deleteModalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes deleteModalSlideIn {
  from { transform: scale(0.9) translateY(-20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.delete-modal-body { 
  padding: 32px 24px 20px; 
  text-align: center;
}

/* Animated Trash Icon */
.delete-icon-animated {
  margin: 0 auto 16px;
  width: 80px;
  height: 80px;
}
.delete-icon-body {
  stroke-dasharray: 140;
  stroke-dashoffset: 140;
  animation: drawTrashBody 0.5s ease-out 0.1s forwards;
}
.delete-icon-lid {
  stroke-dasharray: 32;
  stroke-dashoffset: 32;
  animation: drawTrashLid 0.3s ease-out forwards;
}
.delete-icon-handle {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawTrashHandle 0.3s ease-out 0.3s forwards;
}
.delete-icon-lines {
  stroke-dasharray: 54;
  stroke-dashoffset: 54;
  animation: drawTrashLines 0.4s ease-out 0.6s forwards;
}
@keyframes drawTrashBody {
  to { stroke-dashoffset: 0; }
}
@keyframes drawTrashLid {
  to { stroke-dashoffset: 0; }
}
@keyframes drawTrashHandle {
  to { stroke-dashoffset: 0; }
}
@keyframes drawTrashLines {
  to { stroke-dashoffset: 0; }
}

/* Continuous shake animation during deletion */
.delete-icon-animated.deleting-shake {
  animation: trashShake 0.6s ease-in-out infinite !important;
  transform-origin: center center !important;
}
.delete-icon-animated.deleting-shake .delete-icon-body,
.delete-icon-animated.deleting-shake .delete-icon-lid,
.delete-icon-animated.deleting-shake .delete-icon-handle,
.delete-icon-animated.deleting-shake .delete-icon-lines {
  animation: none !important;
  stroke-dashoffset: 0 !important;
}
@keyframes trashShake {
  0% { transform: rotate(0deg) scale(1); }
  10% { transform: rotate(-10deg) scale(1.05); }
  20% { transform: rotate(10deg) scale(1.05); }
  30% { transform: rotate(-10deg) scale(1.05); }
  40% { transform: rotate(10deg) scale(1.05); }
  50% { transform: rotate(-10deg) scale(1.05); }
  60% { transform: rotate(10deg) scale(1.05); }
  70% { transform: rotate(-10deg) scale(1.05); }
  80% { transform: rotate(10deg) scale(1.05); }
  90% { transform: rotate(-10deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

.delete-modal-body p { 
  margin: 0 0 8px; 
  color: #333; 
  font-size: 16px;
  font-weight: 500;
}
.delete-warning { 
  color: #666 !important; 
  font-size: 14px !important; 
  font-style: italic;
  font-weight: 400 !important;
  margin-bottom: 0 !important;
}
.delete-modal-footer { 
  padding: 16px 24px 24px; 
  display: flex; 
  gap: 12px; 
  justify-content: center;
}
.btn-cancel, .btn-delete { 
  padding: 12px 32px; 
  border: none; 
  border-radius: 8px; 
  cursor: pointer; 
  font-size: 15px; 
  font-weight: 600; 
  transition: all 0.2s;
  min-width: 120px;
}
.btn-cancel { 
  background: #f8f9fa; 
  color: #6c757d; 
  border: 1px solid #dee2e6;
}
.btn-cancel:hover { 
  background: #e9ecef; 
  color: #495057;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.btn-delete { 
  background: #dc3545; 
  color: white;
}
.btn-delete:hover { 
  background: #c82333; 
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Row Highlighting for Delete */
tr.row-deleting {
  background-color: #ffe0e0 !important;
  transition: background-color 0.3s ease;
}
tr.row-deleting td {
  background-color: transparent !important;
}

/* Small Animated Trash Icon in Table */
.delete-icon-small {
  display: inline-block;
  vertical-align: middle;
  cursor: pointer;
  width: 20px;
  height: 20px;
  stroke: #6b7280;
  color: #6b7280;
  overflow: visible;
}
.delete-icon-small .delete-icon-body,
.delete-icon-small .delete-icon-lid,
.delete-icon-small .delete-icon-handle,
.delete-icon-small .delete-icon-lines {
  stroke: #6b7280;
}
.delete-link {
  display: inline-block;
  overflow: visible;
}
.delete-link:hover {
  z-index: 10;
  position: relative;
}
.delete-link:hover .delete-icon-small {
  transform: scale(1.2);
  transition: transform 0.2s ease;
  stroke: #dc3545;
  color: #dc3545;
}
.delete-link:hover .delete-icon-small path {
  stroke: #dc3545;
  color: #dc3545;
}

/* Small Animated Edit Icon in Table */
.edit-icon-small {
  display: inline-block;
  vertical-align: middle;
  cursor: pointer;
  stroke: #6b7280;
  color: #6b7280;
  width: 20px;
  height: 20px;
  overflow: visible;
}
.edit-icon-small .edit-icon-body {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawEditBody 0.5s ease-out 0.1s forwards;
  stroke: #6b7280;
}
.edit-icon-small .edit-icon-pencil {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawEditPencil 0.5s ease-out 0.3s forwards;
  stroke: #6b7280;
}
@keyframes drawEditBody {
  to { stroke-dashoffset: 0; }
}
@keyframes drawEditPencil {
  to { stroke-dashoffset: 0; }
}
.edit-link {
  color: #6b7280;
  display: inline-block;
  overflow: visible;
}
.edit-link:hover {
  color: #4b5563;
  z-index: 10;
  position: relative;
}
.edit-link:hover .edit-icon-small,
.edit-link:hover .edit-icon-small path {
  transform: scale(1.2);
  transition: transform 0.2s ease;
  stroke: #4b5563;
  color: #4b5563;
}

/* Small View Icon in Table */
.view-link {
  color: #6b7280;
  display: inline-block;
  overflow: visible;
}
.view-link:hover {
  color: #4b5563;
  z-index: 10;
  position: relative;
}
.view-link:hover svg {
  transform: scale(1.2);
  transition: transform 0.2s ease;
  stroke: #4b5563;
  color: #4b5563;
}
.view-link:hover svg path,
.view-link:hover svg circle {
  stroke: #4b5563;
}

/* Small Share Icon in Table */
.share-link {
  color: #6b7280;
  display: inline-block;
  overflow: visible;
}
.share-link:hover {
  color: #4b5563;
  z-index: 10;
  position: relative;
}
.share-link:hover svg {
  transform: scale(1.2);
  transition: transform 0.2s ease;
  stroke: #4b5563;
  color: #4b5563;
}
.share-link:hover svg path,
.share-link:hover svg circle {
  stroke: #4b5563;
}

/* Small Animated Details Icon in Table */
.details-icon-small {
  display: inline-block;
  vertical-align: middle;
  cursor: pointer;
  stroke: #6b7280;
  color: #6b7280;
  width: 20px;
  height: 20px;
  overflow: visible;
}
.details-icon-small path {
  stroke: #6b7280;
}
.details-icon-small .details-icon-line1 { animation: drawDetailsLine 0.4s ease-out 0.1s forwards; stroke-dasharray: 13; stroke-dashoffset: 13; }
.details-icon-small .details-icon-line2 { animation: drawDetailsLine 0.4s ease-out 0.2s forwards; stroke-dasharray: 13; stroke-dashoffset: 13; }
.details-icon-small .details-icon-line3 { animation: drawDetailsLine 0.4s ease-out 0.3s forwards; stroke-dasharray: 13; stroke-dashoffset: 13; }
.details-icon-small .details-icon-dot1 { animation: drawDetailsDot 0.3s ease-out forwards; transform-origin: 3px 6px; }
.details-icon-small .details-icon-dot2 { animation: drawDetailsDot 0.3s ease-out 0.1s forwards; transform-origin: 3px 12px; }
.details-icon-small .details-icon-dot3 { animation: drawDetailsDot 0.3s ease-out 0.2s forwards; transform-origin: 3px 18px; }

@keyframes drawDetailsLine {
  to { stroke-dashoffset: 0; }
}
@keyframes drawDetailsDot {
  0% { transform: scale(0); opacity: 0; }
  80% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.details-link {
  color: #6b7280;
  display: inline-block;
  overflow: visible;
}
.details-link:hover {
  color: #4b5563;
  z-index: 10;
  position: relative;
  background: transparent !important; /* Override legacy background */
}
.details-link:hover .details-icon-small,
.details-link:hover .details-icon-small path {
  transform: scale(1.2);
  transition: transform 0.2s ease;
  stroke: #4b5563;
  color: #4b5563;
}

/* Animated Logout Icon */
.logout-icon-animated {
  margin: 0 auto 16px;
  width: 11.25px;
  height: 11.25px;
}
.logout-icon-door {
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: drawLogoutDoor 0.5s ease-out 0.1s forwards;
}
.logout-icon-handle {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawLogoutHandle 0.4s ease-out 0.3s forwards;
}
.logout-icon-frame {
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  animation: drawLogoutFrame 0.3s ease-out 0.6s forwards;
}
@keyframes drawLogoutDoor {
  to { stroke-dashoffset: 0; }
}
@keyframes drawLogoutHandle {
  to { stroke-dashoffset: 0; }
}
@keyframes drawLogoutFrame {
  to { stroke-dashoffset: 0; }
}

/* Continuous shake animation during logout */
.logout-icon-animated.logout-shake {
  animation: logoutShake 0.6s ease-in-out infinite !important;
  transform-origin: center center !important;
}
.logout-icon-animated.logout-shake .logout-icon-door,
.logout-icon-animated.logout-shake .logout-icon-handle,
.logout-icon-animated.logout-shake .logout-icon-frame {
  animation: none !important;
  stroke-dashoffset: 0 !important;
}
@keyframes logoutShake {
  0% { transform: rotate(0deg) scale(1); }
  10% { transform: rotate(-10deg) scale(1.05); }
  20% { transform: rotate(10deg) scale(1.05); }
  30% { transform: rotate(-10deg) scale(1.05); }
  40% { transform: rotate(10deg) scale(1.05); }
  50% { transform: rotate(-10deg) scale(1.05); }
  60% { transform: rotate(10deg) scale(1.05); }
  70% { transform: rotate(-10deg) scale(1.05); }
  80% { transform: rotate(10deg) scale(1.05); }
  90% { transform: rotate(-10deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

/* User Header — Icon-first compact tile bar (gray theme, Option C styling) */
.user-header {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    color: #f1f5f9;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px -10px rgba(15,23,42,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.user-header-title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

/* Hide User ID and Event pills (kept for back-compat) */
.user-info-item:has(.user-info-label) {
    display: none !important;
}

.user-info-item,
.user-info-label,
.user-info-value { /* legacy classes — no longer rendered */ }

.user-header-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.user-header-info::-webkit-scrollbar { height: 4px; }
.user-header-info::-webkit-scrollbar-track { background: transparent; }
.user-header-info::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.25);
    border-radius: 4px;
}

/* Tile buttons */
.btn-support-tickets,
.btn-user-level,
.btn-live-editor,
.btn-dashboard-toggle,
.btn-homepage,
.btn-logout {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 84px;
    height: 62px;
    padding: 0.45rem 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
    flex-shrink: 0;
}

.btn-support-tickets:hover,
.btn-user-level:hover,
.btn-live-editor:hover,
.btn-dashboard-toggle:hover,
.btn-homepage:hover,
.btn-logout:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: #ffffff;
}

.btn-support-tickets:active,
.btn-user-level:active,
.btn-live-editor:active,
.btn-dashboard-toggle:active,
.btn-homepage:active,
.btn-logout:active {
    transform: translateY(0);
}

.btn-support-tickets i,
.btn-user-level i,
.btn-live-editor i,
.btn-dashboard-toggle i,
.btn-homepage i,
.btn-logout i {
    font-size: 1.05rem;
    line-height: 1;
}

.btn-support-tickets span,
.btn-user-level span,
.btn-live-editor span,
.btn-dashboard-toggle span,
.btn-homepage span,
.btn-logout span {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
}

/* Active states */
.btn-live-editor.active,
.btn-user-level.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Primary tile — Dashboard toggle */
.btn-dashboard-toggle {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}
.btn-dashboard-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.32);
}

/* Responsive design for user header */
@media (max-width: 768px) {
    .user-header {
        padding: 0.85rem 1rem;
        gap: 0.75rem;
    }
    .user-header-title h1 {
        font-size: 1.15rem;
    }
    .btn-support-tickets,
    .btn-user-level,
    .btn-live-editor,
    .btn-dashboard-toggle,
    .btn-homepage,
    .btn-logout {
        min-width: 74px;
        height: 56px;
    }
    .btn-support-tickets span,
    .btn-user-level span,
    .btn-live-editor span,
    .btn-dashboard-toggle span,
    .btn-homepage span,
    .btn-logout span {
        font-size: 0.65rem;
    }
}

/* Modern Pagination Styling */
.pagination-container {
  margin-bottom: 0px !important; /* Remove bottom margin */
  padding-bottom: 0px !important; /* Remove bottom padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    padding: 16px 0 0px 0; /* Remove bottom padding */
    border-top: 1px solid #dee2e6;
    background: #ffffff;
}

.pagination-info {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #dee2e6;
    background: #ffffff;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pagination-link:hover {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #6b7280;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.1);
}

.pagination-link.active {
    background: #94a3b8;
    color: #ffffff;
    border-color: #94a3b8;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.3);
}

.pagination-link.active:hover {
    background: #7e8fa8;
    border-color: #7e8fa8;
    transform: none;
}

.pagination-link.disabled {
    background: #f8f9fa;
    color: #adb5bd;
    border-color: #e9ecef;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-link.disabled:hover {
    transform: none;
    box-shadow: none;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

.pagination-size label {
    font-weight: 500;
}

.pagination-size select {
    padding: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #ffffff;
    color: #495057;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
}

.pagination-size select:hover {
    border-color: #6b7280;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.1);
}

.pagination-size select:focus {
    outline: none;
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: center !important;
        display: flex !important;
    }
    
    /* CRITICAL: .pagination-controls contains all page links - MUST be horizontal row */
    .pagination-controls {
        display: flex !important;
        flex-flow: row wrap !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Force horizontal pagination numbers - target all pagination containers */
    .pagination-nav,
    .pagination,
    div.pagination-nav,
    div.pagination,
    div.pagination-controls {
        display: flex !important;
        flex-flow: row wrap !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* All pagination links - horizontal inline */
    .pagination-controls a,
    .pagination-controls span,
    .pagination-controls .pagination-link,
    .pagination-controls > a,
    .pagination-controls > span,
    .pagination-nav a,
    .pagination-nav span,
    .pagination a,
    .pagination span,
    .pagination-link,
    a.pagination-link,
    span.pagination-link {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 36px !important;
        width: auto !important;
        max-width: none !important;
        height: 36px !important;
        margin: 2px !important;
        padding: 0 8px !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        float: none !important;
        clear: none !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
    }
    
    .pagination-size {
        flex-direction: row !important;
        justify-content: center !important;
        width: 100% !important;
        display: flex !important;
    }
    
    .pagination-info {
        text-align: center !important;
        width: 100% !important;
    }
}

/* Modern Dashboard Styling */
.site-header {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(107, 114, 128, 0.15);
    margin: -20px -20px 24px -20px;
}

.site-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.site-header nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.site-header nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.site-header nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    margin-left: 0;
    margin-right: 0;
    padding: 0 20px;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    max-width: 1400px;
    margin: 0 auto;
}

.module-group {
    margin-bottom: 32px;
}

.group-title {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
    position: relative;
}

.group-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: #6b7280;
    border-radius: 1px;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6b7280, #4b5563);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.15);
    border-color: #6b7280;
    color: #6b7280;
}

.module-card:hover::before {
    transform: scaleX(1);
}

.module-icon {
    font-size: 32px;
    margin-bottom: 12px;
    color: #6c757d;
    transition: all 0.3s ease;
}

/* Module Icon Images */
.module-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
}

.module-card:hover .module-icon {
    color: #6b7280;
    transform: scale(1.1);
}

.module-card:hover .module-icon-img {
    transform: scale(1.1);
}

.module-label {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

/* Responsive Dashboard Design */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        margin: -20px -20px 24px -20px;
        padding: 20px;
    }
    
    .site-header nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    
    .modules-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .module-card {
        padding: 20px 12px;
    }
    
    .module-icon {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .module-label {
        font-size: 13px;
    }
    
    /* Mobile responsive for master headers */
    .master-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .master-info {
        justify-content: center;
        order: 1;
    }
    
    .master-center-nav {
        order: 2;
        justify-content: center;
    }
    
    .master-actions {
        order: 3;
        justify-content: center;
    }
    
    /* Mobile responsive for list navigation */
    .list-nav-icons a {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
    color: #333;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

body > * {
    width: 100%;
    max-width: 1400px;
}

.container {
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0px 24px 16px;
    max-width: 1200px;
    margin: auto;
}

/* List Page Box Container - white box for listing pages */
.list-page-box {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Ensure list-page-box displays correctly in sidebar layouts */
.page-content .list-page-box,
.auction-grid > .list-page-box,
.container-fluid .list-page-box {
    display: block;
    width: 100%;
}

/* List Page Navigation Icons (Articles, etc.) */
.list-nav-icons {
    display: flex;
    gap: 8px;
}

.list-nav-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    color: #495057;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.list-nav-icons a:hover {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.2);
}

.page-header h1 {
    margin: 0;
}

/* Ensure page header works with list navigation */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px; /* Reduced margin-bottom further to 0px */
    padding-bottom: 0;
    border-bottom: none;
    margin-top: 0; /* Reset negative margin */
    padding-top: 12px; /* Add small top padding for visual balance */
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    margin-left: 50px !important;
    margin-right: 5px !important;
}

.page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    opacity: 1 !important;
    visibility: visible !important;
}

.page-actions a {
    text-decoration: none;
    color: #495057;
    margin-left: 16px;
    font-weight: 500;
    transition: color 0.2s;
}

/* btn-new styled to match list-nav-icons buttons height */
.page-actions a.btn-new,
a.btn-new {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: auto !important;
    height: 40px !important;
    padding: 0 14px !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    color: #495057 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.page-actions a.btn-new:hover,
a.btn-new:hover {
    background: #6b7280 !important;
    color: white !important;
    border-color: #6b7280 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.2) !important;
}

.page-actions .advanced-search-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.page-actions a:hover {
    color: #6b7280;
}

/* Search form styles */
.search-form {
    display: inline-flex !important;
    gap: 8px;
    align-items: center;
    margin: 0;
    position: relative;
    opacity: 1 !important;
    visibility: visible !important;
}

.search-form .search-input-wrapper {
    position: relative;
    display: inline-block;
    opacity: 1 !important;
    visibility: visible !important;
    background: #ffffff;
    border-radius: 8px;
}

.search-input {
    padding: 8px 40px 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    height: 38px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 0;
    color: #000000 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

.search-input::placeholder {
    color: #9ca3af !important;
    opacity: 0.7 !important;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: #ffffff !important;
    color: #000000 !important;
}

.search-input-wrapper .search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 0 !important;
    color: #64748b;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    z-index: 1;
    pointer-events: auto;
    opacity: 1 !important;
    visibility: visible !important;
}

.search-input-wrapper .search-btn:hover {
    color: #475569;
    background: transparent !important;
    transform: translateY(-50%);
}

.search-input-wrapper .search-btn i {
    font-size: 14px;
    line-height: 1;
}

/* Keep search text clear of the overlaid magnifying-glass icon. A later
   duplicate ".search-input" rule (see below) resets padding to "8px 12px";
   this wrapper-scoped selector (higher specificity) wins regardless of order
   so long queries scroll under the icon instead of overlapping it. */
.search-form .search-input-wrapper .search-input {
    padding-right: 40px;
}

.clear-btn {
    padding: 8px 12px;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
}

.btn-primary {
    background: #6b7280 !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.btn-primary:hover {
    background: #4b5563 !important;
    color: white !important;
}

/* Expandable Master/Detail Styling - 100% Dynamic */
.master-detail-container {
    margin-bottom: 16px;
}

.master-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #ffffff;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.master-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.master-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    user-select: none;
    gap: 16px;
}

.master-header:hover {
    background: #e9ecef;
}

.master-header:hover .expand-icon {
    color: #6b7280;
}

.master-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.master-title {
    font-weight: 600;
    font-size: 16px;
    color: #212529;
    order: 2;
}

.detail-count {
    background: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    order: 1;
    margin-right: 8px;
}

.master-center-nav {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.master-center-nav a {
    text-decoration: none;
    color: #6c757d;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 4px;
    transition: all 0.2s;
    background: #ffffff;
    border: 1px solid #dee2e6;
}

.master-center-nav a:hover {
    color: #4b5563;
    background: #f3f4f6;
    border-color: #6b7280;
}

.master-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.master-actions a {
    text-decoration: none;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.master-actions a:hover {
    color: #4b5563;
    background: #f3f4f6;
}

.expand-icon {
    font-size: 14px;
    color: #6c757d;
    transition: transform 0.3s ease;
    margin-left: 8px;
}

.master-header.expanded .expand-icon {
    transform: rotate(90deg);
}

.details-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #ffffff;
}

.details-section.expanded {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.details-content {
    padding: 16px 20px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.details-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.details-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

.details-table tr:hover {
    background: #f8f9fa;
}

.detail-actions {
    display: flex;
    gap: 8px;
}

.detail-actions a {
    text-decoration: none;
    color: #6c757d;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.detail-actions a:hover {
    color: #4b5563;
    background: #f3f4f6;
}

.detail-actions a:last-child,
.master-actions a:last-child {
    color: #dc3545;
}

.detail-actions a:last-child:hover,
.master-actions a:last-child:hover {
    color: #ffffff;
    background: #dc3545;
}

.add-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #6b7280;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    margin-top: 12px;
}

.add-detail-btn:hover {
    background: #4b5563;
    color: white;
}

.no-details {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 24px;
}

/* Modern Modal/Popup Styling - 100% Dynamic */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 32px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

.modal-body {
    padding: 24px 32px;
}

.modal-footer {
    padding: 16px 32px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modal-btn-primary {
    background: #6b7280;
    color: white;
}

.modal-btn-primary:hover {
    background: #4b5563;
}

.modal-btn-secondary {
    background: #6c757d;
    color: white;
}

.modal-btn-secondary:hover {
    background: #545b62;
}

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

.modal-loading {
    display: none;
    align-items: center;
    gap: 8px;
    color: #6c757d;
}

.modal-loading.active {
    display: flex;
}

.modal-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #6b7280;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Form Styling */
.modal-form-group {
    margin-bottom: 20px;
}

.modal-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #495057;
}

.modal-form-group input,
.modal-form-group select,
.modal-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.modal-form-group input:focus,
.modal-form-group select:focus,
.modal-form-group textarea:focus {
    outline: none;
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

/* Modern Form Styling - 100% Dynamic */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.form-group label.required::after {
    content: "*";
    color: #ef4444;
    margin-left: 4px;
}

/* Enhanced Input Styling */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1);
    background-color: #fefefe;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #9ca3af;
}

/* Input State Styling - only show after form submission attempt */
.form-submitted .form-group input:invalid,
.form-submitted .form-group select:invalid {
    border-color: #ef4444;
}

.form-submitted .form-group input:invalid:focus,
.form-submitted .form-group select:invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}


/* Specific Input Type Styling */
.form-group input[type="number"] {
    text-align: right;
}

.form-group input[type="date"] {
    position: relative;
}

.form-group input[type="password"] {
    letter-spacing: 2px;
}

.form-group input[type="color"] {
    height: 48px;
    cursor: pointer;
    padding: 4px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    transform: scale(1.2);
}

/* Select Dropdown Styling */
.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-group select:focus {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}

/* Textarea Styling */
.form-group textarea {
    resize: both;
    min-height: 80px;
    line-height: 1.6;
}

/* Form Button Styling */
button[type="submit"],
.btn-primary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    min-width: 120px;
}

button[type="submit"]:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

button[type="submit"]:active,
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-group select {
        padding-right: 40px !important;
    }
    
    button[type="submit"],
    .btn-primary {
        width: 100%;
        padding: 14px 24px;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0px;
}

th, td {
    padding: 3px 8px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

tbody tr:hover {
    background-color: #f1f3f5;
}

td a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
}

td a:hover {
    text-decoration: underline;
}

td a.details-link {
    color: #28a745;
    margin-left: 10px;
}

td a.delete-link {
    color: #dc3545;
    margin-left: 10px;
}

/* Form Styles */
form {
    margin-top: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
}

button[type="submit"] {
    background-color: #6b7280;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

button[type="submit"]:hover {
    background-color: #4b5563;
}

/* Modern File Upload Styles */
.modern-file-upload {
    position: relative;
}

.current-image-preview {
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    border: 2px dashed #9ca3af;
}

.current-image-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.current-image-header .image-icon {
    font-size: 18px;
    margin-right: 8px;
    color: #6b7280;
}

.current-image-header .title {
    font-weight: 600;
    color: #333;
}

.delete-image-btn {
    margin-left: auto;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.delete-image-btn:hover {
    background: #c82333;
}

.image-preview-container {
    display: flex;
    gap: 15px;
    align-items: center;
}

.image-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.image-thumbnail:hover {
    transform: scale(1.05);
}

.image-info {
    flex: 1;
}

.image-filename {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.image-filename .file-icon {
    font-size: 16px;
    margin-right: 6px;
    color: #6b7280;
}

.image-filename a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.image-help-text {
    color: #6c757d;
    font-size: 12px;
}

.upload-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}

.ole-file-input {
    display: none;
}

/* OLE Upload Area - White Theme */
.ole-dropzone {
    background: transparent !important;
    border: none !important;
}

.ole-preview {
    background: transparent !important;
    color: #495057 !important;
}

.ole-upload-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa !important;
    border: 2px dashed #dee2e6 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease;
}

.ole-upload-area:hover {
    border-color: #9ca3af !important;
    background-color: #f3f4f6 !important;
}

.ole-status {
    color: #495057 !important;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #6b7280;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
    border: none;
}

.upload-btn:hover {
    background: #4b5563;
}

.upload-btn .upload-icon {
    font-size: 16px;
}

.upload-status {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 14px;
}

.upload-status.success {
    color: #28a745;
}

.upload-status.error {
    color: #dc3545;
}

.upload-status.loading {
    color: #6b7280;
}

.status-icon {
    font-size: 16px;
}

.success-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-btn, .delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.preview-btn {
    color: #6b7280;
}

.preview-btn:hover {
    background: #f3f4f6;
}

.delete-btn {
    color: #dc3545;
}

.delete-btn:hover {
    background: #f8d7da;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
    font-size: 16px;
}

/* Icon styles */
.icon {
    font-size: 16px;
}

.success-icon {
    color: #28a745;
    font-size: 16px;
}

.error-icon {
    color: #dc3545;
    font-size: 16px;
}

/* OLE_MULTIPLE Drag & Drop Styles */
.drag-drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    position: relative;
}

.drag-drop-zone.drag-over {
    border-color: #9ca3af;
    background: #f3f4f6;
    transform: scale(1.02);
}

.drag-drop-content {
    pointer-events: none;
}

.drag-drop-text {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 16px;
    font-weight: 500;
}

.browse-btn {
    display: inline-block;
    background: #6b7280;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    pointer-events: auto;
    border: none;
}

.browse-btn:hover {
    background: #4b5563;
}

.file-info {
    font-size: 14px;
    color: #6c757d;
    margin-top: 12px;
}

.upload-status-multi {
    margin-top: 16px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    min-height: 20px;
}

.upload-status-multi.uploading {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.upload-status-multi.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-status-multi.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Current Images Grid */
.current-images-grid {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    border: 2px solid #9ca3af;
}

.grid-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 8px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.image-grid-item {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.image-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.image-preview {
    position: relative;
    width: 100%;
    height: 100px;
    overflow: hidden;
    border-radius: 6px;
    background: #f8f9fa;
}

.grid-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-grid-item:hover .image-overlay {
    opacity: 1;
}

.preview-btn-small,
.remove-btn-small {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.preview-btn-small:hover {
    background: rgba(107,114,128,0.8);
}

.remove-btn-small:hover {
    background: rgba(220,53,69,0.8);
}

.image-filename-small {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== MODERN FORM WITH LEGACY LAYOUT (100% CSS Control) ===== */

/* Outer Form Container */
.form-container-wrapper {
  width: 100%;
  max-width: 95%;
  margin: 0 auto 20px auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  overflow: visible !important;
  box-sizing: border-box;
}

/* Top Header with Icons and Title */
.form-container-wrapper .form-header-bar {
  width: 100%;
  max-width: 100%;
  margin: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  background: #e5e7eb;
  border-radius: 0;
  padding: 16px 24px;
  box-shadow: none;
  box-sizing: border-box;
}

.form-header-bar {
  max-width: 95%;
  margin: 0 auto 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  background: #e5e7eb;
  border-radius: 12px 12px 0 0;
  padding: 16px 24px;
  box-shadow: none;
}


.form-nav-top {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.form-nav-top a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  color: #495057;
  font-size: 18px;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-nav-top a i {
  font-size: 18px;
}

.form-nav-top a:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #212529;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.15);
}

/* Page Title in Header Area - align with fields */
.form-title {
  font-size: 18px;
  font-weight: 500;
  color: #212529;
  margin: 0;
  flex: 1;
  padding-left: 0;
  margin-left: 220px;
}

/* Help Tip - Lightbulb & Tooltip */
.help-tip {
  margin-left: 8px;
  cursor: pointer;
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.help-tip-icon {
  fill: #bbb;
  transition: fill 0.2s ease;
  vertical-align: middle;
}

.help-tip:hover .help-tip-icon {
  fill: #999;
}

.help-tip .tooltip-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fffde7;
  color: #333;
  border: 1px solid #e0d88c;
  padding: 10px 28px 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  min-width: 360px;
  max-width: 600px;
  text-align: left;
  word-wrap: break-word;
}

.help-tip .tooltip-content::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: #fffde7;
}

.help-tip .tooltip-content::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-bottom-color: #e0d88c;
}

.tooltip-close {
  position: absolute;
  top: 2px;
  right: 6px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  color: #999;
  line-height: 1;
}

/* Add Code Button (+ next to codes dropdowns) */
.add-code-btn {
  margin-left: 6px;
  padding: 1px 5px;
  background: #bbb;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 28px;
  line-height: 14px;
  vertical-align: middle;
  transition: background 0.2s ease;
  transform: scale(0.7);
}
.add-code-btn:hover {
  background: #999;
}

/* Add Code Modal */
#addCodeModalOverlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.add-code-modal {
  background: white;
  padding: 24px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.add-code-modal h2 {
  margin-top: 0;
  margin-bottom: 16px;
  text-align: center;
  font-size: 16px;
}
.add-code-modal input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}
.add-code-modal .add-code-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.add-code-modal .add-code-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.tooltip-close:hover {
  color: #333;
}

/* Form field icons */
.form-group i.fa,
.form-group .fa,
.form-content-area i.fa,
.form-content-area .fa {
  color: #1976d2;
}

.form-group i.fa:hover,
.form-group .fa:hover,
.form-content-area i.fa:hover,
.form-content-area .fa:hover {
  color: #1565c0;
}

/* Inner Content Area */
.form-container-wrapper .form-content-area {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto !important;
  background: #ffffff !important;
  border-radius: 0 !important;
  padding: 24px 24px 32px 24px !important;
  box-shadow: none;
  color: #333333;
  box-sizing: border-box;
}

.form-content-area {
  max-width: 1100px;
  margin: 0 auto !important;
  background: #ffffff !important;
  border-radius: 0 !important;
  padding: 24px 24px 32px 24px !important;
  box-shadow: none;
  color: #333333;
  box-sizing: border-box;
}

/* Form Group Styling - Horizontal Layout */
.form-group {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
}

.form-group label {
  min-width: 220px;
  max-width: 220px;
  font-weight: 600;
  color: #495057;
  font-size: 16px;
  text-align: right;
  padding-right: 12px;
  flex-shrink: 0;
}

.form-group input,
.form-group select,
.form-group textarea {
  flex: 1;
  max-width: 900px;
  padding: 12px 16px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.6;
  background-color: #ffffff;
  transition: all 0.2s ease;
  font-family: inherit;
  color: #2d3748;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: #a0aec0;
}

.form-group textarea {
  resize: both;
  min-height: 120px;
  font-size: 15px;
}

/* Align label to top for form groups with large content (textarea/editor) */
.form-group:has(textarea),
.form-group:has(.tinymce-editor-container),
.form-group:has(.wysiwyg-editor) {
  align-items: flex-start;
}

.form-group:has(textarea) > label,
.form-group:has(.tinymce-editor-container) > label,
.form-group:has(.wysiwyg-editor) > label {
  padding-top: 12px; /* Align with input padding */
}

.form-group select {
  cursor: pointer;
  padding-right: 40px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
}

/* Form Actions - Moved to footer */
.form-actions {
  display: none; /* Hide from original position */
}

/* Align form actions with input fields for settings forms */
.form-content-area .form-actions {
  display: none; /* Hide from original position */
}

.form-actions button[type="submit"],
.form-actions .btn-cancel,
.form-nav-bottom .form-actions button[type="submit"],
.form-nav-bottom .form-actions .btn-cancel {
  background: #6b7280 !important;
  color: white !important;
  border: none;
  padding: 14px 50px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
  max-width: 200px;
  width: 200px;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.form-actions button[type="submit"]:hover,
.form-actions .btn-cancel:hover,
.form-nav-bottom .form-actions button[type="submit"]:hover,
.form-nav-bottom .form-actions .btn-cancel:hover {
  background: #4b5563 !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.5);
}

.form-actions button[type="submit"]:disabled,
.form-nav-bottom .form-actions button[type="submit"]:disabled {
  background: #718096;
  cursor: not-allowed;
  transform: none;
}

.form-actions button[type="submit"] .spinner,
.form-nav-bottom .form-actions button[type="submit"] .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.form-actions button[type="submit"].loading .spinner,
.form-nav-bottom .form-actions button[type="submit"].loading .spinner {
  display: inline-block;
}

.form-actions button[type="submit"].loading .btn-text,
.form-nav-bottom .form-actions button[type="submit"].loading .btn-text {
  display: none;
}

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

/* Bottom Navigation Icons with Form Actions - Light Gray Footer */
.form-container-wrapper .form-nav-bottom {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-radius: 0;
  background: #e5e7eb;
  box-sizing: border-box;
}

.form-nav-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  background: #e5e7eb;
  max-width: 95%;
  margin: 0 auto 20px auto;
  border-radius: 0 0 12px 12px;
}

.form-nav-bottom .form-actions {
  display: flex !important;
  justify-content: center;
  gap: 16px;
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  order: 1;
}

.form-nav-bottom .nav-icons {
  display: flex;
  gap: 16px;
  justify-content: center;
  order: 2;
}

.form-nav-bottom a:not(.btn-cancel) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  color: #495057;
  font-size: 18px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-nav-bottom a:not(.btn-cancel):hover {
  background: rgba(255, 255, 255, 0.9);
  color: #212529;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.15);
}

/* Scroll Up/Down Arrows - Keep Cyan/Teal */
.form-scroll-controls {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}

.scroll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: #6b7280;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(107, 114, 128, 0.3);
}

.scroll-btn:hover {
  background: #4b5563;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
}

/* File Upload Button Colors */
.ole-label-btn,
.upload-btn,
label.ole-label-btn,
label[for*="-file-input"],
label.file-upload-label {
  background: #6b7280 !important;
  color: white !important;
  border: none !important;
}

.ole-label-btn:hover,
.upload-btn:hover,
label.ole-label-btn:hover,
label[for*="-file-input"]:hover,
label.file-upload-label:hover {
  background: #4b5563 !important;
  color: white !important;
}

input[type="file"] + label {
  background: #6b7280 !important;
  color: white !important;
  border: none !important;
}

input[type="file"] + label:hover {
  background: #4b5563 !important;
  color: white !important;
}

/* Responsive Form Design */
@media (max-width: 768px) {
  .form-header-bar {
    margin: 0 -20px 16px -20px;
    border-radius: 0;
    padding: 16px;
  }
  
  .form-title {
    font-size: 20px;
  }
  
  .form-content-area {
    margin: 0 -20px 16px -20px;
    border-radius: 0;
    padding: 20px;
  }
  
  .form-group {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-bottom: 12px;
  }
  
  .form-group label {
    text-align: left;
    min-width: unset;
    max-width: unset;
    font-size: 13px;
    margin-bottom: 2px;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    max-width: 100%;
    font-size: 15px;
  }
  
  .form-group select {
    padding-right: 40px !important;
  }
  
  .form-nav-bottom {
    flex-direction: column;
    gap: 16px;
  }
  
  .form-nav-bottom .form-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .form-nav-bottom .form-actions button,
  .form-nav-bottom .form-actions .btn-cancel,
  .form-nav-bottom .form-actions button[type="submit"],
  .form-nav-bottom .form-actions a.btn-cancel {
    width: 100%;
    max-width: 100%;
    padding: 12px 32px !important;
    font-size: 14px !important;
    height: auto !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }
  
  .form-nav-bottom .nav-icons {
    justify-content: center;
  }
  
  .form-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .form-actions button,
  .form-actions .btn-cancel,
  .form-actions button[type="submit"],
  .form-actions a.btn-cancel {
    width: 100%;
    padding: 12px 32px !important;
    font-size: 14px !important;
    height: auto !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }
  
  .form-scroll-controls {
    right: 16px;
  }
  
  .scroll-btn {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
}

/* ===== LIST TABLE IMPROVEMENTS ===== */

/* Sort indicator styles */
.sort-indicator {
  font-size: 14px;
  color: #64748b; /* Default visibility (same as hover) */
  opacity: 1;
  font-weight: 900; /* Bold by default */
  transition: all 0.2s ease;
  display: inline-block;
  line-height: 1;
  margin-left: 6px;
}

.sort-indicator.active {
  color: #dc3545; /* Red for active sort */
  opacity: 1;
  font-weight: 900;
  font-size: 16px;
}

th:hover .sort-indicator {
  opacity: 1;
  color: #64748b;
}

th:hover .sort-indicator.active {
  color: #b91c1c; /* Darker red on hover */
}

/* Table width and layout improvements - adaptive based on content */
#list-content table {
  width: auto;
  min-width: 100%;
  table-layout: auto;
  margin-top: 0px;
}

#list-content {
  overflow-x: auto;
  overflow-y: visible;
  width: 100%;
  margin-top: 0px;
}

/* Hide scrollbar when not needed - only show when content overflows */
#list-content::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

#list-content::-webkit-scrollbar-track {
  background: transparent;
}

#list-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

#list-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Hide vertical scrollbar on list pages without pagination */
.list-page-box.no-pagination {
  overflow: visible;
}

.list-page-box.no-pagination::-webkit-scrollbar {
  display: none;
}

/* For Firefox */
.list-page-box.no-pagination {
  scrollbar-width: none;
}

/* Remove scrollbar from page content when no pagination */
.no-pagination #list-content {
  overflow: visible;
}

/* Action icons always visible */
/* Reserve space for action icons in header */
table th.actions-header {
  width: 130px !important;
  min-width: 130px !important;
  padding: 0 !important;
  border: none !important;
}

/* Table rows need relative positioning for absolute action icons */
table tbody tr {
  position: relative;
}

/* Actions cell - always visible on all rows */
table td:last-child:not([colspan]) {
  position: relative;
  white-space: nowrap;
  min-width: 130px !important;
  padding: 3px 12px !important;
  background: transparent;
  opacity: 1;
  visibility: visible;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
}

/* Highlight row on hover */
table tbody tr:hover {
  background-color: #f8fafc !important;
}

/* Action icons styling - circles */
table td:last-child a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #6b7280;
  transition: all 0.15s ease;
  border: none;
  font-size: 13px;
}

table td:last-child a.edit-link {
  color: #2563eb;
}

table td:last-child a.edit-link:hover {
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

table td:last-child a.delete-link {
  color: #dc2626;
}

table td:last-child a.delete-link:hover {
  color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

table td:last-child a.view-link {
  color: #6b7280;
}

table td:last-child a.view-link:hover {
  color: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(75, 85, 99, 0.2);
}

table td:last-child a.share-link {
  color: #6b7280;
}

table td:last-child a.share-link:hover {
  color: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(75, 85, 99, 0.2);
}

table td:last-child a.details-link {
  color: #7c3aed;
}

table td:last-child a.details-link:hover {
  color: #6d28d9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.2);
}

/* Reorder action icons: details, edit, delete */
table td:last-child a.details-link {
  order: 1;
}

table td:last-child a.edit-link {
  order: 2;
}

table td:last-child a.delete-link {
  order: 3;
}

/* Ensure table headers align properly */
table th {
  vertical-align: middle !important;
  padding: 3px 8px;
  line-height: 1.2;
}

table td {
  vertical-align: middle !important;
  padding: 3px 8px;
  line-height: 1.2;
}

/* Column alignment classes */
table th.align-left,
table td.align-left {
  text-align: left;
}

table th.align-center,
table td.align-center {
  text-align: center;
}

table th.align-right,
table td.align-right {
  text-align: right;
}

/* Auto-size table columns based on content */
#list-content table {
  width: auto;
  min-width: 100%;
  table-layout: auto;
  margin-top: 0px;
}

table th, table td {
  width: auto;
  white-space: nowrap;
}

/* Prevent wrapping and truncate with ellipsis - Force with !important */
table td:not(:last-child) {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 300px !important;
  display: table-cell;
}

/* Page actions button styling */
.page-actions a i {
  margin-right: 6px;
}

/* Search Form Styles */
.search-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    height: 38px;
    box-sizing: border-box;
    transition: all 0.2s;
    color: #000000 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: #ffffff !important;
    color: #000000 !important;
}

.search-btn {
    padding: 8px 12px;
    background: #94a3b8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    transition: all 0.2s;
}

.search-btn:hover {
    background: #7e8fa8;
    transform: translateY(-1px);
}

.clear-btn {
    padding: 8px 12px;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #475569;
    transform: translateY(-1px);
}

/* Icon styling for action buttons */
.action-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.action-icon i {
  font-size: 14px;
}

.edit-link {
  color: #6b7280;
}

.edit-link:hover {
  color: #4b5563;
}

.details-link {
  color: #8b5cf6;
}

.details-link:hover {
  color: #7c3aed;
}

.delete-link {
  color: #ef4444;
}

.delete-link:hover {
  color: #dc2626;
}

/* ===================================
   ADVANCED SEARCH STYLES
   =================================== */

.advanced-search-container {
  margin-bottom: 8px;
}

.advanced-search-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.btn-advanced-search {
  padding: 10px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-advanced-search:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-advanced-search i {
  font-size: 16px;
}

.btn-clear-search {
  padding: 10px 20px;
  background: #64748b;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-clear-search:hover {
  background: #475569;
}

.filters-active-badge {
  color: #3b82f6;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.advanced-search-form {
  background: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-top: 12px;
}

.advanced-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.search-field-group {
  margin-bottom: 12px;
}

.search-field-label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 14px;
  color: #334155;
}

.search-field-input,
.search-field-select {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  width: 100%;
  font-size: 14px;
  background: white;
  transition: border-color 0.2s ease;
}

.search-field-input:focus,
.search-field-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.advanced-search-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-search-submit {
  padding: 12px 24px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-search-submit:hover {
  background: #2563eb;
}

.btn-search-reset {
  padding: 12px 24px;
  background: #64748b;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-search-reset:hover {
  background: #475569;
}

.advanced-search-no-fields {
  padding: 40px 20px;
  text-align: center;
  color: #64748b;
}

.advanced-search-no-fields i {
  font-size: 48px;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.advanced-search-no-fields p {
  margin: 8px 0;
  font-size: 16px;
}

.advanced-search-no-fields .help-text {
  font-size: 14px;
  color: #94a3b8;
  margin-top: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .advanced-search-grid {
    grid-template-columns: 1fr;
  }
  
  .advanced-search-header {
    flex-wrap: wrap;
  }
  
  .btn-advanced-search,
  .btn-clear-search {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Advanced Search 3-Column Query Builder Styles */
.search-field,
.search-operator,
.search-value {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
}

.search-operator.error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.search-value:disabled {
  background-color: #f1f5f9;
}

.adv-search-add-btn {
  padding: 8px 12px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  transition: background 0.2s ease;
}

.adv-search-add-btn:hover {
  background: #059669;
}

.adv-search-submit-btn {
  padding: 8px 12px !important;
  background: #94a3b8 !important;
  color: white !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer;
  font-size: 14px !important;
  font-weight: 400 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  height: 38px !important;
  white-space: nowrap !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  min-width: auto !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  transform: none !important;
}

.adv-search-submit-btn:hover {
  background: #7e8fa8 !important;
  transform: none !important;
  box-shadow: none !important;
}

.adv-search-reset-btn {
  padding: 8px 12px !important;
  background: #94a3b8 !important;
  color: white !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer;
  font-size: 14px !important;
  font-weight: 400 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  height: 38px !important;
  white-space: nowrap !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  min-width: auto !important;
  transition: background 0.2s ease !important;
  box-shadow: none !important;
  transform: none !important;
}

.adv-search-reset-btn:hover {
  background: #7e8fa8 !important;
  transform: none !important;
  box-shadow: none !important;
}

.adv-search-error {
  color: #ef4444;
  font-size: 14px;
  font-weight: 500;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #fef2f2;
  border-radius: 6px;
  border: 1px solid #fecaca;
}

.adv-search-error i {
  font-size: 16px;
}

.adv-search-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ========================================
   USER FORMS MODULE STYLES
   ======================================== */

/* Hero Header */
.hero-header {
    text-align: center;
    margin-bottom: 40px;
}

.hero-content {
    display: inline-block;
    text-align: center;
}

.hero-icon {
    margin-bottom: 20px;
}

.hero-icon i {
    font-size: 64px;
    color: #6b7280;
}

.hero-text h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px 0;
}

.hero-text p {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

/* Forms Container */
.forms-horizontal-container {
    margin-bottom: 40px;
}

.forms-horizontal-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Form Cards */
.form-card-horizontal {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-card-horizontal:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #6b7280;
}

/* Card Icon */
.card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.card-icon i {
    font-size: 36px;
    color: white;
}

/* Card Content */
.card-content {
    flex: 1;
    text-align: center;
    margin-bottom: 20px;
}

.form-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px 0;
}

.form-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Card Action */
.card-action {
    margin-top: auto;
}

.customize-btn {
    width: 100%;
    padding: 12px 20px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.customize-btn:hover {
    background: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.customize-btn i {
    font-size: 16px;
}

/* No Forms State */
.no-forms {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.no-forms-icon {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.no-forms h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px 0;
}

.no-forms p {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

/* Error Container */
.error-container {
    text-align: center;
    padding: 60px 20px;
}

.error-container h1 {
    font-size: 28px;
    font-weight: 700;
    color: #ef4444;
    margin: 0 0 16px 0;
}

.error-container p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 24px 0;
}

.error-container button {
    padding: 12px 24px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-container button:hover {
    background: #4b5563;
}

/* Page Content for Form Details */
.page-content {
    padding: 32px;
}

.page-content h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 24px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .forms-horizontal-scroll {
        grid-template-columns: 1fr;
    }
    
    .hero-text h1 {
        font-size: 24px;
    }
    
    .hero-icon i {
        font-size: 48px;
    }
}

/* ========================================
   FORM STICKY HEADER
   ======================================== */
.form-header-bar.sticky-header {
    position: sticky !important;
    position: -webkit-sticky !important;
    top: 0 !important;
    z-index: 2000 !important;
    background: #ffffff !important;
    padding: 0 24px !important;
    height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border: 1px solid #e5e7eb !important;
    border-bottom: 2px solid #f3f4f6 !important;
    border-radius: 12px 12px 0 0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    max-width: 95% !important;
    box-sizing: border-box !important;
    margin: 10px auto 0 auto !important;
    transform: none !important;
}

.form-header-bar.sticky-header .header-left,
.form-header-bar.sticky-header .header-right {
    display: flex !important;
    align-items: center !important;
}

.form-header-bar.sticky-header .header-left {
    gap: 12px !important;
    flex: 1 !important;
}

.form-header-bar.sticky-header .header-right {
    justify-content: flex-end !important;
    gap: 12px !important;
}

.form-header-bar.sticky-header .form-nav-top,
.form-header-bar.sticky-header .form-actions-header {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.form-header-bar.sticky-header .form-nav-top {
    gap: 8px !important;
}

.form-header-bar.sticky-header .form-nav-top a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: #f3f4f6 !important;
    color: #4b5563 !important;
    transition: all 0.2s !important;
    text-decoration: none !important;
    margin: 0 !important;
}

.form-header-bar.sticky-header .form-nav-top a i {
    font-size: 16px !important;
}

.form-header-bar.sticky-header .form-nav-top a:hover {
    background: #e5e7eb !important;
    color: #1f2937 !important;
    transform: translateY(-1px) !important;
}

.form-header-bar.sticky-header .form-title {
    margin: 0 !important;
    font-size: 24px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
}

/* UI/UX Optimized sizes for SUBMIT and CANCEL buttons in header */
.form-header-bar.sticky-header .header-btn-submit,
.form-header-bar.sticky-header .header-btn-cancel {
    background: var(--btn-primary-bg) !important;
    color: var(--btn-primary-color) !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    height: 40px !important;
    min-height: 40px !important;
    width: 110px !important;
    min-width: 110px !important;
    padding: 0 16px !important;
    margin: 0 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    font-size: 14px !important;
    letter-spacing: 0.5px !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.form-header-bar.sticky-header .header-btn-submit:hover,
.form-header-bar.sticky-header .header-btn-cancel:hover {
    background: var(--btn-primary-hover-bg) !important;
    color: var(--btn-primary-hover-color) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Parent container fixes for sticky - sticky fails if any parent has overflow: hidden/auto/scroll or transform */
.main-content, 
.page-content, 
.container-fluid, 
.auction-grid,
.container,
.form-container-wrapper,
.d-flex,
body,
html {
    overflow: visible !important;
    transform: none !important;
    perspective: none !important;
    filter: none !important;
    height: auto !important; /* Fix flex items breaking sticky */
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

/* Specific fix for sidebar layout to allow body scrolling */
.d-flex {
    display: flex !important;
    min-height: 100vh !important;
}

.main-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
}

.form-header-bar.sticky-header .form-display-domain {
    color: #6b7280 !important;
    font-weight: 400 !important;
}

/* Ensure form content doesn't get hidden under sticky header */
.form-content-area {
    margin-top: 0 !important;
}

/* ========================================
   FORM DETAILS PAGE STYLES
   ======================================== */

/* Page Header */
.page-header.sticky-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 2000 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px 12px 0 0;
    margin: 10px auto 0 auto !important;
    max-width: 95% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.page-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.page-meta {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-back-header,
.btn-save,
.btn-reset,
.btn-cancel {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-back-header {
    background: #f3f4f6;
    color: #6b7280;
}

.btn-back-header:hover {
    background: #e5e7eb;
}

.btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

.btn-reset {
    background: #f59e0b;
    color: white;
}

.btn-reset:hover {
    background: #d97706;
}

.btn-save {
    background: #6b7280;
    color: white;
}

.btn-save:hover {
    background: #4b5563;
}

/* Form Fields Container */
.form-fields-container {
    background: white;
    padding: 0;
}

.fields-simple-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Field Cards */
.field-simple-card {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 32px;
    transition: all 0.2s ease;
}

.field-simple-card:hover {
    background: #f3f4f6;
}

.field-simple-content {
    display: grid;
    grid-template-columns: 24px 200px 1fr auto;
    align-items: center;
    gap: 16px;
}

.field-simple-icon {
    color: #9ca3af;
    font-size: 16px;
    cursor: grab;
}

.field-simple-icon:active {
    cursor: grabbing;
}

.field-simple-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.field-caption-display {
    cursor: pointer;
}

.field-caption-edit {
    padding: 6px 10px;
    border: 2px solid #6b7280;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.required-indicator {
    color: #ef4444;
    font-weight: 700;
}

.field-type-indicator {
    padding: 4px 10px;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.field-simple-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.field-required-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #dbeafe;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
}

.field-required-toggle:hover {
    background: #bfdbfe;
}

.required-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-btn {
    background: #dbeafe;
    color: #1d4ed8;
}

.edit-btn:hover {
    background: #bfdbfe;
}

.delete-btn {
    background: #fee2e2;
    color: #dc2626;
}

.delete-btn:hover {
    background: #fecaca;
}

.restore-btn {
    background: #d1fae5;
    color: #059669;
}

.restore-btn:hover {
    background: #a7f3d0;
}

/* Divider Field (Section Headers) */
.field-divider-card {
    background: #374151;
    color: white;
    padding: 12px 32px;
    border-bottom: none;
    margin: 8px 0;
}

.field-divider-card:hover {
    background: #4b5563;
}

.field-divider-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.field-divider-title {
    display: flex;
    align-items: center;
}

.field-divider-title .field-caption-display {
    font-size: 15px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-divider-title .field-caption-edit {
    background: white;
    color: #1f2937;
}

.field-divider-actions {
    display: flex;
    gap: 8px;
}

.field-divider-card .action-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.field-divider-card .action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Hidden Fields */
.field-hidden {
    opacity: 0.5;
    background: #fef2f2 !important;
}

.field-hidden .field-caption-display {
    text-decoration: line-through;
    color: #9ca3af;
}

/* Form Actions Bottom */
.form-actions-bottom {
    padding: 20px 32px;
    border-top: 1px solid #e5e7eb;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-actions-buttons {
    display: flex;
    gap: 12px;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.back-link:hover {
    color: #374151;
}

/* Responsive */
@media (max-width: 768px) {
    .field-simple-content {
        grid-template-columns: 20px 1fr;
        gap: 12px;
    }
    
    .field-type-indicator {
        display: none;
    }
    
    .page-header.sticky-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        top: 0 !important;
    }
    
    .page-header.sticky-header .page-meta {
        width: 100%;
        justify-content: flex-end;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
    
    .page-header.sticky-header .btn-back-header,
    .page-header.sticky-header .btn-save,
    .page-header.sticky-header .btn-reset,
    .page-header.sticky-header .btn-cancel {
        width: 100%;
        text-align: center;
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .page-meta {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============================================
   AUCTION PAYMENT REPORT STYLES
   Modern, professional design for payment reporting
   ============================================ */

/* Report Container */
.report-container {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 20px;
    background: #f8f9fa;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: auto;
}

/* Report Header */
.report-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 30px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.report-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 1 auto;
}

.report-title i {
    font-size: 32px;
    opacity: 0.9;
}

.report-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.report-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
}

.event-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.btn-print {
    background: white;
    color: #667eea;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Compact Search Box */
.compact-search-box {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 14px;
    gap: 10px;
    transition: all 0.3s ease;
    width: 250px;
    max-width: 100%;
    height: 42px;
    flex-shrink: 1;
}

.compact-search-box:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon-compact {
    color: #667eea;
    font-size: 18px;
    flex-shrink: 0;
}

.search-input-compact {
    border: none;
    outline: none;
    padding: 6px 10px;
    font-size: 15px;
    width: 100%;
    min-width: 100px;
    background: transparent;
    height: 100%;
}

.search-input-compact::placeholder {
    color: #9ca3af;
}

.btn-clear-compact {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 16px;
}

.btn-clear-compact:hover {
    background: #f3f4f6;
    color: #667eea;
}

/* Highlight Mark */
.highlight-mark {
    background: #ffeb3b;
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(255, 235, 59, 0.3);
}

/* Search Result Message */
.search-result-message {
    padding: 12px 20px;
    background: #d4edda;
    border-left: 4px solid #28a745;
    border-radius: 8px;
    color: #155724;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Section Container */
.section-container {
    background: white;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.section-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 30px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 22px;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    color: #667eea;
}

.section-actions {
    display: flex;
    gap: 12px;
}

.btn-export {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-export:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.section-content {
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

/* Summary Cards */
.summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 30px;
    width: 100%;
    box-sizing: border-box;
}

.summary-card {
    flex: 1 1 calc(33.333% - 16px);
    min-width: 250px;
}

@media (max-width: 1200px) {
    .summary-card {
        flex: 1 1 calc(50% - 12px);
    }
}

@media (max-width: 768px) {
    .summary-card {
        flex: 1 1 100%;
    }
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.3);
}

.summary-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.summary-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-card-icon {
    font-size: 48px;
    opacity: 0.9;
}

.summary-card-content h3 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px 0;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-value {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.summary-value.positive {
    color: #d4edda;
}

.summary-value.negative {
    color: #f8d7da;
}

/* Summary Table */
.summary-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    width: 100%;
    box-sizing: border-box;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table thead {
    background: #f8f9fa;
}

.summary-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    color: #2c3e50;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecef;
}

.summary-table td {
    padding: 14px 20px;
    color: #495057;
    border-bottom: 1px solid #f1f3f5;
}

.summary-table tbody tr:hover {
    background: #f8f9fa;
}

.amount-cell {
    font-weight: 700;
    color: #28a745;
    font-family: 'Courier New', monospace;
}

/* Payment Stats */
.payments-stats {
    display: flex;
    gap: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    font-weight: 600;
    color: #6c757d;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

/* Payments Table */
.payments-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.payments-table {
    width: 100%;
    border-collapse: collapse;
}

.payments-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.payments-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payments-table td {
    padding: 14px 20px;
    color: #495057;
    border-bottom: 1px solid #f1f3f5;
}

.payment-row:hover {
    background: #f8f9fa;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-unknown {
    background: #e9ecef;
    color: #6c757d;
}

/* No Data Messages */
.no-data-message {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-data-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-data-message h3 {
    font-size: 24px;
    color: #495057;
    margin: 0 0 12px 0;
}

.no-data-message p {
    font-size: 16px;
    margin: 0;
}

/* Error Container */
.error-container {
    max-width: 600px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.error-container h1 {
    color: #dc3545;
    font-size: 28px;
    margin-bottom: 20px;
}

.error-container p {
    color: #6c757d;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.btn-retry, .btn-back {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 8px;
    transition: all 0.3s ease;
}

.btn-retry {
    background: #667eea;
    color: white;
}

.btn-retry:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-back {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.btn-back:hover {
    background: #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .report-container {
        padding: 20px 15px;
    }
    
    .report-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .report-title h1 {
        font-size: 22px;
    }
    
    .report-meta {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .compact-search-box {
        flex: 1;
        min-width: 150px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .payments-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .payments-table-container {
        overflow-x: scroll;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Print Styles */
@media print {
    .compact-search-box,
    .btn-print,
    .btn-export,
    .sidebar {
        display: none !important;
    }
    
    .report-container {
        padding: 0;
    }
    
    .section-container {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* ============================================
   AUCTION ADMIN STYLES
   Card-based dashboard for auction links
   ============================================ */

/* Auction Admin Container */
.auction-admin-container {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 30px;
    background: var(--bg-primary, #0a0a0a) !important;
    min-height: 100vh;
    color: var(--text-primary, #ffffff);
}

/* Auction Admin Header */
.auction-admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.auction-admin-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.auction-admin-title i {
    font-size: 32px;
    opacity: 0.9;
}

.auction-admin-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auction-admin-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Info Banner */
.auction-info-banner {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.auction-info-banner i {
    font-size: 24px;
    color: #3b82f6;
    margin-top: 2px;
}

.auction-info-content h3 {
    margin: 0 0 8px 0;
    color: #1e40af;
    font-size: 18px;
    font-weight: 700;
}

.auction-info-content p {
    margin: 0;
    color: #1e3a8a;
    font-size: 15px;
    line-height: 1.5;
}

/* Auction Cards Grid */
.auction-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

/* Auction Card */
.auction-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.auction-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.auction-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Card Color Variants */
.auction-card-purple::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.auction-card-blue::before {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.auction-card-red::before {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.auction-card-green::before {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

/* Auction Card Icon */
.auction-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.auction-card-purple .auction-card-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auction-card-blue .auction-card-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.auction-card-red .auction-card-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.auction-card-green .auction-card-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Auction Card Content */
.auction-card-content {
    flex: 1;
}

.auction-card-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.auction-card-description {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Auction Card Button */
.auction-card-action {
    margin-top: auto;
}

.auction-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.auction-card-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    text-decoration: none;
}

.auction-card-purple .auction-card-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auction-card-blue .auction-card-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.auction-card-red .auction-card-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.auction-card-green .auction-card-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Help Section */
.auction-help-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.auction-help-section h3 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auction-help-section h3 i {
    color: #667eea;
}

.auction-help-section p {
    margin: 0 0 20px 0;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.6;
}

.auction-help-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.help-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f3f4f6;
    color: #4b5563;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.help-link:hover {
    background: #e5e7eb;
    color: #1f2937;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auction-admin-container {
        padding: 20px 15px;
    }
    
    .auction-admin-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .auction-admin-title h1 {
        font-size: 22px;
    }
    
    .auction-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .auction-help-links {
        flex-direction: column;
    }
    
    .help-link {
        justify-content: center;
    }
}

/* Print Styles for Auction Admin */
@media print {
    .auction-info-banner,
    .auction-help-section,
    .sidebar {
        display: none !important;
    }
    
    .auction-admin-container {
        padding: 0;
    }
    
    .auction-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .auction-card-btn {
        display: none;
    }
}

/* ============================================
   AUCTION SETTINGS STYLES
   Additional styles for AuctionSettings page
   ============================================ */

/* Settings-specific card adjustments */
.auction-admin-container .auction-card-btn i:last-child {
    transition: transform 0.3s ease;
}

.auction-admin-container .auction-card:hover .auction-card-btn i:last-child {
    transform: translateX(3px);
}

/* Error container improvements */
.error-container .btn-retry,
.error-container .btn-back {
    margin: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.error-container .btn-retry {
    background: #667eea;
    color: white;
    border: none;
}

.error-container .btn-retry:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.error-container .btn-back {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.error-container .btn-back:hover {
    background: #e9ecef;
}

/* ============================================
   AI SUPPORT CHAT INTERFACE STYLES
   ============================================ */

.ai-chat-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ai-chat-header {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-chat-header i {
    font-size: 32px;
    opacity: 0.9;
}

.ai-chat-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.ai-chat-window {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 600px;
    border: 1px solid #e9ecef;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8f9fa;
}

.ai-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: messageSlideIn 0.3s ease-out;
}

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

.ai-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message.assistant {
    align-self: flex-start;
}

.ai-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-message.user .ai-message-avatar {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.ai-message.assistant .ai-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-message-content {
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.ai-message.user .ai-message-content {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
}

.ai-chat-input-area {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    background: white;
    border-radius: 0 0 12px 12px;
}

.ai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.ai-chat-send-btn {
    padding: 12px 24px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat-send-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.ai-chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-loading {
    display: none;
    padding: 12px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.ai-loading.active {
    display: block;
}

.ai-loading i {
    margin-right: 8px;
}

.ai-error {
    display: none;
    padding: 12px 16px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    margin: 0 24px 16px 24px;
    border-left: 4px solid #dc2626;
    font-size: 14px;
}

.ai-error.active {
    display: block;
}

/* AI Chat Modal Popup Styles */
.ai-chat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px); /* Reduced from 4px to 2px (50% less) */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 0; /* Remove padding to eliminate white spacing */
    box-sizing: border-box;
    overflow: hidden; /* Prevent any overflow */
}

.ai-chat-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ai-chat-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: calc(100% - 40px); /* Account for padding on sides */
    max-width: 600px; /* Original width */
    max-height: 85vh;
    margin: 20px; /* Add margin instead of padding on overlay */
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.ai-chat-modal-overlay.active .ai-chat-modal-content {
    transform: scale(1) translateY(0);
}

.ai-chat-modal-header {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ai-chat-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-modal-title i {
    font-size: 24px;
}

.ai-chat-modal-title h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.ai-chat-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
}

.ai-chat-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ai-chat-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8f9fa;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.ai-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageSlideIn 0.2s ease-out;
}

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

.ai-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message.assistant {
    align-self: flex-start;
}

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.ai-message.user .ai-message-avatar {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.ai-message.assistant .ai-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-message-content {
    background: #ffffff;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    word-wrap: break-word;
}

.ai-message.user .ai-message-content {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
}

.ai-chat-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    background: white;
    flex-shrink: 0;
}

.ai-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.ai-chat-send-btn {
    padding: 10px 20px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.ai-chat-send-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.ai-chat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-loading {
    display: none;
    padding: 12px 20px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    flex-shrink: 0;
}

.ai-loading.active {
    display: block;
}

.ai-loading i {
    margin-right: 8px;
}

.ai-error {
    display: none;
    padding: 10px 14px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    margin: 0 20px 12px 20px;
    border-left: 4px solid #dc2626;
    font-size: 13px;
    flex-shrink: 0;
}

.ai-error.active {
    display: block;
}

/* Responsive Design for AI Chat Modal */
@media (max-width: 768px) {
    .ai-chat-modal-overlay {
        padding: 0;
    }
    
    .ai-chat-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
        margin: 0; /* Remove margin on mobile */
    }
    
    .ai-chat-modal-header {
        padding: 16px;
    }
    
    .ai-chat-modal-title h2 {
        font-size: 18px;
    }
    
    .ai-message {
        max-width: 90%;
    }
    
    .ai-message-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .ai-message-content {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .ai-chat-modal-footer {
        padding: 12px;
    }
    
    .ai-chat-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 14px;
    }
    
    .ai-chat-send-btn {
        min-width: 48px;
        padding: 12px;
    }
}

/* Newsletter Processing Styles */
.newsletter-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.newsletter-form-panel {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.newsletter-instructions {
    margin-bottom: 20px;
    color: #6b7280;
    line-height: 1.6;
}

.newsletter-categories-table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}

.newsletter-categories-table th {
    text-align: left;
    padding: 10px;
    background: #f3f4f6;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
}

.newsletter-categories-table td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.expiring-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.expiring-input-group input {
    width: 150px;
    /* Keep theme padding and other styles */
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.expiring-label {
    color: #6b7280;
}

.newsletter-form-actions {
    margin-top: 30px;
    display: flex !important;
    gap: 10px;
    width: 100%;
    justify-content: center;
    visibility: visible !important;
}

.newsletter-submit-btn,
.newsletter-cancel-btn {
    padding: 10px 30px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    min-width: 120px !important;
    display: inline-block !important;
    visibility: visible !important;
}

.newsletter-submit-btn {
    background-color: #000000 !important;
    color: #ffffff !important;
}

.newsletter-submit-btn:hover {
    background-color: #333333 !important;
    opacity: 1 !important;
}

.newsletter-cancel-btn {
    background-color: #000000 !important;
    color: #ffffff !important;
}

.newsletter-cancel-btn:hover {
    background-color: #333333 !important;
    opacity: 1 !important;
}

.newsletter-editor-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Ensure newsletter forms use theme standard form styling */
.newsletter-form-container .form-group select {
    padding-right: 40px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

.newsletter-form-container .form-group input,
.newsletter-form-container .form-group select,
.newsletter-form-container .form-group textarea,
.newsletter-editor-container .form-group input,
.newsletter-editor-container .form-group textarea,
.newsletter-email-list-container .form-group textarea {
    /* Inherit theme defaults - no overrides needed */
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    background-color: #ffffff;
    box-sizing: border-box;
}

.newsletter-editor-container .form-group textarea {
    min-height: 500px;
    font-family: Arial, sans-serif;
}

.newsletter-info {
    margin-bottom: 20px;
    color: #6b7280;
}

.newsletter-email-list-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.newsletter-email-list-textarea {
    width: 100% !important;
    padding: 12px !important;
    font-family: monospace !important;
    white-space: pre-wrap !important;
    background-color: #ffffff !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    color: #111827 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    min-height: 300px !important;
}

.newsletter-content-preview {
    max-width: 600px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
}

.newsletter-welcome {
    text-align: center;
    color: #111827;
    margin-bottom: 20px;
}

.newsletter-featured {
    color: #6b7280;
    border-bottom: 2px solid #d1d5db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.newsletter-article {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.newsletter-article-heading {
    color: #111827;
    margin-bottom: 10px;
}

.newsletter-article-body {
    color: #6b7280;
    line-height: 1.6;
}

.wysiwyg-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 11000;
}

.wysiwyg-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 11001;
    border-radius: 0;
    box-shadow: none;
}

.wysiwyg-modal-header {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wysiwyg-modal-header h3 {
    margin: 0;
}

.wysiwyg-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #111827;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wysiwyg-modal-close:hover {
    opacity: 0.7;
}

.wysiwyg-modal-body {
    padding: 15px;
    height: calc(100vh - 60px);
    overflow: auto;
}

.wysiwyg-modal-body textarea {
    width: 100%;
    height: 100%;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
}

/* Embedded WYSIWYG Editor */
.wysiwyg-editor {
    width: 100%;
    min-height: 500px;
}

/* TinyMCE Editor Container */
.tox-tinymce {
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    position: relative !important;
    z-index: 1 !important;
}

.tox .tox-edit-area__iframe {
    background-color: #ffffff !important;
}

/* Ensure TinyMCE toolbar is clickable */
.tox .tox-toolbar,
.tox .tox-toolbar__group,
.tox .tox-toolbar__overflow,
.tox .tox-toolbar__primary,
.tox button,
.tox .tox-tbtn,
.tox .tox-split-button {
    pointer-events: auto !important;
    z-index: 10 !important;
    position: relative !important;
}

/* CRITICAL: Reset global button styles for TinyMCE toolbar */
.tox button,
.tox .tox-tbtn,
.tox .tox-split-button,
.tox .tox-tbtn--select,
.tox .tox-mbtn,
.tox-tinymce button,
.tinymce-fullscreen-modal .tox button {
    min-height: auto !important;
    min-width: auto !important;
    /* Let TinyMCE handle its own padding */
}

/* Let TinyMCE's own button styles apply properly */
.tox .tox-tbtn {
    width: 34px !important;
    height: 34px !important;
}

.tox .tox-tbtn--bespoke {
    width: auto !important;
}

.tox .tox-mbtn {
    height: auto !important;
}

/* Fix toolbar spacing - remove lines between wrapped toolbar rows */
.tox .tox-editor-header {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    border-bottom: none !important;
}

.tox .tox-toolbar-overlord {
    padding: 4px 0 8px 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
}

/* Remove borders between wrapped toolbar rows */
.tox .tox-toolbar {
    border-top: none !important;
    border-bottom: none !important;
    background: none !important;
}

.tox .tox-toolbar__primary {
    border: none !important;
    background: none !important;
}

/* Toolbar groups - subtle vertical separator between button groups */
.tox .tox-toolbar__group {
    padding: 0 4px !important;
    margin: 2px 0 !important;
    border: none !important;
}

.tox .tox-toolbar__group::after {
    content: '' !important;
    display: block !important;
    width: 1px !important;
    height: 24px !important;
    background: #e5e7eb !important;
    margin-left: 4px !important;
}

.tox .tox-toolbar__group:last-child::after {
    display: none !important;
}

/* Ensure proper spacing for edit area */
.tox .tox-edit-area {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: 1px solid #e5e7eb !important;
}

/* Ensure TinyMCE menubar is clickable */
.tox .tox-menubar {
    pointer-events: auto !important;
    z-index: 10 !important;
    position: relative !important;
}

/* Embedded TinyMCE should be able to fill the viewport when requested */
.tinymce-full-window { 
    --editor-vh-offset: 180px; /* dynamic; updated via JS based on layout */
    width: 100%;
}
.tinymce-full-window .tox-tinymce {
    height: calc(100vh - var(--editor-vh-offset)) !important;
    max-height: calc(100vh - var(--editor-vh-offset)) !important;
    width: 100% !important;
}
@media (max-width: 992px) {
    .tinymce-full-window { --editor-vh-offset: 140px; }
}
@media (max-width: 576px) {
    .tinymce-full-window { --editor-vh-offset: 110px; }
}

/* TinyMCE fullscreen modal footer - no z-index needed, footer is in normal flex flow */
.tinymce-fullscreen-modal .tinymce-modal-footer {
}

.tinymce-fullscreen-modal .tinymce-modal-footer button {
    cursor: pointer !important;
}

/* CRITICAL FIX: TinyMCE dialogs must appear above modal */
/* TinyMCE renders dialogs in these containers at body level */
.tox-tinymce-aux,
.tox-dialog-wrap,
.tox-dialog,
.tox-pop,
.tox-menu {
    z-index: 2147483647 !important;
}
/* Silver sink is a full-viewport invisible overlay for click-outside detection.
   Let clicks pass through it so modal footer buttons remain clickable. */
.tox-silver-sink {
    z-index: 2147483647 !important;
    pointer-events: none !important;
}
/* Re-enable pointer events on the actual visible dropdown/dialog elements inside the sink */
.tox-silver-sink .tox-menu,
.tox-silver-sink .tox-dialog,
.tox-silver-sink .tox-dialog-wrap,
.tox-silver-sink .tox-pop,
.tox-silver-sink .tox-collection,
.tox-silver-sink .tox-selectfield {
    pointer-events: auto !important;
}

/* Ensure backdrop for TinyMCE dialogs appears correctly */
.tox-dialog-wrap__backdrop {
    z-index: 100000 !important;
}

/* TinyMCE custom buttons styling */
.tox .tox-tbtn--select[aria-label*="Save"],
.tox .tox-tbtn--select[aria-label*="Cancel"],
.tox .tox-tbtn[title*="Save"],
.tox .tox-tbtn[title*="Cancel"] {
    background-color: #007bff !important;
    color: white !important;
    border-radius: 4px !important;
    margin-right: 8px !important;
}

.tox .tox-tbtn[title*="Cancel"] {
    background-color: #6c757d !important;
}

/* TinyMCE Fullscreen Modal Styles - kept minimal, inline styles handle layout */
.tinymce-editor-textarea {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    resize: none;
}

/* Page Designer Icon Button */
@keyframes pulse-grow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.pagedesigner-icon-btn {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 2px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #6b7280 !important;
    vertical-align: middle !important;
    animation: pulse-grow 2s ease-in-out infinite !important;
}

.pagedesigner-icon-btn:hover {
    color: #4b5563 !important;
}

.pagedesigner-icon-btn:active {
    transform: scale(0.95) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tinymce-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .tinymce-modal-header {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    
    .tinymce-modal-title {
        font-size: 16px;
    }
    
    .tinymce-modal-actions {
        width: 100%;
        margin-top: 8px;
        justify-content: flex-end;
    }
    
    .tinymce-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .tinymce-btn-text {
        display: none;
    }
}

/* ============================================
   REPORT GENERATION STYLES
   ============================================ */

/* Report Popup Overlay */
.report-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.report-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.report-popup {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.report-popup-header {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.report-popup-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-popup-title h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.report-popup-title i {
    font-size: 20px;
    color: white;
}

.report-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-popup-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 16px;
}

.report-popup-close:hover {
    background: rgba(255,255,255,0.25);
}

.btn-generate-sticky {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-generate-sticky:hover {
    background: rgba(255,255,255,0.25);
}

.report-popup-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 70px);
}

/* Report Links */
.report-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.report-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.report-link-item.single-link {
    background: #e8f4fd;
    border: 2px solid #0066cc;
}

.report-link-label {
    font-weight: 600;
    min-width: 60px;
    color: #333;
}

.report-link-url {
    flex: 1;
    color: #0066cc;
    text-decoration: none;
    word-break: break-all;
    font-size: 0.9rem;
}

.report-link-url:hover {
    text-decoration: underline;
}

/* Copy Button */
.copy-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.copy-btn:hover:not(:disabled) {
    background: #0056b3;
}

.copy-btn.copied {
    background: #28a745;
}

.copy-btn:disabled,
.copy-btn.disabled {
    background: #9fc3e8;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Spinning Icon Animation */
.spinning-icon {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* Format Selector */
.format-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.format-selector label {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.format-dropdown {
    padding: 8px 16px;
    font-size: 1rem;
    border: 2px solid #0066cc;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    min-width: 100px;
}

.format-dropdown:focus {
    outline: none;
    border-color: #004499;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

/* Report Actions Bottom */
.report-actions-bottom {
    margin-top: 20px;
    text-align: center;
}

.btn-open-report {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #28a745 0%, #20863b 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-open-report:hover {
    background: linear-gradient(135deg, #20863b 0%, #186930 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    color: white;
}

/* Column Selection Popup */
.column-select-popup {
    max-width: 500px;
}

.column-select-desc {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 0.95rem;
}

.column-select-actions-top {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-select-all,
.btn-select-none {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-select-all:hover,
.btn-select-none:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.columns-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 20px;
}

.column-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

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

.column-checkbox-item:hover {
    background-color: #f8f9fa;
}

.column-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.column-name {
    font-size: 0.95rem;
    color: #333;
}

.columns-loading,
.columns-error {
    padding: 20px;
    text-align: center;
    color: #666;
}

.columns-error {
    color: #dc3545;
}

.column-select-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.btn-cancel {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.btn-generate {
    padding: 10px 20px;
    border: none;
    background: linear-gradient(135deg, #28a745 0%, #20863b 100%);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-generate:hover {
    background: linear-gradient(135deg, #20863b 0%, #186930 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Dynamic Report Table Styles */
.report-dynamic-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.report-dynamic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.report-dynamic-title {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.report-dynamic-badges {
    display: flex;
    gap: 10px;
    align-items: center;
}

.report-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.report-badge-primary {
    background: #0066cc;
    color: white;
}

.report-badge-success {
    background: #28a745;
    color: white;
}

.report-dynamic-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.report-dynamic-table thead {
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
}

.report-dynamic-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #0055aa;
}

.report-dynamic-table td {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
}

.report-dynamic-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.report-dynamic-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Format Selectors Container */
.format-selectors {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* Report Popup Wide (for team reports) */
.report-popup-wide {
    max-width: 700px;
}

/* Report Loading State */
.report-loading {
    padding: 30px;
    text-align: center;
    color: #666;
    font-size: 1rem;
}

/* Team Reports Header */
.team-reports-header {
    padding: 15px;
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: white;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
}

.team-reports-count {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Team Report Item */
.team-report-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid #0066cc;
}

.team-report-item:hover {
    background: #e9ecef;
}

.team-report-item .team-name {
    min-width: 120px;
    font-weight: 600;
    color: #0066cc;
}

.team-report-item .report-link-url {
    flex: 1;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Small Open Button for Team Reports */
.btn-open-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #28a745;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-open-small:hover {
    background: #20863b;
    transform: scale(1.05);
    color: white;
}

/* Centered Top Navbar */
.top-navbar-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 24px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.top-navbar-centered .page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

/* Forms Grid - Horizontal Layout */
.forms-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 24px;
    justify-content: center;
}

.form-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    min-width: 180px;
    max-width: 220px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #6b7280;
}

.form-card .card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: #374151;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 32px;
}

.form-card .form-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
}

.form-card .form-actions {
    margin-top: auto;
}

.form-card .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-card .btn-primary:hover {
    background: #d97706;
}

.form-card .card-icon-link,
.form-card .form-title-link {
    text-decoration: none;
    color: inherit;
}

.form-card .form-title-link:hover .form-title {
    color: #f59e0b;
}

/* Auction Card Actions */
.auction-card-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.auction-card-btn-secondary {
    background: #374151 !important;
    border: none;
    cursor: pointer;
}

.auction-card-btn-secondary:hover {
    background: #4b5563 !important;
}

/* Payment Request Modal */
.payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.payment-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.payment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.payment-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.payment-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.payment-modal-body {
    padding: 32px 24px;
    text-align: center;
}

.payment-modal-body .payment-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.payment-modal-body p {
    color: #4b5563;
    margin: 0 0 12px 0;
    font-size: 15px;
}

.payment-modal-body .payment-amount {
    font-size: 36px;
    font-weight: 800;
    color: #10b981;
    margin: 16px 0 24px 0;
    padding: 16px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 12px;
    border: 2px solid #a7f3d0;
}

.payment-modal-body .payment-info {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.payment-modal-body .payment-info p {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 12px 0;
    color: #4b5563;
    font-size: 14px;
}

.payment-modal-body .payment-info p:first-child {
    margin-top: 0;
}

.payment-modal-body .payment-info p:last-child {
    margin-bottom: 0;
}

.payment-modal-body .payment-info i {
    color: #6b7280;
    width: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.payment-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.btn-modal-cancel {
    flex: 1;
    padding: 14px 24px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-modal-cancel:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn-modal-confirm {
    flex: 1;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-modal-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-modal-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Status Message */
.payment-modal .status-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.payment-modal .status-message.success {
    display: block;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.payment-modal .status-message.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.payment-modal-body .payment-confirm-hint {
    color: #9ca3af;
    font-size: 13px;
    margin-top: 16px;
}

/* ==========================================================================
   EDIT/NEW POPUP MODAL
   ========================================================================== */

.edit-popup-overlay {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
}

/* Body scroll lock when popup is open */
body.popup-open {
    overflow: hidden !important;
}

.edit-popup-modal {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.edit-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 12px 12px 0 0;
    position: relative;
    gap: 16px;
}

.edit-popup-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    flex: 0 1 auto;
    text-align: left;
    padding-right: 0;
}

/* Header actions container for SUBMIT and CANCEL buttons */
.edit-popup-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
    margin-right: 60px; /* Space for close button */
}

/* Submit button in popup header */
.popup-header-submit-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.popup-header-submit-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.popup-header-submit-btn:active {
    transform: translateY(0);
}

/* Cancel button in popup header */
.popup-header-cancel-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-header-cancel-btn:hover {
    background: #4b5563;
}

.edit-popup-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #6b7280;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 300;
    line-height: 1;
}

.edit-popup-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.edit-popup-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.edit-popup-loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-size: 16px;
}

.edit-popup-body .form-content-area {
    box-shadow: none !important;
    padding: 0 0 24px 0 !important;
    margin: 0 !important;
}

.edit-popup-body .form-header-bar,
.edit-popup-body .form-nav-bottom,
.edit-popup-body .form-nav-top,
.edit-popup-body .form-scroll-controls,
.edit-popup-body .form-container-wrapper {
    display: none !important;
}

/* Hide form-actions in popup body since buttons are now in popup header */
/* Note: This only affects popups, not regular pages */
#editPopupOverlay .edit-popup-body .form-actions,
#editPopupBody .form-actions {
    display: none !important;
}

/* Hide any list/table action buttons that might accidentally appear in popup forms */
.edit-popup-body .action-btn,
.edit-popup-body .btn-view,
.edit-popup-body .btn-edit,
.edit-popup-body .btn-delete,
.edit-popup-body [class*="action-cell"],
.edit-popup-body [class*="row-actions"],
.edit-popup-body [class*="list-actions"],
.edit-popup-body table:not(.form-table),
.edit-popup-body .data-table,
.edit-popup-body .list-table,
.edit-popup-body .form-group button:not([type="submit"]):not(.ole-label-btn):not(.add-code-btn),
.edit-popup-body .form-group a[onclick*="openEdit"],
.edit-popup-body .form-group a[onclick*="openNew"],
.edit-popup-body .form-group a[onclick*="delete"] {
    display: none !important;
}

/* Ensure form fields in popup only show the actual input, not any overlay buttons */
.edit-popup-body .form-group .field-wrapper {
    position: relative;
}
.edit-popup-body .form-group .field-wrapper > button:not(.ole-label-btn):not(.add-code-btn),
.edit-popup-body .form-group .field-wrapper > a:not(.ole-label-btn) {
    display: none !important;
}

/* ==========================================================================
   POPUP FORM GROUP STYLING - Match Master Form Horizontal Layout
   ========================================================================== */

/* Popup forms should have same horizontal layout as regular forms */
.edit-popup-body .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.edit-popup-body .form-group label {
    min-width: 180px;
    max-width: 180px;
    font-weight: 600;
    color: #495057;
    font-size: 15px;
    text-align: right;
    padding-right: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.edit-popup-body .form-group input,
.edit-popup-body .form-group select,
.edit-popup-body .form-group textarea {
    flex: 1;
    max-width: 450px;
    padding: 12px 16px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.6;
    background-color: #ffffff;
    transition: all 0.2s ease;
    font-family: inherit;
    color: #2d3748;
}

.edit-popup-body .form-group input:focus,
.edit-popup-body .form-group select:focus,
.edit-popup-body .form-group textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.edit-popup-body .form-group input:hover,
.edit-popup-body .form-group select:hover,
.edit-popup-body .form-group textarea:hover {
    border-color: #a0aec0;
}

.edit-popup-body .form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.edit-popup-body .form-group select {
    cursor: pointer;
    padding-right: 40px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

/* Help tip icons in popup forms */
.edit-popup-body .form-group .help-tip {
    flex-shrink: 0;
}

/* Responsive popup form on smaller screens */
@media (max-width: 768px) {
    .edit-popup-body .form-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .edit-popup-body .form-group label {
        text-align: left;
        min-width: unset;
        max-width: unset;
        padding-right: 0;
    }
    
    .edit-popup-body .form-group input,
    .edit-popup-body .form-group select,
    .edit-popup-body .form-group textarea {
        max-width: 100%;
    }
    
    /* Responsive header buttons */
    .edit-popup-header-actions {
        margin-right: 50px;
        gap: 6px;
    }
    
    .popup-header-submit-btn,
    .popup-header-cancel-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .edit-popup-header h2 {
        font-size: 18px;
    }
}

/* ==========================================================================
   IMPORT DATA POPUP STYLING (Orange Theme)
   ========================================================================== */

/* Import Data Popup Overlay */
.import-data-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.import-data-popup-overlay.active {
    opacity: 1;
}

/* Import Data Popup Content */
.import-data-popup-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.import-data-popup-overlay.active .import-data-popup-content {
    transform: translateY(0);
}

/* Import Data Popup Header - Orange Theme */
.import-data-popup-header {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.import-data-popup-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.import-data-popup-title h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.import-data-popup-title i {
    font-size: 20px;
}

/* Import Data Popup Close Button */
.import-data-popup-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.import-data-popup-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Import Data Popup Body */
.import-data-popup-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Import Data Popup Grid */
.import-data-popup-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Import Data Cards */
.import-data-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid #fed7aa;
    border-radius: 12px;
    text-decoration: none;
    color: #c2410c;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 140px;
}

.import-data-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(249, 115, 22, 0.2);
    border-color: #f97316;
    background: linear-gradient(145deg, #ffedd5 0%, #fed7aa 100%);
}

.import-data-card i {
    font-size: 36px;
    margin-bottom: 12px;
    color: #f97316;
    transition: transform 0.3s ease;
}

.import-data-card:hover i {
    transform: scale(1.15);
    color: #ea580c;
}

.import-data-card span {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.import-data-card-desc {
    font-size: 12px;
    color: #9a3412;
    margin: 0;
    opacity: 0.8;
}

/* Import Data Loading State */
.import-data-popup-loading {
    text-align: center;
    padding: 40px;
    color: #f97316;
}

/* Import Data Empty State */
.import-data-empty {
    text-align: center;
    padding: 40px;
    color: #9a3412;
}

.import-data-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #fed7aa;
}

.import-data-empty p {
    margin: 0;
    font-size: 15px;
}


 
 / *   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
       R E P O R T   P O P U P   S T Y L I N G   ( M o v e d   f r o m   s e p a r a t e   f i l e ) 
 
       = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   * / 
 
 
 
 / *   R e p o r t   P o p u p   H e a d e r   A c t i o n s   * / 
 
 . r e p o r t - h e a d e r - a c t i o n s   { 
 
         d i s p l a y :   f l e x ; 
 
         a l i g n - i t e m s :   c e n t e r ; 
 
         g a p :   1 2 p x ; 
 
         m a r g i n - l e f t :   a u t o ;   / *   P u s h   t o   t h e   r i g h t   * / 
 
 } 
 
 
 
 . b t n - g e n e r a t e - s t i c k y   { 
 
         b a c k g r o u n d - c o l o r :   # 2 8 a 7 4 5 ; 
 
         c o l o r :   w h i t e ; 
 
         b o r d e r :   n o n e ; 
 
         p a d d i n g :   8 p x   1 6 p x ; 
 
         b o r d e r - r a d i u s :   6 p x ; 
 
         f o n t - s i z e :   1 4 p x ; 
 
         f o n t - w e i g h t :   6 0 0 ; 
 
         c u r s o r :   p o i n t e r ; 
 
         d i s p l a y :   f l e x ; 
 
         a l i g n - i t e m s :   c e n t e r ; 
 
         g a p :   8 p x ; 
 
         t r a n s i t i o n :   b a c k g r o u n d - c o l o r   0 . 2 s ,   t r a n s f o r m   0 . 1 s ; 
 
         w h i t e - s p a c e :   n o w r a p ; 
 
         b o x - s h a d o w :   0   2 p x   4 p x   r g b a ( 0 , 0 , 0 , 0 . 1 ) ; 
 
 } 
 
 
 
 . b t n - g e n e r a t e - s t i c k y : h o v e r   { 
 
         b a c k g r o u n d - c o l o r :   # 2 1 8 8 3 8 ; 
 
         t r a n s f o r m :   t r a n s l a t e Y ( - 1 p x ) ; 
 
         b o x - s h a d o w :   0   4 p x   6 p x   r g b a ( 0 , 0 , 0 , 0 . 1 5 ) ; 
 
 } 
 
 
 
 . b t n - g e n e r a t e - s t i c k y : a c t i v e   { 
 
         t r a n s f o r m :   t r a n s l a t e Y ( 0 ) ; 
 
         b o x - s h a d o w :   0   1 p x   2 p x   r g b a ( 0 , 0 , 0 , 0 . 1 ) ; 
 
 } 
 
 
 
 . b t n - g e n e r a t e - s t i c k y   i   { 
 
         f o n t - s i z e :   1 4 p x ; 
 
 } 
 
 
 
 / *   H i d e   t h e   b o t t o m   a c t i o n s   a r e a   s i n c e   b u t t o n   m o v e d   t o   t o p   * / 
 
 . c o l u m n - s e l e c t - a c t i o n s   { 
 
         d i s p l a y :   n o n e   ! i m p o r t a n t ; 
 
 } 
 
 
 
 / *   A d j u s t   R e p o r t   P o p u p   H e a d e r   l a y o u t   * / 
 
 . r e p o r t - p o p u p - h e a d e r   { 
 
         d i s p l a y :   f l e x ; 
 
         j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ; 
 
         a l i g n - i t e m s :   c e n t e r ; 
 
         p a d d i n g :   1 6 p x   2 4 p x ; 
 
         b o r d e r - b o t t o m :   1 p x   s o l i d   # e 5 e 7 e b ; 
 
         b a c k g r o u n d - c o l o r :   # f f f ; 
 
         p o s i t i o n :   s t i c k y ; 
 
         t o p :   0 ; 
 
         z - i n d e x :   1 0 ; 
 
 } 
 
 
 
 . r e p o r t - p o p u p - t i t l e   { 
 
         d i s p l a y :   f l e x ; 
 
         a l i g n - i t e m s :   c e n t e r ; 
 
         g a p :   1 2 p x ; 
 
         m a r g i n :   0 ;   / *   O v e r r i d e   e x i s t i n g   m a r g i n   * / 
 
 } 
 
 
 
 . r e p o r t - p o p u p - t i t l e   h 2   { 
 
         m a r g i n :   0 ; 
 
         f o n t - s i z e :   1 8 p x ; 
 
         f o n t - w e i g h t :   6 0 0 ; 
 
         c o l o r :   # 1 1 1 8 2 7 ; 
 
 } 
 
 
 
 . r e p o r t - p o p u p - t i t l e   i   { 
 
         f o n t - s i z e :   1 8 p x ; 
 
         c o l o r :   # 4 b 5 5 6 3 ; 
 
 } 
 
 

/* ==========================================================================
   Bulk Table Updates - Spreadsheet Style Editing
   ========================================================================== */

/* sys-bulktable.css - Bulk Table Updates Styles */
/* Upload this file to R2 bucket */

* { box-sizing: border-box; }

.bulk-update-main {
    padding: 0;
    background: #f8f9fa;
    min-height: 100vh;
}

.bulk-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.bulk-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: rgba(255,255,255,0.2);
}

.bulk-header-title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-count-badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 8px;
}

.bulk-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bulk-header .search-container {
    position: relative;
}

.bulk-header .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.bulk-header .search-input {
    padding: 10px 12px 10px 38px;
    border: none;
    border-radius: 8px;
    width: 250px;
    font-size: 14px;
    background: rgba(255,255,255,0.1);
    color: white;
}

.bulk-header .search-input::placeholder {
    color: rgba(255,255,255,0.5);
}

.bulk-header .search-input:focus {
    outline: none;
    background: rgba(255,255,255,0.15);
}

.refresh-btn {
    background: #34a853;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    background: #2d8f47;
}

.save-status {
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s;
}

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

.save-status.saving {
    background: #fff3cd;
    color: #856404;
}

.save-status.success {
    background: #d4edda;
    color: #155724;
}

.save-status.error {
    background: #f8d7da;
    color: #721c24;
}

.table-container {
    padding: 20px 30px;
    overflow-x: auto;
}

.bulk-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
    table-layout: auto;
}

.bulk-table th,
.bulk-table td {
    text-align: left;
    vertical-align: middle;
}

.bulk-table th {
    background: #f8f9fa;
    padding: 14px 12px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    min-width: 80px;
}

.bulk-table th .th-content {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.2s;
    z-index: 1;
}

.resize-handle:hover,
.resize-handle.resizing {
    background: #1a73e8;
}

.row-num-header {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    text-align: center;
}

.bulk-table td {
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
}

.row-num {
    text-align: center;
    color: #999;
    font-size: 12px;
    padding: 10px !important;
    background: #fafafa;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
}

.bulk-table tbody tr:hover {
    background: #f8f9fa;
}

.bulk-table tbody tr:hover .row-num {
    background: #f0f0f0;
}

.editable-cell {
    position: relative;
}

.cell-input,
.cell-select,
.cell-textarea {
    width: 100%;
    border: none;
    padding: 12px;
    font-size: 13px;
    background: transparent;
    font-family: inherit;
}

.cell-input:focus,
.cell-select:focus,
.cell-textarea:focus {
    outline: none;
    background: #fff9e6;
    box-shadow: inset 0 0 0 2px #1a73e8;
}

.cell-input.changed,
.cell-select.changed {
    background: #fff9e6;
}

.cell-input.saved,
.cell-select.saved {
    background: #d4edda !important;
    animation: saveFlash 0.5s ease-out;
}

@keyframes saveFlash {
    0% { background: #34a853; }
    100% { background: #d4edda; }
}

.cell-textarea {
    min-height: 60px;
    resize: vertical;
}

.textarea-cell {
    min-width: 200px;
}

.loading-cell,
.empty-cell,
.error-cell {
    text-align: center;
    padding: 40px 20px !important;
    color: #666;
}

.error-cell {
    color: #c5221f;
}

@media (max-width: 768px) {
    .bulk-header {
        padding: 15px 20px;
    }
    
    .search-input {
        width: 180px;
    }
    
    .table-container {
        padding: 15px;
    }
}

/* ==========================================================================
   MOBILE RESPONSIVE OVERRIDES (max-width: 767px)
   ========================================================================== */
@media screen and (max-width: 767px) {
    /* Body and container adjustments */
    body {
        padding: 4px !important;
    }
    
    .list-page-box {
        padding: 8px 4px !important;
        margin: 0 !important;
    }
    
    /* Page header mobile */
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        padding: 8px 4px !important;
        position: relative !important;
        z-index: 998 !important;
    }
    
    .page-header h1 {
        font-size: 18px !important;
    }
    
    /* Navigation icons smaller */
    .list-nav-icons {
        gap: 6px !important;
    }
    
    .list-nav-icons a {
        width: 32px !important;
        height: 32px !important;
        font-size: 13px !important;
    }
    
    /* Page actions area */
    /* Page actions area - search must be visible */
    .page-actions {
        width: 100% !important;
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
        position: relative !important;
        z-index: 999 !important;
    }
    
    /* Hide advanced search wrapper on mobile to give space to main search */
    .page-actions .advanced-search-wrapper {
        display: none !important;
    }
    
    /* Table container */
    #list-content,
    .table-responsive,
    .table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 0 -4px !important;
        padding: 0 4px !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Table mobile styling */
    table {
        font-size: 12px !important;
        min-width: 600px !important;
    }
    
    table th {
        padding: 2px 4px !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
    }
    
    table td {
        padding: 2px 4px !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
    }
    
    /* Action icons mobile */
    table td:last-child:not([colspan]) {
        padding: 2px 6px !important;
        gap: 3px !important;
    }
    
    table td:last-child a {
        width: 24px !important;
        height: 24px !important;
        font-size: 11px !important;
    }
    
    /* Pagination mobile - Force horizontal layout */
    .pagination-container {
        flex-direction: column !important;
        gap: 8px !important;
        padding: 12px 4px !important;
        align-items: center !important;
        display: flex !important;
    }
    
    /* CRITICAL: .pagination-controls contains all page links - MUST be horizontal row */
    .pagination-controls {
        display: flex !important;
        flex-flow: row wrap !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Force horizontal pagination numbers - target all pagination containers */
    .pagination-nav,
    .pagination,
    div.pagination-nav,
    div.pagination,
    div.pagination-controls {
        display: flex !important;
        flex-flow: row wrap !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* All pagination links - FORCE horizontal inline display */
    .pagination-link,
    .pagination-controls a,
    .pagination-controls span,
    .pagination-controls .pagination-link,
    .pagination-controls > a,
    .pagination-controls > span,
    .pagination-nav a,
    .pagination-nav span,
    .pagination a,
    .pagination span,
    a.pagination-link,
    span.pagination-link {
        min-width: 36px !important;
        width: auto !important;
        max-width: none !important;
        height: 36px !important;
        font-size: 13px !important;
        padding: 0 8px !important;
        margin: 2px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        border-radius: 6px !important;
        float: none !important;
        clear: none !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }
    
    .pagination-info {
        font-size: 12px !important;
        text-align: center !important;
        order: -1 !important;
        width: 100% !important;
        padding: 4px 0 !important;
        display: block !important;
    }
    
    .pagination-size {
        order: 1 !important;
        font-size: 12px !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 4px 0 !important;
    }
    
    .pagination-size label {
        display: inline !important;
    }
    
    .pagination-size select {
        font-size: 14px !important;
        padding: 4px 8px !important;
        min-width: 60px !important;
        display: inline-block !important;
    }
    
    /* Search mobile - Force visibility */
    .search-form,
    .page-actions .search-form,
    form.search-form {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 200px !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: relative !important;
        z-index: 1001 !important;
        display: block !important;
    }
    
    .search-input-wrapper,
    .search-form .search-input-wrapper,
    .page-actions .search-form .search-input-wrapper,
    form.search-form .search-input-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 200px !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: relative !important;
        z-index: 1002 !important;
        pointer-events: auto !important;
        background: #ffffff !important;
        border-radius: 8px !important;
    }
    
    .search-input,
    input[type="text"].search-input,
    input.search-input,
    .search-form .search-input,
    .search-input-wrapper .search-input,
    .page-actions .search-input,
    input#searchInput,
    input[name="search"] {
        font-size: 16px !important;
        width: 100% !important;
        min-width: 200px !important;
        max-width: 100% !important;
        display: block !important;
        box-sizing: border-box !important;
        padding: 8px 40px 8px 12px !important;
        height: 40px !important;
        min-height: 40px !important;
        line-height: 24px !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        color: #000000 !important;
        background-color: #ffffff !important;
        background: #ffffff !important;
        position: relative !important;
        z-index: 1003 !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        touch-action: manipulation !important;
        -webkit-user-select: text !important;
        -moz-user-select: text !important;
        user-select: text !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1) !important;
        border: 2px solid #64748b !important;
        border-radius: 8px !important;
        cursor: text !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        outline: none !important;
    }
    
    .search-input::placeholder,
    input[type="text"].search-input::placeholder {
        color: #94a3b8 !important;
        opacity: 0.7 !important;
    }
    
    .search-input:focus,
    input[type="text"].search-input:focus {
        outline: 2px solid #3b82f6 !important;
        outline-offset: 0 !important;
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2) !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .search-input-wrapper .search-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        right: 4px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        color: #64748b !important;
        background: transparent !important;
        position: absolute !important;
        z-index: 1004 !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
    }
    
    /* Button mobile */
    .btn-new,
    a.btn-new {
        height: 32px !important;
        padding: 0 10px !important;
        font-size: 12px !important;
        flex-shrink: 0 !important;
    }
    
    /* Form group mobile - reduce gaps between labels and inputs */
    .form-group {
        margin-bottom: 12px !important;
    }
    
    .form-group label {
        margin-bottom: 2px !important;
        font-size: 13px !important;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px !important;
    }
    
    .form-group select {
        padding-right: 40px !important;
    }
    
    .modal-form-group {
        margin-bottom: 12px !important;
    }
    
    .modal-form-group label {
        margin-bottom: 2px !important;
    }
    
    /* Form buttons - same size for cancel and submit */
    .form-actions button,
    .form-actions .btn-cancel,
    .form-actions button[type="submit"],
    .form-actions a.btn-cancel,
    .form-nav-bottom .form-actions button,
    .form-nav-bottom .form-actions .btn-cancel,
    .btn-cancel,
    .btn-submit,
    button[type="submit"] {
        width: 100% !important;
        padding: 12px 32px !important;
        font-size: 14px !important;
        height: auto !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
    }
}

/* ==========================================================================
   List View Table Styles - Compact rows and improved spacing
   ========================================================================== */

/* Reduce space above page header (title and navigation icons) */
.page-header {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
.list-page-box {
  margin-top: 0 !important;
}
/* Target the container that wraps page-header to reduce top spacing */
.container > .list-page-box {
  margin-top: 0 !important;
}
/* Move navigation icons down by 10px total */
.list-nav-icons {
  margin-top: 10px !important;
  padding-top: 0 !important;
  margin-bottom: 0 !important;
}
/* Reduce h1 top margin if present */
.page-header h1 {
  margin-top: 0 !important;
  padding-top: 0 !important;
  margin-bottom: 0 !important;
}
/* Reduce spacing in the flex container */
.page-header > div:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Increase table container and table width by 25% and improve column spacing */
.container {
  max-width: 95% !important; /* Increase from default (usually 80-90%) to 95% */
  width: 95% !important;
}
.list-page-box {
  width: 100% !important;
  max-width: none !important;
  padding-bottom: 24px !important; /* Add bottom padding to show border and pagination */
  margin-bottom: 10px !important; /* Add bottom margin for spacing */
}
#list-content {
  width: 100% !important;
  max-width: none !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important; /* Smooth scrolling on iOS */
  scroll-behavior: smooth !important;
  padding-bottom: 0px !important; /* Remove bottom padding */
  margin-bottom: 0px !important; /* Remove bottom margin */
}
#list-content table {
  width: 100% !important;
  max-width: none !important;
  table-layout: auto !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

/* Reduce row spacing - compact rows to show pagination without scrolling */
#list-content table tbody tr {
  height: auto !important;
  line-height: 0.95 !important; /* Further reduced from 1.0 to 0.95 for maximum compactness */
  margin: 0 !important;
  padding: 0 !important;
}

/* Table header - increase height of field titles */
#list-content table thead th:not(.actions-header) {
  padding: 10px 20px !important; /* Increased vertical padding for header titles */
  min-width: 100px !important;
}

/* Table body cells - minimal vertical padding to make rows as compact as possible */
#list-content table td:not(:last-child) {
  padding: 0px 20px !important; /* Reduced vertical padding to 0px, kept horizontal at 20px */
  min-width: 100px !important; /* Minimum width to prevent cramping, auto-sizing handles the rest */
}
/* First column gets extra left padding */
#list-content table thead th:first-child:not(.actions-header) {
  padding-left: 24px !important;
  padding-top: 10px !important; /* Increased vertical padding for header */
  padding-bottom: 10px !important;
}
#list-content table td:first-child:not(:last-child) {
  padding-left: 24px !important;
  padding-top: 0px !important; /* Minimal vertical padding */
  padding-bottom: 0px !important;
}

/* Fix action icons overflow issue - ensure they're visible */
/* Minimal vertical padding to match other cells */
#list-content table td:last-child,
#list-content table td.actions-cell {
  padding: 0px 20px !important; /* Reduced vertical padding to 0px */
  text-align: right !important;
  overflow: visible !important;
  min-width: 150px !important;
  width: 150px !important;
  display: table-cell !important; /* Ensure cell is displayed */
}
/* Ensure action cell wrapper div doesn't hide content */
#list-content table td:last-child > div,
#list-content table td.actions-cell > div {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure action icons are visible - very specific selectors */
#list-content .action-icon,
#list-content table .action-icon,
#list-content table td .action-icon,
.action-icon.view-link,
.action-icon.share-link,
.action-icon.edit-link,
.action-icon.delete-link,
.action-icon.details-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  padding: 0px !important; /* Reduced to 0px */
  margin: 0 2px !important; /* Keep minimal horizontal spacing */
  text-decoration: none !important;
  vertical-align: middle !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
}
#list-content .action-icon svg,
#list-content table .action-icon svg,
.action-icon svg {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 20px !important;
  height: 20px !important;
}
.actions-header {
  min-width: 150px !important;
  padding: 10px 20px !important; /* Increased vertical padding for header */
  text-align: right !important;
  display: table-cell !important;
}

/* Mobile-friendly responsive styles */
@media screen and (max-width: 768px) {
  /* Reduce padding on mobile for better space utilization */
  #list-content table th:not(.actions-header),
  #list-content table td:not(:last-child) {
    padding: 8px 12px !important;
    min-width: 80px !important; /* Smaller min-width on mobile */
  }
  #list-content table th:first-child:not(.actions-header),
  #list-content table td:first-child:not(:last-child) {
    padding-left: 12px !important;
  }
  /* Smaller action column on mobile */
  #list-content table td:last-child {
    padding: 8px 12px !important;
    min-width: 120px !important;
    width: 120px !important;
  }
  .actions-header {
    min-width: 120px !important;
    padding: 8px 12px !important;
  }
  /* Tighter spacing for action icons on mobile */
  .action-icon {
    padding: 4px !important;
    margin: 0 3px !important;
  }
}

/* Extra small mobile devices */
@media screen and (max-width: 480px) {
  #list-content table th:not(.actions-header),
  #list-content table td:not(:last-child) {
    padding: 6px 8px !important;
    min-width: 60px !important;
    font-size: 0.9em !important;
  }
  #list-content table td:last-child {
    padding: 6px 8px !important;
    min-width: 100px !important;
    width: 100px !important;
  }
  .actions-header {
    min-width: 100px !important;
    padding: 6px 8px !important;
  }
  .action-icon {
    padding: 3px !important;
    margin: 0 2px !important;
  }
  .action-icon svg {
    width: 16px !important;
    height: 16px !important;
  }
}

/* ==========================================================================
   PAID FORMS - Mobile-First Payment Form Styles
   ========================================================================== */

/* Payment form container */
.payment-form {
  max-width: 750px;
  margin: 0 auto;
  padding: 20px;
}

@media (max-width: 576px) {
  .payment-form {
    padding: 12px;
  }
}

/* Payment form header */
.payment-form .text-center h2 {
  font-size: 1.5rem;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.payment-form .text-muted {
  color: #6b7280;
  font-size: 0.95rem;
}

/* Section headers */
.payment-form section h5 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

/* File upload component - mobile-friendly */
.pf-file-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  flex-wrap: wrap;
}

.pf-file-upload-label {
  background: #6b7280;
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  transition: background 0.2s;
  min-height: 44px; /* Touch-friendly */
}

.pf-file-upload-label:hover {
  background: #4b5563;
}

.pf-file-upload-label span,
.pf-file-icon {
  margin-right: 6px;
}

.pf-file-input {
  display: none;
}

.pf-file-status {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #495057;
  font-size: 14px;
}

/* Price tag for file uploads */
.pf-file-price {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* Pricing summary box */
.pf-pricing-summary {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.pf-pricing-summary hr {
  border: 0;
  border-top: 1px solid #dee2e6;
  margin: 12px 0;
}

/* Credit card section placeholder */
.pf-credit-card-section {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

/* Buttons */
.pf-btn-pay {
  background: #10b981;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.2s;
}

.pf-btn-pay:hover {
  background: #059669;
}

.pf-btn-pay:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.pf-btn-cancel {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  min-height: 48px;
  transition: all 0.2s;
}

.pf-btn-cancel:hover {
  background: #e5e7eb;
}

/* Form inputs in payment form - ensure touch-friendly */
.payment-form .form-control {
  min-height: 44px;
  font-size: 16px; /* Prevents iOS zoom */
  padding: 10px 12px;
}

.payment-form .form-select {
  min-height: 44px;
  font-size: 16px;
  padding: 10px 12px;
}

.payment-form .form-label {
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

/* Input group styling */
.payment-form .input-group-text {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
}

/* Mobile-specific adjustments */
@media (max-width: 767px) {
  .payment-form section h5 {
    font-size: 1rem;
  }

  .payment-form .row {
    margin-left: -8px;
    margin-right: -8px;
  }

  .payment-form .row > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
  }

  .payment-form .mb-3 {
    margin-bottom: 12px !important;
  }

  .payment-form .mb-4 {
    margin-bottom: 16px !important;
  }

  .pf-file-upload {
    padding: 10px;
  }

  .pf-file-upload-label {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
  }

  .pf-file-status {
    width: 100%;
    justify-content: center;
  }

  /* Stack buttons on mobile */
  .payment-form .d-md-flex {
    flex-direction: column;
  }

  .payment-form .d-md-flex .pf-btn-pay,
  .payment-form .d-md-flex .pf-btn-cancel {
    width: 100%;
    margin-bottom: 8px;
  }
}

/* =============================================
   Dashboard Popup & Modal Styles
   (Moved from inline <style> for performance)
   ============================================= */

/* --- Form Details Popup --- */
#formDetailsPopupOverlay .edit-popup-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 24px 20px !important;
    gap: 16px !important;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%) !important;
    position: relative !important;
    min-height: auto !important;
}
#formDetailsPopupOverlay .edit-popup-header h2,
#formDetailsPopupOverlay #formDetailsPopupTitle {
    margin: 0 !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: white !important;
    width: 100% !important;
    order: 1 !important;
}
#formDetailsPopupOverlay .header-actions-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    order: 2 !important;
    gap: 12px !important;
}
#formDetailsPopupOverlay #formDetailsPopupActions {
    display: flex !important;
    gap: 8px !important;
    flex: 1 !important;
    justify-content: flex-start !important;
}
#formDetailsPopupOverlay .edit-popup-close {
    position: relative !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    background: rgba(255,255,255,0.2) !important;
    border-radius: 8px !important;
    color: white !important;
    font-size: 28px !important;
    order: 3 !important;
    transform: none !important;
    top: auto !important;
    right: auto !important;
}
@media (min-width: 992px) {
    #formDetailsPopupOverlay .edit-popup-header {
        flex-direction: row !important;
        padding: 16px 24px !important;
    }
    #formDetailsPopupOverlay .edit-popup-header h2 {
        width: auto !important;
    }
    #formDetailsPopupOverlay .header-actions-group {
        width: auto !important;
        flex: 1 !important;
        justify-content: flex-end !important;
    }
}

#formDetailsPopupOverlay .edit-popup-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    background: #f9fafb;
}
#formDetailsPopupOverlay .edit-popup-loading {
    text-align: center;
    padding: 60px;
    color: #6b7280;
    font-size: 16px;
}
#formDetailsPopupBody .form-header-card {
    display: none !important;
}
#formDetailsPopupBody .field-simple-card {
    background: transparent;
    border: none;
    padding: 12px 0;
    margin-bottom: 0;
    border-bottom: 1px solid #e5e7eb;
}
#formDetailsPopupBody .field-simple-card:last-child {
    border-bottom: none;
}
#formDetailsPopupBody .field-simple-content {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 16px !important;
}
#formDetailsPopupBody .field-simple-title {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 600px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
#formDetailsPopupBody .field-caption-edit,
#formDetailsPopupBody input[type="text"].field-caption-edit {
    width: 100% !important;
    max-width: 600px !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    background: white !important;
    flex-shrink: 1 !important;
}
#formDetailsPopupBody .field-caption-display {
    display: none !important;
}
#formDetailsPopupBody .field-simple-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
}
#formDetailsPopupBody .required-indicator {
    color: #ef4444;
    font-weight: bold;
    margin-left: 4px;
}
#formDetailsPopupBody .field-required-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
}
#formDetailsPopupBody .action-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
#formDetailsPopupBody .action-btn.edit-btn {
    display: none !important;
}
#formDetailsPopupBody .action-btn.delete-btn,
#formDetailsPopupBody .action-btn.restore-btn {
    background: #6b7280 !important;
    color: white !important;
}
#formDetailsPopupBody .action-btn:hover {
    opacity: 0.9;
}
#formDetailsPopupBody .field-divider-card {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    color: white;
}
#formDetailsPopupBody .field-divider-card .field-caption-edit,
#formDetailsPopupBody .field-divider-card input[type="text"].field-caption-edit {
    width: 100% !important;
    max-width: 600px !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    background: rgba(255,255,255,0.95) !important;
    color: #374151 !important;
    border: 1px solid rgba(255,255,255,0.5) !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    flex-shrink: 1 !important;
}
#formDetailsPopupBody .field-divider-actions .action-btn {
    background: rgba(255,255,255,0.25) !important;
    color: white !important;
}
#formDetailsPopupBody .field-divider-actions .action-btn.edit-btn {
    display: none !important;
}
#formDetailsPopupActions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
#formDetailsPopupActions .btn-cancel {
    background: #f3f4f6;
    color: #495057;
    border: 1px solid #e5e7eb;
}
#formDetailsPopupActions .btn-cancel:hover {
    background: #e5e7eb;
}
#formDetailsPopupActions .btn-reset,
#formDetailsPopupActions .btn-save {
    background: #6b7280;
    color: white;
}
#formDetailsPopupActions .btn-reset:hover,
#formDetailsPopupActions .btn-save:hover {
    background: #4b5563;
}

/* --- Common Popup Overlay --- */
.forms-popup-overlay, .settings-popup-overlay, .reports-popup-overlay, .auction-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.forms-popup-overlay.active, .settings-popup-overlay.active, .reports-popup-overlay.active, .auction-popup-overlay.active {
    opacity: 1;
}

.forms-popup-content, .settings-popup-content, .reports-popup-content, .auction-popup-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.forms-popup-overlay.active .forms-popup-content,
.settings-popup-overlay.active .settings-popup-content,
.reports-popup-overlay.active .reports-popup-content,
.auction-popup-overlay.active .auction-popup-content {
    transform: translateY(0);
}

.forms-popup-header, .settings-popup-header, .reports-popup-header, .auction-popup-header {
    color: white;
    padding: 16px 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.forms-popup-header { background: linear-gradient(135deg, #1f2937 0%, #374151 100%); }

.forms-popup-title, .settings-popup-title, .reports-popup-title, .auction-popup-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.forms-popup-title h2, .settings-popup-title h2, .reports-popup-title h2, .auction-popup-title h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.forms-popup-close, .settings-popup-close, .reports-popup-close, .auction-popup-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.forms-popup-close:hover { background: rgba(255,255,255,0.2); }

.forms-popup-body, .settings-popup-body, .reports-popup-body, .auction-popup-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.forms-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.form-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.form-card:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.form-card i {
    font-size: 32px;
    color: #6b7280;
    margin-bottom: 12px;
    display: block;
}
.form-card span {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

/* --- Settings Popup --- */
.settings-popup-header { background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%); }
.settings-popup-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.settings-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
    border-top: 4px solid #6b7280;
}
.settings-card.settings-card-blue { border-top-color: #3b82f6; }
.settings-card.settings-card-purple { border-top-color: #7c3aed; }
.settings-card.settings-card-green { border-top-color: #10b981; }
.settings-card:hover {
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.settings-card-icon {
    font-size: 28px;
    color: #6b7280;
    margin-bottom: 12px;
}
.settings-card.settings-card-blue .settings-card-icon { color: #3b82f6; }
.settings-card.settings-card-purple .settings-card-icon { color: #7c3aed; }
.settings-card.settings-card-green .settings-card-icon { color: #10b981; }

.settings-detail-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.settings-detail-header {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
#settingsDetailPopupActions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
#settingsDetailPopupActions .btn-cancel {
    background: #f3f4f6;
    color: #495057;
    border: 1px solid #e5e7eb;
}
#settingsDetailPopupActions .btn-save {
    background: #6b7280;
    color: white;
}

/* --- Reports Popup --- */
.reports-popup-header { background: linear-gradient(135deg, #059669 0%, #047857 100%); }
.reports-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.report-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.report-card:hover {
    background: #f3f4f6;
    border-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.report-card i {
    font-size: 28px;
    color: #059669;
    margin-bottom: 12px;
    display: block;
}

/* --- Auction Popup --- */
.auction-popup-header { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }
.auction-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.auction-link-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    border-top: 4px solid #6b7280;
    text-align: center;
}
.auction-link-card.purple { border-top-color: #7c3aed; }
.auction-link-card.blue { border-top-color: #3b82f6; }
.auction-link-card.red { border-top-color: #ef4444; }
.auction-link-card.green { border-top-color: #10b981; }
.auction-link-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
    color: white;
    font-size: 22px;
}
.auction-link-card.purple .auction-link-card-icon { background: #7c3aed; }
.auction-link-card.blue .auction-link-card-icon { background: #3b82f6; }
.auction-link-card.red .auction-link-card-icon { background: #ef4444; }
.auction-link-card.green .auction-link-card-icon { background: #10b981; }
.auction-link-btn-primary { background: #7c3aed; color: white; }
.auction-link-btn-secondary { background: #374151; color: white; }

/* --- Import Data Popup --- */
.import-data-popup-header { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.import-data-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid #fed7aa;
    border-radius: 12px;
    text-decoration: none;
    color: #c2410c;
    text-align: center;
    transition: all 0.2s;
}
.import-data-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.2);
    border-color: #fb923c;
}
.import-data-card i { font-size: 32px; margin-bottom: 12px; }
.import-data-card span { font-weight: 600; font-size: 16px; }

.import-upload-area {
    border: 2px dashed #f97316;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #fff7ed;
}
.import-dropzone { cursor: pointer; }
.import-dropzone-icon { font-size: 48px; color: #f97316; margin-bottom: 16px; }

.import-progress-bar {
    height: 20px;
    background: #fed7aa;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}
.import-progress-fill {
    height: 100%;
    background: #f97316;
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
}

/* AI Chat Modal styles moved to sys-ai-chat.css (shared with dashboard2) */

/* ========== Login Page Styles ========== */

@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes loginModalIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Light login surface. A vibrant accent + two light background tints come from
   three CSS vars (--login-accent / --login-bg1 / --login-bg2) set inline on
   .login-body per request, so each page load gets one of ~10 random accents
   over a soft light background. The values below are fallbacks if the inline
   vars are absent. */
.login-body {
    --login-accent: #3b6cff;
    --login-bg1: #eef1fb;
    --login-bg2: #dbe4ff;
    background:
        radial-gradient(1100px 760px at 15% 12%, var(--login-bg2), transparent 60%),
        radial-gradient(900px 680px at 85% 88%, var(--login-bg2), transparent 55%),
        var(--login-bg1);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

/* Soft floating glow blobs behind the card (accent-tinted) */
.login-body::before,
.login-body::after {
    content: "";
    position: fixed;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.18;
    background: var(--login-accent);
    z-index: 0;
    pointer-events: none;
    animation: loginDrift 18s ease-in-out infinite;
}
.login-body::before { top: -160px; left: -120px; }
.login-body::after { bottom: -180px; right: -140px; animation-delay: -9s; }

@keyframes loginDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, 30px) scale(1.12); }
}

.login-body > * {
    max-width: none;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 16px;
}

.login-card {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: 0 24px 60px rgba(20,28,60,0.14), inset 0 1px 0 rgba(255,255,255,0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: loginCardIn 0.45s ease-out both;
}

.login-title {
    margin: 0 0 24px 0;
    font-size: 30px;
    font-weight: 700;
    color: #1a1d29;
}

.login-form {
    display: block;
}

.login-label {
    display: grid;
    gap: 6px;
    margin: 12px 0;
    font-size: 16px;
    font-weight: 500;
    color: #4a5160;
}

.login-input-wrap {
    position: relative;
    margin: 14px 0;
}

.login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9aa1b0;
    pointer-events: none;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 16px;
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 12px;
    font-size: 18px;
    font-family: inherit;
    color: #1a1d29;
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.login-input::placeholder {
    color: #9aa1b0;
}

.login-input.login-input-iconed {
    padding-left: 42px;
}

.login-input:hover {
    border-color: rgba(0,0,0,0.24);
    background: #ffffff;
}

.login-input:focus {
    outline: none;
    border-color: var(--login-accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--login-accent) 22%, transparent);
}

.login-button {
    width: 100%;
    padding: 16px 14px;
    margin-top: 12px;
    border: 0;
    border-radius: 12px;
    background: var(--login-accent);
    color: #ffffff;
    font-size: 19px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 12px 30px color-mix(in srgb, var(--login-accent) 34%, transparent);
    transition: filter 0.15s, box-shadow 0.15s, transform 0.1s;
}

.login-button:hover {
    filter: brightness(1.08);
}

.login-button:active {
    transform: scale(0.985);
}

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

.login-button:focus-visible {
    outline: 2px solid var(--login-accent);
    outline-offset: 2px;
}

.login-forgot-row {
    margin-top: 16px;
    text-align: center;
}

.login-forgot-row a {
    color: #6b7280;
    font-size: 16px;
    text-decoration: none;
    transition: color 0.15s;
}

.login-forgot-row a:hover {
    color: #1a1d29;
    text-decoration: underline;
}

/* Modal */
.login-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(20,28,60,0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-modal-overlay.active {
    display: flex;
}

.login-modal {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    color: #1a1d29;
    min-width: 320px;
    max-width: 420px;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 30px 80px rgba(20,28,60,0.25);
    animation: loginModalIn 0.25s ease-out both;
}

.login-modal-msg {
    margin-bottom: 14px;
    font-size: 18px;
    color: #2a2f3c;
    line-height: 1.5;
}

.login-modal-extra {
    display: none;
    margin-bottom: 14px;
}

.login-modal-extra .login-input {
    width: 100%;
    box-sizing: border-box;
}

.login-modal-actions {
    text-align: right;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.login-modal-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s, background-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.login-modal-btn:active {
    transform: scale(0.985);
}

.login-modal-btn-primary {
    border: 0;
    background: var(--login-accent);
    color: #ffffff;
}

.login-modal-btn-primary:hover {
    filter: brightness(1.06);
}

.login-modal-btn-secondary {
    display: none;
    border: 1px solid rgba(0,0,0,0.14);
    background: #f3f4f6;
    color: #2a2f3c;
}

.login-modal-btn-secondary:hover {
    background: #e5e7eb;
    border-color: rgba(0,0,0,0.22);
}

@media (prefers-reduced-motion: reduce) {
    .login-body::before,
    .login-body::after { animation: none; }
}

/* Responsive */
@media screen and (max-width: 480px) {
    .login-container {
        padding: 12px;
    }
    .login-card {
        padding: 28px 20px;
    }
    .login-modal {
        min-width: auto;
        margin: 0 16px;
    }
}

