/* ==========================================================================
   SK Minerals — Brand & Collateral Studio : dashboard chrome
   ========================================================================== */

.studio {
  --ink: #0C0A1E;
  --nav: #16123A;
  --nav-2: #1E1850;
  --indigo: #383084;
  --orange: #F07E2F;
  --orange-soft: #FFA45C;
  --bg: #F2F2F8;
  --card: #FFFFFF;
  --line: #E4E3EF;
  --text: #17152B;
  --muted: #6A6980;
  --radius: 14px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.studio *, .studio *::before, .studio *::after { box-sizing: border-box; }
.studio button, .studio input, .studio select, .studio textarea { font: inherit; color: inherit; }
.studio h1, .studio h2, .studio h3, .studio h4 { font-family: "Sora", "Inter", sans-serif; margin: 0; letter-spacing: -0.02em; }
.studio p { margin: 0; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(100deg, #14103A 0%, #241E5E 58%, #332A78 100%);
  color: #fff; padding: 12px clamp(14px, 3vw, 32px);
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 2px 18px rgba(12,10,30,.28);
}
.top .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top .brand img { height: 38px; width: auto; display: block; }
.top .brand .bt { min-width: 0; }
.top .brand .bt strong { display: block; font-family: "Sora", sans-serif; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.top .brand .bt span { display: block; font-size: 11px; color: rgba(255,255,255,.62); letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.top .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px; padding: 8px 14px; min-width: 200px; max-width: 330px; flex: 1 1 240px;
}
.search input { background: none; border: 0; outline: none; width: 100%; color: #fff; font-size: 13.5px; }
.search input::placeholder { color: rgba(255,255,255,.5); }
.search svg { flex: 0 0 auto; opacity: .6; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; background: var(--orange); color: #201400;
  font-weight: 600; font-size: 13px; padding: 9px 15px; border-radius: 10px;
  cursor: pointer; transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { background: #FF8F45; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.2); }
.btn.ghost:hover { background: rgba(255,255,255,.2); }
.btn.soft { background: #fff; color: var(--indigo); border-color: var(--line); }
.btn.soft:hover { background: #F6F6FC; }
.btn.dark { background: var(--nav); color: #fff; }
.btn.dark:hover { background: var(--nav-2); }
.btn.tiny { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- layout ---------- */
.body { flex: 1; display: flex; min-height: 0; }
.rail {
  width: 244px; flex: 0 0 244px; background: #fff; border-right: 1px solid var(--line);
  padding: 20px 14px; position: sticky; top: 62px; align-self: flex-start;
  max-height: calc(100vh - 62px); overflow: auto;
}
.rail h4 { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin: 0 8px 10px; }
.rail .nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 10px; padding: 10px 12px; cursor: pointer;
  font-size: 13.5px; color: #2C2A44; margin-bottom: 2px;
}
.rail .nav-item:hover { background: #F4F4FA; }
.rail .nav-item.active { background: var(--nav); color: #fff; }
.rail .nav-item.active .count { background: rgba(255,255,255,.18); color: #fff; }
.rail .nav-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--indigo); flex: 0 0 auto; }
.rail .nav-item .count { margin-left: auto; font-size: 11.5px; color: var(--muted); background: #F0F0F8; border-radius: 999px; padding: 2px 8px; }
.rail .rail-sep { height: 1px; background: var(--line); margin: 14px 8px; }
.rail .rail-note { font-size: 12px; color: var(--muted); line-height: 1.5; padding: 0 8px; }
.rail .rail-brand { display: flex; align-items: center; gap: 8px; margin: 4px 8px 12px; font-size: 12px; color: var(--muted); }
.rail .rail-brand img { height: 20px; width: auto; }

.main { flex: 1; min-width: 0; padding: clamp(16px, 2.6vw, 34px); }
.hero-band {
  background: linear-gradient(102deg, #14103A 0%, #241E5E 46%, #3A2F86 100%);
  color: #fff; border-radius: var(--radius); padding: clamp(20px, 3vw, 34px);
  position: relative; overflow: hidden; margin-bottom: 24px;
}
.hero-band::after {
  content: ""; position: absolute; right: -60px; top: -70px; width: 300px; height: 300px;
  background: rgba(240,126,47,.22); transform: rotate(24deg); border-radius: 40px;
}
.hero-band::before {
  content: ""; position: absolute; right: 120px; bottom: -110px; width: 230px; height: 230px;
  background: rgba(255,255,255,.07); transform: rotate(18deg); border-radius: 32px;
}
.hero-band .hb-in { position: relative; z-index: 2; }
.hero-band .hb-kick { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--orange-soft); font-weight: 600; }
.hero-band h2 { font-size: clamp(20px, 2.6vw, 30px); margin: 10px 0 8px; max-width: 660px; }
.hero-band p { font-size: 13.5px; color: rgba(255,255,255,.78); max-width: 620px; line-height: 1.55; }
.hero-band .hb-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero-band .hb-stat { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 10px 14px; min-width: 104px; }
.hero-band .hb-stat b { display: block; font-family: "Sora", sans-serif; font-size: 19px; }
.hero-band .hb-stat span { font-size: 10.5px; color: rgba(255,255,255,.68); letter-spacing: .06em; text-transform: uppercase; }

.sec-head { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 14px; }
.sec-head h3 { font-size: 17px; }
.sec-head .sh-sub { font-size: 12.5px; color: var(--muted); }
.sec-head .sh-line { flex: 1; height: 1px; background: var(--line); }

/* ---------- document cards ---------- */
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 18px; }
.dcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .18s ease, transform .18s ease;
}
.dcard:hover { box-shadow: 0 14px 34px rgba(20,16,58,.13); transform: translateY(-2px); }
.dcard .thumb {
  height: 250px; background: linear-gradient(150deg, #EDEDF6, #DFDFEC); position: relative; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line);
}
.dcard .thumb::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px;
  background: rgba(56,48,132,.05); transform: rotate(22deg); border-radius: 26px; pointer-events: none;
}
.thumbfit { border-radius: 3px; overflow: hidden; position: relative; }
.dcard .thumb .badge-pages {
  position: absolute; right: 10px; bottom: 10px; z-index: 3;
  background: rgba(12,10,30,.82); color: #fff; font-size: 11px; border-radius: 999px; padding: 3px 9px;
  backdrop-filter: none;
}
.dcard .meta { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.dcard .tagline { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); font-weight: 700; }
.dcard h4 { font-size: 15.5px; line-height: 1.25; }
.dcard .desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; flex: 1; }
.dcard .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.dcard .kinds { display: flex; gap: 6px; }
.dcard .kind {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
  background: #F1F1F9; color: var(--indigo); border-radius: 6px; padding: 3px 7px;
}

/* ---------- viewer ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 90; background: #26243C; display: flex; flex-direction: column;
}
.viewer[hidden] { display: none; }
.viewer .vbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: linear-gradient(100deg, #14103A, #241E5E); color: #fff; flex: 0 0 auto;
}
.viewer .vbar .vt { min-width: 0; flex: 1; }
.viewer .vbar .vt strong { display: block; font-family: "Sora", sans-serif; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .vbar .vt span { display: block; font-size: 11px; color: rgba(255,255,255,.6); }
.viewer .vbody { flex: 1; display: flex; min-height: 0; }
.viewer .vthumbs {
  width: 168px; flex: 0 0 168px; background: #1C1A30; overflow: auto; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.viewer .vthumb {
  background: #fff; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer;
  position: relative; box-shadow: 0 4px 10px rgba(0,0,0,.3);
}
.viewer .vthumb.active { border-color: var(--orange); }
.viewer .vthumb .n { position: absolute; right: 5px; bottom: 4px; background: rgba(12,10,30,.8); color: #fff; font-size: 10px; border-radius: 4px; padding: 1px 5px; z-index: 2; }
.viewer .vthumb .pg, .viewer .vthumb .pgwrap { box-shadow: none !important; }
.viewer .vstage { flex: 1; overflow: auto; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.viewer .vstage .pg { box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.viewer .vstage .plabel { color: rgba(255,255,255,.4); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: -12px; }
.viewer .vzoom { display: flex; align-items: center; gap: 6px; }
.viewer .vzoom output { font-size: 12px; min-width: 44px; text-align: center; color: rgba(255,255,255,.8); }

/* ---------- editor drawer ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 94vw); z-index: 120;
  background: #fff; box-shadow: -18px 0 48px rgba(12,10,30,.3); display: flex; flex-direction: column;
}
.drawer[hidden] { display: none; }
.drawer .dhead { padding: 16px 18px; background: linear-gradient(100deg, #14103A, #241E5E); color: #fff; display: flex; align-items: center; gap: 12px; }
.drawer .dhead strong { font-family: "Sora", sans-serif; font-size: 15px; flex: 1; }
.drawer .dhead .sub { font-size: 11px; color: rgba(255,255,255,.6); display: block; }
.drawer .dbody { flex: 1; overflow: auto; padding: 16px 18px 24px; }
.drawer .dfoot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; background: #FAFAFE; }
.fieldset { border: 0; margin: 0 0 20px; padding: 0; }
.fieldset > legend { font-family: "Sora", sans-serif; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--indigo); padding: 0 0 10px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.field input[type="text"], .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-size: 13px;
  background: #FCFCFE; outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--indigo); background: #fff; }
.field textarea { min-height: 78px; resize: vertical; line-height: 1.5; }
.field.row { display: flex; gap: 10px; align-items: center; }
.field.row label { margin: 0; flex: 0 0 46%; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 9px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 2px var(--indigo); }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; background: #F6F6FC; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }

/* ---------- toast / busy ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200;
  background: #14103A; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 13px;
  box-shadow: 0 12px 30px rgba(0,0,0,.32); display: flex; align-items: center; gap: 10px;
}
.toast[hidden] { display: none; }
.spinner {
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--orange); animation: spin .8s linear infinite; flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dots span { animation: blink 1.2s infinite; opacity: .25; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .25 } 50% { opacity: 1 } }
.blank { text-align: center; color: var(--muted); padding: 50px 20px; font-size: 13px; }

/* On-screen page scaling wrapper */
.pgfit { position: relative; }
.pgfit > .pg { position: absolute; top: 0; left: 0; transform-origin: top left; }
.pgfit.center { margin: 0 auto; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .rail { display: none; }
  .top .brand .bt span { display: none; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; }
  .top .brand img { height: 30px; }
  .search { order: 3; max-width: none; flex: 1 1 100%; }
  .dcard .thumb { height: 208px; }
  .viewer .vthumbs { display: none; }
  .viewer .vstage { padding: 12px; }
  .hero-band .hb-stats { gap: 8px; }
  .hero-band .hb-stat { min-width: 88px; padding: 8px 10px; }
}
