/*
Theme Name: Quan Ly Trung Tam
Theme URI: https://example.com
Description: Blank starter theme for center management
Author: Quan Ly Trung Tam Team
Version: 0.1.0
Text Domain: quanlytrungtam
*/

:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: #f4f1fb;
  color: #1f2336;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 32px;
}

header {
  width: 100%;
  padding: 0;
  height: 0;
  overflow: hidden;
}

.site-header,
.site-footer {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
}

.site-footer {
  border-top: 1px solid #e5e5e5;
  border-bottom: none;
}

.site-main {
  padding: 32px 0;
}

.brand a {
  font-weight: 600;
  letter-spacing: 0.4px;
}

/* Dashboard layout */
.qltt-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 120px);
  gap: 24px;
  padding: 24px 32px;
}


.qltt-sidebar {
  background: #f8fafc;
  color: #0f172a;
  border-radius: 16px;
  padding: 20px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
}

.qltt-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 16px 20px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qltt-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.qltt-nav li {
  margin: 2px 0;
}

.qltt-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: #0f172a;
  font-weight: 600;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border-radius: 10px;
  margin: 2px 8px;
}

.qltt-nav .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.qltt-nav .nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: #475569;
}

.qltt-nav a.is-active .nav-icon svg,
.qltt-nav a:hover .nav-icon svg {
  stroke: #2563eb;
}

.qltt-nav a:hover {
  background: #e0f2fe;
  color: #0f172a;
  border-color: #38bdf8;
  text-decoration: none;
}

.qltt-nav a.is-active {
  background: #dbeafe;
  color: #0f172a;
  border-color: #2563eb;
}

/* Pagination controls shared */
.qltt-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.qltt-pagination .page-info {
  color: #4b5563;
  font-weight: 600;
}
.qltt-pagination button {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}
.qltt-pagination button:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.qltt-pagination button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.qltt-main {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.qltt-main-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qltt-search {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}

.qltt-search input {
  width: 100%;
  padding: 10px 12px 10px 12px;
  border-radius: 10px;
  border: 1px solid #dbe2ea;
  background: #f7f2ff;
  color: #1f2336;
}

.qltt-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-ghost {
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: linear-gradient(120deg, #8b5cf6, #ec4899);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: #f1eaff;
  color: #2d1f5f;
  border: 1px solid #e5d9ff;
}

.btn-icon {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #1f2937;
}

.btn-icon.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.btn-icon.danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.qltt-btn-icon {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  font-size: 18px;
  border-radius: 6px;
  transition: all 0.2s;
}

.qltt-btn-icon:hover {
  background: #f3f4f6;
  transform: scale(1.1);
}

.qltt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.qltt-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
  align-items: center;
}

.qltt-input,
.qltt-select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5d9ff;
  background: #f9f7ff;
  color: #1f2336;
  min-width: 180px;
}

.qltt-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f4e8ff;
  color: #7c3aed;
  font-size: 12px;
  font-weight: 600;
}

.qltt-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.qltt-form {
  background: #ffffff;
  border: 1px solid #eadfff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
  margin-top: 14px;
}

.qltt-form h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.qltt-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.qltt-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #4c3b73;
  font-size: 14px;
}

.qltt-form input,
.qltt-form textarea,
.qltt-form select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5d9ff;
  background: #f9f7ff;
  color: #1f2336;
}

.qltt-form textarea {
  min-height: 96px;
  resize: vertical;
}

.qltt-form .form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* Modal Form - Clean Rewrite */
.qltt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 998;
}

.qltt-modal-overlay.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
  visibility: visible !important;
  opacity: 1 !important;
}

.qltt-modal-form {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  z-index: 999;
}

.qltt-modal-overlay.active + .qltt-modal-form {
  display: flex !important;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
}

/* Handle modal form as child of overlay */
.qltt-modal-overlay.active .qltt-modal-form {
  display: flex !important;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
}

.qltt-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px;
  border-bottom: 1px solid #f0eefd;
  flex-shrink: 0;
}

.qltt-form-header h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 700;

  .qltt-form-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2d1f5f;
  }

  .qltt-btn-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
  }

  .qltt-btn-close:hover {
    background: #f3f4f6;
    color: #1f2937;
  }
  color: #2d1f5f;
}

.qltt-form-badge {
  display: inline-block;
  padding: 4px 8px;
  background: #e9d5ff;
  color: #6b21a8;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
}

.qltt-form-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.qltt-form-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.qltt-form-body {
  flex: 1;

  /* Form rows and groups */
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }

  .form-row:last-child {
    margin-bottom: 0;
  }

  .form-group {
    display: flex;
    flex-direction: column;
  }

  .form-row > .form-group:only-child {
    grid-column: 1 / -1;
  }

  .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
  }

  .form-group .required {
    color: #dc2626;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
  }

  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  }

  .form-group textarea {
    resize: vertical;
    min-height: 80px;
  }

  .equipment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
  }

  .equipment-item {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    color: #374151;
  }
  padding: 20px;
  overflow-y: auto;
}

.qltt-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.qltt-form-row:last-child {
  margin-bottom: 0;
}

.qltt-form-col {
  display: flex;
  flex-direction: column;
}

.qltt-form-col:only-child,
.qltt-form-row > .qltt-form-col:nth-child(n+3) {
  grid-column: 1 / -1;
}

.qltt-form-col label {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
}

.qltt-form-col input,
.qltt-form-col select,
.qltt-form-col textarea {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

.qltt-form-col input:focus,
.qltt-form-col select:focus,
.qltt-form-col textarea:focus {
  outline: none;
  border-color: #c084fc;
  box-shadow: 0 0 0 3px rgba(196, 132, 252, 0.1);
}

.qltt-form-col textarea {
  resize: vertical;
  min-height: 80px;
}

.qltt-form-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #f0eefd;
  flex-shrink: 0;
  justify-content: flex-end;
}

.qltt-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qltt-btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  color: #ffffff;
}

.qltt-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.qltt-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.qltt-btn-secondary:hover {
  background: #e5e7eb;
}

.qltt-btn-ghost {
  background: none;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.qltt-btn-ghost:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.qltt-card {
  background: #f9f7ff;
  border: 1px solid #e5ddff;
  border-radius: 12px;
  padding: 14px 16px;
}

.qltt-card h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #594a72;
}

.qltt-card strong {
  font-size: 22px;
}

.qltt-panel {
  margin-top: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.qltt-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f7f2ff;
  border-bottom: 1px solid #eadfff;
}

.qltt-table {
  width: 100%;
  border-collapse: collapse;
}

.qltt-table th,
.qltt-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #f0eaff;
  font-size: 14px;
}

.qltt-table th {
  background: #f7f2ff;
  color: #4c3b73;
}

.qltt-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #f4e8ff;
  color: #7c3aed;
}

.qltt-badge-warn {
  background: #fff5e6;
  color: #d97706;
}

.qltt-badge-ok {
  background: #e6fbf4;
  color: #0f9f6e;
}

.qltt-status.status-ok {
  background: #e6fbf4;
  color: #0f9f6e;
}

.qltt-status.status-warn {
  background: #fff5e6;
  color: #d97706;
}

/* Action Dropdown */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 8px;
  min-width: 180px;
  z-index: 1000;
  margin-top: 4px;
}

.action-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  border-radius: 4px;
  transition: background 0.2s;
  color: #374151;
}

.action-menu button:hover {
  background: #f3f4f6;
}

.btn-icon .icon,
.action-menu .icon,
.qltt-status .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
}

.btn-icon .icon svg,
.action-menu .icon svg,
.qltt-status .icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

.action-menu hr {
  border: none;
  border-top: 1px solid #e5e7eb;
}

@media (max-width: 960px) {
  .qltt-shell {
    grid-template-columns: 1fr;
  }

  .qltt-sidebar {
    order: 2;
  }

  .qltt-main {
    order: 1;
  }
}

