:root{
  --bg:#f5f7ff;
  --bg-2:#eaf0ff;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --primary:#1145ff;
  --primary-2:#0b36d6;
  --line:#dbe5fb;
  --shadow:0 20px 50px rgba(17,69,255,.12);
  --radius:28px;
}

*{box-sizing:border-box}
html,body{
  min-height:100%;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar{
  width:0;
  height:0;
}
body{
  margin:0;
  font-family:'Outfit',system-ui,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at top left, rgba(17,69,255,.08), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  overflow-x:hidden;
}
html.portal-booting,
body.portal-booting{
  overflow:hidden;
}
body[data-theme="dark"]{
  --bg:#08111f;
  --bg-2:#0d1728;
  --card:#111a2d;
  --text:#edf2ff;
  --muted:#9aa9c2;
  --primary:#6c8dff;
  --primary-2:#4f71ff;
  --line:#26344d;
  --shadow:0 20px 50px rgba(0,0,0,.26);
  color-scheme:dark;
}
body[data-theme="dark"]{
  background:linear-gradient(180deg, #08111f 0%, #0d1728 100%);
}
body[data-theme="dark"] .portal-shell{
  background-image:
    linear-gradient(rgba(108,141,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108,141,255,.08) 1px, transparent 1px);
}
body[data-theme="dark"] .portal-login-card,
body[data-theme="dark"] .portal-header,
body[data-theme="dark"] .portal-hero,
body[data-theme="dark"] .portal-toolbar,
body[data-theme="dark"] .portal-card{
  background:rgba(17,26,45,.92);
  border-color:var(--line);
  box-shadow:var(--shadow);
}
body[data-theme="dark"] .portal-input,
body[data-theme="dark"] .portal-select-trigger{
  background:#0f1829;
  border-color:var(--line);
  color:var(--text);
}
body[data-theme="dark"] .portal-brand-sub,
body[data-theme="dark"] .portal-login-copy,
body[data-theme="dark"] .portal-kicker,
body[data-theme="dark"] .portal-field label,
body[data-theme="dark"] .portal-stat span,
body[data-theme="dark"] .portal-card-meta,
body[data-theme="dark"] .portal-empty{
  color:var(--muted);
}
body[data-theme="dark"] .portal-name,
body[data-theme="dark"] .portal-role,
body[data-theme="dark"] .portal-row-label,
body[data-theme="dark"] .portal-row-value,
body[data-theme="dark"] .portal-brand-title{
  color:var(--text);
}
body[data-theme="dark"] .portal-row-copy-btn,
body[data-theme="dark"] .portal-ghost-btn{
  background:#0f1829;
  border-color:var(--line);
  color:var(--text);
}
body[data-theme="dark"] .theme-toggle-btn{
  background:rgba(255,255,255,.08);
  color:var(--text);
  border:1px solid var(--line);
  box-shadow:0 8px 24px rgba(0,0,0,.22);
}

.portal-shell{
  min-height:100vh;
  padding:32px;
  background-image:
    linear-gradient(rgba(17,69,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,69,255,.06) 1px, transparent 1px);
  background-size: 36px 36px;
  position:relative;
}

.portal-boot-splash{
  position:fixed;
  inset:0;
  display:none;
  place-items:center;
  background:
    radial-gradient(circle at top left, rgba(17,69,255,.08), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  z-index:400;
}

html.portal-booting .portal-boot-splash,
body.portal-booting .portal-boot-splash{
  display:grid;
}

body[data-theme="dark"] .portal-boot-splash{
  background:linear-gradient(180deg, #08111f 0%, #0d1728 100%);
}

.portal-boot-dot{
  width:18px;
  height:18px;
  border-radius:999px;
  background:linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow:0 0 0 8px rgba(17,69,255,.08);
  animation:portalBootPulse 1s ease-in-out infinite;
}

@keyframes portalBootPulse{
  0%, 100%{
    transform:scale(.88);
    opacity:.7;
  }
  50%{
    transform:scale(1.05);
    opacity:1;
  }
}

html.portal-booting #portal-login,
html.portal-booting #portal-app,
body.portal-booting #portal-login,
body.portal-booting #portal-app{
  visibility:hidden;
}

.portal-login,
.portal-app{
  width:min(1240px, 100%);
  margin:0 auto;
}

.portal-login{
  min-height:calc(100vh - 64px);
  display:grid;
  place-items:center;
}

.portal-login-card,
.portal-hero,
.portal-toolbar,
.portal-grid .portal-card{
  backdrop-filter:blur(10px);
}

.portal-login-card{
  width:min(560px, 100%);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 40px;
  padding: 48px;
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 30px 60px rgba(17, 69, 255, 0.12);
  position: relative;
  z-index: 10;
}

.portal-brand{
  display:flex;
  align-items:center;
  gap:14px;
}

.portal-brand-icon{
  width:54px;
  height:54px;
  border-radius:18px;
  background:linear-gradient(135deg, var(--primary), var(--primary-2));
  color:#fff;
  display:grid;
  place-items:center;
  box-shadow:0 14px 30px rgba(17,69,255,.3);
  flex:0 0 auto;
}

.portal-brand-title{
  font-size:13px;
  letter-spacing:.2em;
  font-weight:800;
  color:var(--primary);
}

.portal-brand-sub,
.portal-login-copy,
.portal-kicker,
.portal-field label,
.portal-stat span,
.portal-card-meta,
.portal-empty{
  color:var(--muted);
}

.portal-login-copy{
  margin:22px 0 24px;
  line-height:1.6;
  font-size:15px;
}
.theme-toggle-btn{
  position:fixed;
  right:16px;
  top:16px;
  z-index:200;
  border:1px solid var(--line);
  background:rgba(255,255,255,.88);
  color:var(--text);
  border-radius:999px;
  padding:10px 14px;
  font-family:'Outfit',system-ui,sans-serif;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 8px 24px rgba(15,23,42,.08);
  backdrop-filter:blur(10px);
}

.portal-form{
  display:grid;
  gap:12px;
}

.portal-label{
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:1px;
  margin-bottom:8px;
  color:var(--muted);
}

.portal-input {
  width: 100%;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  padding: 18px 22px;
  font: inherit;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.01);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 
    0 0 0 5px rgba(17, 69, 255, 0.1),
    0 10px 24px rgba(17, 69, 255, 0.08);
  transform: translateY(-1px);
}

.portal-select-shell{
  position:relative;
  z-index:5;
}

.portal-select-shell.open{
  z-index:60;
}

.portal-select-trigger{
  width:100%;
  min-height:48px;
  border:1.5px solid var(--line);
  background:#fff;
  border-radius:18px;
  padding:11px 15px;
  font:inherit;
  color:var(--text);
  outline:none;
  box-shadow:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  cursor:pointer;
  font-size:15px;
  font-weight:600;
  transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}

.portal-select-trigger:hover{
  border-color:rgba(17,69,255,.28);
  box-shadow:none;
}

.portal-select-trigger:focus-visible{
  border-color:rgba(17,69,255,.45);
  box-shadow:0 0 0 4px rgba(17,69,255,.1);
}

.portal-select-trigger span{
  font-size:15px;
  line-height:1.2;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.portal-select-trigger svg{
  width:18px;
  height:18px;
  flex:0 0 auto;
  fill:none;
  stroke:var(--primary);
  stroke-width:2.25;
  stroke-linecap:round;
  stroke-linejoin:round;
  transition:transform .2s ease;
}

.portal-select-shell.open .portal-select-trigger{
  border-color:rgba(17,69,255,.45);
  box-shadow:0 0 0 4px rgba(17,69,255,.08);
}

.portal-select-shell.open .portal-select-trigger svg{
  transform:rotate(180deg);
}

.portal-select-menu{
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 10px);
  z-index:80;
  background:rgba(255,255,255,.98);
  border:1px solid rgba(17,69,255,.16);
  border-radius:20px;
  box-shadow:0 24px 50px rgba(17,69,255,.18);
  padding:8px;
  max-height:280px;
  overflow:auto;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(-6px);
  transition:opacity .18s ease, transform .2s ease, visibility .18s ease;
}

.portal-select-shell.open .portal-select-menu{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translateY(0);
}

.portal-select-option{
  width:100%;
  border:0;
  background:transparent;
  color:var(--text);
  font:inherit;
  font-weight:600;
  text-align:left;
  padding:12px 14px;
  border-radius:14px;
  cursor:pointer;
  transition:background .18s ease, color .18s ease, transform .18s ease;
}

.portal-select-option:hover{
  background:rgba(17,69,255,.08);
  color:var(--primary);
}

.portal-select-option.active{
  background:linear-gradient(135deg, var(--primary), var(--primary-2));
  color:#fff;
}

.portal-error{
  min-height:20px;
  color:#e11d48;
  font-size:14px;
}

.portal-btn,
.portal-ghost-btn{
  border:0;
  border-radius:18px;
  font:inherit;
  font-weight:800;
  cursor:pointer;
  transition:transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.portal-btn{
  margin-top:4px;
  background:linear-gradient(135deg, var(--primary), var(--primary-2));
  color:#fff;
  padding:16px 20px;
  box-shadow:0 18px 36px rgba(17,69,255,.28);
}

.portal-btn:hover,
.portal-ghost-btn:hover{
  transform:translateY(-1px);
}

.portal-app{
  display:flex;
  flex-direction:column;
  gap:24px;
}

.portal-header,
.portal-hero,
.portal-toolbar{
  background:rgba(255,255,255,.82);
  border:1px solid rgba(17,69,255,.12);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.portal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:24px 28px;
}

.portal-ghost-btn{
  background:#eef4ff;
  color:var(--primary);
  padding:14px 18px;
}

.portal-hero{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  align-items:center;
  gap:18px 28px;
  padding:24px 28px 22px;
}

.portal-hero h1{
  margin:0 0 10px;
  font-size:clamp(32px, 3.6vw, 46px);
  line-height:1.03;
  letter-spacing:-.03em;
}

.portal-hero-copy{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:68px;
  max-width:none;
  flex:1;
  min-width:0;
}

.portal-hero p{
  margin:0;
  max-width:none;
  font-size:14px;
  line-height:1.35;
  letter-spacing:-.01em;
  color:var(--muted);
  white-space:nowrap;
}

.portal-stats{
  display:flex;
  align-self:center;
  min-width:0;
}

.portal-stat{
  min-width:0;
  padding:10px 16px;
  background:#fff;
  border:1px solid rgba(17,69,255,.14);
  border-radius:16px;
  box-shadow:none;
  display:flex;
  align-items:center;
  gap:10px;
}

.portal-stat span{
  font-size:12px;
  font-weight:800;
  color:var(--muted);
  white-space:nowrap;
}

.portal-stat strong{
  font-size:20px;
  line-height:1;
  letter-spacing:-.03em;
}

.portal-toolbar{
  padding:20px;
  display:grid;
  gap:18px;
  position:relative;
  z-index:40;
  overflow:visible;
}

.portal-grid-filters{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
}

.portal-field{
  display:grid;
  gap:8px;
}

.portal-field label{
  font-size:12px;
  font-weight:800;
  letter-spacing:.03em;
  text-transform:uppercase;
  line-height:1.2;
}

.portal-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:18px;
  position:relative;
  z-index:1;
}

.portal-card{
  background:rgba(255,255,255,.92);
  border:1px solid rgba(17,69,255,.12);
  border-radius:28px;
  padding:22px;
  box-shadow:0 14px 30px rgba(17,69,255,.08);
  display:grid;
  gap:16px;
}

.portal-card-top{
  display:flex;
  align-items:center;
  gap:18px;
}

.portal-card-headtext{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.portal-copy-btn{
  width:42px;
  height:42px;
  flex:0 0 auto;
  border:1px solid rgba(17,69,255,.12);
  border-radius:14px;
  background:linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color:var(--primary);
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(17,69,255,.08);
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.portal-copy-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(17,69,255,.25);
  box-shadow:0 12px 24px rgba(17,69,255,.12);
}

.portal-copy-btn svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.portal-copy-btn.copied{
  background:linear-gradient(135deg, var(--primary), var(--primary-2));
  color:#fff;
  border-color:transparent;
}

.portal-copy-btn.copied span{
  font-size:11px;
  font-weight:800;
  letter-spacing:.02em;
}

.portal-row-copy-btn{
  width:38px;
  height:38px;
  border:1px solid rgba(17,69,255,.14);
  border-radius:14px;
  background:#fff;
  color:var(--primary);
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:none;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.portal-row-copy-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(17,69,255,.25);
  box-shadow:0 10px 20px rgba(17,69,255,.1);
}

.portal-row-copy-btn svg{
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.portal-row-copy-btn.copied{
  background:linear-gradient(135deg, var(--primary), var(--primary-2));
  color:#fff;
  border-color:transparent;
}

.portal-avatar{
  width:74px;
  height:74px;
  border-radius:24px;
  background:#f7faff;
  overflow:hidden;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  border:1px solid rgba(17,69,255,.14);
  box-shadow:none;
}

.portal-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.portal-name{
  font-size:24px;
  font-weight:700;
  line-height:1.08;
  letter-spacing:-.02em;
}

.portal-role{
  font-size:15px;
  font-weight:600;
  color:var(--primary);
  line-height:1.32;
}

.portal-card-meta{
  font-size:14px;
  font-weight:500;
  line-height:1.32;
}

.portal-card-body{
  display:grid;
  gap:14px;
}

.portal-card-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  align-items:center;
  gap:14px;
  padding:16px 18px;
  background:#fbfdff;
  border:1px solid rgba(17,69,255,.14);
  border-radius:20px;
  box-shadow:none;
}

.portal-row-content{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.portal-row-label{
  color:var(--muted);
  font-size:13px;
  font-weight:600;
  letter-spacing:0;
  line-height:1.28;
  min-width:0;
}

.portal-row-value{
  text-align:left;
  font-size:17px;
  line-height:1.34;
  font-weight:600;
  min-width:0;
  overflow-wrap:break-word;
  word-break:normal;
}

.portal-card-row .portal-row-content .portal-row-value{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.portal-status-working{
  color:#16a34a;
  font-weight:600;
}

.portal-status-dismissed{
  color:#dc2626;
  font-weight:600;
}

.portal-status-vacation{
  color:#d97706;
  font-weight:600;
}

.portal-status-sick{
  color:#7c3aed;
  font-weight:600;
}

.portal-empty{
  padding:24px;
  border:1px dashed rgba(17,69,255,.28);
  border-radius:24px;
  background:rgba(255,255,255,.78);
}

.portal-copy-toast{
  position:fixed;
  left:50%;
  bottom:24px;
  transform:translateX(-50%) translateY(16px);
  background:linear-gradient(135deg, var(--primary), var(--primary-2));
  color:#fff;
  padding:12px 16px;
  border-radius:14px;
  font-family:'Outfit',system-ui,sans-serif;
  font-size:14px;
  font-weight:700;
  box-shadow:0 14px 30px rgba(17,69,255,.24);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .22s ease;
  z-index:220;
}

.portal-copy-toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

.hidden{display:none !important;}

@media (max-width: 1100px){
  .portal-grid{grid-template-columns:repeat(2, minmax(0, 1fr));}
  .portal-hero{align-items:flex-start; flex-direction:column;}
}

@media (max-width: 720px){
  .portal-shell{padding:16px;}
  .portal-login{min-height:auto; padding:40px 0;}
  .portal-login-card,
  .portal-header,
  .portal-hero,
  .portal-toolbar{border-radius:22px;}
  .portal-grid,
  .portal-grid-filters,
  .portal-stats{grid-template-columns:1fr;}
  .portal-header{flex-direction:column; align-items:flex-start;}
  .portal-hero{padding:22px 20px 20px; gap:18px;}
  .portal-hero h1{font-size:clamp(26px, 8vw, 34px)}
  .portal-hero p{font-size:14px}
  .portal-stat{min-width:0}
  .portal-toolbar{padding:18px}
  .portal-card{padding:18px}
  .portal-card-top{align-items:flex-start}
  .portal-card-row{
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px 10px;
  }
  .portal-row-value{
    justify-self:start;
    text-align:left;
    font-size:15px;
  }
  .portal-row-copy-btn{
    grid-column:2;
    grid-row:1;
    align-self:center;
  }
  .portal-select-menu{
    max-height:240px;
  }
  .portal-select-option{
    padding:11px 12px;
  }
  .portal-name{font-size:18px}
  .portal-role{font-size:13px}
  .portal-card-meta{font-size:12px}
}

@media (max-width: 420px){
  .portal-shell{padding:12px}
  .portal-login-card,
  .portal-header,
  .portal-hero,
  .portal-toolbar{border-radius:20px}
  .portal-login-card{padding:22px}
  .portal-header{padding:18px}
  .portal-hero{padding:20px 16px 18px}
  .portal-toolbar{padding:16px}
  .portal-card{padding:16px}
  .portal-grid{grid-template-columns:1fr}
  .portal-card-top{gap:12px}
  .portal-avatar{width:56px;height:56px;border-radius:18px}
  .portal-row-copy-btn{width:32px;height:32px;border-radius:10px}
  .portal-row-copy-btn svg{width:15px;height:15px}
}

body[data-theme="dark"] .portal-select-menu{
  background:rgba(15,24,41,.98);
  border-color:rgba(108,141,255,.2);
  box-shadow:0 24px 50px rgba(0,0,0,.28);
}
body[data-theme="dark"] .portal-select-option{
  color:var(--text);
}
body[data-theme="dark"] .portal-select-option:hover{
  background:rgba(108,141,255,.12);
  color:#fff;
}
body[data-theme="dark"] .portal-select-option.active{
  background:linear-gradient(135deg, rgba(108,141,255,.24), rgba(108,141,255,.14));
  color:#fff;
}
body[data-theme="dark"] .portal-stat,
body[data-theme="dark"] .portal-card-row,
body[data-theme="dark"] .portal-empty,
body[data-theme="dark"] .portal-ghost-btn{
  background:#0f1829;
  border-color:var(--line);
}
body[data-theme="dark"] .portal-row-copy-btn{
  background:rgba(108,141,255,.14);
  color:#dbe5ff;
  border-color:rgba(108,141,255,.24);
}
body[data-theme="dark"] .portal-row-copy-btn svg{
  stroke:#dbe5ff;
}
body[data-theme="dark"] .portal-status-working{
  color:#34d399;
}
body[data-theme="dark"] .portal-status-dismissed{
  color:#fb7185;
}
body[data-theme="dark"] .portal-status-vacation{
  color:#fbbf24;
}
body[data-theme="dark"] .portal-status-sick{
  color:#c084fc;
}
