
/* ==========================================================================
   Road Safety Thai v3.3.7.1 — Visual Refinement
   Fine-tunes typography, color, spacing, image treatment and responsive UI.
   No Vue render functions are modified.
   ========================================================================== */

:root{
  --rst-font:"Noto Sans Thai","Leelawadee UI",Tahoma,"Segoe UI",Arial,sans-serif;
  --rst-ink:#10213a;
  --rst-ink-strong:#08162b;
  --rst-body:#334760;
  --rst-muted:#65758b;
  --rst-muted-soft:#8795a8;
  --rst-page:#f3f7fc;
  --rst-card:#ffffff;
  --rst-line:#dde6f0;
  --rst-blue:#1d5fe9;
  --rst-cyan:#0b95bd;
  --rst-teal:#11877f;
  --rst-green:#19a653;
  --rst-amber:#f3a20a;
  --rst-red:#e24848;
}

html,body,#app,button,input,select,textarea{
  font-family:var(--rst-font)!important;
}
html,body{
  background:
    radial-gradient(circle at 85% -10%, rgba(56,189,248,.07), transparent 28%),
    linear-gradient(180deg,#f7faff 0%,var(--rst-page) 100%)!important;
  color:var(--rst-ink)!important;
}
body{
  font-weight:400;
  line-height:1.58;
}

/* ---------- Sidebar ---------- */
@media (min-width:961px){
  .app-shell{
    grid-template-columns:292px minmax(0,1fr)!important;
  }
  .desktop-sidebar{
    padding:24px 18px 14px!important;
  }
  .desktop-sidebar .brand{
    justify-content:center;
  }
  .desktop-sidebar .brand img{
    width:202px!important;
    max-height:74px;
    object-fit:contain;
  }
  .profile-card{
    margin-top:24px!important;
    padding:13px 14px!important;
    border-radius:18px!important;
    background:linear-gradient(180deg,#fbfdff,#f6f9fd)!important;
  }
  .avatar{
    width:48px!important;
    height:48px!important;
    border-radius:14px!important;
    overflow:hidden;
  }
  .avatar img,.avatar-image{
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
  }
  .profile-copy strong{
    font-size:.93rem!important;
    line-height:1.3!important;
  }
  .profile-copy small{
    font-size:.75rem!important;
    color:#64748b!important;
  }
  .side-nav{
    margin-top:18px!important;
    gap:4px!important;
  }
  .side-nav a,.side-logout{
    min-height:48px!important;
    padding:8px 12px!important;
    gap:12px!important;
    font-size:.94rem!important;
    line-height:1.35!important;
  }
  .side-nav a{
    color:#44566f!important;
  }
  .side-nav a:hover{
    color:#174db7!important;
    background:#f4f8ff!important;
  }
  .side-nav a.router-link-active{
    color:#1554d1!important;
    background:linear-gradient(90deg,#eef5ff,#eaf3ff)!important;
    border:1px solid #d5e5ff!important;
  }
  .side-nav svg{
    color:inherit;
  }
  .side-logout{
    margin-top:8px!important;
    color:#be2929!important;
    background:#fff1f1!important;
  }
  .security-note{
    margin-top:9px!important;
    font-size:.7rem!important;
  }
}

/* ---------- Main content width / layout ---------- */
.app-main{
  padding-top:30px!important;
}
.dashboard-page,
.license-page,
.learning-page{
  max-width:1240px!important;
}
.section-topline h1{
  color:var(--rst-ink-strong)!important;
  font-weight:800!important;
  letter-spacing:-.025em!important;
}
.section-topline p{
  color:#5b6d84!important;
}

/* ---------- Hero / welcome panel ---------- */
.welcome-panel{
  position:relative;
  overflow:hidden;
  background:linear-gradient(118deg,#2258d8 0%,#0a9cc3 56%,#117f77 100%)!important;
  box-shadow:0 18px 42px rgba(30,92,190,.18)!important;
  border:1px solid rgba(255,255,255,.18);
}
.welcome-panel::after{
  content:"";
  position:absolute;
  right:-120px;
  top:-125px;
  width:300px;
  height:300px;
  border:44px solid rgba(255,255,255,.055);
  border-radius:50%;
  pointer-events:none;
}
.welcome-panel h1,
.welcome-panel h2{
  color:#fff!important;
  text-shadow:0 1px 1px rgba(0,0,0,.06);
}
.welcome-panel p{
  color:#f0f7ff!important;
}
.welcome-kicker,
.identity-chip{
  color:#fff!important;
  background:rgba(255,255,255,.15)!important;
  border:1px solid rgba(255,255,255,.10);
}
.welcome-panel img{
  border:1px solid rgba(255,255,255,.28);
  box-shadow:0 10px 24px rgba(0,0,0,.14);
}

/* Dashboard QR card */
.welcome-panel [class*="qr"],
.dashboard-page [class*="hero"] [class*="qr"]{
  backdrop-filter:blur(3px);
}
.dashboard-page img[alt*="QR"],
.dashboard-page img[alt*="Qr"]{
  background:#fff;
  border-radius:15px;
  padding:7px;
}

/* ---------- Dashboard metrics ---------- */
.student-metric-grid{
  margin-top:22px!important;
}
.student-metric-grid .metric-card{
  min-height:176px!important;
  border-color:#dfe8f2!important;
  background:linear-gradient(180deg,#fff,#fcfdff)!important;
}
.student-metric-grid .metric-card:hover{
  border-color:#cbdcf2!important;
  box-shadow:0 12px 28px rgba(15,23,42,.075)!important;
}
.student-metric-grid .metric-card small{
  color:#43566f!important;
  font-size:.79rem!important;
  font-weight:750!important;
}
.student-metric-grid .metric-card strong:not(.rst-v3363-mini-ring){
  color:#08162b!important;
  font-weight:800!important;
}
.student-metric-grid .metric-card p{
  color:#708096!important;
  font-size:.75rem!important;
}
.metric-icon{
  box-shadow:inset 0 0 0 1px rgba(15,23,42,.025);
}

/* ---------- Panels / cards ---------- */
.panel-card,
.full-lesson-card,
.native-card{
  background:linear-gradient(180deg,#fff 0%,#fefeff 100%)!important;
  border-color:#dfe7f0!important;
}
.panel-head h2,
.section-heading h2{
  color:#0c1d35!important;
  font-weight:800!important;
}
.panel-head small,
.section-heading small{
  color:#7b8aa0!important;
}
.text-link{
  color:#1559dd!important;
  font-weight:800!important;
}

/* Learning journey on dashboard */
.lesson-progress-row{
  min-height:74px;
}
.lesson-progress-row strong{
  color:#13233b!important;
  font-weight:750!important;
}
.lesson-progress-row small{
  color:#6a7b91!important;
}
.progress-track,
.lesson-meter{
  background:#e8eef5!important;
}

/* ---------- Learning page ---------- */
.learning-page .section-topline{
  margin-bottom:18px!important;
}
.learning-page .section-topline h1{
  font-size:clamp(2.15rem,3vw,3.05rem)!important;
}
.learning-page .metric-grid{
  gap:14px!important;
  margin-top:16px!important;
}
.learning-page .metric-card{
  min-height:118px!important;
  padding:17px!important;
}
.learning-page .metric-card small{
  font-size:.74rem!important;
  color:#53657c!important;
}
.learning-page .metric-card strong{
  font-size:1.5rem!important;
}
.lesson-card-grid{
  gap:16px!important;
}
.full-lesson-card{
  min-height:222px;
  padding:20px!important;
  border-radius:22px!important;
}
.full-lesson-card>div>small{
  font-size:.68rem!important;
  color:#1e5be0!important;
  letter-spacing:.07em!important;
}
.full-lesson-card h3{
  margin:5px 0 7px!important;
  color:#0d1d33!important;
  font-size:1.03rem!important;
  line-height:1.42!important;
  font-weight:800!important;
}
.full-lesson-card p{
  color:#5c6f87!important;
  font-size:.79rem!important;
  line-height:1.63!important;
}
.tag-row{
  margin-top:12px!important;
  gap:6px!important;
}
.tag-row span{
  padding:5px 9px!important;
  color:#45566d!important;
  background:#f0f4f8!important;
  font-size:.64rem!important;
  font-weight:750!important;
}
.lesson-meter{
  height:8px!important;
  margin-top:15px!important;
}
.lesson-percent{
  margin-top:7px!important;
  color:#60738b!important;
  font-size:.68rem!important;
  font-weight:700!important;
}
.lesson-no.big{
  color:#1558dc!important;
  background:#edf4ff!important;
}

/* ---------- Digital License ---------- */
.digital-license-card{
  background:linear-gradient(122deg,#2455d8 0%,#089cc1 58%,#128078 100%)!important;
  border:1px solid rgba(255,255,255,.15);
  box-shadow:0 18px 42px rgba(29,78,216,.16)!important;
}
.digital-license-card,
.digital-license-card *{
  color:#fff;
}
.digital-license-card h2,
.digital-license-card h3,
.digital-license-card strong{
  color:#fff!important;
}
.digital-license-card .holder-code,
.digital-license-card .holder-class,
.digital-license-card p,
.digital-license-card small{
  color:#e9f5ff!important;
}
.license-holder-photo{
  overflow:hidden;
  background:#dbeafe!important;
}
.license-holder-photo img{
  width:100%;
  height:100%;
  object-fit:cover!important;
  object-position:center;
}
.license-qr-box{
  background:#fff!important;
  box-shadow:0 12px 30px rgba(0,0,0,.13)!important;
}
.license-qr-box small{
  color:#23344c!important;
}
.readiness-badge{
  color:#fff!important;
  border:1px solid rgba(255,255,255,.12);
}
.behavior-separate{
  color:#eef8ff!important;
}
.license-meta span{
  color:#fff!important;
  background:rgba(255,255,255,.13)!important;
}

/* Readiness component cards */
.readiness-summary-panel .readiness-components article.rst-v3363-component-card{
  background:linear-gradient(180deg,#fff,#fbfdff)!important;
}
.rst-v3363-component-card>span{
  color:#283b54!important;
}
.rst-v3363-component-card>small{
  color:#718198!important;
}
.readiness-learning-points{
  background:#eef5ff!important;
  color:#1848a8!important;
}
.readiness-formula{
  color:#63758c!important;
}

/* ---------- Images ---------- */
.avatar img,
.mini-avatar img,
.profile-card img,
.license-holder-photo img{
  image-rendering:auto;
}
.profile-card img{
  object-fit:cover!important;
  object-position:center!important;
}
img{
  max-width:100%;
}

/* ---------- Mobile header / dashboard ---------- */
@media (max-width:960px){
  .desktop-sidebar{display:none!important}
  .app-shell{
    display:block!important;
  }
  .mobile-app-header{
    display:flex!important;
    position:sticky;
    top:0;
    z-index:50;
    min-height:64px;
    padding:10px 16px!important;
    background:rgba(255,255,255,.96)!important;
    backdrop-filter:blur(10px);
    border-bottom:1px solid #e5ebf2;
  }
  .mobile-app-header strong{
    font-size:1rem!important;
    color:#12233c!important;
  }
  .mobile-app-header .mini-avatar{
    width:42px!important;
    height:42px!important;
    overflow:hidden;
  }
  .app-main{
    padding-top:14px!important;
  }
  .welcome-panel{
    border-radius:24px!important;
  }
  .welcome-panel h1{
    color:#fff!important;
    font-size:clamp(1.8rem,7.5vw,2.45rem)!important;
    line-height:1.18!important;
  }
}

/* Mobile dashboard layout */
@media (max-width:650px){
  .app-main{
    padding-left:12px!important;
    padding-right:12px!important;
    padding-bottom:calc(112px + env(safe-area-inset-bottom))!important;
  }
  .dashboard-page{
    width:100%;
  }
  .welcome-panel{
    padding:22px 18px 24px!important;
  }
  .welcome-panel p{
    font-size:.95rem!important;
  }
  .student-metric-grid{
    grid-template-columns:1fr!important;
    margin-top:14px!important;
  }
  .student-metric-grid .metric-card{
    min-height:116px!important;
    padding:15px 16px!important;
  }
  .student-metric-grid .metric-card small{
    font-size:.83rem!important;
  }
  .student-metric-grid .metric-card strong:not(.rst-v3363-mini-ring){
    font-size:1.95rem!important;
  }
  .student-metric-grid .metric-card p{
    display:block!important;
    font-size:.76rem!important;
  }
  .mobile-tabbar{
    left:8px!important;
    right:8px!important;
    bottom:8px!important;
    height:76px!important;
    padding:6px!important;
    border:1px solid #e1e8f1!important;
    border-radius:22px!important;
    background:rgba(255,255,255,.97)!important;
    box-shadow:0 12px 34px rgba(15,23,42,.14)!important;
  }
  .mobile-tabbar a{
    min-width:76px!important;
    min-height:62px;
    border-radius:15px!important;
  }
  .mobile-tabbar a span{
    max-width:72px!important;
    font-size:.62rem!important;
    line-height:1.2!important;
  }
  .mobile-tabbar a svg{
    width:22px!important;
    height:22px!important;
  }
  .mobile-tabbar a.router-link-active{
    color:#1655d3!important;
    background:#eef5ff!important;
  }
}

/* Mobile learning / license */
@media (max-width:700px){
  .section-topline h1{
    font-size:1.9rem!important;
  }
  .lesson-card-grid{
    grid-template-columns:1fr!important;
  }
  .full-lesson-card{
    min-height:auto;
    grid-template-columns:48px minmax(0,1fr) 22px!important;
    padding:16px!important;
  }
  .full-lesson-card h3{
    font-size:1rem!important;
  }
  .full-lesson-card p{
    font-size:.78rem!important;
  }
  .digital-license-card{
    padding:18px!important;
  }
  .license-v22-grid{
    gap:18px!important;
  }
  .license-holder h2{
    font-size:1.38rem!important;
  }
  .license-holder h3{
    font-size:1rem!important;
  }
  .license-qr-box{
    width:min(270px,100%)!important;
    margin-inline:auto!important;
  }
  .readiness-summary-panel{
    padding:16px!important;
  }
}

/* Very narrow devices */
@media (max-width:430px){
  .mobile-app-header{
    padding-inline:12px!important;
  }
  .welcome-panel{
    padding:18px 14px 22px!important;
  }
  .welcome-panel h1{
    font-size:1.72rem!important;
  }
  .identity-chip{
    max-width:100%;
    white-space:normal!important;
  }
  .student-metric-grid .metric-card{
    gap:12px!important;
  }
  .mobile-tabbar{
    overflow-x:auto!important;
  }
  .full-lesson-card{
    grid-template-columns:44px minmax(0,1fr) 18px!important;
    gap:10px!important;
    padding:14px!important;
  }
}

/* Prevent visible overflow */
.app-main,
.dashboard-page,
.license-page,
.learning-page,
.panel-card,
.full-lesson-card,
.digital-license-card,
.metric-card{
  min-width:0;
  max-width:100%;
}
h1,h2,h3,p,small,strong,.nav-label{
  overflow-wrap:anywhere;
}
