/* 
  Specijalna bolnica Naftalan - Minimal Premium Stylesheet (Light-only)
*/
:root {
  --bg: #fff; 
  --card-bg: #ffffff;
  --th-bg: #f6f6f6; 
  --text: #000;
  --text-muted: #666;
  --primary: #2d4971;
  --primary-hover: #2d4971;
  --primary-light: #eee;
  --primary-light-text: #0369a1;
  --border: #eee;
  --border-hover: #ddd;
  --shadow: 0 4px 10px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.01);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.03), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s ease-in-out;
}

/* Tabs */
.tabs-wrapper {
  display: flex;
  gap: 0.5rem;
  background: var(--card-bg);
  padding: 0.375rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  align-self: flex-start;
  box-shadow: var(--shadow);
}

.tab-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
}

/* Controls Bar */
.controls-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.95rem;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.25rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* Main Table styling */
.table-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
}

th {
  background-color: var(--th-bg);
  color: var(--text);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border);
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  white-space: nowrap;
}

th:hover {
  background-color: var(--border);
}

th .sort-icon {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background-color 0.1s ease;
}

tr {
  transition: var(--transition);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background-color: rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue {
  background-color: var(--primary-light);
  color: var(--primary-light-text);
}

.badge-gray {
  background-color: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Details Drawer Panel */
.drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--card-bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer.open {
  right: 0;
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.drawer-close-btn:hover {
  color: var(--text);
}

.drawer-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

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

.detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
  word-break: break-all;
}

.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Empty state display */
.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
  display: none;
}

.empty-state svg {
  margin-bottom: 1rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Pagination controls */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow);
  margin-top: 1rem;
  transition: var(--transition);
}

.page-size-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.page-size-select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--card-bg);
  color: var(--text);
  outline: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.page-size-select:focus {
  border-color: var(--primary);
}

.page-buttons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary-light-text);
}

.page-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive Mobile Layout Override for Table */
@media (max-width: 900px) {
  body {
    padding: 1rem 0.5rem;
  }
  
  header {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrapper {
    min-width: 100%;
  }

  /* Table Card Transform */
  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead {
    display: none; /* Hide header completely on mobile */
  }

  tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    overflow: hidden;
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: right;
  }

  td:last-child {
    border-bottom: none;
  }

  td::before {
    content: attr(data-label);
    font-weight: 700;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 1.5rem;
    flex-shrink: 0;
  }
}

/* Učitavanje / Loading spinner */
.loading-spinner {
  display: inline-block;
  animation: spin 1.2s linear infinite;
}

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