/* Base custom additions for D&T Fulfillment */

@layer utilities {
  .text-shadow-sm {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }
  .text-balance {
    text-wrap: balance;
  }
  .text-pretty {
    text-wrap: pretty;
  }
}

/* Typography Anti-Orphan & Native Balance Engine */
h1, h2, h3, .text-balance {
  text-wrap: balance;
}
.text-pretty {
  text-wrap: pretty;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Glassmorphism helpers */
.glass-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.glass-dark {
  background: rgba(7, 19, 38, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(30, 58, 138, 0.3);
}

/* Card hover tactile feedback */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -10px rgba(12, 33, 68, 0.12);
}

/* Floating animation */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}
.animate-float {
  animation: float 4s ease-in-out infinite;
}

/* Custom pulse ring */
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}
.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  background-color: inherit;
  opacity: 0.4;
  animation: pulse-ring 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  z-index: -1;
}

/* ====== Admin CMS Styling (Light Theme Optimization) ====== */
.bg-main {
  background-color: #f8fafc;
}

.form-control-custom {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control-custom:focus {
  border-color: #2C5E9B !important;
  box-shadow: 0 0 0 3px rgba(44, 94, 155, 0.2) !important;
  outline: none;
  color: #0f172a !important;
}
.form-control-custom::placeholder {
  color: #94a3b8 !important;
}

.btn-orange-custom {
  background: linear-gradient(135deg, #173e72 0%, #2C5E9B 100%);
  color: #ffffff !important;
  border: none;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.5rem 1.25rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-orange-custom:hover {
  background: linear-gradient(135deg, #0f2b52 0%, #1f4c86 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(44, 94, 155, 0.35);
  color: #ffffff !important;
}

.nav-link-custom {
  color: #475569;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}
.nav-link-custom:hover, .nav-link-custom.active {
  background-color: #e4eef9;
  color: #2C5E9B;
}

.navbar-brand-custom {
  font-weight: 800;
  font-size: 1.25rem;
  color: #0f172a;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-orange { color: #2C5E9B; }
.brand-blue { color: #173e72; }
.brand-red { color: #dc2626; }

/* Infinite Marquee */
@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  display: flex;
  width: max-content;
  animation: marquee 25s linear infinite;
}

.animate-marquee:hover {
  animation-play-state: paused;
}

/* Glass & Glow utilities for B2B */
.bento-glow-border {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95));
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}

.bento-glow-border:hover {
  border-color: rgba(44, 94, 155, 0.4);
  box-shadow: 0 12px 30px -4px rgba(44, 94, 155, 0.15);
}

/* Color Utilities for Platform Icons & Badges across CMS and Web */
.text-orange-500 { color: #f97316 !important; }
.text-slate-900 { color: #0f172a !important; }
.text-blue-500 { color: #3b82f6 !important; }
.text-blue-600 { color: #2563eb !important; }
.text-dt-blue-600 { color: #2C5E9B !important; }
.text-emerald-600 { color: #059669 !important; }
.text-purple-600 { color: #9333ea !important; }
.text-amber-500 { color: #f59e0b !important; }
.text-amber-600 { color: #d97706 !important; }
.text-teal-600 { color: #0d9488 !important; }
.text-slate-800 { color: #1e293b !important; }
.text-indigo-600 { color: #4f46e5 !important; }
.text-rose-500 { color: #f43f5e !important; }

/* ====== Modern CMS Admin Sidebar (Impeccable Design & Anti-Slop) ====== */
.admin-layout-wrapper {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: #f8fafc;
}

.admin-sidebar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  height: 100vh;
  background-color: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  position: sticky;
  top: 0;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.25s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.25s ease;
  overflow: hidden;
  box-shadow: 1px 0 10px rgba(15, 23, 42, 0.03);
}

/* Collapsed Mini-Sidebar Mode (72px) */
.admin-sidebar.sidebar-collapsed {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

/* Brand Header & Toggle */
.sidebar-brand-full {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.sidebar-brand-mini {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #173e72 0%, #2C5E9B 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 13.5px;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 6px rgba(44, 94, 155, 0.3);
  text-decoration: none;
}
.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  background-color: #f8fafc;
}
.sidebar-toggle-btn:hover {
  background-color: #edf4fc;
  border-color: #2C5E9B;
  color: #2C5E9B;
}

.admin-sidebar.sidebar-collapsed .sidebar-brand-full {
  display: none !important;
}
.admin-sidebar.sidebar-collapsed .sidebar-brand-mini {
  display: flex !important;
}
.admin-sidebar.sidebar-collapsed .sidebar-toggle-btn {
  width: 100%;
  margin-top: 0.35rem;
}

/* Scroll Container: Sửa triệt để lỗi bẻ cột ngang flex-wrap */
.admin-sidebar-scroll {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  flex-wrap: nowrap !important;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.admin-sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}
.admin-sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.admin-sidebar-scroll::-webkit-scrollbar-thumb {
  background-color: #e2e8f0;
  border-radius: 9999px;
}
.admin-sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #cbd5e1;
}

/* Sidebar Search */
.menu-search-container {
  position: relative;
  transition: opacity 0.2s ease;
}
.menu-search-input {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
  border-radius: 0.65rem;
  padding: 0.45rem 2rem 0.45rem 2.2rem;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}
.menu-search-input:focus {
  background-color: #ffffff !important;
  border-color: #2C5E9B !important;
  box-shadow: 0 0 0 3px rgba(44, 94, 155, 0.15) !important;
  outline: none;
}
.menu-search-clear {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  padding: 0;
  font-size: 0.75rem;
  cursor: pointer;
  display: none;
}
.menu-search-clear:hover {
  color: #64748b;
}
.menu-search-mini-btn {
  display: none;
  width: 36px;
  height: 36px;
  margin: 0 auto 0.65rem auto;
  border-radius: 0.65rem;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  color: #64748b;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.menu-search-mini-btn:hover {
  background-color: #ffffff;
  border-color: #2C5E9B;
  color: #2C5E9B;
  box-shadow: 0 2px 6px rgba(44, 94, 155, 0.15);
}
.admin-sidebar.sidebar-collapsed .menu-search-container {
  display: none !important;
}
.admin-sidebar.sidebar-collapsed .menu-search-mini-btn {
  display: flex !important;
}

/* Direct Menu Links (Top Level) */
.menu-direct-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 3px solid transparent;
}
.menu-direct-link:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}
.menu-direct-link.active {
  background: linear-gradient(90deg, #f1f6fc 0%, #e8f1fb 100%);
  color: #2C5E9B;
  font-weight: 600;
  border-left-color: #2C5E9B;
  box-shadow: 0 1px 2px rgba(44, 94, 155, 0.05);
}
.menu-direct-link.active .menu-icon-box {
  background-color: #2C5E9B;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(44, 94, 155, 0.3);
}

/* Accordion Group Header */
.menu-group-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 0.65rem;
  border: none;
  background: transparent;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}
.menu-group-btn:hover {
  background-color: #f8fafc;
  color: #0f172a;
}
.menu-group-btn[aria-expanded="true"] {
  color: #0f172a;
  background-color: #f8fafc;
}
.menu-group-btn[aria-expanded="true"] .menu-chevron {
  transform: rotate(180deg);
}
.menu-group-btn.has-active-child {
  color: #2C5E9B;
  font-weight: 700;
}
.menu-group-btn.has-active-child .menu-icon-box {
  background-color: #e4eef9;
  color: #2C5E9B;
}

/* Icon Box */
.menu-icon-box {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
  color: #64748b;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}
.menu-group-btn:hover .menu-icon-box {
  background-color: #e2e8f0;
  color: #334155;
}

.menu-chevron {
  font-size: 0.68rem;
  color: #94a3b8;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Submenu Accordion Body */
.menu-sub-list {
  list-style: none;
  padding: 0.2rem 0 0.35rem 0;
  margin: 0 0 0 1.15rem;
  border-left: 2px solid #e2e8f0;
}

.menu-sub-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem 0.35rem 0.85rem;
  margin: 0.15rem 0;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
}
.menu-sub-link:hover {
  background-color: #f8fafc;
  color: #0f172a;
}
.menu-sub-link.active {
  background: linear-gradient(90deg, #f1f6fc 0%, #e4eef9 100%);
  color: #2C5E9B;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(44, 94, 155, 0.06);
}
.menu-sub-link.active::before {
  content: '';
  position: absolute;
  left: -0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background-color: #2C5E9B;
  border-radius: 2px;
}

/* Collapsed Sidebar Items Styling */
.admin-sidebar.sidebar-collapsed .menu-direct-link {
  padding: 0.45rem 0;
  justify-content: center;
  gap: 0;
  border-left: none;
  margin: 0.15rem 0;
}
.admin-sidebar.sidebar-collapsed .menu-direct-link .menu-item-text,
.admin-sidebar.sidebar-collapsed .menu-direct-link .badge {
  display: none !important;
}
.admin-sidebar.sidebar-collapsed .menu-group-btn {
  padding: 0.45rem 0;
  justify-content: center;
  margin: 0.15rem 0;
}
.admin-sidebar.sidebar-collapsed .menu-group-btn > div:first-child {
  padding-right: 0 !important;
  gap: 0 !important;
  justify-content: center;
  width: 100%;
}
.admin-sidebar.sidebar-collapsed .menu-group-btn .menu-group-title,
.admin-sidebar.sidebar-collapsed .menu-group-btn .menu-group-meta {
  display: none !important;
}
.admin-sidebar.sidebar-collapsed .menu-sub-list {
  display: none !important;
}

/* Active Child Pulsating Dot on Collapsed Parent */
.active-child-indicator {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #2C5E9B;
  box-shadow: 0 0 0 3px rgba(44, 94, 155, 0.25);
  display: inline-block;
  margin-right: 0.25rem;
}

/* Counter Badge */
.menu-count-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.42rem;
  border-radius: 9999px;
  background-color: #f1f5f9;
  color: #64748b;
}
.menu-group-btn[aria-expanded="true"] .menu-count-badge {
  background-color: #e2e8f0;
  color: #334155;
}

/* User Profile Card */
.menu-profile-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  transition: all 0.2s ease;
}
.menu-profile-card:hover {
  border-color: #cbd5e1;
}

.status-online-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border: 2px solid #ffffff;
  border-radius: 9999px;
  position: absolute;
  bottom: -1px;
  right: -1px;
}

.admin-sidebar.sidebar-collapsed .menu-profile-card {
  padding: 0.35rem 0;
  background: transparent;
  border: none;
  display: flex;
  justify-content: center;
}
.admin-sidebar.sidebar-collapsed .menu-profile-card .profile-info,
.admin-sidebar.sidebar-collapsed #toggleAllGroupsBtn {
  display: none !important;
}
.admin-sidebar.sidebar-collapsed .logout-text {
  display: none !important;
}
.admin-sidebar.sidebar-collapsed #logoutBtn {
  padding: 0.4rem 0 !important;
  justify-content: center !important;
}

/* Admin Main Content Area */
.admin-main-content {
  flex: 1 1 auto;
  min-width: 0;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 2rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: #f8fafc;
}
@media (min-width: 1200px) {
  .admin-main-content {
    padding: 2rem 2.5rem;
  }
}
@media (max-width: 991.98px) {
  .admin-layout-wrapper {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .admin-sidebar {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    position: relative !important;
    box-shadow: none;
    border-bottom: 1px solid #e2e8f0;
  }
  .admin-sidebar.sidebar-collapsed {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
  }
  .admin-main-content {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding: 1rem;
  }
}

/* ==========================================================================
   Editorial Reading Paper Canvas & News Article Prose Enhancements
   ========================================================================== */

/* Enhanced Editorial Prose Typography */
.article-prose {
  color: #334155;
  font-size: 1rem;
  line-height: 1.85;
}

.article-prose h2 {
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 800;
  margin-top: 2.25rem;
  margin-bottom: 1rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.article-prose h3 {
  color: #0f172a;
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.article-prose h4 {
  color: #1e293b;
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.article-prose p {
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}

.article-prose strong {
  color: #0f172a;
  font-weight: 700;
}

.article-prose ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}

.article-prose ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}

.article-prose li {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  line-height: 1.75;
}

/* Article Images & Figures */
.article-prose img {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  margin: 1.75rem auto;
  max-width: 100%;
  height: auto;
  display: block;
}

/* Article Blockquotes */
.article-prose blockquote {
  background: linear-gradient(135deg, rgba(241, 246, 252, 0.85) 0%, rgba(228, 238, 249, 0.5) 100%);
  border-left: 4px solid #2C5E9B;
  border-radius: 0 1rem 1rem 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #1e3a5f;
}

/* Article Tables - Modern, Clean & Rounded (No Ugly Raw Black Borders) */
.article-prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.75rem 0;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.04);
}

.article-prose table th {
  background-color: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.article-prose table th:last-child {
  border-right: none;
}

.article-prose table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  vertical-align: top;
}

.article-prose table td:last-child {
  border-right: none;
}

.article-prose table tr:last-child td {
  border-bottom: none;
}

.article-prose table tr:hover td {
  background-color: #f8fafc;
}



