/* ==========================================================
   CloudX — Apple-inspired theme
   Developed by Phoenify
   ========================================================== */
:root {
  --cx-bg: #f5f5f7;
  --cx-surface: #ffffff;
  --cx-surface-2: #fbfbfd;
  --cx-text: #1d1d1f;
  --cx-text-2: #6e6e73;
  --cx-text-3: #86868b;
  --cx-border: rgba(0, 0, 0, .08);
  --cx-border-strong: rgba(0, 0, 0, .14);
  --cx-blue: #0071e3;
  --cx-blue-hover: #0077ed;
  --cx-blue-soft: rgba(0, 113, 227, .09);
  --cx-red: #ff3b30;
  --cx-green: #34c759;
  --cx-radius: 18px;
  --cx-radius-sm: 12px;
  --cx-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --cx-shadow-lg: 0 12px 40px rgba(0, 0, 0, .12);
  --cx-sidebar-w: 250px;
  --cx-topbar-h: 64px;
  --cx-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html, body { height: 100%; }
body {
  font-family: var(--cx-font);
  background: var(--cx-bg);
  color: var(--cx-text);
  font-size: 15px;
  letter-spacing: -0.01em;
}
a { color: var(--cx-blue); text-decoration: none; }
a:hover { color: var(--cx-blue-hover); }
h1, h2, h3, h4, h5 { font-weight: 600; letter-spacing: -0.025em; }
.text-secondary-cx { color: var(--cx-text-2) !important; }
.text-muted { color: var(--cx-text-3) !important; }
::selection { background: rgba(0, 113, 227, .2); }

/* ---------- Buttons ---------- */
.btn { border-radius: 980px; font-weight: 500; padding: .5rem 1.15rem; letter-spacing: -0.01em; transition: all .18s ease; }
.btn-sm { padding: .35rem .85rem; font-size: .85rem; }
.btn-primary { background: var(--cx-blue); border-color: var(--cx-blue); }
.btn-primary:hover, .btn-primary:focus { background: var(--cx-blue-hover); border-color: var(--cx-blue-hover); }
.btn-light-cx { background: rgba(0, 0, 0, .05); color: var(--cx-text); border: 0; }
.btn-light-cx:hover { background: rgba(0, 0, 0, .09); color: var(--cx-text); }
.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.btn-danger { background: var(--cx-red); border-color: var(--cx-red); }

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-radius: var(--cx-radius-sm);
  border: 1px solid var(--cx-border-strong);
  padding: .7rem .95rem;
  background-color: var(--cx-surface);
  font-size: 15px;
}
.form-control:focus, .form-select:focus { border-color: var(--cx-blue); box-shadow: 0 0 0 4px rgba(0, 113, 227, .15); }
.form-label { font-weight: 500; font-size: .875rem; color: var(--cx-text-2); margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--cx-blue); border-color: var(--cx-blue); }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }

/* ---------- Cards ---------- */
.cx-card {
  background: var(--cx-surface);
  border-radius: var(--cx-radius);
  border: 1px solid var(--cx-border);
  box-shadow: var(--cx-shadow);
}
.cx-card-body { padding: 1.5rem; }
.cx-section-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 1rem; }
.cx-alert { border-radius: var(--cx-radius-sm); border: 0; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 113, 227, .10), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(191, 90, 242, .10), transparent 60%),
    var(--cx-bg);
}
.auth-card { width: 100%; max-width: 420px; padding: 2.5rem 2.25rem; border-radius: 24px; }
.auth-logo {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 1.25rem;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #2997ff, #0058b9);
  color: #fff; font-size: 30px;
  box-shadow: 0 10px 30px rgba(0, 113, 227, .35);
}
.auth-title { font-size: 1.75rem; text-align: center; margin-bottom: .35rem; }
.auth-sub { text-align: center; color: var(--cx-text-2); margin-bottom: 1.75rem; }
.cx-credit { font-size: .8rem; color: var(--cx-text-3); text-align: center; }
.cx-credit a { color: var(--cx-text-2); font-weight: 500; }

/* ---------- Layout ---------- */
.cx-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--cx-sidebar-w);
  background: rgba(246, 246, 248, .82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--cx-border);
  display: flex; flex-direction: column;
  z-index: 1030;
  padding: 1.1rem .85rem;
  overflow-y: auto;
}
.cx-brand { display: flex; align-items: center; gap: .65rem; padding: .25rem .6rem 1.25rem; color: var(--cx-text); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.03em; }
.cx-brand:hover { color: var(--cx-text); }
.cx-brand-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, #2997ff, #0058b9);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px;
  box-shadow: 0 4px 12px rgba(0, 113, 227, .3);
}
.cx-nav-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; color: var(--cx-text-3); letter-spacing: .04em; padding: 1rem .7rem .4rem; }
.cx-nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .52rem .7rem; border-radius: 10px;
  color: var(--cx-text); font-size: .92rem; font-weight: 450;
  margin-bottom: 2px;
}
.cx-nav a i { font-size: 1.05rem; width: 20px; text-align: center; color: var(--cx-blue); }
.cx-nav a:hover { background: rgba(0, 0, 0, .05); }
.cx-nav a.active { background: rgba(0, 0, 0, .08); font-weight: 600; }
.cx-nav a .badge { margin-left: auto; }
.cx-storage { margin-top: auto; padding: 1rem .7rem .25rem; }
.cx-storage .progress { height: 6px; border-radius: 6px; background: rgba(0, 0, 0, .08); }
.cx-storage .progress-bar { background: linear-gradient(90deg, #2997ff, #0071e3); border-radius: 6px; }
.cx-storage small { color: var(--cx-text-2); font-size: .78rem; }

.cx-main { margin-left: var(--cx-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.cx-topbar {
  position: sticky; top: 0; z-index: 1020;
  height: var(--cx-topbar-h);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1.75rem;
  background: rgba(245, 245, 247, .78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--cx-border);
}
.cx-search { position: relative; flex: 1; max-width: 520px; }
.cx-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--cx-text-3); }
.cx-search input { padding-left: 2.4rem; border-radius: 12px; background: rgba(0, 0, 0, .05); border: 1px solid transparent; height: 40px; }
.cx-search input:focus { background: #fff; }
.cx-content { padding: 1.75rem; flex: 1; }
.cx-footer { padding: 1.25rem 1.75rem; font-size: .8rem; color: var(--cx-text-3); border-top: 1px solid var(--cx-border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.cx-footer a { color: var(--cx-text-2); font-weight: 500; }

.cx-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: .82rem; flex-shrink: 0;
}
.cx-avatar.lg { width: 72px; height: 72px; font-size: 1.6rem; }

.dropdown-menu { border-radius: 14px; border: 1px solid var(--cx-border); box-shadow: var(--cx-shadow-lg); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .9rem; display: flex; align-items: center; gap: .6rem; }
.dropdown-item i { width: 18px; color: var(--cx-text-2); }
.dropdown-item.text-danger i { color: var(--cx-red); }
.dropdown-item:active { background: var(--cx-blue); }
.dropdown-item:active i { color: #fff; }

/* ---------- Page header ---------- */
.cx-page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.cx-page-title { font-size: 1.85rem; font-weight: 700; margin: 0; letter-spacing: -0.035em; }
.cx-breadcrumb { font-size: .9rem; margin-bottom: .25rem; }
.cx-breadcrumb a { color: var(--cx-text-2); }
.cx-breadcrumb a:hover { color: var(--cx-blue); }
.cx-breadcrumb .sep { color: var(--cx-text-3); margin: 0 .35rem; }

.cx-segment { display: inline-flex; background: rgba(0, 0, 0, .06); border-radius: 10px; padding: 3px; }
.cx-segment button, .cx-segment a { border: 0; background: transparent; padding: .35rem .7rem; border-radius: 8px; color: var(--cx-text-2); font-size: .9rem; }
.cx-segment .active { background: #fff; color: var(--cx-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- Stats ---------- */
.cx-stat { padding: 1.25rem 1.35rem; display: flex; align-items: center; gap: 1rem; height: 100%; }
.cx-stat-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.cx-stat-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.cx-stat-label { color: var(--cx-text-2); font-size: .85rem; }

.cx-storage-bar { display: flex; height: 12px; border-radius: 8px; overflow: hidden; background: rgba(0, 0, 0, .06); }
.cx-storage-bar span { display: block; height: 100%; }
.cx-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: var(--cx-text-2); }
.cx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

/* ---------- Drop zone ---------- */
.cx-dropzone {
  border: 2px dashed var(--cx-border-strong);
  border-radius: var(--cx-radius);
  padding: 2.25rem 1rem; text-align: center;
  background: var(--cx-surface-2);
  transition: all .2s ease; cursor: pointer;
}
.cx-dropzone:hover, .cx-dropzone.drag { border-color: var(--cx-blue); background: var(--cx-blue-soft); }
.cx-dropzone i { font-size: 2.4rem; color: var(--cx-blue); }
body.dragging-file::after {
  content: "Drop files to upload to CloudX";
  position: fixed; inset: 12px; z-index: 2000;
  border: 3px dashed var(--cx-blue); border-radius: 24px;
  background: rgba(0, 113, 227, .08);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 600; color: var(--cx-blue);
  pointer-events: none;
}

/* ---------- Grid view ---------- */
.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.cx-item {
  position: relative;
  background: var(--cx-surface);
  border: 1px solid var(--cx-border);
  border-radius: 16px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  user-select: none;
}
.cx-item:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }
.cx-thumb {
  aspect-ratio: 4 / 3;
  border-radius: 15px 15px 0 0;
  background: #f2f2f4;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.cx-thumb img, .cx-thumb video { width: 100%; height: 100%; object-fit: cover; }
.cx-thumb .bi { font-size: 3rem; }
.cx-thumb .cx-play {
  position: absolute; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(8px); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.cx-thumb .cx-play .bi { font-size: 1.3rem; }
.cx-folder-thumb .bi { font-size: 3.6rem; color: #5ac8fa; }
.cx-meta { padding: .7rem .85rem .8rem; }
.cx-name { font-size: .88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-sub { font-size: .76rem; color: var(--cx-text-3); margin-top: 2px; }
.cx-item .cx-more {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s; box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.cx-item:hover .cx-more, .cx-item .cx-more[aria-expanded="true"] { opacity: 1; }
.cx-thumb .cx-star-badge { position: absolute; top: 10px; left: 10px; color: #ffcc00; font-size: 1.05rem; text-shadow: 0 1px 3px rgba(0, 0, 0, .3); }

/* ---------- List view ---------- */
.cx-list { background: var(--cx-surface); border: 1px solid var(--cx-border); border-radius: var(--cx-radius); }
.cx-list-head { border-radius: var(--cx-radius) var(--cx-radius) 0 0; }
.cx-row:last-child { border-radius: 0 0 var(--cx-radius) var(--cx-radius); }
.cx-item.dd-open, .cx-row.dd-open { z-index: 50; }
.cx-list-head, .cx-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 110px 150px 44px; align-items: center; gap: .75rem; padding: .65rem 1.1rem; }
.cx-list-head { font-size: .75rem; font-weight: 600; color: var(--cx-text-3); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--cx-border); background: var(--cx-surface-2); }
.cx-row { border-bottom: 1px solid var(--cx-border); cursor: pointer; font-size: .9rem; transition: background .12s; }
.cx-row:last-child { border-bottom: 0; }
.cx-row:hover { background: #f7f7f9; }
.cx-row .cx-row-name { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.cx-row .cx-row-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cx-row-icon { width: 38px; height: 38px; border-radius: 9px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f2f2f4; flex-shrink: 0; font-size: 1.25rem; }
.cx-row-icon img { width: 100%; height: 100%; object-fit: cover; }
.cx-row .col-muted { color: var(--cx-text-2); font-size: .85rem; }
.cx-row .cx-more { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 50%; }
.cx-row .cx-more:hover { background: rgba(0, 0, 0, .06); }

/* ---------- Empty state ---------- */
.cx-empty { text-align: center; padding: 4rem 1rem; color: var(--cx-text-2); }
.cx-empty .bi { font-size: 4rem; color: #c7c7cc; display: block; margin-bottom: 1rem; }
.cx-empty h5 { color: var(--cx-text); }

/* ---------- Preview modal (Quick Look style) ---------- */
.cx-preview .modal-content { background: rgba(28, 28, 30, .92); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: 0; border-radius: 22px; color: #f5f5f7; overflow: hidden; }
.cx-preview .modal-header { border: 0; padding: .9rem 1.25rem; gap: .5rem; }
.cx-preview .modal-title { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-preview .modal-body { padding: 0; display: flex; align-items: center; justify-content: center; min-height: 60vh; max-height: calc(100vh - 160px); background: #000; position: relative; }
.cx-preview .modal-body img { max-width: 100%; max-height: calc(100vh - 160px); object-fit: contain; }
.cx-preview .modal-body video { width: 100%; max-height: calc(100vh - 160px); background: #000; }
.cx-preview .modal-body iframe { width: 100%; height: calc(100vh - 160px); border: 0; background: #fff; }
.cx-preview .modal-body pre { width: 100%; height: calc(100vh - 160px); margin: 0; padding: 1.25rem; overflow: auto; background: #1c1c1e; color: #e5e5ea; font-size: .85rem; white-space: pre-wrap; }
.cx-preview .btn-pv { background: rgba(255, 255, 255, .12); color: #fff; border: 0; }
.cx-preview .btn-pv:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.cx-preview .modal-footer { border: 0; justify-content: space-between; font-size: .8rem; color: #a1a1a6; padding: .7rem 1.25rem; }
.cx-pv-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; backdrop-filter: blur(10px); font-size: 1.2rem; }
.cx-pv-nav:hover { background: rgba(255, 255, 255, .3); }
.cx-pv-prev { left: 14px; } .cx-pv-next { right: 14px; }
.cx-pv-audio { padding: 3rem 2rem; text-align: center; width: 100%; }
.cx-pv-audio .bi { font-size: 5rem; color: #ff375f; display: block; margin-bottom: 1.5rem; }
.cx-pv-none { padding: 3rem 2rem; text-align: center; }
.cx-pv-none .bi { font-size: 5rem; display: block; margin-bottom: 1rem; }

/* ---------- Modals ---------- */
.modal-content { border-radius: 20px; border: 0; box-shadow: var(--cx-shadow-lg); }
.modal-header { border-bottom: 0; padding: 1.25rem 1.5rem .5rem; }
.modal-body { padding: .75rem 1.5rem; }
.modal-footer { border-top: 0; padding: .75rem 1.5rem 1.25rem; }
.modal-backdrop.show { opacity: .3; }

/* ---------- Upload panel ---------- */
.cx-upload-panel {
  position: fixed; right: 20px; bottom: 20px; width: 360px; max-width: calc(100vw - 40px);
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(20px);
  border-radius: 18px; box-shadow: var(--cx-shadow-lg); border: 1px solid var(--cx-border);
  z-index: 1060; display: none; overflow: hidden;
}
.cx-upload-panel.show { display: block; }
.cx-upload-head { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1rem; font-weight: 600; font-size: .92rem; border-bottom: 1px solid var(--cx-border); }
.cx-upload-list { max-height: 280px; overflow-y: auto; }
.cx-upload-row { padding: .65rem 1rem; border-bottom: 1px solid var(--cx-border); font-size: .84rem; }
.cx-upload-row:last-child { border-bottom: 0; }
.cx-upload-row .progress { height: 4px; margin-top: 6px; border-radius: 4px; }
.cx-upload-row .progress-bar { background: var(--cx-blue); }

/* ---------- Toast ---------- */
.cx-toast-wrap { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 2100; }
.cx-toast { background: rgba(29, 29, 31, .9); color: #fff; padding: .7rem 1.2rem; border-radius: 980px; font-size: .9rem; margin-bottom: .5rem; backdrop-filter: blur(12px); box-shadow: var(--cx-shadow-lg); animation: cxIn .25s ease; display: flex; align-items: center; gap: .5rem; }
.cx-toast.error { background: rgba(255, 59, 48, .95); }
@keyframes cxIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- Tables (admin) ---------- */
.cx-table { margin: 0; }
.cx-table thead th { font-size: .75rem; font-weight: 600; color: var(--cx-text-3); text-transform: uppercase; letter-spacing: .04em; background: var(--cx-surface-2); border-bottom: 1px solid var(--cx-border); padding: .8rem 1rem; white-space: nowrap; }
.cx-table td { padding: .85rem 1rem; vertical-align: middle; border-color: var(--cx-border); font-size: .9rem; }
.cx-table tbody tr:hover { background: #fafafc; }
.cx-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .65rem; border-radius: 980px; font-size: .75rem; font-weight: 600; }
.cx-pill.green { background: rgba(52, 199, 89, .14); color: #248a3d; }
.cx-pill.red { background: rgba(255, 59, 48, .12); color: #d70015; }
.cx-pill.blue { background: var(--cx-blue-soft); color: var(--cx-blue); }
.cx-pill.gray { background: rgba(0, 0, 0, .06); color: var(--cx-text-2); }
.cx-mini-bar { height: 5px; border-radius: 4px; background: rgba(0, 0, 0, .07); overflow: hidden; width: 110px; }
.cx-mini-bar span { display: block; height: 100%; background: var(--cx-blue); }

/* ---------- Mobile ---------- */
.cx-mobile-nav { display: none; }
.cx-backdrop { display: none; }
@media (max-width: 991.98px) {
  .cx-sidebar { transform: translateX(-100%); transition: transform .28s ease; box-shadow: var(--cx-shadow-lg); background: rgba(246, 246, 248, .96); }
  .cx-sidebar.open { transform: none; }
  .cx-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .25); z-index: 1025; }
  .cx-main { margin-left: 0; }
  .cx-topbar { padding: 0 1rem; }
  .cx-content { padding: 1.15rem 1rem 6rem; }
  .cx-footer { padding-bottom: 5.5rem; }
  .cx-mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040;
    background: rgba(250, 250, 252, .88); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--cx-border);
    padding: .4rem .25rem calc(.4rem + env(safe-area-inset-bottom));
  }
  .cx-mobile-nav a { flex: 1; text-align: center; font-size: .68rem; color: var(--cx-text-3); padding: .2rem 0; }
  .cx-mobile-nav a i { display: block; font-size: 1.35rem; margin-bottom: 1px; }
  .cx-mobile-nav a.active { color: var(--cx-blue); }
  .cx-mobile-nav .cx-fab { width: 50px; height: 50px; border-radius: 50%; background: var(--cx-blue); color: #fff; display: flex; align-items: center; justify-content: center; margin: -22px auto 0; box-shadow: 0 6px 18px rgba(0, 113, 227, .45); }
  .cx-mobile-nav .cx-fab i { font-size: 1.5rem; margin: 0; }
  .cx-page-title { font-size: 1.5rem; }
  .cx-list-head { display: none; }
  .cx-row { grid-template-columns: minmax(0, 1fr) 40px; }
  .cx-row .hide-sm { display: none; }
  .cx-row .cx-row-name small.d-sm-none-cx { display: block !important; }
  .cx-upload-panel { bottom: 84px; }
}
@media (max-width: 575.98px) {
  .cx-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .cx-item .cx-more { opacity: 1; }
  .auth-card { padding: 2rem 1.35rem; }
  .cx-preview .modal-dialog { margin: .5rem; }
}
.d-sm-none-cx { display: none; }


/* ==========================================================
   Mobile fit fixes (v1.0.1)
   ========================================================== */
.min-w-0 { min-width: 0; }
.cx-main { min-width: 0; overflow-x: clip; }
.cx-content { min-width: 0; }
.cx-stat > div:last-child { min-width: 0; flex: 1 1 auto; }
.cx-stat-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-stat-label { line-height: 1.25; }
@media (max-width: 991.98px) {
  /* hidden sidebar must not cast a shadow onto the page */
  .cx-sidebar { box-shadow: none; }
  .cx-sidebar.open { box-shadow: var(--cx-shadow-lg); }
}
@media (max-width: 575.98px) {
  .cx-stat { padding: .9rem .85rem; gap: .65rem; }
  .cx-stat-icon { width: 38px; height: 38px; border-radius: 11px; font-size: 1.1rem; }
  .cx-stat-value { font-size: 1.2rem; }
  .cx-stat-label { font-size: .78rem; }
  .cx-card-body { padding: 1.1rem; }
  .cx-page-head { margin-bottom: 1.1rem; }
}