/* =========================
   GLOBAL THEME & RESET
========================= */
:root{
  --sidebar-w: 260px;
  --sidebar-collapsed-w: 78px;

  --bg: #f5f7fb;
  --white: #ffffff;

  --theme: #0b7cd2;
  --theme-dark: #085fa3;

  --text: #0f172a;
  --muted: #64748b;

  --shadow: 0 10px 30px rgba(2,6,23,.08);
  --radius: 14px;
}

*{
  box-sizing: border-box;
}

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* =========================
   LAYOUT
========================= */
.layout{
  display: flex;
  min-height: 100vh;
}

/* =========================
   SIDEBAR
========================= */
.sidebar{
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--theme), var(--theme-dark));
  color: #eaf4ff;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  transition: width .2s ease, transform .2s ease;
}

.sidebar .brand{
  display: flex;
  align-items: flex-start; /* biar rapi kalau 2 baris */
  gap: 12px;
  padding: 16px;
  font-weight: 700;
  /* HAPUS white-space: nowrap; */
}


.avatar{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;

}

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

.nav a{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #eaf4ff;
  text-decoration: none;
  white-space: nowrap;
  opacity: .9;
}

.nav a:hover{
  background: rgba(255,255,255,.15);
}

.nav a.active{
  background: rgba(255,255,255,.25);
}

.icon{
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.2);
  border-radius: 8px;
  font-size: 12px;
}

.label{
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Sidebar user info (fix kepotong) ===== */
.brand .name{
  display: flex;
  flex-direction: column;
  min-width: 0; /* KUNCI: biar flex item boleh shrink & ellipsis jalan */
}

.user-name{
  font-weight: 800;
  font-size: 14px;
  line-height: 1.25;

  /* max 2 baris, sisanya kepotong rapi */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.user-meta{
  margin-top: 2px;
  font-size: 12px;
  opacity: .9;
  color: rgba(234,244,255,.95);

  /* 1 baris + ellipsis */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.user-name{
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
}

.user-meta{
  margin-top: 2px;
  font-size: 12px;
  opacity: .9;
  color: rgba(234,244,255,.95);
}


/* =========================
   SIDEBAR COLLAPSED
========================= */
.layout.is-collapsed .sidebar{
  width: var(--sidebar-collapsed-w);
}

.layout.is-collapsed .sidebar .label,
.layout.is-collapsed .sidebar .brand .name{
  opacity: 0;
  width: 0;
  pointer-events: none;
}

/* =========================
   MAIN CONTENT
========================= */
.main{
  flex: 1;
  padding: 18px;
}

/* =========================
   TOPBAR
========================= */
.topbar{
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.leftTop{
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn{
  border: 1px solid rgba(15,23,42,.12);
  background: var(--white);
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.btn:hover{
  background: #f1f5f9;
}

.crumbs{
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.btn{
  text-decoration:none;
  color: var(--text);
}
.btn:visited{
  color: var(--text);
}


/* =========================
   CARDS & CONTENT
========================= */
.grid{
  margin-top: 14px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.card{
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card h3{
  margin: 0 0 12px;
  font-size: 18px;
}

.apps{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.app{
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
}

.app:hover{
  background: #f8fafc;
}

.appIcon{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  margin: 0 auto 10px;
  background: rgba(11,124,210,.15);
  display: grid;
  place-items: center;
  color: var(--theme);
  font-weight: 800;
}

.appName{
  font-size: 13px;
}

/* =========================
   OVERLAY (MOBILE)
========================= */
.overlay{
  display: none;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 980px){
  .grid{
    grid-template-columns: 1fr;
  }
  .apps{
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px){
  .sidebar{
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    z-index: 50;
  }

  .layout.is-open .sidebar{
    transform: translateX(0);
  }

  .overlay{
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,.45);
    z-index: 40;
  }

  .layout.is-open .overlay{
    display: block;
  }
}


/* =========================
   LOGIN PAGE
========================= */
.login-wrap{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #eef2f7;
}

.login-card{
  width: min(420px, 100%);   /* sebelumnya 520px */
  background: var(--white);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(2,6,23,.10);
  overflow: hidden;
}


.login-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 50px 14px;
  border-bottom: 1px solid rgba(15,23,42,.08);
}

.sso-title{
  font-size: 34px;
  font-weight: 900;
  letter-spacing: .5px;
  line-height: 1;
  color: #0f172a;
}

.sso-sub{
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.brand-logo{
  height: 48px;          /* naikin kalau mau lebih gede */
  width: auto;
}

.login-body{
  padding: 22px;
}

.login-body label{
  display: block;
  font-size: 14px;
  color: #334155;
  margin: 14px 0 8px;
}

.login-body input{
  width: 100%;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.15);
  outline: none;
  font-size: 15px;
}

.login-body input:focus{
  border-color: rgba(11,124,210,.6);
  box-shadow: 0 0 0 4px rgba(11,124,210,.12);
}

.login-btn{
  margin-top: 18px;
  width: 100%;
  padding: 14px 14px;
  border-radius: 12px;
  border: none;
  background: var(--theme);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}

.login-btn:hover{
  filter: brightness(.96);
}

.login-err{
  margin-top: 12px;
  color: #b91c1c;
  font-size: 13px;
}


.btn{
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 10px;
}


/* App cards should look like cards, not links */
.app{
  text-decoration: none;
  color: inherit;
}
.app:visited{
  color: inherit;
}

.app, .app *{
  text-decoration: none;
}
