*{box-sizing:border-box}
:root{
  font-family:"IBM Plex Sans Thai Looped",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#102a56;background:#f5f7fb
}
body{
  margin:0;
  background:
    radial-gradient(circle at 12% 10%,rgba(62,205,255,.14),transparent 24%),
    radial-gradient(circle at 88% 12%,rgba(174,102,255,.12),transparent 23%),
    #f5f7fb
}
button,input,select,textarea{font:inherit}.hidden{display:none!important}
.topbar{
  height:70px;background:rgba(255,255,255,.96);backdrop-filter:blur(12px);
  border-bottom:1px solid #e8eef7;display:flex;align-items:center;justify-content:space-between;
  padding:0 22px;position:sticky;top:0;z-index:10
}
.brand{display:flex;align-items:center;gap:10px}.brandmark{
  width:42px;height:42px;border-radius:13px;display:grid;place-items:center;color:#fff;font-weight:700;
  background:linear-gradient(135deg,#1268e8,#7259e8)
}
.brand strong{display:block;font-size:16px;font-weight:700}.brand span{display:block;font-size:11px;color:#7b8ca5}
.top-right{display:flex;align-items:center;gap:10px;color:#6a7e9b;font-size:13px}.icon-btn,.btn{
  border:0;border-radius:13px;padding:11px 16px;font-weight:600;cursor:pointer
}
.icon-btn{background:#fff;border:1px solid #e4eaf4}.primary{
  color:#fff;background:linear-gradient(135deg,#1769e8,#5d55e8);box-shadow:0 9px 22px rgba(50,88,208,.18)
}.ghost{background:#edf3ff;color:#1d5fc8}
.login-wrap{width:min(1040px,calc(100% - 28px));margin:42px auto}.login-card{
  min-height:550px;background:#fff;border-radius:26px;overflow:hidden;display:grid;grid-template-columns:1.1fr .9fr;
  box-shadow:0 20px 65px rgba(35,70,130,.12)
}
.visual{background:linear-gradient(145deg,#edf8ff,#f4efff);position:relative}.vcard{
  position:absolute;display:grid;place-items:center;color:#fff;font-weight:700;border-radius:24px;box-shadow:0 20px 45px rgba(54,85,180,.18)
}
.v1{width:185px;height:130px;left:60px;top:90px;background:linear-gradient(135deg,#45cef4,#3376ef);transform:rotate(-8deg)}
.v2{width:215px;height:145px;right:60px;top:185px;background:linear-gradient(135deg,#8964ed,#ed7fc2);transform:rotate(7deg)}
.v3{width:150px;height:105px;left:220px;bottom:65px;background:linear-gradient(135deg,#194fc0,#5c59e8)}
.login-copy{align-self:center;padding:50px}.eyebrow{font-size:12px;font-weight:700;letter-spacing:.06em;color:#1769e8}
.login-copy h1,.hero h1{font-size:44px;letter-spacing:-.02em;margin:10px 0;font-weight:700}.login-copy p,.hero p{color:#657a98;line-height:1.7}
.app{display:grid;grid-template-columns:240px 1fr;min-height:calc(100vh - 70px)}
.sidebar{background:#fff;border-right:1px solid #e8edf6;padding:12px 12px;position:sticky;top:70px;height:calc(100vh - 70px);overflow:auto}
.side-label,.nav-section{font-size:10px;font-weight:700;color:#a0adbe;text-transform:uppercase;letter-spacing:.07em;padding:7px 10px 4px}
#roleNav{display:grid;gap:2px}.nav{
  width:100%;border:0;background:transparent;border-radius:12px;padding:8px 12px;display:flex;gap:10px;align-items:center;
  color:#405776;font-weight:600;text-align:left;cursor:pointer
}
.nav:hover{background:#f4f7fc}.nav.active{background:linear-gradient(135deg,#1769e8,#5d55e8);color:#fff}
.side-footer{margin-top:12px;padding-top:10px;border-top:1px solid #eef2f7}
.content{padding:25px 28px 60px;min-width:0}.hero{
  min-height:165px;border-radius:24px;padding:28px 30px;display:flex;align-items:center;justify-content:space-between;
  background:linear-gradient(120deg,#eef9ff,#f6efff 55%,#fff1f7);border:1px solid #e6edf8
}
.hero h1{font-size:36px}.hero-art{display:flex;gap:8px}.hero-art span{
  width:78px;height:72px;border-radius:18px;display:grid;place-items:center;color:#fff;font-size:28px;font-weight:700;
  box-shadow:0 13px 28px rgba(66,83,170,.14)
}
.hero-art span:nth-child(1){background:linear-gradient(135deg,#2ab8ef,#3874ef);transform:rotate(-7deg)}
.hero-art span:nth-child(2){background:linear-gradient(135deg,#8964ed,#d46ee6);transform:rotate(5deg)}
.hero-art span:nth-child(3){background:linear-gradient(135deg,#ff9b56,#f36f8e);transform:rotate(-3deg)}
.role-badges{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.role-badge{
  padding:7px 10px;border-radius:999px;background:#fff;border:1px solid #dfe7f3;color:#46617f;font-size:12px;font-weight:600
}
.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;margin:18px 0}.stat{
  background:#fff;border:1px solid #e7edf6;border-radius:18px;padding:18px
}
.stat small{display:block;color:#7b8ba1;font-size:12px}.stat b{display:block;font-size:28px;margin-top:8px;color:#1769e8;font-weight:700}
.panel{background:#fff;border:1px solid #e8eef7;border-radius:20px;padding:22px;margin-top:16px;box-shadow:0 8px 22px rgba(44,71,120,.05)}
.panel h2{margin:0 0 18px;font-size:21px;font-weight:700}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.panel-head h2{margin:0}.panel-head p{margin:4px 0 0;color:#8492a6;font-size:12px}
.media-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:17px}.media-item{
  border:1px solid #e7edf6;border-radius:17px;overflow:hidden;background:#fff
}
.media-cover{
  min-height:112px;padding:16px;background:linear-gradient(135deg,#dff6ff,#eee8ff);display:flex;align-items:flex-end;
  color:#2f5fb0;font-weight:700;font-size:21px
}
.media-body{padding:14px}.media-body h3{font-size:16px;margin:0 0 8px;font-weight:700}.meta{display:flex;flex-wrap:wrap;gap:6px}
.tag{padding:5px 8px;border-radius:999px;background:#eef4ff;color:#2866cf;font-size:10px;font-weight:600}.status{background:#f3edff;color:#7a50d8}
.media-foot{display:flex;justify-content:space-between;align-items:flex-end;gap:10px;margin-top:14px}.media-foot small{color:#8997aa;line-height:1.45}
.media-actions{display:flex;gap:6px;flex-wrap:nowrap}.mini-btn{border:0;background:#edf3ff;color:#1e5ec3;border-radius:9px;padding:7px 10px;font-weight:600;cursor:pointer}
.mini-btn.danger{background:#fff0f2;color:#c64059}
.empty{grid-column:1/-1;border:1px dashed #cad7ea;border-radius:16px;min-height:150px;display:grid;place-items:center;text-align:center;color:#7d8da4;padding:20px}
.steps{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:18px 0}.step{
  background:#fff;border:1px solid #e7edf6;border-radius:15px;padding:12px;color:#73849d;font-weight:600
}
.step.active{color:#1769e8;border-color:#a9c9fa}.step span{font-size:11px;margin-left:4px}.grid{display:grid;gap:14px}.grid.two{grid-template-columns:repeat(2,1fr)}
label{display:block;color:#29466e;font-weight:600;font-size:13px;margin-top:13px}label span,label small{font-weight:400;color:#8997aa}b{color:#e34865}
input,select,textarea{width:100%;margin-top:7px;border:1px solid #d9e3f2;border-radius:12px;padding:12px;background:#fbfdff;color:#17365e;font-weight:400}
textarea{resize:vertical}.field-block{margin-top:18px}.field-title{font-weight:600;margin-bottom:9px}.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{display:flex;align-items:center;gap:6px;padding:8px 10px;border:1px solid #dfe7f4;background:#fafcff;border-radius:999px;font-size:12px;color:#3b5677;cursor:pointer}
.chip input{width:auto;margin:0}.segmented{display:flex;flex-wrap:wrap;gap:8px}.segmented label,.checkline{
  display:flex;align-items:center;gap:7px;background:#f5f8fd;border:1px solid #e3eaf5;border-radius:12px;padding:10px 12px
}
.segmented input,.checkline input{width:auto;margin:0}.note{background:linear-gradient(135deg,#f0f8ff,#f7f1ff)}.note p{margin-bottom:0;color:#647994}
.actions{display:flex;justify-content:space-between;gap:12px;margin-top:18px}.msg{color:#b42e48;min-height:22px}
.queue-table{width:100%;border-collapse:collapse;font-size:13px}.queue-table th,.queue-table td{padding:12px 10px;border-bottom:1px solid #eef2f7;text-align:left}
.queue-table th{color:#7b8ba1;font-size:11px;font-weight:600}.profile-line{padding:12px;background:#f7f9fc;border-radius:12px;margin:8px 0}
.profile-line span{display:block;color:#7c8ca2;font-size:11px;margin-bottom:4px}
.notice{padding:14px 16px;border-radius:14px;background:#fff7e7;color:#8a6212;border:1px solid #f5dfad;font-size:13px;margin-top:14px}
@media(max-width:1000px){.app{grid-template-columns:78px 1fr}.nav span,.side-label,.nav-section{display:none}.nav{justify-content:center;font-size:18px}.media-list{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.app{display:block}.sidebar{position:static;height:auto;display:flex;overflow:auto;border-right:0;border-bottom:1px solid #e8edf6}.nav{width:auto}.content{padding:14px}.stat-grid{grid-template-columns:1fr 1fr}.media-list{grid-template-columns:1fr}.grid.two{grid-template-columns:1fr}.steps{grid-template-columns:1fr 1fr}.login-card{grid-template-columns:1fr}.visual{min-height:240px}.top-right span{display:none}}


/* v6 workflow */
.status-draft{background:#f3edff;color:#754fd5}
.status-submitted{background:#fff3df;color:#b56d08}
.status-subject_review{background:#eaf4ff;color:#1769e8}
.status-revision_required{background:#fff0f2;color:#c43e58}
.status-subject_approved{background:#eaf8f0;color:#178452}
.workflow-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}
.workflow-btn{border:0;border-radius:10px;padding:8px 11px;font-weight:600;cursor:pointer}
.workflow-btn.blue{background:#eaf2ff;color:#1a62c9}
.workflow-btn.green{background:#e9f8ef;color:#16814f}
.workflow-btn.orange{background:#fff4e4;color:#ad6a0b}
.workflow-btn.red{background:#fff0f2;color:#c64059}
.review-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.review-card{border:1px solid #e6edf7;border-radius:17px;padding:16px;background:#fff}
.review-card h3{margin:0 0 7px;font-size:16px}
.review-card p{margin:5px 0;color:#6e819d;font-size:13px;line-height:1.55}
.review-card textarea{margin-top:12px}
.review-meta{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.feedback-box{margin-top:10px;padding:10px 12px;border-radius:12px;background:#fff7e9;color:#875d0a;font-size:12px;line-height:1.55}
@media(max-width:820px){.review-grid{grid-template-columns:1fr}}


/* v6.1 custom modal */
.app-modal{
  position:fixed;inset:0;z-index:1000;
  display:grid;place-items:center;
  padding:20px;
  background:rgba(15,32,64,.34);
  backdrop-filter:blur(5px)
}
.app-modal-card{
  width:min(420px,100%);
  background:#fff;
  border:1px solid #e5ecf7;
  border-radius:22px;
  padding:26px;
  text-align:center;
  box-shadow:0 26px 70px rgba(24,50,100,.22)
}
.app-modal-icon{
  width:54px;height:54px;margin:0 auto 14px;
  display:grid;place-items:center;border-radius:50%;
  background:#eef4ff;color:#1769e8;
  font-size:25px;font-weight:700
}
.app-modal-card h3{margin:0 0 8px;font-size:21px}
.app-modal-card p{
  margin:0;color:#647994;line-height:1.65;white-space:pre-line
}
.app-modal-actions{
  display:flex;justify-content:center;gap:10px;margin-top:22px
}
.app-modal-actions .btn{min-width:100px}


/* v7 publisher workflow */
.status-ready_to_publish{background:#eaf2ff;color:#1b62c8}
.status-publishing_revision_required{background:#fff0f2;color:#c43e58}
.status-published{background:#e8f8ef;color:#16814f}
.publisher-checklist{
  display:grid;gap:9px;margin-top:14px;padding:14px;
  background:#f8faff;border:1px solid #e5ecf7;border-radius:14px
}
.publisher-checklist label{
  margin:0;display:flex;align-items:flex-start;gap:9px;
  font-size:12px;font-weight:500;color:#3d5576
}
.publisher-checklist input{width:auto;margin:2px 0 0}
.public-link-box{
  margin-top:12px;padding:12px;border-radius:12px;
  background:#eef7ff;border:1px solid #d9eaff;color:#245a9f;
  font-size:12px;overflow-wrap:anywhere
}
.public-code{
  display:inline-block;padding:6px 9px;border-radius:999px;
  background:#eef4ff;color:#1b61c5;font-weight:700;font-size:11px
}


/* v8.4 backoffice visual alignment */
:root{
  --hub-navy:#0b2559;
  --hub-blue:#155eef;
  --hub-cyan:#22b8f0;
  --hub-violet:#7357e8;
}
.topbar{
  border-bottom:1px solid #e2e9f4;
  box-shadow:0 4px 16px rgba(24,48,93,.04)
}
.brandmark{
  background:linear-gradient(135deg,var(--hub-navy),var(--hub-blue))!important;
}
.sidebar{
  background:linear-gradient(180deg,#ffffff 0%,#fbfcff 100%)!important;
}
.nav.active{
  background:linear-gradient(135deg,var(--hub-navy),var(--hub-blue))!important;
  box-shadow:0 8px 18px rgba(21,94,239,.16)
}
.hero{
  background:
    radial-gradient(circle at 88% 20%,rgba(34,184,240,.16),transparent 22%),
    linear-gradient(135deg,#0b2559 0%,#155eef 58%,#7357e8 100%)!important;
  color:#fff!important;
  border:0!important;
  box-shadow:0 14px 34px rgba(18,49,107,.13)
}
.hero .eyebrow,.hero p,.hero h1{color:#fff!important}
.hero-art span{
  border:1px solid rgba(255,255,255,.16);
  box-shadow:0 16px 30px rgba(0,0,0,.12)
}
.panel,.stat{
  border-color:#e4ebf5!important;
  box-shadow:0 8px 20px rgba(29,63,120,.04)
}
.stat b{color:var(--hub-blue)!important}
.role-badge{
  border-color:#dfe8f4!important;
  background:#fff!important
}
.primary{
  background:linear-gradient(135deg,var(--hub-blue),#2f80ed)!important
}


/* v8.5 login/branding cleanup */
.brand-logo-app{
  width:46px;
  height:46px;
  object-fit:contain;
  flex:0 0 auto;
}
.brand > div:last-child span{
  max-width:440px;
  white-space:normal;
  line-height:1.25;
}
.login-copy h1{
  margin-bottom:26px;
}
.login-google-btn{
  min-width:212px;
  justify-content:center;
}
.system-credit{
  width:min(1040px,calc(100% - 28px));
  margin:18px auto 26px;
  text-align:center;
  color:#7b8ca4;
  font-size:11px;
  line-height:1.55;
}
.system-credit strong{
  display:block;
  color:#5e718f;
  font-weight:600;
}
.system-credit span{
  display:block;
}
@media(max-width:720px){
  .brand-logo-app{width:40px;height:40px}
  .brand > div:last-child span{display:none}
}
