/* Grid & Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--card-shadow);
  transition: all 0.15s ease;
  position: relative;
}

.card:hover {
  border-color: var(--border-highlight);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(96, 205, 255, 0.08);
  color: var(--color-accent);
  border: 1px solid rgba(96, 205, 255, 0.14);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.04);
}

.stat-info .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.15;
  letter-spacing: -0.3px;
}

.stat-info .stat-label {
  font-size: 11.5px;
  color: var(--color-text-secondary);
  margin-top: 2px;
  font-weight: 500;
}

/* Section Header & Toolbar */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Category Filter Tags (Action Pills) */
.category-filter-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 12px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  padding: 3.5px 10px;
  border-radius: var(--radius-xs);
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  border-bottom: 1px solid var(--btn-secondary-border-bottom);
  color: var(--color-text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
  user-select: none;
}

.filter-tag:hover {
  background: var(--btn-secondary-hover);
  color: var(--color-text-primary);
  border-color: rgba(255, 255, 255, 0.18);
}

.filter-tag:active {
  transform: scale(0.97);
}

.filter-tag.active {
  background: var(--bg-active);
  color: var(--color-accent);
  border-color: var(--color-accent);
  font-weight: 600;
}

/* Data Tables */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 9px 14px;
  font-size: 12.5px;
}

th {
  background: var(--bg-card-header);
  color: var(--color-text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  font-size: 11.5px;
  letter-spacing: 0.2px;
  text-transform: none;
}

td {
  border-bottom: 1px solid var(--border-subtle);
  color: var(--color-text-primary);
  vertical-align: middle;
}

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

tbody tr {
  transition: background 0.1s ease;
}

tbody tr:hover {
  background: var(--bg-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  text-decoration: none;
  font-family: inherit;
  user-select: none;
  border: 1px solid transparent;
  line-height: 1.35;
  height: 28px;
  box-sizing: border-box;
}

.btn-primary {
  background: var(--color-accent);
  color: #121212;
  font-weight: 600;
  border: 1px solid var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  border-bottom: 1px solid var(--btn-secondary-border-bottom);
  color: var(--color-text-primary);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-danger {
  background: rgba(255, 77, 79, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 77, 79, 0.22);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:active {
  transform: scale(0.97);
}

.btn-sm {
  padding: 3px 8px;
  font-size: 11.5px;
  height: 24px;
  border-radius: var(--radius-xs);
}

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-xs);
}

/* Form Controls */
.form-group {
  margin-bottom: 13px;
}

.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  height: 30px;
  padding: 5px 9px;
  border-radius: var(--radius-xs);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--color-text-primary);
  font-size: 12.5px;
  font-family: inherit;
  transition: all 0.12s ease;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 2px var(--color-accent-glow);
}

textarea.form-control {
  height: auto;
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
  padding: 7px 9px;
}

.search-input-wrap {
  position: relative;
  width: 220px;
}

.search-input-wrap input {
  padding-left: 28px;
  height: 28px;
  font-size: 12px;
}

.search-input-wrap svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--color-text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 7px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

.badge-blue { background: rgba(96, 205, 255, 0.1); color: #60cdff; border: 1px solid rgba(96, 205, 255, 0.2); }
.badge-green { background: rgba(82, 196, 26, 0.1); color: #52c41a; border: 1px solid rgba(82, 196, 26, 0.2); }
.badge-orange { background: rgba(250, 173, 20, 0.1); color: #faad14; border: 1px solid rgba(250, 173, 20, 0.2); }
.badge-purple { background: rgba(179, 127, 235, 0.1); color: #b37feb; border: 1px solid rgba(179, 127, 235, 0.2); }

/* Modals & Dialogs */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
  animation: modalScaleUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 13px 18px;
  background: var(--bg-card-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 5px;
  border-radius: var(--radius-xs);
  transition: all 0.1s;
}

.modal-close:hover {
  color: var(--color-text-primary);
  background: var(--bg-hover);
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

.modal-footer {
  padding: 11px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-card-header);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleUp {
  from { transform: scale(0.97); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Empty State */
.empty-state {
  padding: 40px 14px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 12px;
}

.empty-state svg {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  stroke: var(--color-text-muted);
}
