/*
 * Phoenix Guild Command v12.1.0
 * Unified Stitch dashboard shell.
 * Geometry is derived from the 1920 × 1080 CSS viewport represented by
 * the supplied 3840 × 2160 Stitch reference.
 */
:root{
  --stitch-sidebar:256px;
  --stitch-cyan:#9de2ff;
  --stitch-cyan-strong:#5ed4ff;
  --stitch-cyan-container:#00ccff;
  --stitch-gold:#e9c176;
  --stitch-gold-dark:#604403;
  --stitch-bg:#051424;
  --stitch-lowest:#010f1f;
  --stitch-low:#0d1c2d;
  --stitch-container:#122131;
  --stitch-high:#1c2b3c;
  --stitch-highest:#273647;
  --stitch-text:#d4e4fa;
  --stitch-muted:#bbc8d0;
  --stitch-line:rgba(233,193,118,.28);
  --stitch-panel:rgba(5,16,26,.82);
  --stitch-error:#ffb4ab;
  --blue:var(--stitch-cyan);
  --gold:var(--stitch-gold);
  --red:#ff5f68;
  --green:var(--stitch-cyan);
  --muted:var(--stitch-muted);
}

.material-symbols-outlined{
  font-family:"Material Symbols Outlined"!important;
  font-weight:normal!important;
  font-style:normal!important;
  font-size:24px;
  line-height:1;
  letter-spacing:normal;
  text-transform:none;
  display:inline-block;
  white-space:nowrap;
  word-wrap:normal;
  direction:ltr;
  -webkit-font-feature-settings:"liga";
  -webkit-font-smoothing:antialiased;
  font-feature-settings:"liga";
}

html{background:var(--stitch-bg)!important}
html body{
  background:transparent!important;
  color:var(--stitch-text)!important;
  font-family:"Work Sans",system-ui,-apple-system,"Segoe UI",sans-serif!important;
}
body::before{
  background:rgba(1,10,20,.42)!important;
}
.phoenix-master-artwork{
  object-fit:cover!important;
  object-position:50% 50%!important;
  transform:none!important;
}
#desktopStage{will-change:auto!important}

/* Exact 256px Stitch command rail */
.master-sidebar{
  width:256px!important;
  background:rgba(5,16,26,.74)!important;
  border-right:1px solid rgba(233,193,118,.28)!important;
  box-shadow:0 0 15px rgba(0,204,255,.12)!important;
  backdrop-filter:blur(12px)!important;
}
.sidebar-brand{
  flex:0 0 260px!important;
  height:260px!important;
  background:url("./phoenix-stitch-logo.png") center 22px/132px 132px no-repeat!important;
}
.sidebar-brand::before{
  top:172px!important;
  font-size:48px!important;
  line-height:56px!important;
  letter-spacing:.05em!important;
}
.sidebar-brand::after{
  top:220px!important;
  font-size:14px!important;
  letter-spacing:.2em!important;
}
.master-nav{
  gap:0!important;
  padding:0 8px!important;
}
.master-nav button{
  min-height:48px!important;
  padding:0 20px!important;
  gap:14px!important;
  color:var(--stitch-muted)!important;
  font-size:14px!important;
}
.master-nav button::before{width:4px!important}
.master-nav button.active{
  color:var(--stitch-cyan)!important;
  background:rgba(0,204,255,.18)!important;
}
.master-nav button>.material-symbols-outlined{
  flex:0 0 26px;
  width:26px;
  color:inherit;
  font-size:26px!important;
}
.master-nav img{display:none!important}
.sidebar-footer-art{
  flex:0 0 158px!important;
  height:158px!important;
  margin-top:20px!important;
}
.sidebar-footer-art::before{
  content:"◉  STRENGTH IN LOYALTY"!important;
  top:28px!important;
  font-size:12px!important;
}
.sidebar-footer-art::after{
  top:76px!important;
  left:52px!important;
  right:52px!important;
  font-size:11px!important;
}

/* The shared workspace is the exact Stitch canvas, not a scaled stage. */
.master-workspace{
  width:calc(100% - 256px)!important;
  margin-left:256px!important;
}
.stitch-appbar{
  height:160px!important;
  margin:0!important;
  padding:32px!important;
  background:linear-gradient(180deg,rgba(5,20,36,.82),rgba(5,20,36,.28) 78%,transparent)!important;
  backdrop-filter:none!important;
}
#pageTitle{
  left:32px!important;
  top:34px!important;
  max-width:500px!important;
  font-size:32px!important;
  line-height:40px!important;
  letter-spacing:.02em!important;
}
#pageSub{
  left:32px!important;
  top:78px!important;
  max-width:560px!important;
  font-family:"Work Sans",sans-serif!important;
  font-size:16px!important;
  letter-spacing:.3em!important;
}

/* Event, year, and signed-in ledger controls */
.event-control{
  right:481px!important;
  top:38px!important;
  width:145px!important;
  height:58px!important;
}
.year-control{
  right:353px!important;
  top:38px!important;
  width:120px!important;
  height:58px!important;
}
.add-year-control{
  right:301px!important;
  top:38px!important;
  width:44px!important;
  height:58px!important;
  border:1px solid var(--stitch-line)!important;
  background:rgba(1,15,31,.78)!important;
  color:var(--stitch-cyan)!important;
  font-size:25px!important;
}
.event-control select,
.year-control select,
.role-control select{
  padding:0 18px!important;
  border:1px solid var(--stitch-line)!important;
  background:rgba(1,15,31,.78)!important;
  color:var(--stitch-cyan)!important;
  font-size:16px!important;
}
.role-control,
.live-identity{
  right:32px!important;
  top:30px!important;
  width:245px!important;
  min-height:66px!important;
  height:66px!important;
}
.role-control select{
  height:66px!important;
  color:var(--stitch-gold)!important;
}
.live-identity{
  padding:10px 10px 10px 16px!important;
  border:1px solid var(--stitch-line)!important;
  background:rgba(1,15,31,.78)!important;
}
.live-identity-copy{
  flex:1 1 auto;
  text-align:right;
}
.live-identity-copy strong{
  color:var(--stitch-gold)!important;
  font-size:14px!important;
}
.live-identity-copy span{
  color:var(--stitch-muted)!important;
  font-size:12px!important;
}
.live-signout{
  flex:0 0 48px!important;
  width:48px!important;
  height:48px!important;
  overflow:hidden;
  border:2px solid var(--stitch-cyan)!important;
  background:
    linear-gradient(rgba(1,15,31,.12),rgba(1,15,31,.12)),
    url("./pirate-avatar-1.png") center/cover no-repeat!important;
  color:transparent!important;
  box-shadow:0 0 10px rgba(157,226,255,.38)!important;
}
.live-signout:hover{
  border-color:var(--stitch-gold)!important;
  box-shadow:0 0 12px rgba(233,193,118,.42)!important;
}

.master-content{
  min-height:calc(100vh - 160px)!important;
  padding:0 32px 48px!important;
}
.master-content>#dashboard{
  position:relative!important;
  inset:auto!important;
  width:100%!important;
  min-height:0!important;
}
#dataManagementAccessDenied{display:none!important}

/* Six equal overview cards */
.stats-strip{
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:16px!important;
  margin:0 0 32px!important;
}
.stat-card{
  min-height:90px!important;
  height:90px!important;
  padding:16px!important;
  flex-direction:row!important;
  border:1px solid rgba(233,193,118,.22)!important;
  background:rgba(5,16,26,.72)!important;
  backdrop-filter:blur(12px)!important;
}
.stat-copy{
  width:auto!important;
  min-width:0!important;
  flex:1 1 auto!important;
}
.stat-value{
  display:flex;
  align-items:center;
  gap:9px;
  font-size:24px!important;
  line-height:32px!important;
}
.stat-label{
  max-width:none!important;
  margin-top:3px!important;
  font-size:12px!important;
  line-height:16px!important;
  white-space:nowrap!important;
}
.stat-material{
  flex:0 0 38px;
  width:38px;
  color:rgba(157,226,255,.48);
  font-size:38px!important;
}
.stat-card.gold .stat-material{color:rgba(233,193,118,.78)}
.stat-card.danger .stat-material{color:rgba(255,180,171,.62)}
.collection-ring{
  position:relative!important;
  display:inline-block!important;
  width:32px!important;
  height:32px!important;
  border:4px solid rgba(39,54,71,.9);
  border-top-color:var(--stitch-cyan);
  border-right-color:var(--stitch-cyan);
  border-radius:50%;
  transform:rotate(15deg);
}

/* Dashboard: 9/3 Stitch grid */
.dashboard-content{
  grid-template-columns:minmax(0,9fr) minmax(350px,3fr)!important;
  gap:32px!important;
  align-items:start!important;
}
.members-ledger{
  position:relative!important;
  min-height:750px!important;
  border-radius:4px!important;
}
.ledger-title{
  min-height:98px!important;
  height:98px!important;
  padding:24px!important;
  border-bottom:1px solid rgba(233,193,118,.2)!important;
}
.ledger-title img{display:none!important}
.ledger-title::before{
  content:"diversity_3";
  font-family:"Material Symbols Outlined";
  color:var(--stitch-cyan);
  font-size:30px;
}
.ledger-title h3{
  font-size:24px!important;
  line-height:32px!important;
}
.ledger-toolbar{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:0!important;
  z-index:3;
  min-height:98px!important;
  height:98px!important;
  padding:24px!important;
  border-bottom:1px solid rgba(233,193,118,.2)!important;
  background:transparent!important;
  pointer-events:none;
}
.dashboard-view-label{
  position:absolute;
  left:66px;
  top:59px;
  font-size:12px!important;
  letter-spacing:.14em!important;
}
.toolbar-search{
  margin-left:auto;
  pointer-events:auto;
}
.search-shell input{
  width:256px!important;
  min-height:42px!important;
  height:42px!important;
  padding:0 16px 0 42px!important;
}
.dashboard-view-toolbar .search-shell{
  width:256px!important;
  height:42px!important;
  border:0!important;
  background:transparent!important;
}
.dashboard-view-toolbar .search-shell input{width:100%!important}
.search-shell::before{
  content:"search";
  position:absolute;
  left:14px;
  top:50%;
  z-index:2;
  color:var(--stitch-muted);
  font-family:"Material Symbols Outlined";
  font-size:20px;
  transform:translateY(-50%);
}
.search-shell img{display:none!important}
.filter-btn{
  width:42px!important;
  min-height:42px!important;
  height:42px!important;
}
.filter-btn img{display:none!important}
.filter-btn::before{
  content:"filter_list";
  font-family:"Material Symbols Outlined";
  color:var(--stitch-muted);
  font-size:22px;
}
.dashboard-table-wrap{
  height:324px!important;
  max-height:324px!important;
  overflow:auto!important;
}
.dashboard-table{
  min-width:1040px!important;
}
.dashboard-table th{
  position:sticky;
  top:0;
  z-index:2;
  height:52px!important;
  padding:12px 24px!important;
  font-size:12px!important;
}
.dashboard-table td{
  height:68px!important;
  padding:12px 24px!important;
  font-size:14px!important;
}
.dashboard-table .col-fair-name{width:25%!important}
.dashboard-table .col-rank{width:13%!important}
.dashboard-table .col-ship{width:17%!important}
.dashboard-table .col-real-name{width:15%!important}
.dashboard-table .col-money{width:9%!important}
.dashboard-table .col-outstanding{width:12%!important}
.dashboard-table th:last-child,
.dashboard-table td:last-child{
  display:table-cell!important;
  text-align:left!important;
}
.dashboard-table .money{text-align:left!important}
.dashboard-table .member-avatar{
  width:32px!important;
  height:32px!important;
}
.dashboard-table .member-cell strong{font-size:14px!important}
.dashboard-table .rank{padding:5px 12px!important}
.ledger-footer{
  min-height:64px!important;
  height:64px!important;
  padding:12px 24px!important;
  font-size:12px!important;
}
.page-pill,.page-nav{
  width:32px!important;
  height:32px!important;
  min-height:32px!important;
}
.ledger-footer select{
  min-height:34px!important;
  height:34px!important;
}

.dashboard-rail{
  gap:24px!important;
}
.rail-panel{
  min-height:0!important;
  padding:24px!important;
  border-radius:4px!important;
}
.outstanding-panel{height:auto!important}
.ship-panel{min-height:402px!important}
.rail-heading{
  margin-bottom:20px!important;
  font-size:24px!important;
  line-height:32px!important;
  letter-spacing:.08em!important;
}
.rail-heading img{display:none!important}
.outstanding-panel .rail-heading::before{
  content:"warning";
  font-family:"Material Symbols Outlined";
  color:var(--stitch-gold);
  font-size:26px;
}
.ship-panel .rail-heading::before{
  content:"sailing";
  font-family:"Material Symbols Outlined";
  color:var(--stitch-cyan);
  font-size:26px;
}
.mini{
  min-height:52px!important;
  padding:10px 0!important;
}
.mini strong{
  color:#c91823!important;
  font-size:17px!important;
}
.rail-button{
  min-height:50px!important;
  margin-top:20px!important;
}
.ship-row{
  min-height:82px!important;
  padding:14px 0!important;
}

/* One unified ledger treatment for every working module */
.master-content>.view:not(#dashboard){
  min-height:calc(100vh - 160px)!important;
}
.card,.panel,.framed-panel,.rail-panel{
  border-color:rgba(233,193,118,.28)!important;
  border-radius:4px!important;
  background:rgba(5,16,26,.82)!important;
  box-shadow:none!important;
  backdrop-filter:blur(12px)!important;
}
.panel-head{
  min-height:98px!important;
  padding:24px!important;
  background:rgba(5,16,26,.7)!important;
}
.panel-head h3{
  font-size:32px!important;
  line-height:40px!important;
}
.table-wrap th,
.roster-table th,
.stowaway-table th,
.meal-table th{
  height:52px!important;
  padding:12px 18px!important;
  background:rgba(28,43,60,.56)!important;
}
.table-wrap td,
.roster-table td,
.stowaway-table td,
.meal-table td{
  height:64px!important;
  padding:10px 18px!important;
}
.btn{
  border-radius:2px!important;
}
.btn.primary{
  background:var(--stitch-gold)!important;
  color:#261900!important;
}
.rank{
  border-radius:999px!important;
  background:rgba(18,33,49,.82)!important;
}

/* Local preview/login use the same ledger visual language. */
.live-gate{
  background:
    linear-gradient(rgba(1,10,20,.54),rgba(1,10,20,.72)),
    url("./phoenix-storm-master.png") center/cover no-repeat fixed!important;
}
.live-gate-card{
  border:1px solid var(--stitch-line)!important;
  border-radius:4px!important;
  background:rgba(5,16,26,.9)!important;
  backdrop-filter:blur(14px)!important;
}

/* Preserve the complete theme on narrower desktop windows; panels reflow only
   where the exact desktop grid physically cannot fit. */
@media (max-width:1500px) and (min-width:821px){
  .stitch-appbar{height:150px!important}
  #pageTitle{top:20px!important}
  #pageSub{top:61px!important}
  .event-control{left:32px!important;right:auto!important;top:94px!important;width:140px!important;height:46px!important}
  .year-control{left:180px!important;right:auto!important;top:94px!important;width:112px!important;height:46px!important}
  .add-year-control{left:300px!important;right:auto!important;top:94px!important;width:42px!important;height:46px!important}
  .role-control,.live-identity{top:28px!important}
  .master-content{min-height:calc(100vh - 150px)!important}
}

@media (max-width:1100px) and (min-width:821px){
  .stats-strip{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .dashboard-content{grid-template-columns:minmax(0,1fr)!important}
  .dashboard-rail{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* Stitch mobile reflow: sidebar becomes bottom navigation and all cards stack. */
@media (max-width:820px){
  html body{
    padding-bottom:74px!important;
    overflow-x:hidden!important;
  }
  .master-sidebar{
    inset:auto 0 0 0!important;
    width:100%!important;
    height:70px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    border:0!important;
    border-top:1px solid var(--stitch-line)!important;
    background:rgba(5,16,26,.96)!important;
  }
  .sidebar-brand,.sidebar-footer-art{display:none!important}
  .master-nav{
    width:max-content!important;
    min-width:100%!important;
    height:70px!important;
    flex-direction:row!important;
    padding:0!important;
  }
  .master-nav button{
    flex:1 0 76px!important;
    min-width:76px!important;
    min-height:70px!important;
    padding:8px 6px!important;
    flex-direction:column!important;
    justify-content:center!important;
    gap:4px!important;
    font-size:10px!important;
    text-align:center!important;
  }
  .master-nav button::before{
    left:0!important;
    right:0!important;
    top:0!important;
    bottom:auto!important;
    width:auto!important;
    height:3px!important;
  }
  .master-nav button>.material-symbols-outlined{font-size:23px!important}
  .master-workspace{
    width:100%!important;
    margin-left:0!important;
  }
  .stitch-appbar{
    position:relative!important;
    height:228px!important;
    padding:18px!important;
  }
  #pageTitle{
    left:18px!important;
    top:18px!important;
    right:18px!important;
    max-width:none!important;
    font-size:28px!important;
    line-height:34px!important;
  }
  #pageSub{
    left:18px!important;
    top:56px!important;
    right:18px!important;
    max-width:none!important;
    overflow:hidden;
    font-size:12px!important;
    letter-spacing:.18em!important;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .event-control{left:18px!important;right:auto!important;top:92px!important;width:calc(50% - 43px)!important;height:46px!important}
  .year-control{left:calc(50% + 7px)!important;right:auto!important;top:92px!important;width:calc(50% - 66px)!important;height:46px!important}
  .add-year-control{left:auto!important;right:18px!important;top:92px!important;width:42px!important;height:46px!important}
  .role-control,.live-identity{
    left:18px!important;
    right:18px!important;
    top:150px!important;
    width:auto!important;
    height:60px!important;
    min-height:60px!important;
  }
  .master-content{
    min-height:calc(100vh - 228px)!important;
    padding:0 14px 28px!important;
  }
  .stats-strip{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
    margin-bottom:14px!important;
  }
  .stat-card{
    height:88px!important;
    min-height:88px!important;
    padding:13px!important;
  }
  .stat-value{font-size:21px!important}
  .stat-label{font-size:10px!important;white-space:normal!important}
  .stat-material{width:30px!important;flex-basis:30px;font-size:30px!important}
  .dashboard-content{grid-template-columns:minmax(0,1fr)!important;gap:14px!important}
  .members-ledger{min-height:630px!important}
  .ledger-title{
    height:128px!important;
    min-height:128px!important;
    padding:18px!important;
    align-items:flex-start!important;
  }
  .ledger-toolbar{
    height:128px!important;
    min-height:128px!important;
    padding:70px 18px 14px!important;
  }
  .dashboard-view-label{left:58px;top:49px}
  .toolbar-search{width:100%!important}
  .search-shell{flex:1 1 auto!important}
  .search-shell input{width:100%!important}
  .dashboard-table-wrap{height:318px!important}
  .dashboard-table{min-width:920px!important}
  .ledger-footer{
    height:auto!important;
    min-height:112px!important;
    padding:14px 18px!important;
    flex-wrap:wrap!important;
  }
  .dashboard-rail{display:flex!important;gap:14px!important}
  .rail-panel{padding:20px!important}
  .panel-head{
    padding:18px!important;
    align-items:flex-start!important;
    flex-direction:column!important;
  }
  .panel-head h3{font-size:28px!important}
  .tools{width:100%!important;justify-content:flex-start!important}
  .tools input.search{min-width:0!important;width:100%!important}
  .modal-card{
    width:calc(100vw - 24px)!important;
    max-height:calc(100dvh - 24px)!important;
    overflow:auto!important;
  }
}

@media (max-width:430px){
  #pageTitle{font-size:25px!important}
  .stat-card{padding:11px!important}
  .stat-value{font-size:19px!important}
  .stat-material{display:none!important}
  .pagination{order:3;width:100%!important}
}
