:root { 
  --p1: #21005E; 
  --p_sidebar: #390094; 
  --p_wip_light: #B5A6FF; 
  --p2: #390094; 
  --p4: #6B2DEF; 
  --p6: #B5A6FF;
  --p7: #E8E5FF; 
  --p8: #F8F7FF; 
  --p9: #F8F9FC; 
  --white: #ffffff;
  --text-gray: #E8E5FF; 
  --text-dark: #1a1a1a;
}

/* Global Text is Roboto */
body { font-family: 'Roboto', sans-serif; margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; background-color: var(--p9); }

/* ALL HEADINGS ARE POPPINS */
h1, h2, h3, h4, h5, h6, .brand, .page-title, .stat-value, .menu-label {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
}

/* GLOBAL TOP HEADER */
.top-header { 
  background-color: var(--p1); padding: 0 30px 0 25px; height: 60px; 
  display: flex; justify-content: space-between; align-items: center; 
  box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 10; flex-shrink: 0; box-sizing: border-box;
  transition: margin-top 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
}
.top-header.hidden { margin-top: -60px; }

.top-header-left { display: flex; align-items: center; gap: 20px; }

.menu-toggle { color: var(--white); font-size: 1.2rem; cursor: pointer; transition: color 0.2s; }
.menu-toggle:hover { color: var(--p6); }

.brand { color: var(--white); font-weight: 700; font-size: 1.3rem; letter-spacing: 0.5px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: color 0.2s; }
.brand:hover { color: var(--p6); }

.header-divider { width: 1px; height: 24px; background-color: rgba(255,255,255,0.2); }
.page-title { font-size: 1.1rem; font-weight: 500; color: var(--white); margin: 0; display: flex; align-items: center; letter-spacing: 0.5px; }

/* BODY ROW */
.body-row { display: flex; flex: 1; overflow: hidden; position: relative; }

/* DRAWER HANDLE */
.drawer-handle { position: absolute; left: 0; top: 50%; transform: translateY(-50%); background: var(--p1); color: var(--white); width: 16px; height: 70px; display: flex; align-items: center; justify-content: center; border-radius: 0 8px 8px 0; cursor: pointer; z-index: 4; box-shadow: 2px 0 8px rgba(0,0,0,0.2); opacity: 0; pointer-events: none; transition: width 0.2s, opacity 0.3s, background 0.2s; }
.drawer-handle i { font-size: 0.7rem; opacity: 0.7; transition: 0.2s; }
.drawer-handle.visible { opacity: 1; pointer-events: auto; }
.drawer-handle:hover { width: 24px; background: var(--p4); }
.drawer-handle:hover i { opacity: 1; }

/* SIDEBAR */
.sidebar { width: 260px; background-color: var(--p_sidebar); color: var(--text-gray); display: flex; flex-direction: column; flex-shrink: 0; z-index: 5; position: relative; transition: margin-left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: 2px 0 10px rgba(0,0,0,0.05); }
.sidebar.hidden { margin-left: -260px; }
.sidebar-header { background-color: var(--p1); padding: 0 25px; height: 60px; display: none; align-items: center; box-sizing: border-box; flex-shrink: 0; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 20px 0; }

.menu-section { margin-bottom: 25px; }

.menu-label { 
  font-family: 'Poppins', sans-serif;
  padding: 0 25px;
  font-size: 0.75rem; 
  font-weight: 700; 
  text-transform: uppercase; 
  color: rgba(255,255,255,0.5); 
  letter-spacing: 1.5px; 
  margin-top: 15px;
  margin-bottom: 10px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  cursor: pointer; 
  transition: color 0.2s ease; 
  user-select: none;
}

.menu-label:hover { 
  color: rgba(255,255,255,0.85); 
}

.menu-label i { 
  font-size: 0.7rem; 
  transition: transform 0.25s ease-in-out; 
}

.menu-label.collapsed i { 
  transform: rotate(-90deg); 
}

/* The Modern Grid Drop */
.accordion-content { 
  display: grid;
  grid-template-rows: 1fr; /* Opens to exactly 100% of the content's real height */
  transition: grid-template-rows 0.35s ease-in-out; 
}

.accordion-content.collapsed { 
  grid-template-rows: 0fr; /* Shrinks perfectly to 0 */
}

/* This inner wrapper is required to hide the links as the grid shrinks */
.accordion-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.menu-item { padding: 10px 25px; display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--text-gray); text-decoration: none; cursor: pointer; border-left: 4px solid transparent; transition: 0.2s; }
.menu-item:hover { color: var(--white); background-color: rgba(255,255,255,0.06); }
.menu-item.active { color: var(--white); background-color: var(--p1); border-left-color: var(--white); font-weight: 500; }
.menu-item i { width: 18px; text-align: center; font-size: 1rem; color: var(--white); opacity: 0.9; }
.wip-badge { font-family: 'Roboto', sans-serif; font-size: 0.55rem; font-weight: 700; background-color: rgba(0,0,0,0.2); color: var(--p_wip_light); padding: 2px 6px; border-radius: 10px; margin-left: auto; letter-spacing: 0.5px; }

/* MAIN CONTENT */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.content-area { flex: 1; padding: 30px; overflow-y: auto; box-sizing: border-box; display: flex; flex-direction: column; }
.tool-canvas { background: var(--white); border-radius: 8px; border: 1px solid #eee; flex: 1; box-shadow: 0 2px 8px rgba(0,0,0,0.02); overflow: hidden; position: relative; }

/* Home Dashboard */
.home-dash { padding: 30px; }
.welcome-banner { margin-bottom: 30px; }
.welcome-banner h1 { margin: 0 0 5px 0; color: var(--p1); font-size: 2.2rem; font-weight: 800; letter-spacing: -0.5px; } 
.welcome-banner p { margin: 0; color: #666; }
.welcome-banner a { color: var(--p_sidebar); text-decoration: none; font-weight: 500; transition: 0.2s; }
.welcome-banner a:hover { color: var(--p4); text-decoration: underline; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--p9); padding: 20px; border-radius: 8px; border: 1px solid #eee; border-left: 4px solid var(--p_sidebar); display: flex; flex-direction: column; justify-content: space-between; height: 100%; box-sizing: border-box; }
.stat-title { font-size: 0.75rem; text-transform: uppercase; color: #666; font-weight: 700; margin-bottom: 15px; letter-spacing: 0.5px; }
.stat-value { font-size: 2.2rem; font-weight: 700; color: var(--text-dark); line-height: 1; }

/* LOGIN WALL CSS */
.login-container { 
  min-height: 100vh; 
  width: 100%; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  background: linear-gradient(135deg, var(--p1) 0%, var(--p4) 100%); 
  font-family: 'Poppins', sans-serif; 
  position: relative; 
  overflow: hidden; 
  padding: 20px;
  box-sizing: border-box;
}

.login-container::before { 
  content: ''; position: absolute; top: -15%; left: -10%; width: 60vw; height: 60vw; 
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 60%); 
  pointer-events: none; 
}
.login-container::after { 
  content: ''; position: absolute; bottom: -20%; right: -10%; width: 70vw; height: 70vw; 
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 60%); 
  pointer-events: none; 
}

.login-card {
  background: var(--white);
  width: 100%;
  max-width: 540px; 
  padding: 60px 55px;
  border-radius: 24px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.25);
  text-align: center;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

.card-logo {
  height: 65px; 
  width: auto;
  object-fit: contain;
  margin-bottom: 35px;
}

.login-card h1 {
  font-size: 2rem; 
  font-weight: 800;
  color: var(--p1);
  margin: 0 0 20px 0;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.login-card p {
  color: #666;
  font-family: 'Roboto', sans-serif;
  font-size: 1.05rem;
  margin: 0 0 40px 0;
  line-height: 1.5;
}

.btn-google {
  width: 100%;
  background: var(--p1); 
  border: 1px solid var(--p1);
  padding: 15px 24px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white); 
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  font-family: 'Roboto', sans-serif;
}

.btn-google:hover {
  opacity: 0.9;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

.login-help {
  margin-top: 45px;
  font-size: 0.9rem;
  color: #6b7280;
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
}

.login-help a {
  color: var(--p1);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
}

.login-help a:hover {
  text-decoration: underline;
  color: var(--p4);
}

.login-copyright {
  margin-top: 40px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  font-family: 'Roboto', sans-serif;
  z-index: 2;
  text-align: center;
}

@media (min-width: 1600px) {
  .login-card { max-width: 620px; padding: 70px 65px; }
  .card-logo { height: 75px; margin-bottom: 40px; }
  .login-card h1 { font-size: 2.3rem; margin-bottom: 25px; }
  .login-card p { font-size: 1.15rem; margin-bottom: 45px; }
  .btn-google { padding: 18px 24px; font-size: 1.15rem; }
  #btn-login-icon { width: 24px !important; height: 24px !important; }
  .login-help { font-size: 1rem; margin-top: 55px; }
  .login-copyright { font-size: 1rem; margin-top: 60px; }
}

@media (max-width: 500px) {
  .login-card { padding: 40px 25px; }
  .card-logo { height: 45px; }
  .login-card h1 { font-size: 1.6rem; }
}