/* ============================================
   PRIMOS Base Styles
   Reset, typography, and base elements
   ============================================ */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base body */
body {
  font-family: var(--font-family);
  background: var(--color-gray-100);
  color: #333;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 600;
}

/* Links */
a {
  color: var(--color-info);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Tables - Base Styles */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th {
  position: relative;
  user-select: none;
  background: #f8f9fa;
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #555;
  text-transform: uppercase;
  border-bottom: 2px solid #eee;
}

td {
  padding: 15px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

tr:hover {
  background: #f8f9fa;
}

tr.clickable {
  cursor: pointer;
}

/* Resizable columns */
th .resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  background: transparent;
  z-index: 10;
}

th .resize-handle:hover,
th .resize-handle.resizing {
  background: var(--color-primary);
}

/* Column width hints - Default table */
th:nth-child(1) { min-width: 80px; }
th:nth-child(2) { min-width: 70px; }
th:nth-child(3) { min-width: 120px; }
th:nth-child(4) { min-width: 80px; }
th:nth-child(5) { min-width: 80px; }
th:nth-child(6) { min-width: 50px; }
th:nth-child(7) { min-width: 60px; }
th:nth-child(8),
th:nth-child(9),
th:nth-child(10),
th:nth-child(11),
th:nth-child(12) { min-width: 50px; }
th:nth-child(13),
th:nth-child(14) { min-width: 80px; }

/* Sortable columns */
th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 25px;
  transition: background var(--transition-normal);
}

th.sortable:hover {
  background: #eef2f7;
}

th.sortable::after {
  content: '⇅';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.3;
  font-size: 12px;
}

th.sortable.asc::after {
  content: '▲';
  opacity: 1;
  color: var(--color-primary);
}

th.sortable.desc::after {
  content: '▼';
  opacity: 1;
  color: var(--color-primary);
}

/* Selection and Focus States */
::selection {
  background: var(--color-primary-light);
  color: white;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-bold { font-weight: bold; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }

.text-muted { color: #666; }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning-dark); }
.text-danger { color: var(--color-danger); }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* Date indicators */
.date-done {
  color: var(--color-success);
}

.date-pending {
  color: #999;
}

/* Muted text */
.muted {
  color: #999;
  font-style: italic;
}
