/* ========================================================================== 
   Morya Indian Club v12.1 — UI/UX Pro
   Shared, non-destructive presentation layer for Admin, Member, Auth and Web.
   Loads last so legacy and current pages inherit one consistent system.
   ========================================================================== */

:root{
  color-scheme:light;
  --ui-primary:#4f46a5;
  --ui-primary-strong:#37307f;
  --ui-secondary:#c62c88;
  --ui-accent:#168f69;
  --ui-warning:#b86808;
  --ui-danger:#c0342b;
  --ui-info:#2467c9;
  --ui-page:#f5f6fb;
  --ui-page-glow:rgba(79,70,165,.07);
  --ui-surface:#ffffff;
  --ui-surface-2:#fafaff;
  --ui-surface-3:#f0f1f8;
  --ui-text:#17192b;
  --ui-text-2:#3f4562;
  --ui-muted:#6c728d;
  --ui-border:rgba(49,53,85,.13);
  --ui-border-soft:rgba(49,53,85,.075);
  --ui-overlay:rgba(12,14,28,.58);
  --ui-sidebar:#1d1b3e;
  --ui-sidebar-2:#2c1f4b;
  --ui-sidebar-text:rgba(255,255,255,.76);
  --ui-sidebar-muted:rgba(255,255,255,.45);
  --ui-focus:0 0 0 4px rgba(79,70,165,.18);
  --ui-shadow-xs:0 1px 2px rgba(19,22,43,.05);
  --ui-shadow-sm:0 8px 22px rgba(28,31,61,.07);
  --ui-shadow:0 18px 48px rgba(28,31,61,.105);
  --ui-shadow-lg:0 34px 90px rgba(24,26,56,.18);
  --ui-radius-sm:10px;
  --ui-radius:16px;
  --ui-radius-lg:24px;
  --ui-radius-xl:32px;
  --ui-sidebar-width:284px;
  --ui-sidebar-collapsed:82px;
  --ui-topbar-height:72px;
  --ui-gradient:linear-gradient(125deg,#208fc2 0%,#4f46a5 42%,#8d3f9f 70%,#c62c88 100%);
  --ui-gradient-soft:linear-gradient(125deg,rgba(32,143,194,.11),rgba(79,70,165,.09),rgba(198,44,136,.1));
  --ui-gradient-warm:linear-gradient(125deg,#e88819,#c62c88);
  --ui-ease:cubic-bezier(.22,.72,.28,1);

  /* Compatibility aliases used throughout legacy CSS. */
  --ink:var(--ui-text);
  --text:var(--ui-text);
  --muted:var(--ui-muted);
  --surface:var(--ui-surface);
  --surface-alt:var(--ui-surface-2);
  --soft:var(--ui-page);
  --white:var(--ui-surface);
  --line:var(--ui-border);
  --border:var(--ui-border);
  --primary:var(--ui-primary);
  --brand-primary:var(--ui-primary);
}

html[data-theme="dark"]{
  color-scheme:dark;
  --ui-primary:#a99cf7;
  --ui-primary-strong:#c7bcff;
  --ui-secondary:#ff83c8;
  --ui-accent:#55d5aa;
  --ui-warning:#f3b75f;
  --ui-danger:#ff7f76;
  --ui-info:#79afff;
  --ui-page:#0d1019;
  --ui-page-glow:rgba(154,139,245,.08);
  --ui-surface:#161a26;
  --ui-surface-2:#1b2030;
  --ui-surface-3:#23293a;
  --ui-text:#f1f3fb;
  --ui-text-2:#cbd0e2;
  --ui-muted:#969db8;
  --ui-border:rgba(255,255,255,.12);
  --ui-border-soft:rgba(255,255,255,.065);
  --ui-overlay:rgba(0,0,0,.72);
  --ui-sidebar:#101326;
  --ui-sidebar-2:#261936;
  --ui-sidebar-text:rgba(255,255,255,.82);
  --ui-sidebar-muted:rgba(255,255,255,.48);
  --ui-focus:0 0 0 4px rgba(169,156,247,.24);
  --ui-shadow-xs:0 1px 2px rgba(0,0,0,.42);
  --ui-shadow-sm:0 9px 25px rgba(0,0,0,.33);
  --ui-shadow:0 20px 54px rgba(0,0,0,.44);
  --ui-shadow-lg:0 38px 95px rgba(0,0,0,.58);
  --ink:var(--ui-text);
  --text:var(--ui-text);
  --muted:var(--ui-muted);
  --surface:var(--ui-surface);
  --surface-alt:var(--ui-surface-2);
  --soft:var(--ui-page);
  --white:var(--ui-surface);
  --line:var(--ui-border);
  --border:var(--ui-border);
  --primary:var(--ui-primary);
}

html{background:var(--ui-page);accent-color:var(--ui-primary)}
body{
  background:
    radial-gradient(circle at 92% -8%,var(--ui-page-glow),transparent 28rem),
    var(--ui-page)!important;
  color:var(--ui-text)!important;
  transition:background-color .2s ease,color .2s ease;
}
body,button,input,select,textarea{font-family:"Inter Tight","Inter","Noto Sans Myanmar","Noto Sans Devanagari",system-ui,-apple-system,"Segoe UI",sans-serif}
p,li,dd{color:var(--ui-text-2)}
a{transition:color .16s ease,background .16s ease,border-color .16s ease,opacity .16s ease}
hr{border:0;border-top:1px solid var(--ui-border)}
::selection{background:color-mix(in srgb,var(--ui-primary) 26%,transparent)}
*:focus-visible{outline:0!important;box-shadow:var(--ui-focus)!important}
[hidden]{display:none!important}

/* ----- Shared theme controls -------------------------------------------- */
.ui-theme-button,.site-theme-toggle{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-width:42px;min-height:40px;padding:7px 11px;border:1px solid var(--ui-border);
  border-radius:12px;background:var(--ui-surface);color:var(--ui-text-2);
  box-shadow:var(--ui-shadow-xs);font-weight:750;white-space:nowrap
}
.ui-theme-button:hover,.site-theme-toggle:hover{background:var(--ui-surface-2);color:var(--ui-primary);border-color:color-mix(in srgb,var(--ui-primary) 42%,var(--ui-border));transform:translateY(-1px)}
.ui-theme-button [data-theme-icon],.site-theme-toggle [data-theme-icon]{width:18px;text-align:center;font-size:16px}
.theme-toggle-label{font-size:12px}
.ui-theme-floating{position:fixed;right:18px;top:18px;z-index:100}
html[data-theme="dark"] img:not([data-preserve-colour]){color-scheme:dark}

/* ----- Consistent surfaces and typography ------------------------------- */
.admin-body,.member-body,.auth-body,.public-body{background-color:var(--ui-page)!important}
.page-header,.member-page-head{align-items:center!important;margin-bottom:26px!important}
.page-header>div:first-child,.member-page-head>div:first-child{min-width:0}
.page-header h1,.member-page-head h1{font-size:clamp(27px,2.6vw,38px)!important;margin:7px 0 6px!important;color:var(--ui-text)!important}
.page-header p,.member-page-head p{max-width:850px;color:var(--ui-muted)!important}
.eyebrow{display:inline-flex;align-items:center;gap:7px;color:var(--ui-primary)!important;font-size:11px!important;letter-spacing:.135em!important;font-weight:850!important}
.eyebrow::before{content:"";width:18px;height:2px;border-radius:99px;background:var(--ui-gradient)}

.panel,.metric-card,.feature-card,.section-card,.kpi-card,.cms-card,.form-panel,.form-section,
.module-card,.management-card,.quick-card,.editor-card,.publisher-card,.check-card,.permission-row,
.phase12-command-box,.phase13-panel,.phase14-panel,.phase15-panel,.note-box,.notice-box,.callout{
  background:var(--ui-surface)!important;color:var(--ui-text)!important;
  border-color:var(--ui-border)!important;box-shadow:var(--ui-shadow-xs)
}
.panel,.section-card,.form-panel,.phase12-command-box,.phase13-panel,.phase14-panel,.phase15-panel{border-radius:var(--ui-radius)!important}
.panel{box-shadow:var(--ui-shadow-sm)!important}
.panel:hover{border-color:color-mix(in srgb,var(--ui-primary) 25%,var(--ui-border))!important}
.panel-header{align-items:flex-start!important}
.panel-header h2,.section-card-header h2,.form-section h2{color:var(--ui-text)!important}
.panel-header p,.section-card-header p,.form-help,.muted,small{color:var(--ui-muted)}
.block-muted,.empty-card,.empty-state,.empty-state-card{background:var(--ui-surface-2)!important;color:var(--ui-muted)!important;border-color:var(--ui-border)!important}

.metric-grid,.kpi-grid{gap:16px!important}
.metric-card,.kpi-card{position:relative;overflow:hidden;padding:22px!important;border-radius:18px!important;box-shadow:var(--ui-shadow-sm)!important}
.metric-card::after,.kpi-card::after{content:"";position:absolute;right:-22px;top:-28px;width:92px;height:92px;border-radius:50%;background:var(--ui-gradient-soft);pointer-events:none}
.metric-card>span,.kpi-card>span{color:var(--ui-muted)!important;font-size:12px;font-weight:800!important;letter-spacing:.035em;text-transform:uppercase}
.metric-card strong,.kpi-card strong{color:var(--ui-text)!important;font-variant-numeric:tabular-nums}
.metric-link:hover{transform:translateY(-4px)!important;box-shadow:var(--ui-shadow)!important}

/* ----- Buttons and form controls ---------------------------------------- */
.button{border-radius:12px!important;min-height:42px!important;font-weight:750!important;box-shadow:none}
.button-primary{background:var(--ui-gradient)!important;color:#fff!important;border-color:transparent!important;box-shadow:0 9px 24px rgba(79,70,165,.24)}
.button-primary:hover{box-shadow:0 14px 30px rgba(79,70,165,.32)}
.button-secondary,.button-ghost{background:var(--ui-surface)!important;color:var(--ui-text-2)!important;border-color:var(--ui-border)!important}
.button-secondary:hover,.button-ghost:hover{background:var(--ui-surface-2)!important;color:var(--ui-primary)!important;border-color:color-mix(in srgb,var(--ui-primary) 40%,var(--ui-border))!important}
.button-danger{color:#fff!important}
.icon-button{background:var(--ui-surface)!important;color:var(--ui-text-2)!important;border:1px solid var(--ui-border)!important;box-shadow:var(--ui-shadow-xs)}

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),select,textarea,.searchable-select-input{
  background:var(--ui-surface)!important;color:var(--ui-text)!important;
  border:1px solid var(--ui-border)!important;border-radius:11px!important;
  box-shadow:inset 0 1px 1px rgba(20,22,42,.025);min-height:44px
}
textarea{min-height:96px}
input::placeholder,textarea::placeholder{color:color-mix(in srgb,var(--ui-muted) 76%,transparent)}
input:focus,select:focus,textarea:focus,.searchable-select-input:focus{border-color:var(--ui-primary)!important;box-shadow:var(--ui-focus)!important}
input:disabled,select:disabled,textarea:disabled{background:var(--ui-surface-3)!important;color:var(--ui-muted)!important;cursor:not-allowed}
label,.label-title{color:var(--ui-text-2)!important}
select{color-scheme:light dark}
option{background:var(--ui-surface);color:var(--ui-text)}
.code-editor,pre,code{background:var(--ui-surface-2)!important;color:var(--ui-text-2)!important;border-color:var(--ui-border)!important}
.color-field{background:var(--ui-surface-2)!important;border-color:var(--ui-border)!important}
.check-card,.permission-row,.switch-row,.checkbox-label,.toggle-field{background:var(--ui-surface-2)!important;color:var(--ui-text-2)!important}
.searchable-select-panel{background:var(--ui-surface)!important;border-color:var(--ui-border)!important;box-shadow:var(--ui-shadow)!important}
.searchable-select-panel button{color:var(--ui-text-2)!important}
.searchable-select-panel button:hover,.searchable-select-panel button.active{background:var(--ui-surface-2)!important;color:var(--ui-primary)!important}

/* ----- Tables ------------------------------------------------------------ */
.table-wrap,.table-responsive{
  position:relative;background:var(--ui-surface)!important;border:1px solid var(--ui-border)!important;
  border-radius:var(--ui-radius)!important;box-shadow:var(--ui-shadow-xs);overflow:auto;
  scrollbar-gutter:stable
}
table{background:transparent!important;color:var(--ui-text-2)!important}
th{position:sticky;top:0;z-index:2;background:var(--ui-surface-2)!important;color:var(--ui-muted)!important;border-color:var(--ui-border)!important;white-space:nowrap}
td{background:transparent!important;color:var(--ui-text-2)!important;border-color:var(--ui-border-soft)!important}
td strong{color:var(--ui-text)!important}
tbody tr:hover{background:color-mix(in srgb,var(--ui-primary) 5%,var(--ui-surface))!important}
.unread-row{background:color-mix(in srgb,var(--ui-warning) 8%,var(--ui-surface))!important}
.table-wrap::after{content:"";position:sticky;right:0;display:block;width:1px;height:1px}

/* ----- Admin shell ------------------------------------------------------- */
.admin-shell{grid-template-columns:var(--ui-sidebar-width) minmax(0,1fr)!important}
.sidebar{
  width:var(--ui-sidebar-width)!important;padding:18px 13px 24px!important;
  background:radial-gradient(circle at 75% 2%,rgba(198,44,136,.22),transparent 22rem),linear-gradient(175deg,var(--ui-sidebar),var(--ui-sidebar-2))!important;
  border-right:1px solid rgba(255,255,255,.07);box-shadow:14px 0 45px rgba(13,12,31,.12)
}
.admin-logo{display:flex!important;align-items:center!important;gap:12px!important;padding:4px 8px 16px!important;color:#fff!important;min-height:58px}
.admin-logo img{max-width:146px!important;max-height:42px!important;object-fit:contain;background:rgba(255,255,255,.96);border-radius:10px;padding:5px}
.admin-logo span{font-size:13px!important;line-height:1.25!important;min-width:0}
.admin-logo small{display:block;color:var(--ui-sidebar-muted)!important;font-size:10px!important;margin-top:3px;white-space:nowrap}
.admin-nav-tools{display:grid;grid-template-columns:minmax(0,1fr) 38px;gap:7px;padding:2px 3px 12px;position:sticky;top:-18px;z-index:6;background:linear-gradient(180deg,var(--ui-sidebar) 78%,transparent)}
.admin-nav-search{width:100%;height:38px;min-height:38px!important;padding:8px 10px 8px 31px!important;background:rgba(255,255,255,.085)!important;color:#fff!important;border:1px solid rgba(255,255,255,.12)!important;border-radius:10px!important}
.admin-nav-search::placeholder{color:rgba(255,255,255,.48)}
.admin-nav-search-wrap{position:relative;min-width:0}
.admin-nav-search-wrap::before{content:"⌕";position:absolute;left:10px;top:7px;color:rgba(255,255,255,.58);z-index:1}
.sidebar-collapse-button{height:38px;border:1px solid rgba(255,255,255,.12);border-radius:10px;background:rgba(255,255,255,.085);color:#fff;font-size:17px}
.sidebar-nav{gap:3px!important}
.sidebar-nav a{min-height:42px;border-radius:11px!important;color:var(--ui-sidebar-text)!important;font-size:13.5px!important;padding:10px 11px!important}
.sidebar-nav a span{display:grid;place-items:center;width:24px;height:24px;flex:0 0 24px;border-radius:7px;background:rgba(255,255,255,.055);font-size:14px;color:inherit!important}
.sidebar-nav a:hover{background:rgba(255,255,255,.09)!important;color:#fff!important;transform:translateX(2px)}
.sidebar-nav a.active{background:linear-gradient(120deg,rgba(32,143,194,.92),rgba(93,65,174,.96),rgba(198,44,136,.9))!important;box-shadow:0 8px 22px rgba(11,10,28,.24)!important;color:#fff!important}
.sidebar-nav a.active::after{content:"";position:absolute;right:8px;width:5px;height:5px;border-radius:50%;background:#fff;box-shadow:0 0 0 4px rgba(255,255,255,.12)}
.nav-label{color:var(--ui-sidebar-muted)!important;margin-top:4px;padding:19px 11px 6px!important}
.nav-label.ui-filter-empty,.sidebar-nav a.ui-filter-hidden{display:none!important}
.admin-main{grid-column:2!important;min-width:0}
.admin-topbar{
  min-height:var(--ui-topbar-height)!important;height:auto!important;background:color-mix(in srgb,var(--ui-surface) 88%,transparent)!important;
  border-color:var(--ui-border-soft)!important;box-shadow:0 1px 0 var(--ui-border-soft);backdrop-filter:blur(18px) saturate(1.3)!important
}
.admin-topbar-title{display:flex;align-items:center;gap:10px;min-width:0}
.admin-topbar-title strong{color:var(--ui-text);white-space:nowrap}
.admin-breadcrumb{display:flex;align-items:center;gap:6px;color:var(--ui-muted);font-size:12px;min-width:0}
.admin-breadcrumb span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:260px}
.environment-badge{background:var(--ui-gradient-soft)!important;color:var(--ui-primary)!important;border:1px solid color-mix(in srgb,var(--ui-primary) 16%,transparent)}
.admin-content{max-width:1680px!important;padding:30px clamp(18px,2.5vw,38px)!important}
.admin-dashboard-footer{color:var(--ui-muted)!important;border-color:var(--ui-border)!important}
.topbar-actions{min-width:0;flex-wrap:nowrap}
.user-chip{color:var(--ui-text-2)}
.user-chip>span:last-child{max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.locale-switch{background:var(--ui-surface-2)!important;border-color:var(--ui-border)!important}
.locale-switch a{color:var(--ui-muted)!important}
.locale-switch a:hover{background:var(--ui-surface)!important;color:var(--ui-primary)!important}

body.sidebar-collapsed{--ui-sidebar-width:var(--ui-sidebar-collapsed)}
body.sidebar-collapsed .sidebar{width:var(--ui-sidebar-collapsed)!important}
body.sidebar-collapsed .admin-logo{justify-content:center;padding-left:2px!important;padding-right:2px!important}
body.sidebar-collapsed .admin-logo img{max-width:52px!important}
body.sidebar-collapsed .admin-logo span,body.sidebar-collapsed .admin-nav-search-wrap,body.sidebar-collapsed .nav-label,body.sidebar-collapsed .sidebar-nav a:not(.active)::after{display:none!important}
body.sidebar-collapsed .admin-nav-tools{grid-template-columns:1fr;padding-inline:7px}
body.sidebar-collapsed .sidebar-collapse-button{transform:rotate(180deg)}
body.sidebar-collapsed .sidebar-nav a{justify-content:center;padding-inline:8px!important;font-size:0}
body.sidebar-collapsed .sidebar-nav a span{font-size:15px}
body.sidebar-collapsed .sidebar-nav a.active::after{right:5px}

/* ----- Member shell ------------------------------------------------------ */
.member-shell{grid-template-columns:var(--ui-sidebar-width) minmax(0,1fr)!important}
.member-sidebar{width:var(--ui-sidebar-width)!important;background:radial-gradient(circle at 76% 3%,rgba(198,44,136,.22),transparent 22rem),linear-gradient(175deg,var(--ui-sidebar),var(--ui-sidebar-2))!important}
.member-main{grid-column:2!important;min-width:0}
.member-brand{color:#fff!important}
.member-brand img{background:rgba(255,255,255,.96);border-radius:10px;padding:5px;max-height:44px}
.member-nav a{color:var(--ui-sidebar-text)!important}
.member-nav a:hover{color:#fff!important}
.member-nav a.active{color:#fff!important}
.member-topbar{background:color-mix(in srgb,var(--ui-surface) 88%,transparent)!important;border-color:var(--ui-border-soft)!important;backdrop-filter:blur(18px) saturate(1.3)!important}
.member-topbar>div:first-of-type strong{color:var(--ui-text)!important}
.member-topbar>div:first-of-type small{display:block;color:var(--ui-muted)!important}
.member-content{max-width:1540px!important;padding:30px clamp(18px,2.5vw,38px)!important}
.member-sidebar-status{border-color:rgba(255,255,255,.1)!important;color:var(--ui-sidebar-text)!important}

/* ----- Website ----------------------------------------------------------- */
.public-body{--ui-content-width:1240px}
.public-body .container{width:min(var(--ui-content-width),calc(100% - 36px))}
.site-header{height:76px!important;background:color-mix(in srgb,var(--ui-surface) 88%,transparent)!important;border-color:var(--ui-border-soft)!important;box-shadow:0 1px 0 var(--ui-border-soft);backdrop-filter:blur(20px) saturate(1.35)!important}
.site-header.is-stuck{box-shadow:0 12px 34px rgba(22,23,48,.09)!important}
.brand-logo{display:flex;align-items:center;min-width:0}
.brand-logo img{max-width:min(270px,32vw)!important;max-height:52px!important;object-fit:contain}
.public-nav{gap:8px!important}
.public-nav>a:not(.button),.public-nav-group>a{padding:9px 10px!important;border-radius:10px;color:var(--ui-text-2)!important;font-size:13.5px;font-weight:700}
.public-nav>a:not(.button):hover,.public-nav-group>a:hover{background:var(--ui-surface-2);color:var(--ui-primary)!important}
.public-nav>a.active:not(.button),.public-nav-group>a.active{background:var(--ui-gradient-soft);color:var(--ui-primary)!important}
.public-submenu{background:var(--ui-surface)!important;border:1px solid var(--ui-border)!important;border-radius:14px!important;box-shadow:var(--ui-shadow)!important;padding:7px!important}
.public-submenu a{border-radius:9px;color:var(--ui-text-2)!important}
.public-submenu a:hover{background:var(--ui-surface-2)!important;color:var(--ui-primary)!important}
.public-live-nav{color:var(--ui-danger)!important}
.public-menu-toggle{background:var(--ui-surface)!important;color:var(--ui-text)!important;border:1px solid var(--ui-border)!important;border-radius:11px!important;width:42px;height:42px}
.public-flash{position:relative;z-index:2}
.public-body main{min-height:42vh}
.section{padding-block:clamp(54px,7vw,88px)!important}
.section-heading{max-width:780px!important}
.section-heading h2{font-size:clamp(31px,4vw,48px)!important;color:var(--ui-text)!important}
.hero,.cms-hero{color:var(--ui-text)}
.hero-copy{color:var(--ui-text-2)!important}
.feature-card,.public-event-card,.public-plan-card,.gallery-card,.testimonial-card{box-shadow:var(--ui-shadow-sm)!important}
.site-footer{background:linear-gradient(150deg,#11132a,#24172f 62%,#30162c)!important;border-top:1px solid rgba(255,255,255,.08)}
.site-footer,.site-footer h3{color:#fff!important}
.site-footer p,.site-footer .muted-light{color:rgba(255,255,255,.66)!important}
.site-footer a{color:rgba(255,255,255,.76)!important}
.site-footer a:hover{color:#fff!important}
.footer-bottom{border-color:rgba(255,255,255,.1)!important}
.scroll-progress{position:fixed;left:0;top:0;height:3px;width:0;background:var(--ui-gradient);z-index:1000;pointer-events:none;transition:width .08s linear}
.scroll-to-top{background:var(--ui-gradient)!important;color:#fff!important;border:0!important;box-shadow:var(--ui-shadow)!important}

/* Dark coverage for legacy website classes with hard-coded white. */
html[data-theme="dark"] .hero,html[data-theme="dark"] .cms-hero,
html[data-theme="dark"] .auth-body{
  background:radial-gradient(circle at 86% 4%,rgba(169,156,247,.13),transparent 28rem),linear-gradient(145deg,#0d1019,#131725)!important
}
html[data-theme="dark"] .ball-timeline span,html[data-theme="dark"] .attachment-list a,
html[data-theme="dark"] .priority-low,html[data-theme="dark"] .status-closed,
html[data-theme="dark"] .status-archived{background:var(--ui-surface-3)!important;color:var(--ui-text-2)!important}
html[data-theme="dark"] .support-message.member-message,
html[data-theme="dark"] .support-member-card.unread,
html[data-theme="dark"] .unread-row{background:color-mix(in srgb,var(--ui-warning) 9%,var(--ui-surface))!important}
html[data-theme="dark"] .support-message.internal-note{background:color-mix(in srgb,var(--ui-primary) 12%,var(--ui-surface))!important}

/* ----- Auth -------------------------------------------------------------- */
.auth-body{background:radial-gradient(circle at 12% 8%,rgba(79,70,165,.13),transparent 24rem),radial-gradient(circle at 90% 90%,rgba(198,44,136,.1),transparent 24rem),var(--ui-page)!important}
.auth-card{background:var(--ui-surface)!important;border-color:var(--ui-border)!important;border-radius:var(--ui-radius-lg)!important;box-shadow:var(--ui-shadow-lg)!important}
.auth-heading h1{color:var(--ui-text)!important}
.auth-heading p,.auth-footer{color:var(--ui-muted)!important}
.auth-logo img{background:rgba(255,255,255,.96);border-radius:12px;padding:6px}

/* ----- Dialogs, menus, flashes ------------------------------------------ */
dialog,.modal,.video-preview-dialog,.video-preview-modal [role="dialog"]{background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;box-shadow:var(--ui-shadow-lg)!important}
.sidebar-overlay,.member-overlay,.video-preview-backdrop{background:var(--ui-overlay)!important;backdrop-filter:blur(3px)}
.flash{background:var(--ui-surface)!important;color:var(--ui-text-2)!important;border-color:var(--ui-border)!important;box-shadow:var(--ui-shadow-sm)!important}
.flash-success{border-left:4px solid var(--ui-accent)!important}
.flash-warning{border-left:4px solid var(--ui-warning)!important}
.flash-error{border-left:4px solid var(--ui-danger)!important}

/* ----- Command palette --------------------------------------------------- */
.ui-command-palette{position:fixed;inset:0;z-index:500;display:grid;place-items:start center;padding-top:min(14vh,120px);background:var(--ui-overlay);backdrop-filter:blur(8px)}
.ui-command-dialog{width:min(680px,calc(100% - 28px));max-height:min(72vh,680px);display:flex;flex-direction:column;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:22px;box-shadow:var(--ui-shadow-lg);overflow:hidden}
.ui-command-head{display:flex;align-items:center;gap:10px;padding:14px;border-bottom:1px solid var(--ui-border)}
.ui-command-head input{flex:1;margin:0!important;border:0!important;box-shadow:none!important;background:transparent!important;font-size:16px}
.ui-command-key{padding:4px 7px;border:1px solid var(--ui-border);border-radius:7px;background:var(--ui-surface-2);color:var(--ui-muted);font-size:10px}
.ui-command-results{overflow:auto;padding:8px}
.ui-command-results a{display:flex;align-items:center;gap:11px;padding:11px 12px;border-radius:11px;color:var(--ui-text-2)}
.ui-command-results a:hover,.ui-command-results a.active{background:var(--ui-gradient-soft);color:var(--ui-primary)}
.ui-command-results a i{display:grid;place-items:center;width:29px;height:29px;border-radius:9px;background:var(--ui-surface-2);font-style:normal}
.ui-command-empty{padding:32px;text-align:center;color:var(--ui-muted)}

/* ----- Dashboard-specific polish ---------------------------------------- */
.admin-dashboard-pro .phase8-dashboard-grid,.admin-dashboard-pro .work-queue-grid{gap:20px!important}
.admin-dashboard-pro .mini-chart{background:linear-gradient(180deg,transparent,var(--ui-surface-2));border-radius:14px;padding-inline:12px}
.admin-dashboard-pro .mini-chart-column span{background:var(--ui-gradient)!important;box-shadow:0 5px 12px rgba(79,70,165,.2)}
.queue-row{border-color:var(--ui-border-soft)!important;color:var(--ui-text-2)!important;border-radius:10px;padding-inline:8px!important}
.queue-row:hover{background:var(--ui-surface-2);color:var(--ui-primary)!important}
.health-row{border-color:var(--ui-border-soft)!important}
.sla-summary>div{background:var(--ui-surface-2)!important;border-color:var(--ui-border)!important}

/* ----- Loading and interaction states ----------------------------------- */
body.ui-navigating::after{content:"";position:fixed;left:0;top:0;height:3px;width:38%;z-index:1500;background:var(--ui-gradient);animation:uiNav 1.15s ease-in-out infinite}
@keyframes uiNav{0%{transform:translateX(-110%)}100%{transform:translateX(320%)}}
.ui-copy-feedback{position:fixed;right:18px;bottom:18px;z-index:600;padding:11px 14px;border-radius:12px;background:var(--ui-text);color:var(--ui-surface);box-shadow:var(--ui-shadow);font-weight:750;animation:uiToast .25s ease both}
@keyframes uiToast{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ----- Responsive -------------------------------------------------------- */
@media(max-width:1180px){
  .topbar-actions{gap:7px!important}
  .topbar-actions .button[href="/"]{font-size:0;width:40px;padding:0!important}
  .topbar-actions .button[href="/"]::before{content:"↗";font-size:16px}
  .user-chip>span:last-child{display:none}
}
@media(max-width:980px){
  .admin-shell,.member-shell{display:block!important}
  .sidebar,.member-sidebar{width:min(88vw,304px)!important}
  .admin-main,.member-main{width:100%;grid-column:auto!important}
  body.sidebar-collapsed{--ui-sidebar-width:284px}
  .sidebar-collapse-button{display:none}
  .admin-nav-tools{grid-template-columns:1fr}
  .admin-topbar,.member-topbar{min-height:66px!important;padding:9px 14px!important}
  .admin-content,.member-content{padding:20px 16px 30px!important}
  .admin-breadcrumb,.environment-badge{display:none}
  .topbar-actions form .button{font-size:0;width:40px;padding:0!important}
  .topbar-actions form .button::before{content:"↪";font-size:16px}
}
@media(max-width:820px){
  .site-header{height:70px!important}
  .brand-logo img{max-width:225px!important}
  .phase4-public .public-nav{top:72px!important;background:var(--ui-surface)!important;border-color:var(--ui-border)!important;box-shadow:var(--ui-shadow)!important;max-height:calc(100vh - 88px);overflow:auto}
  .public-nav-group{width:100%}
  .public-submenu{position:static!important;display:grid!important;margin:2px 0 7px 14px!important;box-shadow:none!important;background:var(--ui-surface-2)!important}
  .site-theme-toggle{width:100%;justify-content:flex-start;padding:10px 12px}
  .footer-grid{gap:28px!important}
}
@media(max-width:700px){
  .page-header,.member-page-head{align-items:stretch!important;flex-direction:column!important}
  .page-actions,.header-actions{width:100%}
  .page-actions .button,.header-actions .button{flex:1 1 auto}
  .metric-grid,.phase8-metrics,.kpi-grid,.support-metrics,.report-summary-grid{grid-template-columns:1fr 1fr!important}
  .panel,.section-card,.form-panel{padding:18px!important}
  .filter-bar,.report-filter,.upload-form{grid-template-columns:1fr!important}
  .topbar-actions .locale-switch{display:none!important}
  .theme-toggle-label{display:none}
  .ui-theme-button,.site-theme-toggle{min-width:40px;padding-inline:9px}
  .public-nav .theme-toggle-label{display:inline}
}
@media(max-width:480px){
  .metric-grid,.phase8-metrics,.kpi-grid,.support-metrics,.report-summary-grid{grid-template-columns:1fr!important}
  .admin-content,.member-content{padding-inline:12px!important}
  .topbar-actions{gap:5px!important}
  .topbar-actions .button,.ui-theme-button,.icon-button{width:38px!important;min-width:38px!important;height:38px!important;min-height:38px!important}
  .brand-logo img{max-width:190px!important}
  .public-body .container{width:min(100% - 24px,var(--ui-content-width))}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
@media print{
  html,body{background:#fff!important;color:#111!important}
  .sidebar,.admin-topbar,.member-sidebar,.member-topbar,.site-header,.site-footer,.scroll-to-top,.ui-theme-button,.ui-command-palette,.admin-nav-tools{display:none!important}
  .admin-main,.member-main{grid-column:auto!important}
  .admin-content,.member-content{padding:0!important;max-width:none!important}
  .panel,.section-card,.table-wrap{box-shadow:none!important;border-color:#ccc!important;break-inside:avoid}
}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.ui-theme-admin-options{margin-top:18px}.ui-theme-admin-options .switch-row{align-self:end;min-height:76px}
.dashboard-header-tools{display:flex;flex-direction:column;align-items:flex-end;gap:10px;min-width:min(100%,720px)}
.dashboard-quick-links{display:flex;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.dashboard-quick-links a{padding:6px 10px;border:1px solid var(--ui-border);border-radius:999px;background:var(--ui-surface);color:var(--ui-muted);font-size:11px;font-weight:800}
.dashboard-quick-links a:hover{background:var(--ui-gradient-soft);border-color:color-mix(in srgb,var(--ui-primary) 30%,var(--ui-border));color:var(--ui-primary)}
.dashboard-header-tools .dashboard-range{margin:0!important}
.public-home-page .cms-hero,.public-home-page .hero{min-height:min(720px,calc(100vh - 76px));display:flex;align-items:center}
.public-home-page .section:nth-of-type(even){background:color-mix(in srgb,var(--ui-surface-2) 68%,transparent)}
@media(max-width:900px){.dashboard-header-tools{align-items:stretch;width:100%}.dashboard-quick-links{justify-content:flex-start}.dashboard-header-tools .dashboard-range{width:100%}}
/* Extended dark-mode coverage for specialised legacy pages. */
html[data-theme="dark"] .phase10-intelligence-strip article,
html[data-theme="dark"] .phase10-template-list article,
html[data-theme="dark"] .phase10-entry-marker span,
html[data-theme="dark"] .phase10-mini-feed article>span,
html[data-theme="dark"] .phase11-workspace article,
html[data-theme="dark"] .report-kpi-grid article,
html[data-theme="dark"] .playing-xi-report article,
html[data-theme="dark"] .phase9-section-nav,
html[data-theme="dark"] .phase9-kpi-grid article,
html[data-theme="dark"] .phase9-stat-strip article,
html[data-theme="dark"] .phase9-chart-card,
html[data-theme="dark"] .phase9-table-card,
html[data-theme="dark"] .phase9-mini-leaders>article,
html[data-theme="dark"] .phase9-partnership-grid>a,
html[data-theme="dark"] .phase9-compare-grid>article,
html[data-theme="dark"] .phase9-quality-grid article,
html[data-theme="dark"] .phase8-recent-balls,
html[data-theme="dark"] .phase8-commentary,
html[data-theme="dark"] .phase8-poll,
html[data-theme="dark"] .phase3-team-card,
html[data-theme="dark"] .league-division-public-card,
html[data-theme="dark"] .playoff-public-card,
html[data-theme="dark"] .round-card,
html[data-theme="dark"] .tournament-news-card,
html[data-theme="dark"] .document-card,
html[data-theme="dark"] .management-row,
html[data-theme="dark"] .admin-data-row,
html[data-theme="dark"] .ballot-option,
html[data-theme="dark"] .preference-card,
html[data-theme="dark"] .developer-preview-card,
html[data-theme="dark"] .newsletter-card,
html[data-theme="dark"] .event-booking-form,
html[data-theme="dark"] .chat-composer,
html[data-theme="dark"] .chat-message-list,
html[data-theme="dark"] .member-chat-thread,
html[data-theme="dark"] .participant-option,
html[data-theme="dark"] .verification-card,
html[data-theme="dark"] .danger-zone{
  background:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important
}
html[data-theme="dark"] .phase10-entry-marker i{background:var(--ui-border)!important}
html[data-theme="dark"] .phase10-entry-marker span,
html[data-theme="dark"] .phase10-mini-feed article>span{color:var(--ui-text-2)!important}
html[data-theme="dark"] .phase10-entry.major .phase10-entry-marker span,
html[data-theme="dark"] .phase10-entry.milestone .phase10-entry-marker span{background:color-mix(in srgb,var(--ui-warning) 13%,var(--ui-surface))!important;color:var(--ui-warning)!important}
html[data-theme="dark"] .phase10-entry.critical .phase10-entry-marker span,
html[data-theme="dark"] .phase10-entry.turning_point .phase10-entry-marker span{background:color-mix(in srgb,var(--ui-danger) 13%,var(--ui-surface))!important;color:var(--ui-danger)!important}
html[data-theme="dark"] .phase9-compare-panel select{background:var(--ui-surface)!important;color:var(--ui-text)!important}
html[data-theme="dark"] .phase13-row-status,
html[data-theme="dark"] .phase13-job-status{filter:none!important}
html[data-theme="dark"] .chat-bubble.theirs{background:var(--ui-surface-2)!important;color:var(--ui-text)!important}
html[data-theme="dark"] .chat-bubble.mine{background:color-mix(in srgb,var(--ui-primary) 22%,var(--ui-surface))!important;color:var(--ui-text)!important}
html[data-theme="dark"] .share-card-page{background:var(--ui-page)!important}
