/* RANKHOUSE Workspace Polish v14.11.0
   Shared header alignment, compact workspaces and richer media controls. */

body.rankhouse-dashboard-v14 .main[data-rh-page] > .topbar,
body.rankhouse-dashboard-v14 .topbar.rh-module-command-header {
  grid-template-columns:minmax(360px,1fr) minmax(520px,auto)!important;
  align-items:center!important;
  min-height:126px!important;
  padding:18px 20px!important;
}
body.rankhouse-dashboard-v14 .main[data-rh-page] > .topbar > div:first-child,
body.rankhouse-dashboard-v14 .topbar.rh-module-command-header > div:first-child {
  align-self:center;
}
body.rankhouse-dashboard-v14 .rh-module-header-actions,
body.rankhouse-dashboard-v14 .topbar-actions.rh-module-header-actions {
  display:grid!important;
  grid-template-columns:repeat(2,max-content)!important;
  grid-auto-flow:row dense;
  justify-content:end!important;
  align-items:center!important;
  align-content:center!important;
  column-gap:9px!important;
  row-gap:9px!important;
  width:100%;
  max-width:960px;
}
body.rankhouse-dashboard-v14 .rh-module-header-actions > .rh-header-status-group {
  grid-column:1 / -1!important;
  grid-row:1!important;
  order:0!important;
  display:flex!important;
  justify-content:center!important;
  align-items:center;
  flex-wrap:wrap!important;
  min-height:32px;
  padding:0!important;
}
body.rankhouse-dashboard-v14 .rh-module-header-actions > .account-toolbar {
  grid-column:1 / -1!important;
  grid-row:3!important;
  order:0!important;
  justify-self:center;
  width:auto!important;
  max-width:100%;
  margin:0!important;
}
body.rankhouse-dashboard-v14 .rh-module-header-actions > a,
body.rankhouse-dashboard-v14 .rh-module-header-actions > button,
body.rankhouse-dashboard-v14 .rh-module-header-actions > form {
  grid-row:2!important;
  order:0!important;
  justify-self:end;
}
body.rankhouse-dashboard-v14 .rh-module-header-actions > form { margin:0; }
body.rankhouse-dashboard-v14 .rh-module-header-actions > form > .button { width:100%; }
body.rankhouse-dashboard-v14 .rh-module-header-actions:has(> .account-toolbar):not(:has(> a,> button,> form)) > .account-toolbar { grid-row:2!important; }
body.rankhouse-dashboard-v14 .rh-module-header-actions .account-toolbar {
  border:1px solid rgba(255,255,255,.075);
  border-radius:13px;
  padding:5px;
  background:rgba(0,0,0,.16);
}
body.rankhouse-dashboard-v14 .rh-module-header-actions .theme-switcher,
body.rankhouse-dashboard-v14 .rh-module-header-actions .user-menu { min-height:40px; }

/* Secondary workspaces inside large module tabs. */
.rh-subtabs,
.rh-auto-workspace-tabs {
  display:flex;
  align-items:center;
  gap:7px;
  overflow-x:auto;
  margin:0 0 14px;
  padding:7px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:13px;
  background:rgba(255,255,255,.022);
  scrollbar-width:none;
}
.rh-subtabs::-webkit-scrollbar,.rh-auto-workspace-tabs::-webkit-scrollbar{display:none}
.rh-subtab,
.rh-auto-workspace-tab {
  appearance:none;
  min-height:35px;
  border:1px solid transparent;
  border-radius:9px;
  padding:0 12px;
  color:#9999a7;
  background:transparent;
  font:inherit;
  font-size:10px;
  font-weight:800;
  white-space:nowrap;
  cursor:pointer;
}
.rh-subtab:hover,.rh-auto-workspace-tab:hover{color:#fff;background:rgba(255,255,255,.045)}
.rh-subtab.is-active,.rh-auto-workspace-tab.is-active{
  border-color:rgba(var(--rh-accent-rgb),.28);
  color:#fff;
  background:linear-gradient(135deg,rgba(var(--rh-accent-rgb),.22),rgba(var(--rh-accent-rgb),.08));
  box-shadow:inset 0 0 0 1px rgba(var(--rh-accent-rgb),.08);
}
[data-rh-subpanel],[data-rh-auto-workspace-panel]{display:none}
[data-rh-subpanel].is-active,[data-rh-auto-workspace-panel].is-active{display:block;animation:rhWorkspaceIn .18s ease both}
@keyframes rhWorkspaceIn{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
.rh-auto-workspace-tabs{position:sticky;z-index:44;top:10px;margin-bottom:16px;background:rgba(13,13,19,.96);backdrop-filter:blur(15px)}

/* Modern file selector / drag and drop. */
.rh-file-upload-control { display:grid; gap:9px; }
.rh-file-upload-control > input[type=file] {
  position:absolute!important;
  width:1px!important;height:1px!important;
  overflow:hidden!important;
  clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;
}
.rh-file-dropzone {
  position:relative;
  display:grid;
  grid-template-columns:48px minmax(0,1fr) auto;
  align-items:center;
  gap:13px;
  min-height:92px;
  border:1px dashed rgba(var(--rh-accent-rgb),.36);
  border-radius:14px;
  padding:14px 16px;
  background:linear-gradient(135deg,rgba(var(--rh-accent-rgb),.085),rgba(255,255,255,.015));
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease,transform .16s ease;
}
.rh-file-dropzone:hover,.rh-file-dropzone.is-dragover{border-color:rgba(var(--rh-accent-rgb),.72);background:rgba(var(--rh-accent-rgb),.11);transform:translateY(-1px)}
.rh-file-dropzone-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:13px;background:rgba(var(--rh-accent-rgb),.16);font-size:21px}
.rh-file-dropzone-copy{display:grid;gap:4px;min-width:0}
.rh-file-dropzone-copy strong{font-size:12px;color:#f5f5f8}
.rh-file-dropzone-copy small{color:#8f8f9c;font-size:9px;line-height:1.4}
.rh-file-dropzone-name{overflow:hidden;color:#cfcfd7;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
.rh-file-dropzone-action{min-height:36px;border:1px solid rgba(var(--rh-accent-rgb),.3);border-radius:9px;padding:0 12px;color:#fff;background:rgba(var(--rh-accent-rgb),.15);font-size:10px;font-weight:800}
.rh-file-upload-preview{display:none;overflow:hidden;max-height:210px;border:1px solid rgba(255,255,255,.08);border-radius:12px;background:#08090d}
.rh-file-upload-preview.is-visible{display:block}
.rh-file-upload-preview img{display:block;width:100%;max-height:210px;object-fit:contain}

/* Achievement image controls. */
.achievement-badge-editor-preview img[data-badge-image]{display:none;width:58px;height:58px;border-radius:14px;object-fit:contain;background:rgba(0,0,0,.18)}
.achievement-badge-editor-preview.has-image img[data-badge-image]{display:block}
.achievement-badge-editor-preview.has-image [data-badge-symbol]{display:none}
.rh-media-url-control .rh-media-picker-button[data-rh-badge-picker]{min-width:150px}

/* Rank card editor: compact left side with real design workspaces. */
.rank-card-editor-layout.is-modern{grid-template-columns:minmax(0,1.25fr) minmax(360px,.75fr);gap:16px;align-items:start}
.rh-rank-design-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:0 0 14px}
.rh-rank-design-nav button{min-height:48px;border:1px solid rgba(255,255,255,.075);border-radius:11px;color:#9b9baa;background:rgba(255,255,255,.018);font-size:9px;font-weight:800;cursor:pointer}
.rh-rank-design-nav button.is-active{border-color:rgba(var(--rh-accent-rgb),.34);color:#fff;background:rgba(var(--rh-accent-rgb),.13)}
.rh-rank-design-panel{display:none}.rh-rank-design-panel.is-active{display:block;animation:rhWorkspaceIn .18s ease both}
.rh-style-choice-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-bottom:12px}
.rh-style-choice{position:relative;display:grid;gap:7px;min-height:94px;border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:12px;background:rgba(255,255,255,.018);cursor:pointer}
.rh-style-choice input{position:absolute;opacity:0;pointer-events:none}
.rh-style-choice:has(input:checked){border-color:rgba(var(--rh-accent-rgb),.45);background:rgba(var(--rh-accent-rgb),.105);box-shadow:inset 0 0 0 1px rgba(var(--rh-accent-rgb),.1)}
.rh-style-choice strong{font-size:11px}.rh-style-choice small{color:#8f8f9d;font-size:8px;line-height:1.4}
.rh-style-sample{height:28px;border-radius:8px;background:linear-gradient(135deg,var(--rh-accent),rgba(255,255,255,.08))}
.rh-style-choice.is-glass .rh-style-sample{background:linear-gradient(135deg,rgba(255,255,255,.22),rgba(var(--rh-accent-rgb),.15));backdrop-filter:blur(8px)}
.rh-style-choice.is-minimal .rh-style-sample{border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.025)}

/* AutoMod subtabs and compact exception pickers. */
.automod-protection-form .rh-subpanel-card{border:1px solid rgba(255,255,255,.07);border-radius:13px;padding:14px;background:rgba(255,255,255,.016)}
.automod-protection-form .rh-subpanel-card + .rh-subpanel-card{margin-top:10px}
.automod-protection-form .module-checkbox-grid{max-height:340px;overflow:auto;padding-right:4px}

/* Ticket panel manager. */
.rh-ticket-panel-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:10px}
.rh-ticket-panel-card{display:grid;gap:12px;border:1px solid rgba(255,255,255,.075);border-radius:13px;padding:13px;background:rgba(255,255,255,.018)}
.rh-ticket-panel-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.rh-ticket-panel-card-head h3{margin:4px 0 0;font-size:13px}.rh-ticket-panel-card-head p{margin:4px 0 0;color:#8f8f9c;font-size:8px}
.rh-ticket-panel-card-actions{display:flex;gap:7px;flex-wrap:wrap}
.rh-ticket-panel-editor-shell{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(340px,.75fr);gap:14px;align-items:start}

@media(max-width:1100px){
  body.rankhouse-dashboard-v14 .main[data-rh-page] > .topbar,
  body.rankhouse-dashboard-v14 .topbar.rh-module-command-header{grid-template-columns:1fr!important}
  body.rankhouse-dashboard-v14 .rh-module-header-actions{justify-content:start!important;grid-template-columns:repeat(2,max-content)!important}
  body.rankhouse-dashboard-v14 .rh-module-header-actions > .rh-header-status-group{justify-content:flex-start!important}
  body.rankhouse-dashboard-v14 .rh-module-header-actions > .account-toolbar{justify-self:start}
  .rank-card-editor-layout.is-modern,.rh-ticket-panel-editor-shell{grid-template-columns:1fr}
}
@media(max-width:720px){
  body.rankhouse-dashboard-v14 .rh-module-header-actions{display:flex!important;justify-content:flex-start!important}
  body.rankhouse-dashboard-v14 .rh-module-header-actions > .rh-header-status-group{order:-2!important;width:100%;justify-content:flex-start!important;overflow-x:auto;flex-wrap:nowrap!important}
  body.rankhouse-dashboard-v14 .rh-module-header-actions > .account-toolbar{order:10!important;width:100%!important}
  .rh-file-dropzone{grid-template-columns:42px minmax(0,1fr)}.rh-file-dropzone-action{grid-column:1/-1;width:100%}
  .rh-rank-design-nav{grid-template-columns:repeat(2,minmax(0,1fr))}.rh-style-choice-grid{grid-template-columns:1fr}
}
