.stat-card {
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-primary {
  background-color: #2563eb;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}
.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-danger {
  background-color: #dc2626;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}
.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-secondary {
  background-color: #e5e7eb;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}
.btn-secondary:hover {
  background-color: #d1d5db;
}

.form-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
}
.form-input:focus {
  outline: none;
  ring: 2px solid #3b82f6;
  border-color: transparent;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

.card {
  background-color: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
}

.badge-added {
  background-color: #d1fae5;
  color: #065f46;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.badge-modified {
  background-color: #fef3c7;
  color: #92400e;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.badge-deleted {
  background-color: #fee2e2;
  color: #991b1b;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.row-added {
  background-color: #C8E6C9;
}

.row-modified {
  background-color: #FFF9C4;
}

.row-deleted {
  background-color: #FFCCCC;
}

.gridjs-container {
  font-size: 11px;
}

.gridjs-table {
  width: 100%;
  table-layout: auto;
}

.gridjs-th {
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
  padding: 4px 6px !important;
  white-space: nowrap;
  font-size: 11px;
  border-bottom: 2px solid #e5e7eb;
  height: 28px;
}

.gridjs-td {
  padding: 2px 6px !important;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  line-height: 1.2;
  border-bottom: 1px solid #f3f4f6;
  height: 24px;
}

.gridjs-td:hover {
  overflow: visible;
  white-space: normal;
  word-break: break-word;
  position: relative;
  background: #fff;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gridjs-wrapper {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.gridjs-footer {
  background: #f9fafb;
  padding: 6px 10px !important;
  font-size: 11px;
  border-top: 1px solid #e5e7eb;
}

.gridjs-pagination {
  font-size: 11px;
}

.gridjs-pagination .gridjs-pages button {
  padding: 2px 8px !important;
  font-size: 11px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
}

.gridjs-pagination .gridjs-pages button:hover {
  background: #f3f4f6;
}

.gridjs-pagination .gridjs-pages button.gridjs-currentPage {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.gridjs-search {
  margin-bottom: 8px !important;
}

.gridjs-search input {
  padding: 6px 12px !important;
  font-size: 12px !important;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  width: 280px;
}

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

@media (max-width: 768px) {
  .stat-card {
    margin-bottom: 1rem;
  }
}

#mobile-menu.hidden {
  display: none;
}

#main-content {
  min-height: calc(100vh - 64px);
  padding-bottom: 0 !important;
}

#page-content {
  min-height: calc(100vh - 80px);
}

#settings-content {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}

.change-item.open .change-body {
  display: block;
}

.change-item.open .accordion-arrow {
  transform: rotate(180deg);
}

.sheet-accordion.open .sheet-accordion-body {
  display: block;
}

.sheet-accordion.open .accordion-arrow {
  transform: rotate(180deg);
}

.change-body {
  max-height: 400px;
  overflow-y: auto;
}

.change-field {
  transition: background-color 0.15s;
}

.change-field:hover {
  background-color: #f9fafb;
}

/* Tabulator overrides */
#data-table-container {
  padding: 0 !important;
}

.tabulator {
  border: none !important;
  font-size: 12px;
}

.tabulator .tabulator-header {
  background: #f3f4f6;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
}

.tabulator .tabulator-header .tabulator-col {
  background: #f3f4f6;
  border-right: 1px solid #e5e7eb;
  padding: 4px 6px;
  height: 52px;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-title {
  font-size: 11px;
  color: #374151;
  white-space: nowrap;
  line-height: 1.2;
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter {
  margin-top: 2px;
}

.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input {
  font-size: 11px;
  padding: 3px 4px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  width: 100%;
  box-sizing: border-box;
  height: 22px;
}

.tabulator .tabulator-row {
  border-bottom: 1px solid #f3f4f6;
}

.tabulator .tabulator-row .tabulator-cell {
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  line-height: 1.3;
  border-right: 1px solid #f3f4f6;
  height: 24px;
}

.tabulator .tabulator-row .tabulator-cell:hover {
  overflow: visible;
  white-space: normal;
  word-break: break-word;
  position: relative;
  background: #fff;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tabulator .tabulator-footer {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 4px 8px;
  font-size: 11px;
  flex-shrink: 0;
}

.tabulator {
  display: flex;
  flex-direction: column;
}

.tabulator .tabulator-header {
  flex-shrink: 0;
}

.tabulator .tabulator-tableholder {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: auto !important;
}

.tabulator .tabulator-footer .tabulator-paginator {
  font-size: 11px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.tabulator .tabulator-footer .tabulator-page {
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  margin: 0 2px;
  border-radius: 3px;
}

.tabulator .tabulator-footer .tabulator-page:hover {
  background: #f3f4f6;
}

.tabulator .tabulator-footer .tabulator-page.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.tabulator .tabulator-footer .tabulator-page-size {
  font-size: 11px;
  padding: 2px 4px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
}
