/* ============================================================
   PAGE-SPECIFIC STYLES FOR MODULE LISTS & FORMS
   Inherits all base components from design-system.css
   ============================================================ */

/* ──────────────────────────────────────────
   1. FORM CARD & SECTION LAYOUTS
   (Used in TaoMoi, ChinhSua, ChiTiet pages)
────────────────────────────────────────── */
.module-form-card {
  border: 1px solid #edf1f6;
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.module-section-title {
  margin-bottom: 18px;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 700;
}

.module-form-grid,
.module-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 22px;
}

.module-form-grid label,
.module-detail-item {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.module-form-grid label span,
.module-detail-item span {
  color: #263241;
  font-size: 13px;
  font-weight: 600;
}

.module-detail-item strong {
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.45;
}

.module-textarea {
  min-height: 118px;
  padding-top: 12px;
  resize: vertical;
}

.module-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ──────────────────────────────────────────
   2. RESPONSIVE FOR FORMS
────────────────────────────────────────── */
@media (max-width: 980px) {
  .module-form-grid,
  .module-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .module-form-actions {
    justify-content: flex-start;
  }
  .module-form-grid,
  .module-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ──────────────────────────────────────────
   3. ACTION & FILTER BUTTON STYLES
────────────────────────────────────────── */
.module-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
  border: 1px solid transparent;
}

.module-action-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.module-action-secondary {
  border: 1px solid #d8dee8;
  background: #fff;
  color: #273140;
}

.module-action-secondary:hover {
  border-color: #c50000;
  color: #c50000;
  background: #fffafa;
}

.module-action-primary {
  border: 1px solid #c70000;
  background: linear-gradient(180deg, #d90000 0%, #c40000 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(196, 0, 0, 0.2);
}

.module-action-primary:hover {
  background: #ad0000;
  border-color: #a00000;
}

/* Filter/Form footer buttons */
.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 160ms ease;
  border: 1px solid transparent;
}

.filter-reset {
  border-color: #d8dee8;
  background-color: #fff;
  color: #273140;
}

.filter-reset:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

.filter-submit {
  background: linear-gradient(180deg, #d90000 0%, #c40000 100%) !important;
  border-color: #c70000 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(197, 0, 0, 0.2);
}

.filter-submit:hover {
  background: #ad0000 !important;
  border-color: #990000 !important;
}

/* Tailwind utility class and button fallback rules (only active under .no-tailwind wrapper) */
.no-tailwind .flex { display: flex !important; }
.no-tailwind .inline-flex { display: inline-flex !important; }
.no-tailwind .items-center { align-items: center !important; }
.no-tailwind .justify-between { justify-content: space-between !important; }
.no-tailwind .justify-end { justify-content: flex-end !important; }
.no-tailwind .flex-wrap { flex-wrap: wrap !important; }
.no-tailwind .flex-col { flex-direction: column !important; }
.no-tailwind .shrink-0 { flex-shrink: 0 !important; }

.no-tailwind .text-xs { font-size: 11px !important; }
.no-tailwind .text-sm { font-size: 12.5px !important; }
.no-tailwind .text-base { font-size: 14px !important; }
.no-tailwind .text-lg { font-size: 16px !important; }

.no-tailwind .font-medium { font-weight: 500 !important; }
.no-tailwind .font-semibold { font-weight: 600 !important; }
.no-tailwind .font-bold { font-weight: 700 !important; }
.no-tailwind .font-black { font-weight: 900 !important; }

.no-tailwind .rounded { border-radius: 6px !important; }
.no-tailwind .rounded-lg { border-radius: 8px !important; }
.no-tailwind .rounded-xl { border-radius: 12px !important; }

.no-tailwind .shadow-sm { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important; }
.no-tailwind .shadow-md { box-shadow: 0 4px 6px rgba(15, 23, 42, 0.08) !important; }

.no-tailwind .gap-1 { gap: 4px !important; }
.no-tailwind .gap-1\.5 { gap: 6px !important; }
.no-tailwind .gap-2 { gap: 8px !important; }
.no-tailwind .gap-3 { gap: 12px !important; }
.no-tailwind .gap-4 { gap: 16px !important; }
.no-tailwind .gap-5 { gap: 20px !important; }
.no-tailwind .gap-6 { gap: 24px !important; }

.no-tailwind .px-2 { padding-left: 8px !important; padding-right: 8px !important; }
.no-tailwind .px-3 { padding-left: 12px !important; padding-right: 12px !important; }
.no-tailwind .px-4 { padding-left: 16px !important; padding-right: 16px !important; }
.no-tailwind .px-5 { padding-left: 20px !important; padding-right: 20px !important; }
.no-tailwind .px-6 { padding-left: 24px !important; padding-right: 24px !important; }

.no-tailwind .py-1 { padding-top: 4px !important; padding-bottom: 4px !important; }
.no-tailwind .py-1\.5 { padding-top: 6px !important; padding-bottom: 6px !important; }
.no-tailwind .py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.no-tailwind .py-2\.5 { padding-top: 10px !important; padding-bottom: 10px !important; }

.no-tailwind .mb-3 { margin-bottom: 12px !important; }
.no-tailwind .mb-4 { margin-bottom: 16px !important; }
.no-tailwind .mb-5 { margin-bottom: 20px !important; }
.no-tailwind .mb-6 { margin-bottom: 24px !important; }
.no-tailwind .mb-8 { margin-bottom: 32px !important; }
.no-tailwind .mt-3\.5 { margin-top: 14px !important; }
.no-tailwind .mt-4 { margin-top: 16px !important; }
.no-tailwind .mt-6 { margin-top: 24px !important; }
.no-tailwind .mt-8 { margin-top: 32px !important; }
.no-tailwind .pt-4 { padding-top: 16px !important; }
.no-tailwind .pt-5 { padding-top: 20px !important; }

.no-tailwind .border { border: 1px solid #d8dee8 !important; }
.no-tailwind .border-t { border-top: 1px solid #edf1f6 !important; }
.no-tailwind .border-b { border-bottom: 1px solid #edf1f6 !important; }
.no-tailwind .border-gray-100 { border-color: #f1f5f9 !important; }
.no-tailwind .border-gray-200 { border-color: #e2e8f0 !important; }
.no-tailwind .border-gray-300 { border-color: #cbd5e1 !important; }

@media (min-width: 640px) {
  .no-tailwind .sm\:flex-row { flex-direction: row !important; }
  .no-tailwind .sm\:items-center { align-items: center !important; }
  .no-tailwind .sm\:justify-between { justify-content: space-between !important; }
  .no-tailwind .sm\:flex-row-reverse { flex-direction: row-reverse !important; }
}

/* Base styles for standard buttons using utility padding */
.no-tailwind a[class*="px-"][class*="py-"],
.no-tailwind button[class*="px-"][class*="py-"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: var(--font-base, 'Roboto', Arial, sans-serif) !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: all 160ms ease !important;
  text-decoration: none !important;
}

/* Secondary (white/gray) buttons */
.no-tailwind a[class*="bg-white"], .no-tailwind button[class*="bg-white"] {
  border: 1px solid #d8dee8 !important;
  background-color: #ffffff !important;
  color: #334155 !important;
}
.no-tailwind a[class*="bg-white"]:hover, .no-tailwind button[class*="bg-white"]:hover {
  border-color: #c50000 !important;
  color: #c50000 !important;
  background-color: #fffafa !important;
}

/* Primary (red) buttons */
.no-tailwind a[class*="bg-[#c50000]"], .no-tailwind button[class*="bg-[#c50000]"],
.no-tailwind a[class*="bg-[#c60000]"], .no-tailwind button[class*="bg-[#c60000]"],
.no-tailwind a[class*="bg-[#cf0000]"], .no-tailwind button[class*="bg-[#cf0000]"] {
  border: 1px solid #c70000 !important;
  background: linear-gradient(180deg, #d90000 0%, #c40000 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(196, 0, 0, 0.2) !important;
}
.no-tailwind a[class*="bg-[#c50000]"]:hover, .no-tailwind button[class*="bg-[#c50000]"]:hover,
.no-tailwind a[class*="bg-[#c60000]"]:hover, .no-tailwind button[class*="bg-[#c60000]"]:hover,
.no-tailwind a[class*="bg-[#cf0000]"]:hover, .no-tailwind button[class*="bg-[#cf0000]"]:hover {
  background: #ad0000 !important;
  border-color: #a00000 !important;
}

/* Green (save/success) buttons */
.no-tailwind a[class*="bg-[#16a34a]"], .no-tailwind button[class*="bg-[#16a34a]"] {
  border: 1px solid #15803d !important;
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2) !important;
}
.no-tailwind a[class*="bg-[#16a34a]"]:hover, .no-tailwind button[class*="bg-[#16a34a]"]:hover {
  background: #15803d !important;
  border-color: #14532d !important;
}

/* Red outline buttons (e.g. text-[#cf0000] or border-red-200) */
.no-tailwind a[class*="text-[#cf0000]"], .no-tailwind button[class*="text-[#cf0000]"],
.no-tailwind a[class*="border-red-200"], .no-tailwind button[class*="border-red-200"] {
  color: #cf0000 !important;
  border: 1px solid #fca5a5 !important;
  background-color: #ffffff !important;
}
.no-tailwind a[class*="text-[#cf0000]"]:hover, .no-tailwind button[class*="text-[#cf0000]"]:hover,
.no-tailwind a[class*="border-red-200"]:hover, .no-tailwind button[class*="border-red-200"]:hover {
  background-color: #fef2f2 !important;
  border-color: #ef4444 !important;
}

/* Icons within buttons */
.no-tailwind a[class*="px-"] svg, .no-tailwind button[class*="px-"] svg,
.no-tailwind a[class*="py-"] svg, .no-tailwind button[class*="py-"] svg,
.no-tailwind a.module-action-btn svg, .no-tailwind button.module-action-btn svg,
.no-tailwind a.filter-btn svg, .no-tailwind button.filter-btn svg {
  width: 16px !important;
  height: 16px !important;
  stroke-width: 2.2 !important;
  margin-right: 6px !important;
  vertical-align: middle !important;
}

