.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
    text-align: right;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
}

.table tbody + tbody {
    border-top: 2px solid #dee2e6;
}

.table-sm th,
.table-sm td {
    padding: 0.3rem;
}

.table-bordered {
    border: 1px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

.table-bordered thead th,
.table-bordered thead td {
    border-bottom-width: 2px;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
}
.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: auto;
    background-color: #fff;
    border-color: #dee2e6;
}
.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: #007bff;
    background-color: #fff;
    border: 1px solid #dee2e6;
}
.page-link:hover {
    z-index: 2;
    color: #0056b3;
    text-decoration: none;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.float-right { float: left !important; }
.float-left { float: right !important; }
.float-none { float: none !important; }
.clearfix::after {
    display: block;
    clear: both;
    content: "";
}
.page-icon { font-size: 3rem; color: #42A5F5; }
.welcome-title { color: var(--color-primary); }
.return-icon { opacity: 0.8; font-size: 0.85em; }
.no-result { display: none; }
.no-result-icon { font-size: 2rem; opacity: 0.3; }

.results, .results tbody, .results tr, .results td {
  display: block !important;
  width: 100% !important;
}

.results thead {
  display: none !important;
}

.results tbody {
  display: flex !important;
  flex-direction: column;
}

.results tr {
  border: 1px solid #e3e8f0;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 14px 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.results tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.results td {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  text-align: right;
  border: none !important;
  border-bottom: 1px solid #f0f2f5 !important;
  padding: 7px 0;
  font-size: 0.95rem;
}

.results td:last-child {
  border-bottom: none !important;
}

.results td::before {
  content: attr(data-label);
  font-weight: 700;
  color: #8a94a6;
  margin-left: 12px;
  flex-shrink: 0;
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

@media screen and (min-width: 768px) {
  .results {
    display: table !important;
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .results thead {
    display: table-header-group !important;
  }

  .results thead th {
    background: #f4f6fb;
    color: #5a6278;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding: 12px 14px;
    border-bottom: 2px solid #e3e8f0;
    white-space: nowrap;
  }

  .results thead th:first-child {
    border-radius: 10px 0 0 0;
    width: 50px;
  }

  .results thead th:last-child { border-radius: 0 10px 0 0; }

  .results tbody {
    display: table-row-group !important;
    flex-direction: unset;
  }

  .results tr {
    display: table-row !important;
    width: auto !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
    transition: background 0.15s;
  }

  .results tbody tr:nth-child(even) {
    background: #fafbfe !important;
  }

  .results tbody tr:hover {
    background: #eef2ff !important;
    transform: none;
    box-shadow: none !important;
  }

  .results td {
    display: table-cell !important;
    width: auto !important;
    border: none !important;
    border-bottom: 1px solid #edf0f7 !important;
    padding: 11px 14px !important;
    font-size: 0.92rem;
    vertical-align: middle;
  }

  .results td::before {
    display: none !important;
  }
  .results thead th.col-notes { width: 25%; }
}

.request-content {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
  max-height: 4.5em;
  text-align: right;
  width: 100%;
}

td a {
  padding: 8px 0;
  display: block;
}

@media screen and (min-width: 768px) {
  .request-content {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-height: 3em;
  }

  .request-content:hover {
    overflow-y: auto;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    max-height: 150px;
    scrollbar-width: thin;
  }

  td a {
    padding: 0;
    display: inline-flex;
  }
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.btn-action-return {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border: none !important;
    transition: all 0.2s ease-in-out !important;
}
.btn-action-return:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    filter: brightness(1.1);
}

.btn-action-remind {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border: none !important;
    transition: all 0.2s ease-in-out !important;
}
.btn-action-remind:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    filter: brightness(1.1);
}

.user_type {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
}
.user_type:hover {
    filter: brightness(0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.edit-badge-icon {
    font-size: 0.8em;
    opacity: 0.75;
    transition: opacity 0.2s;
}
.user_type:hover .edit-badge-icon {
    opacity: 1;
}

.store-admin-badge {
    background-color: #f8f9fa;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
    margin: 2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 50px;
    transition: all 0.2s ease;
}
.store-admin-badge:hover {
    background-color: #edf2f7;
    border-color: #cbd5e0;
}
.store-admin-badge .remove-admin {
    color: #e53e3e;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: color 0.2s;
}
.store-admin-badge .remove-admin:hover {
    color: #c53030;
}
.add-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #319795;
    background: #e6fffa;
    border: 1px dashed #319795;
    padding: 0.3rem 0.6rem;
    border-radius: 50px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    cursor: pointer;
    margin: 2px;
}
.add-admin-btn:hover {
    background: #b2f5ea;
    color: #234e52;
    border-style: solid;
}

a.editable-click,
a.editable-click:hover,
a.editable-click:focus {
    color: #2d3748 !important;
    border-bottom: 1px dashed #cbd5e0 !important;
    text-decoration: none !important;
}

.vanilla-editable {
    cursor: pointer !important;
    color: #2d3748 !important;
    border-bottom: 1px dashed #cbd5e0 !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}
.vanilla-editable:hover {
    color: #1a202c !important;
    border-bottom-color: #718096 !important;
}

/* Sortable headers styling */
.results thead th[data-sortable="true"] {
    cursor: pointer;
    position: relative;
    user-select: none;
    padding-left: 24px !important; /* space for icon on left in RTL */
}

.results thead th[data-sortable="true"]::after {
    content: "\f0dc"; /* FontAwesome sort icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    font-size: 0.85em;
    transition: opacity 0.2s, color 0.2s;
}

.results thead th[data-sortable="true"]:hover::after {
    opacity: 0.7;
}

.results thead th[data-sortable="true"].sorted-asc::after {
    content: "\f0de"; /* FontAwesome arrow up */
    opacity: 0.9;
    color: #007bff;
}

.results thead th[data-sortable="true"].sorted-desc::after {
    content: "\f0dd"; /* FontAwesome arrow down */
    opacity: 0.9;
    color: #007bff;
}
