:root{
  --bg:#f5f7fb;
  --surface:#ffffff;
  --card:rgba(255,255,255,.92);
  --ink:#253044;
  --muted:#667085;
  --line:#e5e7eb;
  --red:#d71920;
  --red-soft:#fee2e2;
  --blue:#2563eb;
  --blue-soft:#dbeafe;
  --green:#15803d;
  --green-soft:#dcfce7;
  --amber:#b45309;
  --amber-soft:#fef3c7;
  --dark:#111827;
  --shadow:0 18px 45px rgba(15,23,42,.10);
  --radius:18px;
}

*{box-sizing:border-box}

body{
  margin:0;
  min-height:100vh;
  font-family:Inter,Segoe UI,Arial,sans-serif;
  background:linear-gradient(135deg,#f7f9fc 0%,#eef2f7 55%,#f8edf0 100%);
  color:var(--ink);
  font-weight:400;
  line-height:1.5;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}

a{color:inherit;text-decoration:none}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 28px;
  background:rgba(255,255,255,.82);
  backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(229,231,235,.75);
}

.topbar-logo{
  display:flex;
  align-items:center;
  max-width:min(560px,72vw);
}

.company-logo{
  display:block;
  width:auto;
  max-width:100%;
  height:auto;
  object-fit:contain;
}

.topbar .company-logo{
  width:min(520px,72vw);
  max-height:56px;
}

.brand{font-size:22px;font-weight:700;letter-spacing:0}
.brand span{color:var(--red)}
.subbrand{font-size:12px;color:var(--muted);margin-top:3px}

.app-frame{
  display:grid;
  grid-template-columns:260px minmax(0,1fr);
  min-height:100vh;
}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  gap:18px;
  padding:24px 18px;
  overflow-y:auto;
  background:rgba(255,255,255,.76);
  backdrop-filter:blur(18px);
  border-right:1px solid rgba(229,231,235,.85);
}

.brand-lockup{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:42px;
}

.logo-lockup{
  justify-content:center;
  flex-shrink:0;
  min-height:auto;
  padding:2px 0 18px;
  border-bottom:1px solid var(--line);
}

.logo-lockup .company-logo{
  width:218px;
  max-height:44px;
}

.sidebar-user strong{display:block;font-size:15px}
.sidebar-user small{display:block;color:var(--muted);font-size:12px;margin-top:2px}

.side-nav{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:40px;
  padding:10px 12px;
  border-radius:12px;
  color:#344054;
  font-size:14px;
  font-weight:650;
}

.nav-item:hover,.nav-item.active{
  background:#fff;
  color:var(--red);
  box-shadow:0 10px 24px rgba(15,23,42,.07);
}

.nav-icon{
  display:grid;
  place-items:center;
  width:20px;
  color:inherit;
  font-weight:650;
}

.sidebar-user{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:auto;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}

.user-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background:var(--green);
  box-shadow:0 0 0 5px var(--green-soft);
}

.signout{margin-top:-8px}

.portal-main{min-width:0}

.content-topbar{
  position:sticky;
  top:0;
  z-index:8;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  padding:24px 30px 14px;
  background:rgba(247,249,252,.78);
  backdrop-filter:blur(18px);
}

.content-topbar h1{
  margin:2px 0 0;
  font-size:24px;
  font-weight:650;
  line-height:1.22;
  letter-spacing:0;
}

.eyebrow{
  margin:0;
  color:var(--red);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0;
}

.top-actions{
  display:flex;
  gap:8px;
}

.icon-btn{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  border-radius:999px;
  background:#fff;
  border:1px solid var(--line);
  font-size:13px;
  font-weight:650;
  box-shadow:0 8px 20px rgba(15,23,42,.06);
}

.shell{
  max-width:1280px;
  margin:0 auto;
  padding:20px 30px 30px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:18px;
}

.card,.portal-panel,.profile-panel{
  background:var(--card);
  border:1px solid rgba(255,255,255,.9);
  box-shadow:var(--shadow);
  border-radius:var(--radius);
  padding:22px;
}

.card h1,.card h2,.card h3,.portal-panel h2,.profile-panel h2{
  margin-top:0;
  font-weight:650;
  line-height:1.24;
  letter-spacing:0;
}

.span-12{grid-column:span 12}
.span-8{grid-column:span 8}
.span-6{grid-column:span 6}
.span-4{grid-column:span 4}
.span-3{grid-column:span 3}

.stat{font-size:34px;font-weight:700}
.muted{color:var(--muted)}

label{
  display:block;
  font-weight:650;
  margin:14px 0 7px;
}

input,textarea,select{
  width:100%;
  border:1px solid var(--line);
  border-radius:14px;
  padding:13px 14px;
  background:#fff;
  color:var(--ink);
  font:inherit;
  line-height:1.35;
}

textarea{min-height:130px;resize:vertical}

button,.primary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:14px;
  padding:13px 17px;
  background:var(--dark);
  color:#fff;
  font-weight:650;
  cursor:pointer;
}

button:disabled,.primary:disabled{
  cursor:not-allowed;
  opacity:.62;
}

.primary.red{background:var(--red)}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid var(--line);
  border-radius:999px;
  padding:10px 15px;
  background:#fff;
  box-shadow:0 8px 20px rgba(15,23,42,.06);
  font-weight:650;
  cursor:pointer;
}

.btn:hover,.icon-btn:hover{transform:translateY(-1px)}
.wide{width:100%}

.actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:18px;
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:14px;
}

.table th,.table td{
  text-align:left;
  padding:13px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  background:rgba(255,255,255,.7);
}

.table th{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:0;
  color:var(--muted);
  font-weight:650;
}

.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:#f3f4f6;
  color:#374151;
  font-weight:650;
  font-size:12px;
}

.badge.red{background:var(--red-soft);color:#991b1b}
.badge.green{background:var(--green-soft);color:#166534}
.badge.dark{background:#111827;color:#fff}

.notice{
  padding:13px 15px;
  border-radius:14px;
  background:#fff7ed;
  border:1px solid #fed7aa;
  margin:12px 0;
}

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

.login-card{width:min(460px,100%)}

.field-row{
  display:grid;
  grid-template-columns:1.4fr 1fr .7fr .5fr;
  gap:10px;
  align-items:end;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  margin-bottom:10px;
}

.hr-lock{border-left:5px solid var(--red)}

.portal-dashboard{
  display:grid;
  grid-template-columns:minmax(250px,.9fr) minmax(360px,1.35fr) minmax(280px,1fr);
  gap:18px;
  align-items:start;
}

.profile-panel{grid-column:1;grid-row:1 / span 2}
.clock-panel{grid-column:2;grid-row:1}
.forms-panel{grid-column:2;grid-row:2}
.announcements-panel{grid-column:2;grid-row:3}
.request-panel{grid-column:1;grid-row:3}
.calendar-panel{grid-column:3;grid-row:1 / span 2}
.events-panel{grid-column:3;grid-row:3}
.module-panel{grid-column:1 / -1}

.profile-hero{
  text-align:center;
  padding:4px 0 14px;
}

.avatar{
  display:grid;
  place-items:center;
  width:92px;
  height:92px;
  margin:0 auto 14px;
  border-radius:999px;
  background:linear-gradient(135deg,#111827,#334155);
  color:#fff;
  font-size:38px;
  font-weight:700;
  box-shadow:0 14px 30px rgba(15,23,42,.18);
}

.profile-hero h2{margin:0;font-size:22px;font-weight:650}
.profile-hero p{margin:5px 0 0;color:var(--muted)}
.profile-hero .badge{margin-top:10px}

.profile-tabs{
  display:flex;
  justify-content:center;
  gap:18px;
  border-bottom:1px solid var(--line);
  margin-bottom:14px;
  font-size:12px;
  font-weight:650;
}

.profile-tabs span,.profile-tabs a{
  padding:0 0 10px;
}

.profile-tabs .active{
  color:var(--red);
  border-bottom:2px solid var(--red);
}

.detail-list{margin:0 0 18px}
.detail-list div{
  display:grid;
  grid-template-columns:96px 1fr;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}

.detail-list dt{
  color:var(--muted);
  font-size:12px;
  font-weight:650;
}

.detail-list dd{
  margin:0;
  font-weight:500;
}

.clock-panel{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}

.clock-panel h2{margin:2px 0 2px;font-size:26px;font-weight:650;line-height:1.2}

.section-heading{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:16px;
}

.section-heading h2{margin:2px 0 0;font-size:19px;font-weight:650}

.metric-grid,.request-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin-bottom:14px;
}

.request-stats{grid-template-columns:repeat(2,1fr)}

.metric-grid div,.request-stats div{
  min-height:74px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}

.metric-grid strong,.request-stats strong{
  display:block;
  font-size:24px;
  font-weight:650;
  line-height:1;
}

.metric-grid span,.request-stats span{
  display:block;
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}

.form-shortlist,.compact-table,.announcement-list,.event-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.form-shortlist a,.compact-table a,.announcement-list article,.event-list article{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}

.form-shortlist small,.compact-table small{
  display:block;
  margin-top:4px;
  color:var(--muted);
}

.form-shortlist b{
  align-self:center;
  color:var(--red);
  font-size:12px;
  font-weight:650;
}

.compact-table em{
  align-self:center;
  font-style:normal;
  padding:5px 9px;
  border-radius:999px;
  background:#f3f4f6;
  color:#374151;
  font-size:12px;
  font-weight:650;
}

.announcement-list article span{
  min-width:82px;
  text-align:right;
  color:var(--muted);
  font-size:12px;
}

.announcement-list article span b{
  display:block;
  color:var(--blue);
  margin-bottom:4px;
}

.announcement-list p{margin:4px 0 0}

.calendar-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:8px;
}

.calendar-grid span{
  display:grid;
  place-items:center;
  min-height:34px;
  border-radius:10px;
  background:#fff;
  font-size:12px;
  font-weight:650;
}

.calendar-grid .day-label{
  background:transparent;
  color:var(--muted);
  min-height:24px;
}

.calendar-grid .today{
  background:var(--red);
  color:#fff;
  box-shadow:0 10px 22px rgba(215,25,32,.24);
}

.event-list article{
  display:grid;
  grid-template-columns:76px 1fr auto;
  align-items:center;
}

.event-list article span{
  color:var(--green);
  font-size:12px;
  font-weight:650;
}

.event-list time{
  color:var(--muted);
  font-size:12px;
  font-weight:650;
}

.module-grid{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:12px;
}

.module-grid a{
  min-height:92px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}

.module-grid strong{display:block;margin-bottom:8px;font-weight:650}
.module-grid span{color:var(--muted);font-size:13px;font-weight:500}

@media(max-width:1180px){
  .portal-dashboard{grid-template-columns:1fr 1fr}
  .profile-panel,.clock-panel,.forms-panel,.announcements-panel,.request-panel,.calendar-panel,.events-panel,.module-panel{
    grid-column:auto;
    grid-row:auto;
  }
  .module-grid{grid-template-columns:repeat(3,1fr)}
}

@media(max-width:900px){
  .app-frame{grid-template-columns:1fr}
  .sidebar{
    position:relative;
    height:auto;
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .logo-lockup{
    justify-content:flex-start;
    padding-bottom:14px;
  }
  .logo-lockup .company-logo{
    width:min(320px,82vw);
    max-height:54px;
  }
  .side-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
  .sidebar-user,.signout{display:none}
}

@media(max-width:800px){
  .shell{padding:16px}
  .content-topbar{padding:18px 16px 8px}
  .side-nav{grid-template-columns:repeat(2,minmax(0,1fr))}
  .portal-dashboard,.grid{grid-template-columns:1fr}
  .span-8,.span-6,.span-4,.span-3,.span-12{grid-column:span 1}
  .clock-panel,.section-heading{align-items:stretch;flex-direction:column}
  .metric-grid,.request-stats,.module-grid{grid-template-columns:1fr}
  .event-list article{grid-template-columns:1fr}
  .field-row{grid-template-columns:1fr}
  .topbar{align-items:flex-start;gap:14px;flex-direction:column}
}
