:root {
  --gold: #d4a84b;
  --gold-2: #f0d48a;
  --ink: #12151c;
  --muted: #6b7280;
  --line: #e7e5e4;
  --bg: #f3f1ee;
  --card: #ffffff;
  --side: #10141c;
  --side-2: #171c26;
  --ok: #16a34a;
  --danger: #e11d48;
  --info: #2563eb;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(16, 20, 28, 0.08);
}

body.admin-modern,
body.admin-modern .wrapper,
body.admin-modern .content-wrapper,
body.admin-modern .main-header,
body.admin-modern .main-footer,
body.admin-modern .form-control,
body.admin-modern .btn,
body.admin-modern .nav-sidebar .nav-link,
body.admin-modern .card,
body.admin-modern .small-box,
body.admin-modern .breadcrumb {
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

body.admin-modern.sidebar-mini.layout-fixed {
  background: var(--bg);
}
body.admin-modern .content-wrapper {
  background: var(--bg);
  min-height: calc(100vh - 57px);
}
body.admin-modern .content-header h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-size: 1.7rem;
}
body.admin-modern .breadcrumb {
  background: transparent;
  font-size: 0.82rem;
}
body.admin-modern .breadcrumb-item a { color: var(--gold); }

/* Navbar */
body.admin-modern .main-header.navbar {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
body.admin-modern .main-header .nav-link {
  border-radius: 999px;
  margin: 0 2px;
  color: #374151 !important;
}
body.admin-modern .main-header .nav-link:hover {
  background: #f5f0e6;
  color: #111 !important;
}
body.admin-modern .main-header .nav-link.text-danger {
  color: var(--danger) !important;
}

/* Sidebar */
body.admin-modern .main-sidebar,
body.admin-modern .sidebar {
  overflow-x: hidden;
  background: var(--side) !important;
}
body.admin-modern .main-sidebar {
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.18);
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.brand-link .brand-image-box {
  width: 34px;
  height: 34px;
  margin-left: 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1408;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.brand-link .brand-text {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff !important;
}
body.admin-modern .user-panel {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}
body.admin-modern .user-panel .image {
  background: linear-gradient(180deg, var(--gold-2), var(--gold)) !important;
  color: #1a1408 !important;
}
body.admin-modern .user-panel .info a { color: #e7e5e4 !important; font-weight: 600; }
.nav-sidebar .nav-header {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: #8b8790;
  font-weight: 700;
}
body.admin-modern .nav-sidebar .nav-link {
  border-radius: 12px;
  margin: 3px 10px;
  padding: 0.62rem 0.85rem;
  color: #c4c0b8;
}
body.admin-modern .nav-sidebar .nav-link .nav-icon { color: #9a958c; }
body.admin-modern .nav-sidebar .nav-link:hover {
  background: var(--side-2);
  color: #fff;
}
body.admin-modern .nav-sidebar .nav-link.active {
  background: linear-gradient(180deg, var(--gold-2), var(--gold)) !important;
  color: #1a1408 !important;
  box-shadow: 0 8px 18px rgba(212, 168, 75, 0.28);
}
body.admin-modern .nav-sidebar .nav-link.active .nav-icon {
  color: #1a1408 !important;
}

/* Cards */
body.admin-modern .card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
body.admin-modern .card-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0.95rem 1.15rem;
}
body.admin-modern .card-title {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
}
body.admin-modern .card-primary .card-header,
body.admin-modern .card-info .card-header,
body.admin-modern .card-success .card-header,
body.admin-modern .card-warning .card-header,
body.admin-modern .card-dark .card-header,
body.admin-modern .card-secondary .card-header {
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
body.admin-modern .card-primary:not(.card-outline) .card-header,
body.admin-modern .card-info:not(.card-outline) .card-header {
  background: linear-gradient(180deg, #fff, #faf8f4);
}
body.admin-modern .card-footer {
  background: #fafaf9;
  border-top: 1px solid var(--line);
}
body.admin-modern .apk-log-entry + .apk-log-entry {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

/* Buttons */
body.admin-modern .btn {
  border-radius: 999px !important;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.48rem 1.15rem;
  border: 0 !important;
  box-shadow: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
body.admin-modern .btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}
body.admin-modern .btn:active { transform: translateY(0); }
body.admin-modern .btn-sm { padding: 0.32rem 0.9rem; font-size: 0.85rem; }
body.admin-modern .btn-xs,
body.admin-modern .btn-xs.btn {
  padding: 0.22rem 0.7rem;
  font-size: 0.74rem;
  line-height: 1.3;
}
body.admin-modern .btn-primary,
body.admin-modern .btn-warning {
  background: linear-gradient(180deg, var(--gold-2), var(--gold)) !important;
  color: #1a1408 !important;
  box-shadow: 0 8px 18px rgba(212, 168, 75, 0.28);
}
body.admin-modern .btn-success {
  background: #16a34a !important;
  color: #fff !important;
}
body.admin-modern .btn-info {
  background: #2563eb !important;
  color: #fff !important;
}
body.admin-modern .btn-danger {
  background: #e11d48 !important;
  color: #fff !important;
}
body.admin-modern .btn-secondary,
body.admin-modern .btn-dark,
body.admin-modern .btn-default {
  background: #1f2430 !important;
  color: #fff !important;
}
body.admin-modern .btn-outline-secondary,
body.admin-modern .btn-outline-light {
  background: transparent !important;
  border: 1px solid var(--line) !important;
  color: #374151 !important;
  box-shadow: none;
}
body.admin-modern .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
}
body.admin-modern .btn-block { width: 100%; }

/* Forms */
body.admin-modern .form-control,
body.admin-modern .custom-select,
body.admin-modern select.form-control {
  border-radius: 12px;
  border-color: #e5e2dc;
  min-height: 42px;
  box-shadow: none;
}
body.admin-modern .form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 75, 0.22);
}
body.admin-modern .form-control-file { padding: 0.45rem 0; }
body.admin-modern .custom-range {
  accent-color: var(--gold);
}
body.admin-modern .form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--gold);
}

/* Stats */
body.admin-modern .small-box {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: var(--ink) !important;
}
body.admin-modern .small-box .inner h3 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.admin-modern .small-box p {
  min-height: auto;
  font-weight: 600;
  opacity: 0.75;
}
body.admin-modern .small-box .icon { opacity: 0.12; }
body.admin-modern .small-box > .small-box-footer {
  background: rgba(0, 0, 0, 0.04);
  color: inherit !important;
  font-weight: 600;
}
body.admin-modern .small-box.bg-info {
  background: linear-gradient(160deg, #eef4ff, #dbe7ff) !important;
  color: #1e3a8a !important;
}
body.admin-modern .small-box.bg-success {
  background: linear-gradient(160deg, #ecfdf3, #d1fae5) !important;
  color: #14532d !important;
}
body.admin-modern .small-box.bg-warning {
  background: linear-gradient(160deg, #fff7e8, #fde8b0) !important;
  color: #7a5410 !important;
}
body.admin-modern .small-box.bg-danger {
  background: linear-gradient(160deg, #fff1f2, #fecdd3) !important;
  color: #9f1239 !important;
}

body.admin-modern .card-outline {
  border-top: 3px solid var(--gold);
}
body.admin-modern .alert {
  border: 0;
  border-radius: 12px;
  font-weight: 600;
}
body.admin-modern .alert-success {
  background: #ecfdf3;
  color: #166534;
}
body.admin-modern .table { color: var(--ink); }
body.admin-modern .table th { border-top: 0; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
body.admin-modern .recent-thumb {
  width: 42px;
  height: 56px;
  object-fit: cover;
  background: #111;
  border-radius: 8px;
}
body.admin-modern .photo-list-thumb {
  width: 72px;
  height: 96px;
  object-fit: cover;
  background: #111;
  border-radius: 8px;
  display: block;
}
body.admin-modern .photo-list td,
body.admin-modern .photo-list th {
  vertical-align: middle;
}
body.admin-modern .photo-check {
  width: 22px;
  height: 22px;
}
body.admin-modern .main-footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.frame-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.frame-pick-card {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: #fff;
  cursor: pointer;
  margin: 0;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.frame-pick-card:hover { transform: translateY(-2px); }
.frame-pick-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.frame-pick-card:has(input:checked) {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 168, 75, 0.22);
}
.frame-pick-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #111;
  border-radius: 8px;
}
.frame-pick-card span {
  text-align: center;
  font-size: 13px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.photo-card {
  border-radius: 14px !important;
  overflow: hidden;
}
.photo-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #111;
}
.template-box img {
  max-width: 320px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.control-sidebar-content { padding: 12px 16px; }
.control-sidebar-content dt {
  font-weight: 600;
  color: #adb5bd;
  font-size: 12px;
  margin-top: 10px;
}
.control-sidebar-content dd { margin: 0; color: #fff; }

body.admin-modern.login-page {
  background:
    radial-gradient(circle at 20% 10%, #3a2f1e, transparent 40%),
    linear-gradient(180deg, #141821, #0b0d12);
}
body.admin-modern .login-logo a { color: #fff; font-weight: 800; }
body.admin-modern .login-box .card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
body.admin-modern .login-card-body { padding: 1.6rem; }

.event-font-preview {
  background: #120c08;
  border-radius: 14px;
  padding: 28px 18px;
  text-align: center;
  font-size: calc(2.2rem * var(--event-font-scale, 1));
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  min-height: 96px;
}
.event-font-preview.is-script { font-weight: 400; }
.strip-font-preview {
  font-size: calc(1.35rem * var(--event-font-scale, 1));
  min-height: 72px;
  padding: 18px 16px;
  font-weight: 600;
  white-space: pre-wrap;
}
.strip-font-preview.is-paper {
  background: #fff6ea;
}
.bg-preview-wrap {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #111;
  cursor: zoom-in;
}
.bg-preview-wrap img {
  display: block;
  width: 100%;
  max-width: 100%;
  transform: scale(1.08);
}
.preview-hit {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.preview-hit img,
.template-box .preview-hit img {
  width: 100%;
  max-width: 100%;
}
.pick-visual {
  position: relative;
  display: block;
}
.pick-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(18, 12, 8, 0.72);
  color: #f0d48a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.pick-visual .pick-zoom,
.preview-hit .pick-zoom {
  pointer-events: auto;
}
.thumb-btn {
  padding: 0;
  border: 0;
  background: #000;
  border-radius: 6px;
  cursor: zoom-in;
}
.thumb-btn img {
  height: 48px;
  display: block;
}
.file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 132px;
  padding: 1.2rem;
  border: 2px dashed #e0d3b8;
  border-radius: 16px;
  background: #faf8f4;
  cursor: pointer;
  text-align: center;
  margin: 0;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.file-drop:hover,
.file-drop.has-file {
  border-color: var(--gold);
  background: #fff8ea;
  box-shadow: 0 8px 22px rgba(212, 168, 75, 0.12);
}
.file-drop input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.file-drop-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1408;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}
.file-drop strong {
  font-weight: 800;
  color: var(--ink);
}
.file-drop-name {
  font-style: normal;
  color: var(--muted);
  font-size: 0.85rem;
}
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(8, 6, 4, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.img-lightbox[hidden] { display: none !important; }
.img-lightbox img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  background: #111;
}
.frame-test-stage {
  position: relative;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 14px;
  overflow: hidden;
}
.frame-test-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}
.frame-test-stage canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}
#frame-test-overlay { display: none !important; }
.frame-test-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: #d6d3d1;
  background:
    radial-gradient(circle at 30% 20%, #3a2f1e, transparent 42%),
    #14110e;
}
.frame-test-placeholder[hidden] { display: none !important; }
.frame-test-placeholder i { font-size: 2rem; color: #f0d48a; }
.frame-test-stage.is-live .frame-test-placeholder { display: none; }
.frame-test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.frame-test-status { margin: 0.7rem 0 0; }
.frame-test-result { margin-top: 1rem; }
.frame-test-result[hidden] { display: none !important; }
.frame-test-result img {
  display: block;
  width: 100%;
  max-width: 760px;
  border-radius: 14px;
  background: #111;
}
.img-lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.theme-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.theme-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d8d2c8;
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
}
.theme-card input { margin: 0; accent-color: #c4a15a; }
.theme-card:has(input:checked) {
  border-color: #c4a15a;
  box-shadow: 0 0 0 2px rgba(196, 161, 90, 0.35);
}
.theme-swatch {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.theme-copy { display: flex; flex-direction: column; min-width: 0; }
.theme-copy strong { font-size: 0.95rem; line-height: 1.2; }
.theme-copy small { color: #6b6258; }
