:root{
  --blue:#2f6fdd;
  --accent:#6b2fa6;
  --muted:#7a7a7a;
  --card-bg:#ffffff;
  --border:#e6e9ef;
  --shadow: 0 6px 18px rgba(10,10,10,0.06);
  --radius:8px;
  --sidebar-w:220px;
  --sidebar-collapsed-w:64px;
}

/* base */
html,body{height:100%;margin:0;font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:#fafafa;color:#1f1f1f}
*{box-sizing:border-box}
.app {
  display:flex;
  min-height:100vh;
  transition:all .25s ease;
}

/* LEFT SIDEBAR */
.sidebar {
  flex-shrink:0; /* prevent sidebar from squishing */
  width:var(--sidebar-w);
  background:#fff;
  border-right:1px solid var(--border);
  padding:18px 12px;
  box-sizing:border-box;
  transition:width .28s ease;
  position:relative;
}
.sidebar.collapsed {
  width:var(--sidebar-collapsed-w);
  padding:18px 8px;
}

/* BRAND / LOGO */
.brand{
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:12px;
  padding:4px 0;
  width:100%;
  box-sizing:border-box;
  position:relative;
}
/* When collapsed, add extra top padding so the collapse icon sits above the logo */
.sidebar.collapsed .brand{
  padding-top:28px;
}
/* logo container */
.brand .logo{
  display:flex;
  align-items:center;
  justify-content:center;
  width:auto;
  height:auto;
  overflow:hidden;
  padding:6px;
  z-index:1;
}
.brand .logo img {
  display:block;
  max-width:100%;
  height:56px;   /* expanded logo height (bigger) */
  width:auto;
  object-fit:contain;
  margin:0 auto;
}
/* slightly bigger and pushed downward when collapsed */
.sidebar.collapsed .brand .logo img {
  height:44px;   /* collapsed logo height */
  margin-top:12px;  /* push a bit down */
}
.brand .logo.small img { height:36px; }
/* guard against inline style forcing incorrect width */
#logo[style] {
  display:flex;
  align-items:center;
  justify-content:center;
  width:auto !important;
}

/* collapse button - positioned top-right when expanded, centered when collapsed */
.collapse-toggle{
  position:absolute;
  top:12px;
  right:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:8px;
  background:#f6f9ff;
  border:1px solid #e6f0ff;
  color:#23509a;
  cursor:pointer;
  padding:4px;
  box-shadow: 0 2px 6px rgba(20,40,80,0.04);
  transition: all .18s ease, transform .18s ease;
  font-size:16px;
  z-index: 2;
}
/* hide any span inside if present */
.collapse-toggle span { display:none !important; }

.collapse-toggle svg{ width:18px; height:18px; display:block; }

/* center collapse icon when sidebar is collapsed */
.sidebar.collapsed .collapse-toggle{
  right:auto;
  left:50%;
  transform:translateX(-50%);
  top:10px;
  width:40px;
  height:40px;
  background:#fff;
  border:1px solid #e6e6e6;
}

/* NAV */
nav{display:flex;flex-direction:column;gap:10px;align-items:stretch;margin-top:8px}
.nav-item{display:flex;align-items:center;gap:12px;padding:10px;border-radius:8px;color:#444;cursor:pointer;transition:background .15s}
.nav-item .icon{width:28px;height:28px;background:#f2f6fb;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;color:#23509a;font-weight:700}
.nav-item .icon svg{ width:18px; height:18px; fill:currentColor; display:block; }
.nav-item .label{font-weight:600;color:#2b3b57}
.nav-item.active{background:linear-gradient(90deg, rgba(107,47,166,0.06), rgba(47,111,221,0.03));border-left:4px solid var(--accent);padding-left:8px}
.nav-item:hover{background:#fbfdff}

/* MAIN AREA */
.main {
  flex:1;
  display:flex;
  flex-direction:column;
  transition:all .28s ease;
}
header.top{height:64px;background:var(--blue);color:#fff;display:flex;align-items:center;padding:0 60px;box-sizing:border-box;justify-content:space-between;position:sticky;top:0;z-index:5}
header .title{font-size:20px;font-weight:600;display:flex;align-items:center;gap:12px}
header .title .mini{font-size:12px;opacity:0.9}
header .control{display:flex;gap:12px;align-items:center}
header .control button{background:transparent;border:1px solid rgba(255,255,255,0.2);color:#fff;padding:8px 12px;border-radius:6px;cursor:pointer}

/* make the small user label white and slightly bolder */
header .control .small.user-label {
  color: #ffffff;
  font-weight:700;
  background: rgba(255,255,255,0.06);
  padding:6px 10px;
  border-radius:6px;
  border:1px solid rgba(255,255,255,0.06);
}

/* CONTENT + CARD */
.content{
  padding:28px;
  box-sizing:border-box;
  display:flex;
  justify-content:center;
  align-items:flex-start;
}
.card{
  width:95%;
  max-width:1200px;
  background:var(--card-bg);
  /* border:2px solid #bfbfbf; */
  padding:28px;
  border-radius:6px;
  box-shadow:var(--shadow);
  position:relative;
  min-height:420px;
  transition:all .28s ease;
}

/* when sidebar collapses, let the card grow to use freed space */
.sidebar.collapsed ~ .main .card {
  width:98%;
  max-width:1400px;
  transition: width .28s ease, max-width .28s ease;
}

/* FORM GRID */
.card h2{font-weight:600;color:#2f4c7a;margin:0 0 18px 0;font-size:18px}
.form-grid{display:grid;grid-template-columns:456px 1fr;gap:24px;align-items:start}
label.big{font-size:22px;color:#2f4c7a;padding-top:6px}
.field{margin-bottom:18px}
select,input[type="text"]{width:100%;padding:12px;border:1px solid #9fb0d8;border-radius:4px;background:white;font-size:15px;color:#1b2b4a;box-shadow:inset 0 1px 0 rgba(255,255,255,0.6)}
select:focus,input:focus{outline:none;box-shadow:0 0 0 3px rgba(47,111,221,0.12);border-color:var(--blue)}

/* Attachment area */
.attach-wrap{background-color: rgb(240, 242, 246)!important;height:120px;border-radius:12px;padding:12px;display:flex; flex-direction: row; justify-content: space-around;
    align-items: center;transition:background .15s}
.attach-wrap .hint{color : black;margin-bottom:6px; font-size: 15px;}
.attach{display:flex;gap:10px;align-items:center;color:#334a72}
.attach input[type="file"]{display:none}
.attach .btn{display:inline-block;padding:8px 12px;border-radius:8px;border:1px solid #c7d7f8;background:#fff;cursor:pointer;font-weight:500;color: rgb(115 45 60 / 61%);}

/* Upload row spacing: add .spaced for clear gap */
.upload-row { display:flex; justify-content:flex-start; margin-top:18px; gap:12px; align-items:center; }
.upload-row.spaced { gap:18px; }

/* upload button visuals */
.upload-btn { padding:10px 18px; border-radius:8px; background:#7f7f7f; border:1px solid #cfe0ff; color:white; font-weight:700; cursor:not-allowed; }
.upload-btn.enabled { linear-gradient(180deg, #181717, #37393d); border:1px solid #86a8ff; cursor:pointer; box-shadow: 0 4px 12px rgba(47,111,221,0.08); }

/* status messages */
.status-message { margin-top:12px; font-size:14px; font-weight:700; display:flex; align-items:center; gap:10px; min-height:22px; }
.status-message.success { color:#0f9d58; }
.status-message.error { color:#d93025; }
.status-message.info { color:#23509a; }

/* small spinner using borders (no external image) */
.status-spinner {
  width:18px;
  height:18px;
  border-radius:50%;
  border:3px solid rgba(0,0,0,0.08);
  border-top-color: #23509a;
  animation: spin 1s linear infinite;
  display:inline-block;
  vertical-align:middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* note / helper text */
.small{font-size:13px;color:var(--muted)}
.note{position:absolute;right:18px;bottom:18px;font-size:12px;color:#666}
.loading-overlay {
  position: fixed;
  top:0; left:0; right:0; bottom:0;
  background: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 6px solid rgba(0,0,0,0.1);
  border-top-color: var(--blue);
  animation: spin 1s linear infinite;
}
/* Upload popup overlay */
.upload-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;               /* hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

/* visible state */
.upload-popup.show {
  display: flex;
}

/* popup box */
.upload-popup-content {
  background: #ffffff;
  padding: 22px 26px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  max-width: 420px;
  width: 90%;
  text-align: left;
  border: 1px solid #e2e6f0;
}

.upload-popup-title {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 700;
  color: #2f4c7a;
}

.upload-popup-message {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: #444a63;
  line-height: 1.5;
}

/* Close button */
.upload-popup-close-btn {
  padding: 10px 28px;
  border-radius: 6px;
  border: 1px solid #86a8ff;
  background: linear-gradient(180deg, #ffffff, #eef6ff);
  color: #123153;
  font-weight: 600;
  cursor: pointer;

  display: block;          /* IMPORTANT */
  align-self: center;      /* IMPORTANT: centers inside flex */
  margin-top: 18px;
}
/* Congrats image */
.popup-congrats-img {
  width: 110px;
  margin: 0 auto 10px;
  display: block;
}

/* Loading GIF container */
.popup-loading-holder {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.popup-loading-gif {
  width: 32px;
  height: 32px;
}

.popup-loading-text {
  font-size: 13px;
  color: #445;
}
/* responsive */
@media(max-width:900px){
  .form-grid{grid-template-columns:1fr;}
  .sidebar{display:none}
  .card{padding:18px}
}
.upload-img{
  height: 110%;
    width: 18%;
}

.upload-img img{
  height: 30%;
  width: 30%;
}

.image-text{
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 50%;
}

.form-subgrid{
display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;

}
.hint-text{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.text{
  font-size: 12px;
  color: rgb(115 45 60 / 61%);
}
