/* =========================================================
   Shared admin page styles — included via main layout
   ========================================================= */

/* --- Glass card --- */
.glass-card {
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  padding: 2.5rem 2rem;
  color: rgba(255,255,255,0.92);
}
.glass-card h2 {
  color: rgba(255,255,255,0.92);
  margin-bottom: 1.5rem;
  font-weight: 600;
}
.panel-title {
  color: rgba(255, 255, 255, 0.33);
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.4rem;
}

/* --- Navigation --- */
.back-link {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  margin-bottom: 1.5rem;
  display: inline-block;
}
.back-link:hover {
  color: rgba(255,255,255,0.9);
}

.page-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.page-header-row .back-link {
  margin-bottom: 0;
  flex-shrink: 0;
}
.page-header-row .panel-title {
  margin-bottom: 0;
  flex: 1;
  text-align: center;
}
.page-header-spacer {
  width: 150px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .page-header-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .page-header-row .panel-title {
    width: 100%;
    text-align: left;
  }
  .page-header-spacer {
    display: none;
  }
}

/* --- Buttons --- */
.action-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  color: white;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.btn:hover {
  background: rgba(255,255,255,0.18);
}
.btn-primary {
  background: rgba(76, 175, 80, 0.25);
  border-color: rgba(76, 175, 80, 0.4);
  color: #90ee90;
}
.btn-primary:hover {
  background: rgba(76, 175, 80, 0.35);
  color: #b0ffb0;
}
.btn-glass {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.30);
  color: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  margin-right: 0.4rem;
}
.btn-danger {
  background: rgba(220,53,69,0.25);
  border-color: rgba(220,53,69,0.45);
  color: #ff8e9a;
}
.btn-danger:hover { background: rgba(220,53,69,0.4); }
.btn-warn {
  background: rgba(255,193,7,0.18);
  border-color: rgba(255,193,7,0.35);
  color: #ffd773;
}
.delete-btn {
  background: rgba(220,53,69,0.25);
  border: 1px solid rgba(220,53,69,0.4);
  color: #ff8080;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
  white-space: nowrap;
}
.delete-btn:hover {
  background: rgba(220,53,69,0.42);
  color: #ffaaaa;
  text-decoration: none;
}

/* --- Tables (glass-card scoped) --- */
.glass-card table {
  width: 100%;
  margin-top: 1.5rem;
  color: rgba(255,255,255,0.92);
  font-size: 0.9rem;
}
.glass-card table thead {
  border-bottom: 1px solid rgba(255,255,255,0.2);
}
.glass-card table th {
  color: rgba(255,255,255,0.7);
  font-weight: 600;
  padding: 0.75rem;
  text-align: left;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
.glass-card table th[data-sort] {
  cursor: pointer;
  user-select: none;
}
.glass-card table th[data-sort]::after {
  content: '  \2195';
  opacity: 0.45;
  font-size: 0.72rem;
}
.glass-card table th.sort-asc::after {
  content: '  \2191';
  opacity: 0.85;
}
.glass-card table th.sort-desc::after {
  content: '  \2193';
  opacity: 0.85;
}
.glass-card table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.glass-card table tbody tr {
  cursor: pointer;
}
.glass-card table tbody tr:hover {
  background: rgba(255,255,255,0.08);
}

/* --- Messages --- */
.error-msg,
.success-msg {
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
  margin: 1rem 0;
}
.error-msg {
  background: rgba(220,53,69,0.25);
  border: 1px solid rgba(220,53,69,0.4);
  color: #ff8080;
}
.success-msg {
  background: rgba(76,175,80,0.25);
  border: 1px solid rgba(76,175,80,0.4);
  color: #90ee90;
}
/* Alternative message pattern used by templates/workflows pages */
.msg {
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.msg-error {
  background: rgba(220,53,69,0.25);
  border: 1px solid rgba(220,53,69,0.4);
  color: #ff8080;
}
.msg-ok {
  background: rgba(40,167,69,0.25);
  border: 1px solid rgba(40,167,69,0.4);
  color: #7eff7e;
}
.loading {
  text-align: center;
  color: rgba(255,255,255,0.6);
  padding: 2rem;
}
.empty-state {
  text-align: center;
  color: rgba(255,255,255,0.6);
  padding: 2rem;
  font-size: 0.95rem;
}

/* --- Modal (standard pattern) --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
}
.modal.show {
  display: flex;
}
.modal-content {
  background: rgba(20,20,30,0.95);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: rgba(255,255,255,0.92);
}
.modal-content h3 {
  margin-bottom: 1rem;
  color: rgba(255,255,255,0.92);
}
.modal-close {
  float: right;
  cursor: pointer;
  font-size: 1.5rem;
  color: rgba(255,255,255,0.5);
}
.modal-close:hover {
  color: rgba(255,255,255,0.9);
}
.modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}
/* Alternative modal pattern used by templates/workflows pages */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background: rgba(8, 14, 28, 0.62);
  padding: 1rem;
}
.modal-overlay.open {
  display: flex;
}
.modal-card {
  margin: 0;
}

/* --- Form elements --- */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
/* Bootstrap .form-control override inside glass cards */
.glass-card .form-control,
.glass-card select {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  color: white;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0;
}
.glass-card .form-control:focus,
.glass-card select:focus {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.45);
  color: white;
  box-shadow: none;
  outline: none;
}
.glass-card .form-control::placeholder { color: rgba(255,255,255,0.35); }
.glass-card select option {
  background: #1a3a4f;
  color: white;
}
.form-input {
  width: 100%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  color: white;
  padding: 0.6rem;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.form-input:focus {
  background: rgba(255,255,255,0.18);
  outline: none;
  border-color: rgba(255,255,255,0.45);
}
/* Alternative input style used by templates/workflows pages */
.input-glass {
  width: 100%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  color: #fff;
  padding: 0.55rem 0.7rem;
}
.input-glass:focus {
  outline: none;
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.16);
}

/* --- User/group search --- */
.search-input {
  width: 100%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  color: white;
  padding: 0.6rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.search-input:focus {
  background: rgba(255,255,255,0.18);
  outline: none;
  border-color: rgba(255,255,255,0.45);
}
.search-results {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.search-result-item {
  padding: 0.6rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.search-result-item:hover {
  background: rgba(255,255,255,0.08);
}
