:root{
  --bg: #eef3f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e6edf6;
  --shadow: 0 16px 40px rgba(15, 23, 42, .10);
  --blue: #2b6cf6;
  --blue-2: #1f5fe8;
  --danger: #dc2626;
  --radius: 14px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background:var(--bg);
}

.hidden{ display:none !important; }
.muted{ color:var(--muted); }
.small{ font-size: 13px; }

/* Topbar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 5;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 12px 16px;
  background: rgba(238,243,249,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand{ font-weight:800; }
.badge{
  margin-left: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 700;
}

/* Inputs */
.input{
  width:100%;
  font-size: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #d8e3f3;
  outline:none;
  background:#fff;
}
.input:focus{
  border-color: rgba(43,108,246,.55);
  box-shadow: 0 0 0 4px rgba(43,108,246,.14);
}
.input.small{
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
}

/* Buttons */
.btn{
  cursor:pointer;
  border:none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 800;
}
.btn.small{ padding: 10px 14px; border-radius: 10px; }
.btn.big{ padding: 16px 26px; font-size: 22px; }

.btn.primary{ background: var(--blue); color:#fff; box-shadow: 0 14px 28px rgba(43,108,246,.25); }
.btn.primary:hover{ background: var(--blue-2); }

.btn.secondary{ background:#ffffff; border:1px solid var(--border); color: var(--text); }
.btn.secondary:hover{ background:#f8fbff; }

.btn.danger{ background: var(--danger); color:#fff; }

/* Auth layout (login screenshot) */
.auth-wrap{
  min-height: calc(100vh - 58px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 22px;
  padding: 32px 16px 48px;
}
.auth-logo{
  width: 180px;
  height: 180px;
  object-fit: contain;
}
.auth-card{
  width: min(860px, 92vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 28px 22px;
}
.auth-title{
  margin: 0 0 18px;
  font-size: 34px;
  font-weight: 900;
}
.field{ display:block; margin: 16px 0; }
.label{
  display:block;
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 10px;
}
.auth-actions{
  display:flex;
  align-items:center;
  gap: 16px;
  margin-top: 18px;
}
.status{ color: #b91c1c; font-size: 14px; }

/* App layout */
.app{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  padding: 16px;
  max-width: 1400px;
  margin: 0 auto;
}
.sidebar{
  background:#fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  height: calc(100vh - 110px);
  overflow:auto;
}
.sidebar-row{ margin-bottom: 12px; }
.case-list{ margin-top: 10px; display:flex; flex-direction:column; gap: 8px; }

.listItem{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
  background:#fff;
}
.listItem:hover{ background:#f8fbff; }
.listItem.active{ border-color: rgba(43,108,246,.55); box-shadow: 0 0 0 3px rgba(43,108,246,.12); }
.listItem .t{ font-weight: 800; }
.listItem .d{ font-size: 12px; color: var(--muted); margin-top: 4px; }

.main{
  background:#fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  height: calc(100vh - 110px);
  overflow:auto;
}
.editor-head{
  display:flex;
  gap: 10px;
  align-items:center;
}
.editor-actions{ display:flex; gap: 8px; }
.editor-wrap{ margin-top: 12px; border:1px solid var(--border); border-radius: 12px; overflow:hidden; }
#editor{ min-height: 340px; }

.attach-row{ margin-top: 12px; }
.attachments{
  margin-top: 12px;
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.thumb{
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow:hidden;
  background:#fff;
}
.thumb img{ width:100%; height:140px; object-fit:cover; display:block; }
.thumb .cap{ padding: 10px; font-size: 12px; color: var(--muted); }
