.object-fit-contain {
  object-fit: contain;
}

/* Global utility — used by auto_checkout and other pages */
.hidden { display: none !important; }

/* ── Reports toolbar — mobile layout ─────────────────────────────────────── */
.report-btn {
  flex-shrink: 0;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
@media (max-width: 575.98px) {
  .nk-block-between.flex-wrap .nk-block-head-content.w-100 {
    margin-top: 0.5rem;
  }
  .report-btn .icon { font-size: 1.1rem; }
}

/* ── Fix DashLite .gap-N height vs Bootstrap 5 gap utility conflict ─────────
   DashLite's spacer system defines .gap-2 { height:.75rem } for use as
   <div class="gap gap-2"></div> spacer blocks. This conflicts with Bootstrap 5's
   .gap-2 { gap:.75rem !important } on flex/grid containers. Since the spacer
   rule appears later in dashlite.css it wins, forcing a fixed height onto any
   element that uses gap-2 as a spacing utility. Fix: only apply the height
   when the element also has the .gap base class (proper spacer usage).
──────────────────────────────────────────────────────────────────────────── */
.gap-0:not(.gap), .gap-1:not(.gap), .gap-2:not(.gap),
.gap-3:not(.gap), .gap-4:not(.gap), .gap-5:not(.gap),
.gap-gs:not(.gap) { height: unset !important; }

.user-avatar img, [class^=user-avatar]:not([class*=-group]) img{
  width:100%;
  height:100%;
  object-fit: cover;
}

/* ── Page-header toolbar — mobile fixes (all admin pages) ─────────────────── */
@media (max-width: 575.98px) {

  /* Let the header stack title above toolbar with a gap */
  .nk-block-head .nk-block-between {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Keep the toolbar flush to the right even when stacked */
  .nk-block-head .nk-block-between > .nk-block-head-content:last-child:not(:first-child) {
    margin-left: auto;
  }

  /* The absolute dropdown must escape any overflow clipping on the parent */
  .nk-block-head {
    overflow: visible !important;
  }

  /* Dropdown panel: full width, clear of header, good shadow */
  .nk-block-tools-toggle .toggle-expand-content {
    position: absolute;
    left: 0 !important;
    right: 0 !important;
    top: 100% !important;
    z-index: 200;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0,0,0,.15);
    border-top: 1px solid #e5e7eb;
    padding: 12px 18px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Stack buttons vertically inside the dropdown */
  .nk-block-tools-toggle .nk-block-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  /* Full-width buttons */
  .nk-block-tools-toggle .nk-block-tools > li {
    width: 100%;
  }

  .nk-block-tools-toggle .nk-block-tools > li > a,
  .nk-block-tools-toggle .nk-block-tools > li > button {
    width: 100%;
    justify-content: flex-start;
  }

  /* Remove auto-left-margin override for opt item — looks better stacked */
  .nk-block-tools-toggle .nk-block-tools-opt {
    margin-left: 0 !important;
  }
}

/* Dark-mode dropdown background */
@media (max-width: 575.98px) {
  .dark-mode .nk-block-tools-toggle .toggle-expand-content {
    background: #1f2937;
    border-top-color: #374151;
    box-shadow: 0 12px 32px rgba(0,0,0,.45);
  }
}
/* ── Toolbar "Add New" button — show on all screen sizes ─────────────────── */
/*
 * Several pages mark the primary CTA as d-none d-sm-block which hides it on
 * mobile.  We undo that here so the button is always visible.  It still sits
 * inside the toggle-expand dropdown on <576px thanks to the page-header fix
 * above, so it doesn't cause layout overflow.
 */
.nk-block-tools .nk-block-tools-opt.d-none {
  display: list-item !important;
}
/* ── end toolbar button visibility fix ────────────────────────────────────── */

/* ── end wallet card mobile fix ───────────────────────────────────────────── */



/* card base */
.creative-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  transition: .15s;
}

.creative-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.25);
}

/* thumbnail area */
.thumb-area {
  height: 150px;
  background: #f7f7f7;
  position: relative;
  overflow: hidden;
}
.thumb-area img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.py-2 {
border-top: 1px solid #e3e3e3;
}

/* card hover controls */
.select-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
}

.select-check .form-check-input {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.action-overlay {
  position: absolute;
  inset: 0;
  background: rgba(59,130,246,.45);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s ease;
}

.thumb-area:hover .action-overlay,
.thumb-area-playlist:hover .action-overlay,
.creative-card:hover .action-overlay,
.playlist-card:hover .action-overlay,
.sc-thumb-area:hover .sc-action-overlay,
.sc-card:hover .sc-action-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* checkbox */
.slide-icon-toolbar.slide-toolbar-vertical {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 8px 8px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0px;
  margin-bottom: 2px;
  width: 100%;
  box-sizing: border-box;
}
.slide-toolbar-label {
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 2px;
  padding-left: 2px;
}
.slide-toolbar-btnrow {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.slide-icon-btn-vertical {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-width: 44px;
  padding: 6px 2px 4px 2px;
  gap: 1px !important;
}
.slide-btn-icon {
  display: block;
  margin-bottom: 2px;
}
.slide-btn-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.1;
  margin-top: 0;
  text-align: center;
  white-space: nowrap;
}

.thumb-area:hover .action-overlay {
  flex-direction: row;
}

/* icons group */
.overlay-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sc-overlay-inner {
  position: relative;
  width: 100%;
  height: 100%;
  justify-content: center;
}

.sc-select-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 6;
}

.sc-select-check .form-check-input {
  margin: 0;
}

/* overlay icons look bolder */
.overlay-icon {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}

/* hover effect on icons */
.overlay-icon:hover {
  transform: scale(1.25);
  opacity: .85;
}

.sc-menu-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}


.divider {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.65);
}


.card-menu {
  position: absolute;
  min-width: 180px;
  background: #fff;
  border-radius: 8px;
  padding: 4px 0;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 8px 18px rgba(0,0,0,.15);
  z-index: 9999;
  display: none;
}

.card-menu.show {
  display: block;
}

.card-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.card-menu-item:hover {
  background: #f2f5ff;
}

.card-menu-item svg {
  flex-shrink: 0;
}

.card-menu-item span {
  flex: 1;
  text-align: left;
}



.tag-dropdown {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  margin-top: 4px;
  width: 300px;
  display: none;
  z-index: 30;
}

.tag-item {
  padding: 8px 10px;
  cursor: pointer;
}

.tag-item:hover {
  background: #f5f8ff;
}



.tag-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid #ced4da;
 background-color: #fff;
  min-height: 50px;
  cursor: text;
}

.tag-wrapper:focus-within {
  border-color: #4c8dff;
  box-shadow: 0 0 0 2px rgba(76,141,255,.15);
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}


.tag-chip i {
  color: #5b6aaa;
}

.tag-chip button {
  border: none;
  background: transparent;
  color: #333;
  padding: 0;
  cursor: pointer;
}

.tag-input {
  border: none !important;
  outline: none;
  flex: 1;
  min-width: 120px;
}

.tag-dropdown {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  margin-top: 4px;
  width: 300px;
  display: none;
  z-index: 50;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e9ecff;
  padding: 4px 8px 4px 6px;
  font-size: 13px;
}

.tag-chip i {
  color: #4c6ef5;
}

.tag-chip .remove-btn {
  border: none;
  background: transparent;
  color: #333;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.folder-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.folder-modal.hidden {
  display: none;
}

.folder-card {
  width: 320px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,.15);
}

.folder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 12px;
}

.folder-header .icon {
  width: 20px;
  height: 20px;
}

.icon-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
}

.folder-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  margin-bottom: 14px;
}

.folder-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn.primary {
  background: #2563eb;
  color: #fff;
  border: none;
}

.btn.ghost {
  background: transparent;
  border: 1px solid #ddd;
}

.folder-row{
  position: relative;
}


.folder-actions{
  position:absolute;
  top:8px;
  right:8px;
  display:flex;
  gap:4px;
  opacity:0;
  transform:translateY(-4px);
  transition:.15s ease;
}

.folder-row:hover .folder-actions{
  opacity:1;
  transform:translateY(0);
}

.folder-actions button{
  width:25px;
  height:25px;
  border-radius:5px;
  border:1px solid rgba(0,0,0,.08);
  background:rgba(255,255,255,.9);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.folder-actions button:hover{
  background:#fff;
  border-color:rgba(0,0,0,.15);
}

.cal-backdrop{
  position:fixed; inset:0; background:rgba(7,12,24,.6);
  backdrop-filter: blur(4px);
  display:flex; align-items:center; justify-content:center; z-index:9999;
}
.cal-modal{
  width:540px; max-width:94vw; background:#fff; border-radius:20px;
  box-shadow:0 24px 72px rgba(5,12,30,.35); position:relative; overflow:hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}
.cal-header{ padding:24px 24px 12px 24px; border-bottom:1px solid #edf0f5; background:linear-gradient(180deg,#f7faff,#ffffff); }
.cal-kicker{ display:inline-flex; align-items:center; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#2563eb; background:#eaf1ff; border-radius:999px; padding:6px 10px; }
.cal-header h2{ margin:12px 0 0 0; font-size:28px; letter-spacing:-0.5px; color:#0f172a; }
.cal-header p{ margin:8px 0 0 0; color:#4b5563; font-size:14px; line-height:1.5; max-width:92%; }
.cal-close{
  position:absolute; right:14px; top:14px;
  border:none; background:#ffffff; font-size:14px; cursor:pointer;
  width:36px; height:36px; border-radius:10px;
  border:1px solid #e5e7eb;
}
.cal-close:hover{ background:#f8fafc; }
.cal-card{
  margin:18px 22px 16px 22px; border:1px solid #dbe7ff; border-radius:14px;
  cursor:pointer; background:linear-gradient(135deg,#f9fbff,#f1f5ff);
  transition:all .18s ease;
}
.cal-card:hover{ transform:translateY(-1px); box-shadow:0 8px 24px rgba(37,99,235,.15); }
.cal-card-inner{ display:flex; align-items:center; padding:16px; gap:14px; }
.cal-gicon-box{
  width:72px; height:72px; border-radius:16px; background:#e9f1ff;
  display:flex; align-items:center; justify-content:center; font-size:34px;
  color:#2b6cff; font-weight:700;
}
.cal-card-copy{ flex:1; min-width:0; }
.cal-glabel{
  display:inline-flex; align-items:center; background:#1e3a8a; color:#fff; padding:7px 10px; border-radius:9px;
  font-weight:600; font-size:12px; width:max-content;
}
.cal-subtext{
  padding:8px 0 0 0; color:#475569; font-size:13px; line-height:1.45;
}
.cal-card-arrow{ font-size:12px; font-weight:700; color:#1d4ed8; background:#dbeafe; border:1px solid #bfdbfe; border-radius:999px; padding:8px 12px; }
.cal-step2{ padding:0 22px 22px 22px; border-top:1px dashed #e5e7eb; }
.cal-step-head{ margin-top:16px; font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:#64748b; font-weight:700; }
.cal-label{ display:block; margin:10px 0 6px; color:#444; font-weight:600; }
.cal-select{
  width:100%; padding:11px 12px; border:1px solid #d9dce1; border-radius:10px;
  font-size:14px; background:#fff; height: 42px;
}
.cal-import{
  margin-top:14px; width:100%; padding:12px 14px;
  border:none; border-radius:10px; background:linear-gradient(135deg,#1e40af,#2563eb); color:#fff;
  font-size:14px; font-weight:700; cursor:pointer;
}
.cal-import:hover{ opacity:.92; }
.cal-status{ margin-top:10px; font-size:12px; color:#334155; min-height:18px; }

.ev-wrap{
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  gap:10px;
  border-radius:16px;
  padding:12px;
  box-sizing:border-box;
  border:1px solid rgba(148,163,184,.22);
  background:linear-gradient(180deg,#ffffff,#f8fbff);
  overflow:hidden;
}

.ev-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  padding:6px 8px;
}

.ev-kicker{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:700;
  color:#2563eb;
}

.ev-heading{
  font-size:15px;
  font-weight:700;
  color:var(--ev-heading-color,#0f172a);
  margin-top:2px;
  max-width:280px;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
}

.ev-month{
  font-size:12px;
  color:var(--ev-heading-color,#334155);
  font-weight:600;
  text-align:right;
}

.ev-count{
  margin-top:2px;
  font-size:11px;
  color:var(--ev-muted-color,#64748b);
  text-align:right;
}

.ev-list{
  margin:0;
  padding:0 2px 2px;
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:8px;
  overflow:auto;
}

.ev-item{
  display:grid;
  grid-template-columns:64px 1fr;
  gap:10px;
  align-items:center;
  border:1px solid #e2e8f0;
  border-radius:12px;
  padding:9px;
  background:#ffffff;
}

.ev-item-holiday{
  border-color:#fed7aa;
  background:linear-gradient(135deg,#fff9f2,#ffffff);
}

.ev-item-exam{
  border-color:#fecaca;
  background:linear-gradient(135deg,#fff5f5,#ffffff);
}

.ev-item-class{
  border-color:#bfdbfe;
  background:linear-gradient(135deg,#f4f8ff,#ffffff);
}

.ev-item-deadline{
  border-color:#fde68a;
  background:linear-gradient(135deg,#fffbeb,#ffffff);
}

.ev-item-meeting{
  border-color:#c4b5fd;
  background:linear-gradient(135deg,#f7f4ff,#ffffff);
}

.ev-item-activity{
  border-color:#bbf7d0;
  background:linear-gradient(135deg,#f0fdf4,#ffffff);
}

.ev-date-col{
  border-radius:10px;
  background:#f1f5f9;
  text-align:center;
  padding:8px 6px;
}

.ev-day-num{
  font-size:20px;
  line-height:1;
  font-weight:800;
  color:var(--ev-heading-color,#0f172a);
}

.ev-date{
  margin-top:5px;
  font-size:11px;
  color:var(--ev-muted-color,#475569);
  text-transform:uppercase;
  letter-spacing:.04em;
}

.ev-main-col{ min-width:0; }

.ev-top-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}

.ev-title{
  color:var(--ev-color,#0f172a);
  font-size:var(--ev-font,14px);
  font-weight:700;
  line-height:1.25;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ev-chip{
  font-size:10px;
  font-weight:700;
  color:#92400e;
  background:#ffedd5;
  border:1px solid #fdba74;
  border-radius:999px;
  padding:3px 7px;
  flex-shrink:0;
}

.ev-chip-holiday{
  color:#92400e;
  background:#ffedd5;
  border-color:#fdba74;
}

.ev-chip-exam{
  color:#991b1b;
  background:#fee2e2;
  border-color:#fca5a5;
}

.ev-chip-class{
  color:#1e3a8a;
  background:#dbeafe;
  border-color:#93c5fd;
}

.ev-chip-deadline{
  color:#92400e;
  background:#fef3c7;
  border-color:#fcd34d;
}

.ev-chip-meeting{
  color:#5b21b6;
  background:#ede9fe;
  border-color:#c4b5fd;
}

.ev-chip-activity{
  color:#166534;
  background:#dcfce7;
  border-color:#86efac;
}

.ev-time{
  margin-top:4px;
  color:var(--ev-color,#334155);
  font-weight:600;
}

.ev-loc{
  margin-top:4px;
  color:var(--ev-muted-color,#64748b);
  font-size:11px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ev-empty{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px dashed #cbd5e1;
  border-radius:12px;
  color:#64748b;
  font-size:13px;
  background:#f8fafc;
}

.ev-wrap.ev-theme-light{
  border:1px solid rgba(148,163,184,.22);
  background:linear-gradient(180deg,#ffffff,var(--ev-surface-bg,#f8fbff));
}

.ev-wrap.ev-theme-dark{
  border:1px solid rgba(71,85,105,.6);
  background:linear-gradient(180deg,var(--ev-surface-bg,#0f172a),#0b1220);
}

.ev-wrap.ev-theme-dark .ev-kicker{
  color:var(--ev-accent,#93c5fd);
}

.ev-wrap.ev-theme-light .ev-kicker{
  color:var(--ev-accent,#2563eb);
}

.ev-wrap.ev-theme-dark .ev-heading,
.ev-wrap.ev-theme-dark .ev-day-num,
.ev-wrap.ev-theme-dark .ev-title,
.ev-wrap.ev-theme-dark .ev-time,
.ev-wrap.ev-theme-dark .ev-month{
  color:var(--ev-heading-color,#e2e8f0);
}

.ev-wrap.ev-theme-dark .ev-count,
.ev-wrap.ev-theme-dark .ev-date,
.ev-wrap.ev-theme-dark .ev-loc{
  color:var(--ev-muted-color,#94a3b8);
}

.ev-wrap.ev-theme-dark .ev-item{
  border-color:#334155;
  background:#111827;
}

.ev-wrap.ev-theme-dark .ev-date-col{
  background:#1e293b;
}

.ev-wrap.ev-theme-dark .ev-empty{
  border-color:#334155;
  color:#94a3b8;
  background:#0f172a;
}

.ev-wrap.ev-theme-dark .ev-item-holiday{
  border-color:#92400e;
  background:linear-gradient(135deg,#2a1a0b,#111827);
}

.ev-wrap.ev-theme-dark .ev-item-exam{
  border-color:#7f1d1d;
  background:linear-gradient(135deg,#2a1111,#111827);
}

.ev-wrap.ev-theme-dark .ev-item-class{
  border-color:#1e3a8a;
  background:linear-gradient(135deg,#0d1b3a,#111827);
}

.ev-wrap.ev-theme-dark .ev-item-deadline{
  border-color:#854d0e;
  background:linear-gradient(135deg,#2a210c,#111827);
}

.ev-wrap.ev-theme-dark .ev-item-meeting{
  border-color:#5b21b6;
  background:linear-gradient(135deg,#22123a,#111827);
}

.ev-wrap.ev-theme-dark .ev-item-activity{
  border-color:#166534;
  background:linear-gradient(135deg,#122b1b,#111827);
}



.cal-source-box{
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px;
  margin-bottom:14px;
  background:#fff;
}
.cal-source-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.cal-source-left{
  display:flex;
  gap:12px;
  align-items:center;
}
.cal-source-icon{
  width:36px;
  height:36px;
  border-radius:10px;
  background:#e9f1ff;
  color:#2563eb;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
}
.cal-source-title{
  font-weight:600;
  font-size:15px;
}
.cal-source-sub{
  font-size:13px;
  color:#6b7280;
}
.cal-source-edit{
  color:#2563eb;
  font-weight:600;
  cursor:pointer;
  font-size:14px;
}
.cal-source-icon svg{
  width: 100%;
  height: 100%;
  display: block;
}

.cal-override-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:8px;
  max-height:220px;
  overflow:auto;
  padding-right:4px;
}

.cal-override-row{
  display:grid;
  grid-template-columns:1fr 110px;
  gap:8px;
  align-items:center;
}

.cal-override-name{
  font-size:12px;
  color:#334155;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
}

.cal-override-empty{
  margin-top:8px;
  font-size:12px;
  color:#64748b;
}

.cal-override-toggle-row{
  margin-top:6px;
}

.cal-override-toggle{
  width:100%;
  border:1px solid #cbd5e1;
  background:#f8fafc;
  color:#334155;
  border-radius:8px;
  font-size:12px;
  font-weight:600;
  padding:8px 10px;
  cursor:pointer;
}

.cal-override-toggle:hover{
  background:#f1f5f9;
}

.mc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  grid-auto-rows: 8px;
  align-items: start;
}

@media (max-width: 980px) {
  .mc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .mc-grid {
    grid-template-columns: 1fr;
  }
}

.mc-card {
  position: relative;
  border-radius: 5px;
  overflow: hidden;
  background:#f8f8f8;
  cursor: pointer;
  transition:.15s;
  grid-row-end: span 26;
}

.mc-card:hover {
  box-shadow:0 10px 25px rgba(0,0,0,.1);
  transform:translateY(-2px);
}

.mc-thumb {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background:#eee;
}

.mc-thumb img,
.mc-thumb video {
  position: absolute;
  inset: 0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.mc-audio {
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#555;
  font-size:13px;
}

.mc-hover {
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;            /* center vertically */
  justify-content:center;        /* center horizontally */
  padding:10px;
  opacity:0;
  pointer-events:none;
  background:linear-gradient(to top, rgba(0,0,0,.45), transparent);
  transition:.15s;
}

.mc-card:hover .mc-hover {
  opacity:1;
  pointer-events:auto;
}

/* button style */
.mc-insert {
  background: none;
  color: #dededeff;
  border:0;
  border-radius:999px;
  padding:6px 12px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:18px;
  cursor:pointer;
}

.mc-insert svg {
  flex-shrink:0;
}
 .creative-eye {
  color: #9aa0a6; /* grey */
  display: inline-flex;
  align-items: center;
}


/* GRID */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 10px;
}

/* CARD */
.creative-template-card {
  position: relative;
}

/* THUMB */
.creative-thumb {
  position: relative;
  height: 130px;
  border-radius: 5px;
  overflow: hidden;
  background: #eee;
}

.creative-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* RED BADGE */
.creative-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: #d32f2f;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 14px;
  border-bottom-right-radius: 14px;
}

/* BLUE CORNER */
.creative-corner {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  background: #3b82f6;
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

/* OVERLAY */
.creative-overlay {
  position: absolute;
  inset: 0;
  background: rgba(70, 130, 255, 0.78);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.creative-template-card:hover .creative-overlay {
  opacity: 1;
}

.creative-overlay-inner {
  text-align: center;
  color: #fff;
}

.creative-plus {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 300;
  margin: 0 auto 10px;
}

.creative-text {
  font-size: 10px;
  font-weight: 600;
}

/* META */
.creative-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.creative-title {
  font-size: 10px;
  font-weight: 500;
  color: #2b2b2b;
}

.creative-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 8px;
  color: #7a7a7a;
}

/* CLICK LAYER */
.creative-click {
  position: absolute;
  inset: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}


  .mc-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 5px;
  background: #f4f5f7;
  border: 1px solid #e0e0e0;
  color: #333;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}

.mc-back-btn:hover {
  background: #ececff;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.mc-back-btn svg {
  flex-shrink: 0;
}

/* CATEGORY GRID */
.mc-category-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 10px;
}

.mc-category-card {
  cursor: pointer;
  text-align: center;
}

.mc-category-thumb {
  height: 50px;
  border-radius: 5px;
  background: linear-gradient(135deg, #e3f2fd, #ede7f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: #555;
}

.mc-category-name {
  margin-top: 8px;
  font-size: 12px;
}

.mc-category-card:hover .mc-category-thumb {
  background: linear-gradient(135deg, #e6ddff, #ddd2ff);
}

    .hidden-input{
    display:none !important;
    opacity:0;
    pointer-events:none;
    position:absolute;
    left:-9999px;
}

    .upload-box{
    display:flex;
    align-items:center;
    gap:10px;
}

.upload-btn{
    background:#105496;
    color:white;
    border:none;
    padding:14px 30px;
    font-size:16px;
    border-radius:14px;
    cursor:pointer;
    font-weight:600;
}

.dots-btn{
    width:42px;
    height:38px;
    border-radius:5px;
    border:none;
    background:#105496;
    color:white;
    font-size:26px;
    cursor:pointer;
}

.menu-wrapper{
    position:relative;
}

.upload-menu{
    position:absolute;
    top:60px;
    right:0;
    background:white;
    width:220px;
    border-radius:14px;
    box-shadow:0 10px 30px rgba(0,0,0,.15);
    display:none;
    overflow:hidden;
    z-index:9999;
}

.menu-item{
    padding:16px;
    display:flex;
    align-items:center;
    gap:12px;
    cursor:pointer;
    font-weight:600;
}

.menu-item-icon{
  width:24px;
  height:24px;
  flex:0 0 24px;
  display:block;
}

.menu-item:hover{
    background:#f2f2f2;
}

.gdrive-icon{
  object-fit:contain;
}

.folder-icon{
  color:#6b7280;
}

    .media-search {
  margin-bottom: 10px;
}

#mediaSearch {
  width: 100%;
  padding: 8px 10px;
  border-radius: 5px;
  border: 1px solid #ddd;
}

#mediaSearch:focus {
  outline: none;
  border-color: #d41c58;
}


  #mediaGridWrap {
  position: relative;
}

#mediaDropOverlay {
  position: absolute;
  inset: 0;                 /* fills only the wrapper */
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  z-index: 20;
}

#mediaDropOverlay.active {
  display: flex;
}

/* FOLDER ROW LIST STYLE */
/* FOLDER LIST VIEW */

#mediaGrid.folders-view {
  display: block !important;
  column-count: initial !important;
}

.folder-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  margin-bottom: 10px;
  cursor: pointer;
}

.folder-row:hover {
  background: #fafafa;
}

.folder-row.create {
  border: 2px dashed #ddd;
  background: transparent;
  box-shadow: none;
}

.folder-row .thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #f1f1f1;
  background-size: cover;
  background-position: center;
}

.folder-row .create-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #777;
}

.folder-row .info .name {
  font-weight: 600;
  margin-bottom: 4px;
}

.folder-row .meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 10px;
  color: #666;
}

.folder-row .badge.lock {
  padding: 2px 8px;
  border-radius: 2px;
  background: #eee;
  color: #707070;
font-size: 10px;
font-weight: 500;
}

.badge.lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.badge.lock svg {
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid #ddd;
  font-size: 12px;
}

.search-input:focus {
  outline: none;
  border-color: #d41c58;
}
    
    .url-box {
  margin-bottom: 5px;
}

.url-label {
  font-size: 12px;
  margin-bottom: 4px;
  display:block;
}

.url-row {
  display: flex;
  gap: 6px;
}

.url-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid #ddd;
  font-size: 12px;
}

.url-input:focus {
  outline: none;
  border-color: #d41c58;
}

.url-btn {
  background:#d41c58;
  border:0;
  border-radius:5px;
  width:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;

  transition:.15s;
}

.url-btn:hover {
  background:#9e1542;
}

.url-btn:active {
  transform:scale(.96);
}

    .upload-btn {
  width: 100%;
  background: #d41c58;          /* purple */
  color: #fff;
  border: 0;
  border-radius: 5px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .15s, transform .1s;
}

.upload-btn:hover {
  background: #9e1542;
}

.upload-btn:active {
  transform: scale(.98);
}

.upload-box {
  margin-bottom: 10px;
}

    .media-tabs {
  display:flex;
  gap:3px;
  margin-bottom:10px;
  font-size:12px;
}

.media-tabs button {
  background:transparent;
  border:0;
  cursor:pointer;
  padding-bottom:6px;
}

.media-tabs button.active {
  font-weight:600;
  color:#105496;
  border-bottom:3px solid #105496;
}

[data-tab-panel="media"] {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

#mediaGridWrap {
  width: 100%;
  max-width: 100%;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 12px;
}

/* Masonry media grid */
#mediaGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  grid-auto-rows: 8px;
  align-items: start;
}

@media (max-width: 980px) {
  #mediaGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #mediaGrid {
    grid-template-columns: 1fr;
  }
}

/* base card style */
.media-card {
  background:#fff;
  border-radius:5px;
  overflow:hidden;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
  transition:transform .15s, box-shadow .15s;
  margin: 0;
}

.media-card:hover {
  transform:translateY(-2px);
  box-shadow:0 10px 25px rgba(0,0,0,.12);
}

/* mini thumbnail cards in the grid */
.media-card.mini {
  position: relative;
  width: 100%;
  display: block;
  grid-row-end: span 25;
}

.media-card.mini .thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%;
}

.media-card.mini .thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}



/* 3 dots button */
.media-menu-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: rgba(0,0,0,.55);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: none;
  cursor: pointer;
}

.media-card.mini:hover .media-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Context menu */
.media-context {
  position: absolute;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 25px 50px rgba(0,0,0,.12);
  width: 260px;
  padding: 10px 0;
  z-index: 5000;
}

.media-context .mc-head {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

.media-context .mc-head strong {
  font-size: 14px;
}

.media-context .mc-head small {
  display: block;
  color: #7a7a7a;
  font-size: 11px;
}

.media-context .mc-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
}

.media-context .mc-item:hover {
  background: #f5f5f5;
}

.media-context .mc-item.danger {
  color: #c81e1e;
}
.media-context {
 
  position: fixed !important;
  margin: 0 !important;
}


@keyframes menuPop {
  from {
    transform: scale(.9) translateX(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateX(0);
    opacity: 1;
  }
}
.move-popup {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:7000;
}

.mp-panel {
  background:#fff;
  width:520px;
  border-radius:16px;
  padding:14px 18px;
  box-shadow:0 25px 60px rgba(0,0,0,.25);
}

.mp-header {
  font-size:16px;
  font-weight:600;
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}

.mp-header span {
  font-weight:400;
}

.mp-close {
  background:transparent;
  border:0;
  font-size:20px;
  cursor:pointer;
}

.mp-current {
  font-size:12px;
  margin-bottom:8px;
}

.mp-current .badge {
  padding:4px 8px;
  background:#f5f5f5;
  border-radius:8px;
  color: #585858ff;
}

.mp-search input {
  width:100%;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid #ddd;
  margin-bottom:10px;
}

.mp-list {
  max-height:260px;
  overflow:auto;
  margin-bottom:8px;
}

.mp-row {
  display:flex;
  align-items:center;
  padding:8px;
  border-radius:10px;
  cursor:pointer;
}

.mp-row:hover {
  background:#f6f6f6;
}

.mp-row.active {
  background:#eef3ff;
}

.mp-row .thumb {
  width:40px;
  height:40px;
  border-radius:6px;
  background:#eaeaea;
  background-size:cover;
  background-position:center;
  margin-right:10px;
}

.mp-row .thumb.root {
  background:#f3f3f3;
}

.mp-row .info .name {
  font-size:13px;
}

.mp-row .info .count {
  font-size:11px;
  color:#777;
}

.mp-warning {
  background:#fff3cd;
  color:#6c5717;
  padding:6px 10px;
  border-radius:8px;
  margin-bottom:8px;
}

.mp-create {
  font-size:13px;
  color:#0d6efd;
  cursor:pointer;
  margin:6px 0;
}

.mp-footer {
  display:flex;
  justify-content:flex-end;
  gap:8px;
}

.btn {
  border:1px solid #ddd;
  border-radius:8px;
  padding:6px 10px;
}

.btn.primary {
  background:#0d6efd;
  color:#fff;
}

.btn.primary:disabled {
  opacity:.4;
}

.mc-head-row {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

.mc-head-row .title {
  display:flex;
  align-items:center;
  gap:6px;
  font-weight:600;
}

.file-name {
  font-size:14px;
}

.rename-btn {
  background:transparent;
  border:0;
  cursor:pointer;
}

.meta {
  font-size:11px;
  color:#777;
  margin-top:2px;
}

.mc-menu .mc-item {
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  cursor:pointer;
}

.mc-menu .mc-item:hover {
  background:#f6f6f6;
}

.mc-menu .icon {
  width:20px;
  height:20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.mc-item.danger {
  color:#c81e1e;
}
.details-panel-wrap {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.25);
  display:flex;
  justify-content:flex-end;
  z-index:7000;
}

.details-panel {
  width:340px;
  background:#fff;
  height:100%;
  padding:14px;
  box-shadow:-10px 0 25px rgba(0,0,0,.15);
  display:flex;
  flex-direction:column;
  animation:slideIn .25s ease;
}
.details-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;      /* prevents content from spilling out */
}

.dp-preview {
  width: 100%;
  max-height: 260px;     /* you can tune this */
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.dp-preview img,
.dp-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* keeps aspect ratio correctly */
  display: block;
  background: #fafafa;
}

/* content below preview becomes scrollable */
.details-panel {
  overflow-y: auto;
}


@keyframes slideIn {
  from { transform:translateX(40px); opacity:0; }
  to { transform:translateX(0); opacity:1; }
}

.dp-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:16px;
  margin-bottom:10px;
}

.dp-close {
  background:transparent;
  border:0;
  font-size:20px;
  cursor:pointer;
}


.dp-section {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  background: #f8fafc;
}

.dp-section label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}

.dp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.dp-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.dp-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.dp-meta > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e9eef5;
  font-size: 12px;
  color: #1e293b;
  line-height: 1.35;
}

.dp-meta > div b {
  color: #475569;
  font-weight: 700;
  min-width: 90px;
}

.dp-meta span {
  text-align: right;
  word-break: break-word;
}

.dp-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  color: #334155;
}

.dp-size-raw {
  color: #64748b;
  margin-left: 6px;
  font-size: 11px;
}

.dp-type,
.dp-mime,
.dp-ext,
.dp-source {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
  font-weight: 600;
}

.dp-actions {
  margin-top:auto;
  display:flex;
  gap:8px;
}

.dp-actions .btn {
  flex:1;
}

.btn {
  border:1px solid #ddd;
  padding:8px 10px;
  border-radius:8px;
}

.btn.danger {
  background:#ffe5e5;
  color:#c00;
}
.dp-icon-btn {
  background:transparent;
  border:0;
  cursor:pointer;
  padding:4px;
  border-radius:6px;
}

.dp-icon-btn:hover {
  background:#f3f3f3;
}

.dp-actions button svg {
  margin-right:6px;
}
button.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mp-badge-folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mp-badge-folder svg {
  flex-shrink: 0;
}

.save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #2563eb;
  color: white;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 5px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  min-width: 120px;
  margin-bottom: 5px;
  margin-top: 5px;
  
}

.save-btn:hover:not(:disabled) {
  background: #0a53ad;
}

.save-btn:disabled {
  opacity: .75;
  cursor: not-allowed;
}

/* Testimonials inspector */
.testimonials-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  margin: 6px 0 10px;
}

.testimonials-table .testimonial-slide-row {
  background: #ffffff;
  border: 1px solid #e8edf5;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.testimonials-table .testimonial-slide-row td {
  vertical-align: middle;
  padding: 10px 8px;
}

.testimonials-table .col-no {
  width: 28px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.testimonials-table .col-name {
  min-width: 0;
}

.testimonials-table .name-main {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.testimonials-table .name-sub {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.testimonials-table .col-actions {
  width: 82px;
  text-align: right;
  white-space: nowrap;
  padding-right: 8px;
}

.slide-edit-btn,
.slide-delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #dbe3ee;
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .18s ease;
  margin-left: 6px;
}

.slide-edit-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.slide-delete-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.tm-add-btn {
  width: 100%;
  margin: 6px 0 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all .18s ease;
}

.tm-add-btn:hover {
  border-color: #a5b4fc;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.2);
}

/* Spinner */
.save-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#jsonInput {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.4;
}



#app-loader {
  position: fixed;
  inset: 0;
  background: #f3f4f600; /* light neutral like Adobe */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;
}
.loader-window {
  width: 800px;
  height: 450px;
  background: #ffffff;
  display: flex;
  box-shadow: 0 25px 80px rgba(0,0,0,0.25);
  border-radius: 6px;
  overflow: hidden;
}


/* LEFT PANEL */
/* LEFT PANEL */
.loader-left {
  width: 42%;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* RIGHT PANEL */
.loader-right {
  width: 58%;
  overflow: hidden;
}

.loader-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* LOGO */
.brand img {
  height: 42px;
  margin-bottom: 12px;
}

.brand h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
}

.subtitle {
  margin-top: 16px;
  color: #555;
}

/* PROGRESS BAR */
.progress {
  width: 100%;
  height: 6px;
  background: #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 24px;
}

.progress .bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  animation: loading 2.5s ease-in-out infinite;
}

@keyframes loading {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

.footer {
  font-size: 12px;
  color: #888;
}

/* ARTWORK */
.loader-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* ==============================
   Folder Picker Modal
============================== */

.folder-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

/* Backdrop */
.fp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

/* Panel */
.fp-panel {
  position: relative;
  width: 420px;
  max-width: 92vw;
  max-height: 70vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fp-scale-in 0.18s ease-out;
}

/* Header */
.fp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 15px;
  font-weight: 600;
}

.fp-header strong {
  font-weight: 600;
}

/* Close */
.fp-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  opacity: 0.6;
}

.fp-close:hover {
  opacity: 1;
}

/* Folder List */
.fp-list {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

/* Folder Row */
.fp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.fp-row:hover {
  background: #f3f4f6;
}

.fp-row:active {
  transform: scale(0.98);
}

/* Thumbnail */
.fp-row .thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background-color: #e5e7eb;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

/* Folder Info */
.fp-row .info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fp-row .name {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.fp-row .count {
  font-size: 12px;
  color: #6b7280;
}

/* Animation */
@keyframes fp-scale-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.folder-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* ── NAS File Browser Modal ─────────────────────────────────── */
.nas-browser-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.nb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.nb-panel {
  position: relative;
  width: 560px;
  max-width: 95vw;
  height: 620px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fp-scale-in 0.18s ease-out;
}

.nb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 15px;
  font-weight: 600;
}

.nb-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  opacity: 0.6;
}

.nb-close:hover { opacity: 1; }

.nb-address-bar {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
}

.nb-address-bar input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  min-width: 0;
}

.nb-address-bar input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

.nb-login-row {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  align-items: flex-end;
  background: #f9fafb;
}

.nb-login-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.nb-login-field label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nb-login-field input {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}

.nb-login-field input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

.nb-connect-btn {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  align-self: flex-end;
  white-space: nowrap;
}

.nb-connect-btn:hover { background: #2563eb; }

.nb-go-btn {
  background: #e5e7eb;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

.nb-go-btn:hover { background: #d1d5db; }



.nb-breadcrumbs {
  padding: 6px 16px;
  font-size: 12px;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 28px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.nb-breadcrumb-item {
  cursor: pointer;
  color: #3b82f6;
}

.nb-breadcrumb-item:hover { text-decoration: underline; }

.nb-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.nb-loading,
.nb-error,
.nb-empty {
  padding: 32px 24px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
}

.nb-error { color: #dc2626; }

.nb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  transition: background 0.12s;
}

.nb-item-folder {
  cursor: pointer;
}

.nb-item-folder:hover { background: #eff6ff; }
.nb-item-folder:active { transform: scale(0.98); }

.nb-item-file {
  cursor: default;
  opacity: 0.75;
}

.nb-item-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nb-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
  font-weight: 500;
}

.nb-item-folder .nb-item-name { color: #1d4ed8; }

.nb-footer {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  gap: 10px;
  background: #f9fafb;
}

.nb-current-label {
  font-size: 12px;
  color: #6b7280;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-use-btn {
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.nb-use-btn:hover { background: #15803d; }

/* NAS URL input with Browse button */
.nas-url-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nas-url-row input {
  flex: 1;
  min-width: 0;
}

.nas-browse-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  color: #374151;
  font-weight: 500;
}

.nas-browse-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}
/* ── end NAS File Browser ───────────────────────────────────── */

.folder-count {
  
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #111827;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 600;
}
.slide-duration-badge {
  position: absolute;
  bottom: 10px;
  right: 12px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 500;
  pointer-events: none;
  z-index: 5;
}
.media-storage-bar {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 5px;
  background: #105496;
  border: 1px solid #105496;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  bottom: 0;
  z-index: 6;
  flex-shrink: 0;
  box-shadow: 0 -6px 18px rgba(16, 84, 150, 0.18);
}

.storage-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.storage-icon {
  width: 26px;
  height: 26px;
  color: #38bdf8;
}

.storage-title {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}

.storage-meta {
  font-size: 12px;
  color: #94a3b8;
}

.storage-right {
  flex: 1;
}

.storage-bar {
  height: 8px;
  background: #105496;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #818185b5;
}

.storage-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width 0.3s ease;
  border: 1px solid #818185b5;
}



.sm-talking-avatar-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sm-anchor-ai {
  position: relative;
  width: min(42vw, 520px);
  max-width: 92%;
  transform-origin: center bottom;
  animation: smAvatarIdleMove 6s ease-in-out infinite;
  will-change: transform;
}

.sm-anchor-body {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.sm-anchor-eyes,
.sm-anchor-mouth {
  position: absolute;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.sm-anchor-eyes {
  z-index: 3;
}

.sm-anchor-mouth {
  z-index: 4;
}

.sm-talking-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  width: 100%;
  height: 100%;
  font-size: 18px;
  padding: 20px;
  text-align: center;
}

@keyframes smAvatarIdleMove {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-2px) rotate(0.35deg);
  }
  50% {
    transform: translateY(-4px) rotate(0deg);
  }
  75% {
    transform: translateY(-2px) rotate(-0.35deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

.sm-anchor-ai{

animation:anchorIdle 7s ease-in-out infinite;

transform-origin:center bottom;

}

@keyframes anchorIdle{

0%{
transform:translateY(0) rotate(0deg);
}

25%{
transform:translateY(-3px) rotate(0.5deg);
}

50%{
transform:translateY(-5px) rotate(0deg);
}

75%{
transform:translateY(-3px) rotate(-0.5deg);
}

100%{
transform:translateY(0) rotate(0deg);
}

}

.sm-anchor-body{

animation:breath 5s ease-in-out infinite;

}

@keyframes breath{

0%{transform:scale(1)}
50%{transform:scale(1.01)}
100%{transform:scale(1)}

}

.sm-talking-avatar-wrap{
  position: relative;
  display: inline-block;
}

.sm-anchor-ai{
  position: relative;
  display: inline-block;
}

.sm-anchor-body{
  width: 100%;
  height: auto;
  display: block;
}

.sm-anchor-eyes,
.sm-anchor-mouth{
  position: absolute;
  transform-origin: center;
  pointer-events: none;
}

/* ============================================================
   SLIDESHOW WIDGET  —  Properties Panel + Slide Modal
============================================================ */

/* ---- Stats bar at top of slideshow props ---- */
.ss-stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 10px 0 8px;
  margin-bottom: 2px;
}
.ss-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.ss-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #0ea5e9;
  line-height: 1.1;
}
.ss-stat-lbl {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}
.ss-stat-sep {
  width: 1px;
  height: 32px;
  background: #e2e8f0;
  margin: 0 8px;
}
.ss-empty-hint {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  padding: 12px 8px;
  font-style: italic;
}

/* ---- Slide icon toolbar (add slide buttons) ---- */
.slide-icon-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 2px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}
.slide-toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: max-content;
}
.slide-toolbar-group-right {
  margin-left: auto;
}
.slide-toolbar-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
  margin-right: 2px;
}
.slide-icon-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 9px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0px;
  cursor: pointer;
  color: #374151;
  font-size: 10px;
  font-weight: 500;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  min-width: 0;
  white-space: nowrap;
}
.slide-icon-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
}
.slide-icon-btn:active {
  transform: translateY(0);
}
.slide-icon-btn.playing {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #b45309;
}
.slide-play-btn {
  min-width: 44px;
  flex-shrink: 0;
}
.slide-btn-label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}

/* ---- Slide list table ---- */
.slide-list-host {
  margin: 0;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.slide-table-wrap { width: 100%; }
.slide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.slide-table thead tr {
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}
.slide-table thead th {
  padding: 7px 10px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.th-no  { width: 28px; }
.th-name { }
.th-actions { width: 66px; text-align: center !important; }
.slide-table tbody tr.slide-row {
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .1s;
}
.slide-table tbody tr.slide-row:last-child { border-bottom: none; }
.slide-table tbody tr.slide-row:hover { background: #f8fafc; }
.slide-table tbody tr.slide-row.active { background: #eff6ff; border-left: 3px solid #3b82f6; }
.slide-table tbody tr.slide-row.dragging { opacity: .45; background: #f0f4ff; }
.slide-table .col-no {
  width: 28px;
  padding: 8px 8px 8px 10px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
.slide-table .col-name {
  padding: 7px 8px;
  vertical-align: middle;
}
.slide-table .col-actions {
  width: 66px;
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.slide-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slide-name-text { line-height: 1.3; }
.slide-name-text .name-main {
  font-size: 12.5px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.slide-name-text .name-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}
/* type badge */
.slide-type-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.type-img  { background: #dcfce7; color: #15803d; }
.type-vid  { background: #fee2e2; color: #b91c1c; }
.type-txt  { background: #ede9fe; color: #6d28d9; }
.type-dir  { background: #fef9c3; color: #854d0e; }

/* slide preview thumbnail */
.slide-preview {
  width: 40px;
  height: 28px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-fallback {
  font-size: 14px;
  line-height: 1;
}
.text-preview {
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
  background: #e2e8f0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.folder-preview {
  background: #fef9c3;
  font-size: 16px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.folder-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 9px;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}

/* Edit / Delete buttons in slide row */
.slide-edit-btn,
.slide-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  color: #64748b;
  transition: background .12s, border-color .12s, color .12s;
  padding: 0;
  margin: 0 1px;
}
.slide-edit-btn:hover   { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.slide-delete-btn:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }

/* ============================================================
   SLIDE MODAL
============================================================ */
.slide-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.slide-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(3px);
}
.slide-modal-content {
  position: relative;
  width: 520px;
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 32px 80px rgba(15,23,42,.28), 0 0 0 1px rgba(0,0,0,.06);
  overflow: hidden;
  animation: smScaleIn .18s ease-out;
}
@keyframes smScaleIn {
  from { opacity: 0; transform: scale(.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1)  translateY(0);    }
}
.slide-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}
#slideModalTitle {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: .1px;
}
#slideModalClose {
  width: 28px;
  height: 28px;
  border: none;
  background: #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}
#slideModalClose:hover { background: #fecaca; color: #dc2626; }
.slide-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* ---- Content inside the modal ---- */
.sm-fields-wrap {
  padding: 16px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* type pill at top */
.sm-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 14px;
  align-self: flex-start;
}
.sm-type-image  { background: #dcfce7; color: #15803d; }
.sm-type-video  { background: #fee2e2; color: #b91c1c; }
.sm-type-text   { background: #ede9fe; color: #6d28d9; }
.sm-type-folder { background: #fef9c3; color: #854d0e; }

/* sections */
.sm-section {
  margin-bottom: 16px;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
}
.sm-section-title {
  padding: 7px 12px 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}
/* rows */
.sm-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #f8fafc;
}
.sm-field-row:last-child { border-bottom: none; }
.sm-field-col {
  flex-direction: column;
  align-items: stretch;
}
.sm-label {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  flex-shrink: 0;
  white-space: nowrap;
}
.sm-input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12.5px;
  color: #0f172a;
  background: #fff;
  transition: border-color .15s;
  outline: none;
}
.sm-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.12); }
.sm-select {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12.5px;
  color: #0f172a;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.sm-select:focus { border-color: #3b82f6; }
.sm-textarea {
  width: 100%;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: inherit;
  color: #0f172a;
  line-height: 1.5;
  margin-top: 6px;
  outline: none;
  transition: border-color .15s;
}
.sm-textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.12); }
.sm-color {
  width: 36px;
  height: 28px;
  padding: 2px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
}
.sm-input-unit-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.sm-unit {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  flex-shrink: 0;
}
/* toggle */
.sm-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.sm-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.sm-toggle-knob {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 99px;
  transition: background .2s;
}
.sm-toggle-knob::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.sm-toggle input:checked + .sm-toggle-knob { background: #3b82f6; }
.sm-toggle input:checked + .sm-toggle-knob::after { transform: translateX(16px); }
/* picker in modal */
.sm-picker-wrap { padding: 10px; }
/* folder count note */
.sm-folder-count {
  display: block;
  font-size: 11px;
  color: #64748b;
  padding: 4px 12px 8px;
}
/* footer actions */
.sm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 16px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  gap: 8px;
  margin-top: 4px;
}
.sm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s;
}
.sm-btn:active { transform: scale(.97); }
.sm-btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,.35);
}
.sm-btn-primary:hover { background: linear-gradient(135deg, #2563eb, #1e40af); }
.sm-btn-secondary {
  background: #f1f5f9;
  color: #374151;
  border: 1px solid #e2e8f0;
}
.sm-btn-secondary:hover { background: #e2e8f0; }
.sm-btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.sm-btn-danger:hover { background: #fee2e2; }

/* ============================================================
   AI Creator Panel  — aicreator styles
   ============================================================ */

[data-tab-panel="aicreator"] {
  display: flex; flex-direction: column; gap: 0;
  padding: 0 0 24px; overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Header ── */
.ai-header {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 14px 12px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-bottom: 1px solid #ddd6fe;
}
.ai-header-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.ai-header-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; }
.ai-header-text { flex: 1; min-width: 0; }
.ai-header-title { font-size: 13px; font-weight: 700; color: #1e293b; line-height: 1.2; }

#aiStatusBadge {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 3px;
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  background: rgba(34,197,94,.12); color: #16a34a; border: 1px solid rgba(34,197,94,.3);
}
#aiStatusBadge.ai-badge--off { background: rgba(239,68,68,.08); color: #dc2626; border-color: rgba(239,68,68,.25); }
.ai-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ── Steps ── */
.ai-step {
  padding: 12px 14px 0;
}
.ai-step-head {
  display: flex; align-items: center; gap: 7px; margin-bottom: 8px;
}
.ai-step-num {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: #6366f1; color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ai-step-label {
  font-size: 11px; font-weight: 700; color: #374151; letter-spacing: .02em;
}
.ai-step-hint {
  font-size: 10px; color: #9ca3af; font-style: italic; margin-left: auto;
}

/* ── Chips ── */
.ai-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500;
  padding: 4px 9px; border-radius: 20px; cursor: pointer; user-select: none;
  background: #f9fafb; border: 1px solid #e5e7eb;
  color: #374151; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.ai-chip:hover { background: #ede9fe; border-color: #a5b4fc; color: #4338ca; transform: translateY(-1px); }
.ai-chip.active { background: #6366f1; border-color: #6366f1; color: #fff; box-shadow: 0 2px 6px rgba(99,102,241,.3); }

/* ── Textarea ── */
.ai-textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 80px;
  background: #fff; border: 1.5px solid #e5e7eb;
  border-radius: 8px; color: #1e293b; font-size: 12px; padding: 9px 11px;
  line-height: 1.6; outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.ai-textarea:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.ai-textarea::placeholder { color: #b0b7c3; }

.ai-template-hint {
  margin-top: 6px; padding: 6px 10px; border-radius: 6px;
  font-size: 11px; color: #4338ca;
  background: #eef2ff; border: 1px solid #c7d2fe;
}

/* ── Controls ── */
.ai-controls-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.ai-ctrl { display: flex; flex-direction: column; gap: 4px; }
.ai-ctrl-label { font-size: 9.5px; font-weight: 700; color: #9ca3af; letter-spacing: .07em; text-transform: uppercase; }

.ai-select-wrap { position: relative; }
.ai-ctrl-input {
  width: 100%; box-sizing: border-box;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 8px center / 10px 6px;
  border: 1.5px solid #e5e7eb;
  border-radius: 7px; color: #1e293b; font-size: 11px;
  padding: 6px 26px 6px 9px;
  outline: none; font-family: inherit;
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s; cursor: pointer;
}
.ai-ctrl-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

/* ── Generate button ── */
.ai-generate-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 14px 14px 0;
  padding: 11px 16px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; letter-spacing: .02em;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
  transition: opacity .2s, transform .12s, box-shadow .2s;
}
.ai-generate-btn:hover:not(:disabled) { opacity: .92; box-shadow: 0 6px 18px rgba(99,102,241,.45); transform: translateY(-1px); }
.ai-generate-btn:active:not(:disabled) { transform: scale(.98) translateY(0); }
.ai-generate-btn:disabled,
.ai-generate-btn.ai-generating { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.ai-btn-arrow svg { width: 16px; height: 16px; fill: #fff; }
.ai-spinner {
  width: 14px; height: 14px; border-radius: 50%; display: none;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: ai-spin .7s linear infinite;
}
.ai-generating .ai-spinner { display: inline-block; }
.ai-generating .ai-btn-arrow { display: none; }
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* ── Progress & messages ── */
#aiProgressWrap { display: none; flex-direction: column; gap: 6px; padding: 10px 14px 0; }
#aiProgressWrap.visible { display: flex; }
.ai-progress-bar { width: 100%; height: 5px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
#aiProgressFill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 99px; transition: width .45s ease;
}
#aiProgressLabel { font-size: 10px; color: #6b7280; text-align: center; }

#aiMessage { display: none; margin: 8px 14px 0; padding: 9px 12px; border-radius: 8px; font-size: 11px; line-height: 1.5; }
#aiMessage.visible { display: block; }
#aiMessage.ai-message--error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
#aiMessage.ai-message--warn  { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
#aiMessage.ai-message--info  { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }

#aiResultSummary {
  display: none; margin: 8px 14px 0; padding: 9px 12px; border-radius: 8px;
  font-size: 11px; color: #16a34a; background: #f0fdf4; border: 1px solid #bbf7d0;
}
#aiResultSummary.visible { display: block; }

/* ── Divider ── */
.ai-divider { border: none; border-top: 1px solid #f1f5f9; margin: 14px 0 0; }

/* ── Template grid ── */
#aiTemplateGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px; }

.ai-tpl-card {
  display: flex; flex-direction: column; border-radius: 10px; overflow: hidden;
  cursor: pointer; background: #fff; border: 1.5px solid #e5e7eb;
  transition: border-color .15s, box-shadow .15s, transform .12s; user-select: none;
}
.ai-tpl-card:hover { border-color: #a5b4fc; box-shadow: 0 3px 10px rgba(99,102,241,.12); transform: translateY(-2px); }
.ai-tpl-card.active { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,.2); }

/* Coloured accent strip per industry */
.ai-tpl-preview {
  height: 6px; width: 100%; flex-shrink: 0;
}
.ai-tpl-preview--school      { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.ai-tpl-preview--jewellery   { background: linear-gradient(90deg, #d4a017, #f59e0b); }
.ai-tpl-preview--bakery      { background: linear-gradient(90deg, #f97316, #fb923c); }
.ai-tpl-preview--restaurant  { background: linear-gradient(90deg, #ef4444, #f97316); }
.ai-tpl-preview--retail      { background: linear-gradient(90deg, #ec4899, #f43f5e); }
.ai-tpl-preview--realestate  { background: linear-gradient(90deg, #10b981, #059669); }
.ai-tpl-preview--fitness     { background: linear-gradient(90deg, #8b5cf6, #6366f1); }
.ai-tpl-preview--hospital    { background: linear-gradient(90deg, #06b6d4, #0ea5e9); }
.ai-tpl-preview--hotel       { background: linear-gradient(90deg, #64748b, #475569); }
.ai-tpl-preview--technology  { background: linear-gradient(90deg, #6366f1, #8b5cf6); }

/* chip SVG icon */
.ai-chip-icon {
  width: 13px; height: 13px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* template card icon badge */
.ai-tpl-icon-wrap {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin: 8px 10px 2px;
}
.ai-tpl-icon-wrap svg {
  width: 15px; height: 15px;
  stroke: #fff; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ai-tpl-icon--school     { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.ai-tpl-icon--jewellery  { background: linear-gradient(135deg, #b8860b, #f59e0b); }
.ai-tpl-icon--bakery     { background: linear-gradient(135deg, #f97316, #fb923c); }
.ai-tpl-icon--restaurant { background: linear-gradient(135deg, #ef4444, #f97316); }
.ai-tpl-icon--retail     { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.ai-tpl-icon--realestate { background: linear-gradient(135deg, #10b981, #059669); }
.ai-tpl-icon--fitness    { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.ai-tpl-icon--hospital   { background: linear-gradient(135deg, #06b6d4, #0ea5e9); }
.ai-tpl-icon--hotel      { background: linear-gradient(135deg, #64748b, #475569); }
.ai-tpl-icon--technology { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.ai-tpl-card > .ai-tpl-name { font-size: 11px; font-weight: 700; color: #1e293b; padding: 0 10px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-tpl-card > .ai-tpl-desc { font-size: 10px; color: #6b7280; line-height: 1.4; padding: 0 10px 9px; }

/* ═══════════════════════════════════════════════════════════════════════════
   DASHLITE COMPREHENSIVE MOBILE FIX
   Addresses horizontal overflow, header nav crowding, table scroll,
   modal sizing, form element overflow, and sidebar toggle on small screens.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Prevent horizontal overflow on the whole page ─────────────────────── */
.card-inner {
            padding: 1.25rem !important;
            align-items: unset !important;
            overflow: visible !important;
        }
        @media (min-width: 576px) {
            .card-inner {
                padding: 1.5rem !important;
            }
        }
        .card-inner-sm {
            padding: 0.75rem 1.25rem !important;
            align-items: unset !important;
        }
        /* list-group inside card: allow flush list to render correctly */
        .card > .list-group {
            overflow: hidden;
        }
        .card > .list-group:last-child {
            border-bottom-left-radius: inherit;
            border-bottom-right-radius: inherit;
        }
        .card > .list-group:first-child {
            border-top-left-radius: inherit;
            border-top-right-radius: inherit;
        }
        .list-group-item {
            padding: 0.75rem 1.25rem;
        }
        .list-group-item-action {
            display: block;
            width: 100%;
        }
        /* nosidebar layout: restore content padding stripped by dashlite */
        .nk-wrap-nosidebar .nk-content-body {
            padding: 1.5rem 0 2rem;
        }
        @media (min-width: 576px) {
            .nk-wrap-nosidebar .nk-content-body {
                padding: 2rem 0 3rem;
            }
        }
/* ── 3. nk-quick-nav: tighten spacing on very small screens ──────────────── */
@media (max-width: 479.98px) {
  .nk-header-tools .nk-quick-nav {
    margin: 0 -4px;
  }
  .nk-header-tools .nk-quick-nav > li {
    padding: 0 3px;
  }
  /* Hide decorative language-flag dropdown on xs to save space */
  .nk-header-tools .language-dropdown:not(.user-dropdown) {
    display: none !important;
  }
}

/* ── 4. Dropdowns: never clip inside the header or block-head ─────────────── */
.nk-header,
.nk-header-wrap,
.nk-header-tools {
  overflow: visible !important;
}
.nk-header .dropdown-menu {
  max-width: calc(100vw - 16px);
}

/* ── 5. Tables: DataTable dropdown fix ─────────────────────────────────────── */
/* Dropdown overflow is handled via JS: shown.bs.dropdown temporarily sets
   overflow:visible on the clipping parent, hidden.bs.dropdown restores it.
   We just need z-index so the menu floats above adjacent rows. */
.nk-tb-list .dropdown-menu,
.dataTables_wrapper .dropdown-menu {
  z-index: 1050;
}

/* ── 6. Cards ─────────────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  .nk-content .nk-block-head {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ── 8. Form elements: prevent inputs/selects from exceeding viewport ─────── */
@media (max-width: 575.98px) {
  .form-control,
  .form-select,
  .input-group {
    max-width: 100%;
  }
  /* Select2: keep the rendered select within page bounds */
  .select2-container {
    max-width: 100%;
    min-width: 0 !important;
  }
  .select2-container--default .select2-selection--single {
    width: 100%;
  }
  /* Summernote toolbar: allow wrapping on mobile */
  .note-editor .note-toolbar {
    flex-wrap: wrap;
  }
}

/* ── 9. Modals: proper full-width treatment on mobile ────────────────────── */
@media (max-width: 575.98px) {
  .modal-dialog:not(.modal-dialog-centered.modal-sm) {
    margin: 0.5rem;
    max-width: calc(100vw - 1rem);
  }
  .modal-dialog-scrollable .modal-body {
    overflow-y: auto;
  }
  .modal-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .modal-footer .btn {
    flex: 1 1 auto;
  }
}

/* ── 10. nk-block row / g-gs: prevent column bleed on mobile ─────────────── */
@media (max-width: 575.98px) {
  .nk-block > .row,
  .nk-block > .g-gs {
    margin-left: 0;
    margin-right: 0;
  }
}
.dataTables_wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── 11. Sidebar overlay: correct z-index and tap-to-close region ─────────── */
.nk-sidebar-overlay {
  z-index: 1020;
  cursor: pointer;
}
/* Sidebar itself sits above the overlay */
.nk-sidebar {
  z-index: 1021;
}

/* ── 12. AdminLTE leftover neutralisation ────────────────────────────────── */
/* adminlte.min.js sets inline height on .content-wrapper which doesn't
   exist in DashLite, but the control-sidebar-bg div that's still in the
   footer can cause a horizontal bump. Hide it. */
.control-sidebar-bg {
  display: none !important;
}

/* ── 13. nk-content: ensure enough top clearance below sticky header ─────── */
@media (max-width: 1199.98px) {
  .nk-wrap {
    /* header is ~65px; the nk-wrap top-padding of 15px is already set by
       DashLite, but sometimes the sticky header overlaps content on mobile.
       Adding a safe margin for < xl breakpoint. */
    padding-top: 5px;
  }
}

/* ── 14. Bottom navigation / footer links: wrap on xs ────────────────────── */
@media (max-width: 575.98px) {
  .nk-footer-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .nk-footer-copyright,
  .nk-footer-links {
    width: 100%;
  }
}

/* ── 15. Stat / KPI cards: ensure value numbers don't overflow ───────────── */
@media (max-width: 575.98px) {
  .nk-cmwg .card-inner {
    overflow: visible;
  }
  .nk-cmwg1-ck canvas {
    display: block;
    width: 100% !important;
  }
}

/* ── 16. DataTable dropdown menus: handled by Section 5 position:fixed ── */

/* ── 17. Analytics KPI Widget Cards (nk-wgacc) ── */
.nk-wgacc .nk-wgacc-group{display:flex;align-items:center;justify-content:space-between}
.nk-wgacc .nk-wgacc-amount .number{font-size:1.75rem;font-weight:700;color:#364a63;line-height:1.2}
.nk-wgacc .nk-wgacc-title{font-size:13px;color:#8094ae;margin-top:4px}
.nk-wgacc .nk-wgacc-icon{font-size:2.25rem;opacity:.7}

/* ══════════════════════════════════════════════════════════════════════════ */
