/* ─────────────────────────────────────────────────────────────
   UI audit pass — accessibility, contrast, touch, motion
   Loaded last on every page; overrides only what the audit found.
   ───────────────────────────────────────────────────────────── */

/* AA-safe semantic colours (light theme) */
:root{
  --muted:#5c6e84;      /* 5.07:1 on #fff, 4.74:1 on #f4f7fc */
  --green:#0e7a5f;      /* 5.33:1 on #fff */
  --red:#c94a54;        /* 4.60:1 on #fff */
}

/* skip link: first tab stop on every page */
.skip-link{position:fixed;top:-60px;right:16px;z-index:60;background:#164f96;color:#fff;padding:10px 18px;border-radius:0 0 10px 10px;font:700 13px/1.4 'IRANSansApp',Tahoma,sans-serif;text-decoration:none;transition:top .15s}
.skip-link:focus{top:0}
main#main:focus{outline:none}

/* visible keyboard focus everywhere */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:2px solid #2f6fc0;outline-offset:2px;border-radius:6px
}
.btn:focus-visible,.icon-button:focus-visible,.menu-toggle:focus-visible,
.icon-btn:focus-visible{box-shadow:0 0 0 4px #2f6fc02e}

/* the off-canvas drawer must never create a horizontal scrollbar */
html,body{overflow-x:clip}
body.menu-open{overflow:hidden}

/* ── server-rendered pages (app.css) ── */
.nav-caption{color:#64788e;font-size:11px}
.nav-link{color:#5f738a;min-height:44px}
.brand small,.side-user small,.side-user>a{color:#5c6e84;font-size:11px}
.overline{color:#5c6e84;font-size:11px}
.top-actions{color:#5c6e84}
.metric-label,.row-fill small,.summary-strip>div,.card-bottom,.tab,
.table th,.help-text,.form-field>small{color:#54677d}
.pill{background:#eef4fb;color:#4a6a8c}
.pill.status-todo{color:#5d7488}
.child-count{color:#5f7389}
.empty-state,.project-card p{color:#5c6e84}
.menu-toggle{min-width:44px;min-height:44px}
.brand img{width:54px;height:54px}

/* ── v5 SPA + login (v5.css) ── */
.nav-group{color:#64788e;font-size:11px;letter-spacing:0}
.nav-item{min-height:42px}
.nav-count{background:#eef3fc;color:#3f5f88}
.tag{font-size:10.5px}
.stat-foot,.footnote,.top-caption{font-size:11px}
.icon-btn{flex:0 0 auto}
.v11-login-symbol b,.v11-login-symbol span{font-family:'IRANSansApp',Tahoma,sans-serif!important}
.v11-login-symbol span{color:#5c6e84}

/* dark theme: the audit found 21 failing nodes in the sidebar */
body.dark{--green:#63d6b4;--red:#ff9ba3}
body.dark .nav-item{color:#adc0d5}
body.dark .nav-item:hover{color:#e2eefb}
body.dark .nav-item.active{color:#e4f0ff}
body.dark .nav-group{color:#93a8be}
body.dark .nav-count{background:#22384f;color:#c7daec}
body.dark .tag{background:#22384f;color:#a9cef2}
body.dark .tag.orange{background:#4a3115;color:#ffc183}
body.dark .tag.green{background:#123f33;color:#8ff0cd}
body.dark .tag.red{background:#47222a;color:#ffb3b9}
body.dark .brand small,body.dark .side-user small{color:#a3b7cc}

/* touch screens */
@media(max-width:900px){
  .nav-item{min-height:48px}
  .icon-btn,.icon-button{width:44px;height:44px}
  .btn{min-height:40px}
}

/* respect the OS motion preference */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
    transition-duration:.001ms!important;
    scroll-behavior:auto!important
  }
}
/* the drawer is a functional panel: keep a short gentle slide even with
   reduced motion, instead of popping in instantly */
@media(prefers-reduced-motion:reduce){
  .sidebar,.nav-scrim,.mobile-fade{transition-duration:.14s!important}
}

/* chips, badges and dots: AA for 10–11px text and 3:1 for status glyphs */
.avatar{background:linear-gradient(145deg,#356fae,#1d4f8c)}
.metric-symbol.blue{color:#2c66ab}
.metric-symbol.purple{color:#6b45a0}
.metric-symbol.green{color:#0a7057}
.metric-symbol.orange{color:#a85c0c}
.row-bullet{color:#5b7c99}
.row-bullet.green{color:#0e7a5f}
.pill.status-done{background:#e4f6ee;color:#0f6b4f}
.pill.status-doing{background:#fdf0dd;color:#82500b}
.pill.status-todo{background:#eef2f7;color:#4e6478}

/* every icon/link control keeps a real hit area */
.panel-head a,.head-account{display:inline-flex;align-items:center;min-height:28px}
.side-user>a,.top-actions a[title]{display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:40px}

@media print{.skip-link{display:none}}
