/* DMS Complete — custom app (non-admin) dark theme helpers for Tailwind */
:root {
  --dms-bg: #070b16;
  --dms-panel: #0e1629;
  --dms-border: rgba(56, 120, 220, 0.25);
  --dms-cyan: #3ad4ff;
  --dms-accent: #2f9bff;
  --dms-text: #e8eefc;
  --dms-muted: #8b9bb8;
}

html, body {
  background: radial-gradient(1200px 600px at 10% -10%, #12203f 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #0b1a36 0%, transparent 50%),
    var(--dms-bg);
  color: var(--dms-text);
  min-height: 100%;
}

/* Compact data grids */
.app-table th, .app-table td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid rgba(56, 120, 220, 0.12);
}
.app-table th {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dms-muted);
  background: rgba(8, 14, 28, 0.9);
}
.app-table tbody tr:hover {
  background: rgba(47, 155, 255, 0.07);
}

/* Thumbnails: half size default, 2x original on hover */
.app-thumb {
  --thumb-orig: 160px;
  max-width: calc(var(--thumb-orig) / 2);
  max-height: calc(var(--thumb-orig) / 2);
  object-fit: cover;
  border-radius: 0.4rem;
  border: 1px solid rgba(64, 140, 255, 0.3);
  transition: max-width 0.15s ease, max-height 0.15s ease, box-shadow 0.15s ease;
  cursor: zoom-in;
}
.app-thumb:hover {
  max-width: calc(var(--thumb-orig) * 2);
  max-height: calc(var(--thumb-orig) * 2);
  position: relative;
  z-index: 30;
  box-shadow: 0 0 24px rgba(47, 155, 255, 0.5);
}

/* Glow panels — no 1px border (soft shadow only) */
.app-panel {
  background: linear-gradient(180deg, rgba(14, 22, 40, 0.96), rgba(10, 16, 30, 0.96));
  border: none;
  border-radius: 1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.app-kpi {
  background: linear-gradient(145deg, rgba(30, 70, 140, 0.18), transparent 50%),
    linear-gradient(180deg, rgba(16, 26, 48, 0.95), rgba(10, 16, 30, 0.95));
  border: none;
  border-radius: 1rem;
  box-shadow: 0 0 24px rgba(47, 155, 255, 0.12);
}

/* Reference-style quick links: subtle light → dark blue glass gradient */
.app-qlink {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem; /* default compact height */
  border-radius: 0.7rem;
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.15;
  color: #f2f7ff !important;
  text-decoration: none !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(115deg, #5eb6ff 0%, #2f8de8 42%, #1a5fbf 100%);
  border: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 40, 100, 0.22),
    0 4px 12px rgba(15, 60, 140, 0.22);
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  list-style: none;
}
/* Vertically shrunk sizes for accordion nav */
.app-qlink-sm {
  padding: 0.42rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 0.65rem;
  gap: 0.4rem;
}
.app-qlink-xs {
  padding: 0.28rem 0.6rem;
  font-size: 0.74rem;
  border-radius: 0.55rem;
  gap: 0.35rem;
  font-weight: 550;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 50%),
    linear-gradient(115deg, #3d8fd9 0%, #246db8 50%, #164e96 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 2px 8px rgba(10, 40, 100, 0.2);
}
.app-qlink:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 40, 100, 0.28),
    0 8px 16px rgba(20, 80, 180, 0.3);
}
.app-qlink:active {
  transform: translateY(0);
  filter: brightness(0.98);
}
.app-qlink.is-active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 0 2px rgba(255, 255, 255, 0.2),
    0 6px 14px rgba(20, 80, 180, 0.32);
  filter: brightness(1.04);
}
.app-qlink .material-symbols-outlined {
  font-size: 1.05rem;
  opacity: 0.95;
  text-shadow: 0 1px 2px rgba(0, 30, 80, 0.35);
  flex-shrink: 0;
}
.app-qlink-sm .material-symbols-outlined { font-size: 1rem; }
.app-qlink-xs .material-symbols-outlined { font-size: 0.95rem; }

/* Accordion sections */
.app-acc {
  border: none;
  margin: 0;
}
.app-acc > summary {
  list-style: none;
}
.app-acc > summary::-webkit-details-marker { display: none; }
.app-acc-summary {
  width: 100%;
  user-select: none;
}
.app-acc-chevron {
  margin-left: auto !important;
  font-size: 1rem !important;
  transition: transform 0.18s ease;
  opacity: 0.9;
}
.app-acc[open] > summary .app-acc-chevron {
  transform: rotate(180deg);
}
.app-acc-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.35rem 0 0.2rem 0.55rem;
  margin: 0.15rem 0 0.25rem;
  border-left: 2px solid rgba(90, 170, 255, 0.25);
}

/* Left nav visibility (app + admin share the same partial) */
.app-left-nav { display: none; }
@media (min-width: 768px) {
  .app-left-nav,
  body.admin-app-shell .app-left-nav,
  body.admin-app-shell #app-left-nav {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 16rem;
    flex-shrink: 0;
  }
}

/* Password banner bottom */
.app-password-banner {
  position: sticky;
  bottom: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(90, 60, 0, 0.95), rgba(120, 80, 10, 0.92));
  border-top: 1px solid rgba(255, 200, 87, 0.45);
}

/* Hide any residual django admin branding if mixed */
#django-admin-tools,
.django-admin,
body.admin-interface {
  /* no-op safety */
}

/* Chart canvas */
#dms-sales-chart {
  max-height: 260px;
}
