/* ===== Информ — Retro OS ===== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

@font-face{
  font-family: "Sonic 1 Title Screen Filled";
  src: url("/static/fonts/Sonic1TitleScreenFilled.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root{
  --xp-blue: #2960c9;
  --xp-blue-deep: #1a3f8a;
  --xp-blue-light: #4a86e8;
  --acc-lime: #c0e244;
  --acc-red: #b74325;
  --ink: #2e2d2d;
  --paper: #e9eaef;
  --paper-2: #d4d0c8;
  --paper-3: #ece9d8;
  --shadow: rgba(0,0,0,0.35);
  --frame-font: "Tahoma", "Verdana", "Segoe UI", system-ui, sans-serif;
  --pixel-font: "Sonic 1 Title Screen Filled", "Press Start 2P", monospace;
  --mono-font: "VT323", "Courier New", monospace;
}

*{ box-sizing: border-box; }

html,body{
  margin:0;
  padding:0;
  font-family: var(--frame-font);
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Пиксельный вид только там, где он реально уместен — иконки, мелкие декорации.
   На обычном тексте `font-smoothing: none` на большом мониторе превращается в кашу. */
.dept-icon,
.flag,
.pixel-bar,
.wallpaper{
  image-rendering: pixelated;
}

/* ----- Wallpaper ----- */
.wallpaper{
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-color: var(--xp-blue);
}
.page, .taskbar{ position: relative; z-index: 1; }
.taskbar{ position: fixed; z-index: 50; }

.wp-bliss{
  background:
    radial-gradient(ellipse 80% 60% at 50% 110%, #4a8a3f 0%, #2d6b2a 40%, transparent 70%),
    radial-gradient(ellipse 120% 70% at 50% -10%, #87ceeb 0%, #4a86e8 40%, #2960c9 80%);
  background-color: #2960c9;
}
.wp-bubbles{
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.25) 0 8%, transparent 9%),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.18) 0 12%, transparent 13%),
    radial-gradient(circle at 85% 20%, rgba(255,255,255,0.22) 0 6%, transparent 7%),
    radial-gradient(circle at 35% 80%, rgba(255,255,255,0.15) 0 10%, transparent 11%),
    radial-gradient(circle at 55% 45%, rgba(255,255,255,0.12) 0 14%, transparent 15%),
    linear-gradient(135deg, #4a86e8 0%, #2960c9 50%, #1a3f8a 100%);
}
.wp-teal{
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, #008080 0%, #006666 100%);
}
.wp-stars{
  background:
    radial-gradient(circle at 10% 20%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 80% 30%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 30% 70%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 90% 80%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 50% 50%, #fff 0 1px, transparent 2px),
    linear-gradient(180deg, #1a1a4a 0%, #0a0a2a 100%);
  background-size: 200px 200px, 250px 250px, 180px 180px, 220px 220px, 300px 300px, 100% 100%;
}

.scanlines::after{
  content:"";
  position: fixed;
  inset:0;
  pointer-events:none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.06) 0 1px, transparent 1px 3px);
  z-index: 999;
  mix-blend-mode: multiply;
}

/* ----- Page layout ----- */
.page{
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.page-narrow{ max-width: 720px; }

/* ----- XP-style window ----- */
.win{
  background: var(--paper-2);
  border: 1px solid #0c2a6b;
  border-radius: 8px 8px 4px 4px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.25), 0 12px 30px rgba(0,0,0,0.35);
  overflow: hidden;
  font-family: var(--frame-font);
}

.win-titlebar{
  display:flex;
  align-items:center;
  gap: 6px;
  height: 30px;
  padding: 0 4px 0 8px;
  background: linear-gradient(180deg,
    #3b7be0 0%,
    #2960c9 8%,
    #1f4fb5 50%,
    #2960c9 92%,
    #1a3f8a 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.6);
  user-select: none;
  border-bottom: 1px solid #0c2a6b;
}
.win-icon{
  width:16px; height:16px;
  flex-shrink:0;
}
.win-title{
  flex:1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  letter-spacing: 0.2px;
}
.win-controls{
  display:flex;
  gap: 2px;
}
.win-btn{
  width: 22px; height: 20px;
  background: linear-gradient(180deg,#5a8fe6,#2a5cb8);
  border: 1px solid #0c2a6b;
  border-radius: 3px;
  color:#fff;
  font-family: "Marlett", "Tahoma", sans-serif;
  font-size: 11px;
  font-weight: 900;
  display:flex; align-items:center; justify-content:center;
  cursor: pointer;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.4);
  text-decoration: none;
}
.win-btn.close{
  background: linear-gradient(180deg, #e88d6a, #b03a1f);
}
.win-btn:hover{ filter: brightness(1.15); }

.win-menu{
  display:flex;
  gap: 12px;
  padding: 3px 8px;
  background: var(--paper-3);
  border-bottom: 1px solid #aca899;
  font-size: 12px;
  color: #2e2d2d;
}
.win-menu span{ cursor: default; }
.win-menu span u{ text-decoration: underline; }

.win-body{ background: var(--paper); padding: 18px; }

.win-statusbar{
  background: var(--paper-2);
  border-top: 1px solid #fff;
  box-shadow: inset 0 1px 0 #fff;
  padding: 3px 8px;
  font-size: 12px;
  color: #555;
  display:flex;
  justify-content: space-between;
}

.sunken{
  background: #fff;
  border: 1px solid #aca899;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
  padding: 14px;
}

/* ----- Buttons (XP style) ----- */
.xp-btn{
  display: inline-flex;
  align-items:center;
  gap: 6px;
  font-family: var(--frame-font);
  font-size: 14px;
  padding: 6px 16px;
  background: linear-gradient(180deg, #fafafa 0%, #e0e0e0 50%, #d4d0c8 51%, #b8b4a8 100%);
  border: 1px solid #0c2a6b;
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: inset 1px 1px 0 #fff, 0 1px 0 rgba(0,0,0,0.1);
  text-decoration: none;
}
.xp-btn:hover{
  background: linear-gradient(180deg, #fff 0%, #f0e8a8 50%, #f5d97a 51%, #e8b850 100%);
}
.xp-btn:active{
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.3);
  transform: translateY(1px);
}
.xp-btn.primary{
  font-weight: 700;
  background: linear-gradient(180deg, #fff 0%, #cfe7ff 40%, #6aa6e8 60%, #2960c9 100%);
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}
.xp-btn.primary:hover{
  background: linear-gradient(180deg, #fff 0%, #ffe49a 40%, #f5b542 60%, #c47a10 100%);
  color: #fff;
}
.xp-btn.danger{
  background: linear-gradient(180deg, #fff 0%, #ffd2c0 40%, #d96a44 60%, #b74325 100%);
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}

/* ----- Hero ----- */
.hero{ position: relative; }
.hero .win-body{
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255,255,255,0.7) 0 18%, transparent 25%),
    radial-gradient(ellipse at 75% 70%, rgba(192,226,68,0.5) 0 18%, transparent 25%),
    linear-gradient(135deg, #b3d4ff 0%, #4a86e8 100%);
  padding: 36px 24px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-stars{
  position:absolute;
  font-family: var(--pixel-font);
  color: var(--acc-lime);
  font-size: 24px;
  text-shadow: 2px 2px 0 var(--ink);
}
.hero h1{
  font-family: var(--pixel-font);
  color: var(--acc-red);
  font-size: clamp(40px, 8vw, 96px);
  line-height: 0.95;
  margin: 0 0 8px;
  letter-spacing: 4px;
  text-shadow:
    3px 0 0 #2e2d2d,
    0 3px 0 #2e2d2d,
    3px 3px 0 #2e2d2d,
    6px 6px 0 rgba(0,0,0,0.25);
  -webkit-text-stroke: 1px #2e2d2d;
}

/* Пиксельный шрифт у заголовков отделов — добавляем letter-spacing чтобы
   кириллица «МО» / «КО» не сливалась на больших размерах */
.dept-row-name,
.admin-h1,
.admin-h2{
  letter-spacing: 1.2px;
}
.dept-row-name{ letter-spacing: 1.5px; }
.hero .subtitle{
  font-family: var(--frame-font);
  font-size: clamp(14px, 1.6vw, 18px);
  color: var(--ink);
  background: var(--paper);
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--ink);
  margin-top: 8px;
  font-weight: 600;
}
.hero .meta{
  margin-top: 20px;
  font-family: var(--mono-font);
  font-size: 22px;
  color: var(--ink);
  letter-spacing: 1px;
}
.hero .blink{ animation: blink 1s steps(2) infinite; }
@keyframes blink{ 50%{ opacity: 0; } }

.hero .star1{ top: 12%; left: 8%; font-size: 32px; color: var(--xp-blue); }
.hero .star2{ top: 65%; right: 10%; font-size: 28px; color: var(--acc-lime); }
.hero .star3{ top: 25%; right: 18%; font-size: 20px; color: var(--acc-red); }

.hero-cta{
  display:flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ----- About ----- */
.about-grid{
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}
@media (max-width: 760px){
  .about-grid{ grid-template-columns: 1fr; }
}
.about-text p{ font-size: 16px; line-height: 1.6; margin: 0 0 14px; }
.about-text .lead{ font-size: 17px; font-weight: 600; line-height: 1.55; }
.about-list{
  list-style: none; padding: 0; margin: 12px 0 0;
  display: flex; flex-direction: column; gap: 8px;
}
.about-list li{
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; line-height: 1.45;
}
.about-list .check{
  flex-shrink: 0;
  width: 18px; height: 18px;
  background: var(--acc-lime);
  border: 1px solid var(--ink);
  display:flex; align-items:center; justify-content:center;
  font-family: var(--pixel-font);
  font-size: 10px;
  color: var(--ink);
  margin-top: 2px;
}
.about-side{ display:flex; flex-direction: column; gap: 12px; }
.stat-card{
  background: #fff;
  border: 1px solid #aca899;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
  padding: 12px;
  text-align: center;
}
.stat-card .num{
  font-family: var(--pixel-font);
  color: var(--acc-red);
  font-size: 32px;
  -webkit-text-stroke: 1px var(--ink);
  margin: 4px 0;
  display: block;
}
.stat-card .lbl{ font-size: 12px; color: #555; text-transform: uppercase; letter-spacing: 0.5px; }

/* ----- Departments accordion ----- */
.dept-icon{
  display: block;
  flex-shrink: 0;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}
.dept-accordion{ display:flex; flex-direction:column; gap: 8px; }
.dept-row{
  background: var(--paper);
  border: 1px solid #aca899;
}
.dept-row > summary{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.dept-row > summary::-webkit-details-marker{ display:none; }
.dept-row[open] > summary{ background: #e0ecff; border-bottom: 1px solid #aca899; }
.dept-row-info{ flex:1; min-width: 0; }
.dept-row-name{
  font-family: var(--pixel-font);
  color: var(--acc-red);
  font-size: 15px;
  -webkit-text-stroke: 0.5px var(--ink);
  letter-spacing: 1.5px;
}
.dept-row-tag{ font-size: 13px; color: #555; margin-top: 4px; }
.dept-row-meta{ font-size: 12px; color: #777; text-align: right; }
.dept-row-deadline{ font-family: var(--mono-font); font-size: 13px; }
.dept-row-arrow{ font-family: var(--mono-font); font-size: 18px; margin-left: 4px; }
.dept-row[open] .dept-row-arrow{ transform: rotate(90deg); }
.dept-row-body{ padding: 12px; }

.role-list{ display:flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.role-row{
  display:flex; align-items:center; gap:10px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #aca899;
  flex-wrap: wrap;
}
.role-marker{
  width: 10px; height: 10px;
  background: var(--acc-lime);
  border: 1px solid var(--ink);
  flex-shrink: 0;
}
.role-name{ flex:1; font-size: 14px; min-width: 140px; }
.role-task-flag{ font-family: var(--mono-font); font-size: 13px; color: #888; }
.badge-closed{
  background: #aca899;
  color: var(--ink);
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-new{
  display: inline-block;
  background: var(--acc-lime);
  color: var(--ink);
  font-size: 10px;
  padding: 1px 6px;
  border: 1px solid var(--ink);
  margin-left: 4px;
  font-family: var(--pixel-font);
  -webkit-text-stroke: .3px var(--ink);
}

/* ----- Forms ----- */
.form-grid{ display:flex; flex-direction: column; gap: 10px; }
.form-row{ display: flex; flex-direction: column; gap: 4px; }
.form-row label{ font-size: 13px; font-weight: 600; }
.form-row .hint{ font-size: 11px; color: #777; font-weight: 400; }
.xp-input, .xp-select{
  font-family: var(--frame-font);
  font-size: 14px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #7f7f7f;
  box-shadow: inset 1px 1px 0 #aca899, inset -1px -1px 0 #fff;
  color: var(--ink);
  outline: none;
  width: 100%;
}
.xp-input:focus, .xp-select:focus{
  border-color: var(--xp-blue);
  box-shadow: inset 1px 1px 0 var(--xp-blue-deep), 0 0 0 2px rgba(41,96,201,0.3);
}
.form-grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error{ font-size: 13px; color: var(--acc-red); font-weight: 700; padding: 8px; background:#fff5f0; border:1px solid var(--acc-red); }
.modal-actions{
  display:flex; gap: 8px; justify-content: flex-end;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid #aca899;
  flex-wrap: wrap;
}

.success-icon{
  width: 48px; height: 48px;
  background: var(--acc-lime);
  border: 2px solid var(--ink);
  display:inline-flex;
  align-items:center; justify-content:center;
  font-family: var(--pixel-font);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 10px;
}

/* ----- Tabs (cabinet) ----- */
.tab-bar{
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.tab{
  padding: 6px 14px;
  background: var(--paper-2);
  border: 1px solid var(--ink);
  border-bottom: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  margin-right: 4px;
  position: relative;
  top: 1px;
}
.tab.active{
  background: var(--paper);
  border-bottom: 2px solid var(--paper);
  z-index: 1;
}
.badge-cnt{
  display: inline-block;
  background: var(--acc-red);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}

/* ----- App cards (cabinet/applications) ----- */
.app-list{ display:flex; flex-direction: column; gap: 10px; }
.app-card{
  background: var(--paper);
  border: 1px solid #aca899;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.status-pill{
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border: 1px solid var(--ink);
  letter-spacing: 0.4px;
}

/* ----- Footer / taskbar ----- */
.taskbar{
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 32px;
  background: linear-gradient(180deg,
    #3b7be0 0%, #2960c9 8%, #1f4fb5 50%, #2960c9 92%, #1a3f8a 100%);
  border-top: 1px solid #0c2a6b;
  display:flex;
  align-items: center;
  padding: 0 4px;
  z-index: 50;
  color: #fff;
  font-size: 13px;
}
.start-btn{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  background: linear-gradient(180deg, #5fb04a 0%, #3d8a2c 50%, #2d6b22 100%);
  border: 1px solid #1a4015;
  border-radius: 0 8px 8px 0;
  color: #fff;
  font-family: var(--frame-font);
  font-weight: 700;
  font-style: italic;
  padding: 4px 16px 4px 10px;
  font-size: 14px;
  cursor: pointer;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}
.start-btn .flag{
  display:inline-block;
  width: 16px; height: 14px;
  background:
    linear-gradient(135deg, #ff6b3d 0 50%, transparent 50%),
    linear-gradient(45deg, #6bdb3d 0 50%, transparent 50%),
    linear-gradient(225deg, #3d8aff 0 50%, transparent 50%),
    linear-gradient(315deg, #ffd83d 0 50%, transparent 50%);
}
.taskbar .clock{
  margin-left: auto;
  background: linear-gradient(180deg, #1f4fb5, #2960c9);
  padding: 4px 12px;
  border-left: 1px solid rgba(255,255,255,0.3);
  font-family: var(--mono-font);
  font-size: 16px;
}
.taskbar-tabs{ display:flex; gap: 4px; margin-left: 10px; }
.taskbar-tab{
  background: linear-gradient(180deg, #4a86e8, #1f4fb5);
  border: 1px solid #0c2a6b;
  padding: 3px 12px;
  font-size: 12px;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.taskbar-tab.active{
  background: linear-gradient(180deg, #1f4fb5, #4a86e8);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.4);
}
@media (max-width: 600px){ .taskbar-tabs{ display:none; } }

.pixel-bar{
  height: 8px;
  background:
    repeating-linear-gradient(90deg,
      var(--acc-red) 0 16px,
      var(--acc-lime) 16px 32px,
      var(--xp-blue) 32px 48px,
      var(--ink) 48px 64px);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

/* ----- Density ----- */
.density-cozy .win-body{ padding: 24px; }
.density-compact .win-body{ padding: 12px; }

/* ===== ADMIN SHELL (Outlook-style) ===== */
.admin-page{ max-width: 1280px; }
.admin-win .win-body{ padding: 0; }
.admin-shell{
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 70vh;
  background: var(--paper);
}
.admin-side{
  background: var(--paper-3);
  border-right: 1px solid #aca899;
  display: flex;
  flex-direction: column;
}
.admin-user{
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #cfe7ff, #b3d4ff);
  border-bottom: 1px solid #aca899;
}
.admin-nav{
  display:flex;
  flex-direction: column;
  padding: 6px 0;
}
.admin-nav a{
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.admin-nav a:hover{ background: rgba(255,255,255,0.5); }
.admin-nav a.active{
  background: #fff;
  border-left-color: var(--acc-red);
  font-weight: 700;
}
.admin-side-foot{
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid #aca899;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-main{
  padding: 18px;
  overflow: auto;
}
.admin-section-head{ margin-bottom: 14px; }
.admin-h1{
  font-family: var(--pixel-font);
  color: var(--acc-red);
  font-size: 22px;
  margin: 0 0 4px;
  -webkit-text-stroke: 0.5px var(--ink);
}
.admin-h2{
  font-family: var(--pixel-font);
  color: var(--xp-blue-deep);
  font-size: 14px;
  margin: 18px 0 8px;
  -webkit-text-stroke: 0.4px var(--ink);
}
.admin-sub{ font-size: 12px; color: #555; margin: 0; }
.admin-stat-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.stat-card-flat{
  background: #fff;
  border: 1px solid #aca899;
  padding: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
}
.stat-card-flat .lbl{ font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card-flat .num{
  font-family: var(--pixel-font);
  color: var(--acc-red);
  font-size: 22px;
  -webkit-text-stroke: 0.5px var(--ink);
  margin-top: 4px;
}
.admin-table-wrap{
  background: #fff;
  border: 1px solid #aca899;
  overflow-x: auto;
}
.admin-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th{
  background: var(--paper-3);
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid #aca899;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #444;
  position: sticky;
  top: 0;
}
.admin-table td{
  padding: 8px 10px;
  border-bottom: 1px solid #e0ddd0;
  vertical-align: middle;
}
.admin-table tr:hover td{ background: #fffceb; }
.admin-filter-row{
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.admin-filter-row .xp-input,
.admin-filter-row .xp-select{ width: auto; min-width: 140px; }

@media (max-width: 760px){
  .admin-shell{ grid-template-columns: 1fr; }
  .admin-side{ border-right: none; border-bottom: 1px solid #aca899; }
}

/* CMS / копирайт-редактор */
.cms-toc{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--paper-3);
  border: 1px solid #aca899;
  margin-bottom: 14px;
}
.cms-toc a{
  font-size: 12px;
  padding: 3px 8px;
  background: #fff;
  border: 1px solid #aca899;
  color: var(--ink);
  text-decoration: none;
}
.cms-toc a:hover{ background: var(--acc-lime); }
.cms-section{ margin-bottom: 24px; scroll-margin-top: 16px; }
.cms-rows{
  background: #fff;
  border: 1px solid #aca899;
}
.cms-row{
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e0ddd0;
  align-items: start;
  scroll-margin-top: 16px;
}
.cms-row:last-child{ border-bottom: none; }
.cms-row:target{ background: #fffceb; }
.cms-row-meta{ display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cms-label{ font-size: 13px; font-weight: 600; }
.cms-key{
  font-family: var(--mono-font);
  font-size: 12px;
  color: #888;
  word-break: break-all;
}
.cms-row-input{ min-width: 0; }
.cms-row-action{ align-self: start; }
@media (max-width: 760px){
  .cms-row{ grid-template-columns: 1fr; }
  .cms-row-action{ justify-self: start; }
}

/* ===== Step list (страница заявки) ===== */
.step-list { display:flex; flex-direction:column; gap:8px; }
.step-row {
	display:flex; align-items:center; gap:12px; padding:10px 12px;
	background: var(--paper-2); border:1px solid #aca899;
}
.step-row.step-locked { background: #eeeeee; opacity:.7; }
.step-row.step-completed { background: #e8f5e0; }
.step-row .step-status-icon {
	font-size:18px; width:24px; text-align:center; flex:0 0 24px;
}
.step-row .step-info { flex:1; min-width:0; }
.step-row .step-title { font-weight:700; font-size:14px; }
.step-row .step-subtitle { font-size:12px; color:#555; }
.step-row .step-blocker { font-size:11px; color:var(--acc-red); margin-top:2px; }
.step-row .step-actions { flex:0 0 auto; }

/* ===== Шаг «поиск людей» — карточный список ===== */
.search-people{
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  border: 1px solid #aca899;
  padding: 8px;
}
.search-people-row{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--paper-3);
  border: 1px solid #d4d0c8;
}
.search-people-head{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  font-size: 13px;
}
.search-people-num{ color: #777; font-family: var(--mono-font); font-size: 14px; }
.search-people-name{ font-weight: 700; }
.search-people-mark{ font-weight: 700; font-size: 12px; }
.search-people-mark.ok{ color: #1a8a4a; }
.search-people-mark.err{ color: var(--acc-red); }
.search-people-tries{ font-size: 11px; color: #777; }

/* ============================================================
   Responsive: tablet (≤900px) и mobile (≤560px / ≤380px)
   Главный приоритет — экран кандидата.
   ============================================================ */

/* Слот собеседования: на мобилке резиновая ширина без min-width=96 */
.slot-btn{ flex:1 1 96px; }

@media (max-width: 900px){
  .page{ padding: 16px 12px 60px; gap: 20px; }
  .win-body{ padding: 14px; }
  .density-cozy .win-body{ padding: 16px; }
  .hero .win-body{ padding: 24px 16px 22px; }
  .hero h1{ font-size: clamp(32px, 10vw, 64px); letter-spacing: 2px; }
  .admin-main{ padding: 14px; }
}

@media (max-width: 560px){
  .page{ padding: 12px 8px 60px; gap: 14px; }
  .win-body{ padding: 12px; }
  .density-cozy .win-body{ padding: 12px; }
  .hero .win-body{ padding: 18px 10px 18px; }
  .hero h1{
    font-size: clamp(28px, 11vw, 44px);
    letter-spacing: 1px;
    text-shadow: 2px 0 0 #2e2d2d, 0 2px 0 #2e2d2d, 2px 2px 0 #2e2d2d, 4px 4px 0 rgba(0,0,0,0.25);
  }
  .hero .subtitle{ font-size: 13px; padding: 3px 8px; }
  .hero .meta{ font-size: 16px; margin-top: 12px; }
  .hero-cta{ gap: 8px; }
  .hero-cta .xp-btn{ flex: 1 1 auto; justify-content: center; }

  .win-titlebar{ height: 26px; font-size: 12px; padding: 0 3px 0 6px; }
  .win-btn{ width: 20px; height: 18px; font-size: 10px; }
  .win-menu{ font-size: 11px; gap: 8px; padding: 2px 6px; }
  .win-statusbar{ font-size: 11px; padding: 2px 6px; }

  .xp-btn{ font-size: 13px; padding: 6px 12px; }

  /* Лендинг — отделы */
  .dept-row > summary{
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 8px;
  }
  .dept-row-info{ flex: 1 1 60%; }
  .dept-row-name{ font-size: 13px; letter-spacing: 1.2px; }
  .dept-row-tag{ font-size: 12px; }
  .dept-row-meta{
    flex: 1 1 100%;
    order: 3;
    text-align: left;
    font-size: 11px;
    padding-left: 52px;
  }
  .dept-row-arrow{ order: 2; margin-left: auto; font-size: 16px; }
  .dept-row-body{ padding: 10px; }
  .dept-row > summary > .dept-icon{ width: 32px !important; height: 32px !important; }

  /* role-row внутри отдела */
  .role-row{ padding: 6px 8px; gap: 8px; }
  .role-name{ font-size: 13px; min-width: 0; flex: 1 1 100%; }

  /* About — стат-карточки в одну колонку */
  .about-side{ flex-direction: column; }
  .stat-card .num{ font-size: 26px; }
  .about-text p{ font-size: 14px; }
  .about-text .lead{ font-size: 15px; }

  /* Регистрация — двухколоночный grid в одну */
  .form-grid-2{ grid-template-columns: 1fr; }

  /* Кабинет */
  .tab-bar{ flex-wrap: wrap; gap: 2px; }
  .tab{ padding: 5px 10px; font-size: 12px; }

  .app-card{ padding: 10px; gap: 10px; }
  .app-card > img.dept-icon{ width: 38px !important; height: 38px !important; }
  .app-card > div:last-child{
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 6px !important;
    width: 100%;
    justify-content: flex-start !important;
  }

  /* Страница заявки — список шагов */
  .step-row{
    flex-wrap: wrap;
    padding: 10px;
    gap: 8px;
  }
  .step-row .step-info{ flex: 1 1 60%; }
  .step-row .step-actions{
    flex: 1 1 100%;
    display: flex;
    justify-content: flex-end;
  }

  .modal-actions{ gap: 6px; }
  .modal-actions .xp-btn{ flex: 1 1 auto; justify-content: center; }

  /* Слоты собеседования: в 2 колонки */
  .slot-btn{ flex: 1 1 calc(50% - 8px); min-width: 0; }

  /* Админка тоже немного аккуратнее, но без фанатизма */
  .admin-h1{ font-size: 18px; }
  .admin-h2{ font-size: 13px; }
  .admin-table{ font-size: 12px; }
  .admin-table th, .admin-table td{ padding: 6px 8px; }

  /* Карточный layout для админ-таблиц: thead скрыт, каждая строка — карточка */
  .admin-table-cards{ min-width: 0; }
  .admin-table-cards thead{ display: none; }
  .admin-table-cards, .admin-table-cards tbody, .admin-table-cards tr, .admin-table-cards td{
    display: block;
    width: 100%;
  }
  .admin-table-cards tr{
    padding: 10px;
    border-bottom: 1px solid #aca899;
    background: #fff;
  }
  .admin-table-cards tr:last-child{ border-bottom: none; }
  .admin-table-cards td{
    padding: 4px 0;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: 0;
  }
  .admin-table-cards td[data-label]::before{
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    color: #555;
    font-weight: 700;
    letter-spacing: 0.4px;
    flex-shrink: 0;
  }
  .admin-table-cards td.cell-full{
    flex-direction: column;
    align-items: stretch;
    width: 100% !important;
  }
  .admin-table-cards td.cell-full[data-label]::before{ margin-bottom: 4px; }
  .admin-table-cards .admin-table-wrap-inner-fix{ width: 100%; }
}

@media (max-width: 380px){
  .hero h1{ font-size: 28px; letter-spacing: 0.5px; }
  .win-title{ font-size: 11px; }
  .win-menu{ display: none; }
  .dept-row-meta{ padding-left: 44px; }
  .stat-card .num{ font-size: 22px; }
}
