/* Tags management page */

.tag-page .tag-body {
  padding: 16px 16px 32px;
}

.tag-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tag-back {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #25b7a7;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}

.tag-back svg { width: 16px; height: 16px; }
.tag-back:hover { background: #1a9e8f; }

.tag-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  flex: 1;
  min-width: 60px;
}

.tag-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.tag-search input {
  width: min(220px, 42vw);
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
}

.tag-search input:focus {
  outline: none;
  border-color: #25b7a7;
  box-shadow: 0 0 0 2px rgba(37, 183, 167, .2);
}

.tag-add-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #25b7a7;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 183, 167, .25);
}

.tag-add-btn:hover { background: #1a9e8f; }

.tag-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
  padding: 16px 18px 14px;
}

.tag-section-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #25b7a7;
}

.tag-table-wrap {
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.tag-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  font-size: 13px;
}

.tag-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.tag-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.tag-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tag-icon-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tag-icon-btn svg { width: 16px; height: 16px; }
.tag-icon-btn--edit { color: #25b7a7; }
.tag-icon-btn--del { color: #ef4444; }
.tag-icon-btn:hover { background: #f1f5f9; }

.tag-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.tag-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.tag-pager__btn {
  width: 28px;
  height: 28px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 16px;
  cursor: pointer;
}

.tag-pager__btn:hover:not(:disabled) {
  border-color: #25b7a7;
  color: #25b7a7;
}

.tag-pager__btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.tag-pager__page {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #25b7a7;
  border-radius: 6px;
  color: #25b7a7;
  font-weight: 700;
}

.tag-count {
  font-size: 13px;
  color: #64748b;
}

.tag-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tag-modal[hidden] { display: none !important; }

.tag-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
}

.tag-modal__dialog {
  position: relative;
  width: min(440px, 100%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, .22);
  overflow: hidden;
}

.tag-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.tag-modal__head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
}

.tag-modal__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.tag-modal__close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.tag-modal__form {
  padding: 18px 20px 20px;
}

.tag-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.tag-modal__field label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.tag-req { color: #ef4444; }

.tag-modal__field input[type="text"] {
  height: 40px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  color: #1e293b;
}

.tag-modal__field input[type="text"]:focus {
  outline: none;
  border-color: #25b7a7;
  box-shadow: 0 0 0 2px rgba(37, 183, 167, .2);
}

.tag-modal__colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tag-modal__field input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.tag-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.tag-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.tag-btn--primary {
  background: #25b7a7;
  color: #fff;
}

.tag-btn--primary:hover { background: #1a9e8f; }

.tag-btn--ghost {
  background: #fff;
  color: #475569;
  border-color: #d1d5db;
}

.tag-btn--ghost:hover { border-color: #94a3b8; }

.tag-toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tag-toast {
  min-width: 220px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .25);
  font-size: 13px;
}

.tag-toast strong {
  display: block;
  margin-bottom: 2px;
}

@media (max-width: 700px) {
  .tag-toolbar { width: 100%; margin-left: 0; }
  .tag-search { flex: 1; }
  .tag-search input { width: 100%; }
  .tag-modal__colors { grid-template-columns: 1fr; }
}
