:root{
  --bg:#eef3f9;
  --sidebar:#0b1324;
  --sidebar2:#111b31;
  --card:#fff;
  --line:#d8e1ee;
  --text:#1f2937;
  --muted:#667085;
  --primary:#0f62fe;
  --primary-dark:#0a4fcc;
  --primary-soft:rgba(15,98,254,.13);
  --shadow:0 16px 38px rgba(15,23,42,.08);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:Arial, Helvetica, sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}

.auth-body{
  min-height:100vh;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#0b1324 0%,#16233d 100%);
  padding:24px;
}

.auth-card{
  width:100%;
  max-width:430px;
  background:#fff;
  border-radius:24px;
  box-shadow:0 25px 60px rgba(0,0,0,.25);
  padding:30px;
}

.auth-logo{text-align:center;margin-bottom:22px}
.auth-logo h1{margin:12px 0 6px;font-size:28px}
.auth-logo p{margin:0;color:var(--muted)}
.auth-badge{
  display:inline-block;
  padding:8px 13px;
  border-radius:999px;
  background:#eef5ff;
  color:#28518d;
  font-weight:800;
}

.auth-note{
  margin-top:18px;
  background:#f7faff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:13px;
  font-size:13px;
  color:#475569;
  line-height:1.5;
}

.app-shell{
  display:grid;
  grid-template-columns:310px 1fr;
  min-height:100vh;
}

.sidebar{
  background:linear-gradient(180deg,var(--sidebar) 0%,var(--sidebar2) 100%);
  color:#fff;
  padding:24px 18px 24px 24px;
}

.brand{
  margin-bottom:22px;
}
.brand-title{
  font-size:24px;
  line-height:1.1;
  font-weight:800;
}
.brand-subtitle{
  color:#c8d6f4;
  margin-top:7px;
  font-size:13px;
}

.nav{
  display:grid;
  gap:8px;
}
.nav a{
  display:block;
  color:#dbe4f0;
  padding:12px 13px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.07);
  background:rgba(255,255,255,.035);
  text-decoration:none;
  font-size:14px;
}
.nav a:hover,.nav a.active{
  background:var(--primary-soft);
  color:#fff;
  border-color:rgba(96,165,250,.35);
}

.main{
  padding:28px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:18px;
}
.topbar h1{
  margin:0;
  font-size:30px;
}
.topbar-user{
  display:flex;
  align-items:center;
  gap:12px;
  color:#475569;
  font-size:14px;
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:22px;
}

.card h2{margin:0 0 10px;font-size:22px}
.card p{color:#475569;line-height:1.6}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:none;
  border-radius:12px;
  padding:11px 15px;
  font-size:14px;
  cursor:pointer;
  font-weight:700;
  text-decoration:none;
}
.btn:hover{text-decoration:none}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dark)}
.btn-secondary{background:#fff;color:#1f2937;border:1px solid var(--line)}
.btn-small{padding:8px 10px;font-size:13px;background:#fff;border:1px solid var(--line);color:#1f2937}
.btn-full{width:100%}

.link-button{
  background:none;
  border:none;
  color:var(--primary);
  cursor:pointer;
  font-weight:700;
  padding:0;
}

.alert{
  padding:12px 14px;
  border-radius:14px;
  margin-bottom:14px;
  font-size:14px;
}
.alert-error{
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fecaca;
}

.form-group{
  display:flex;
  flex-direction:column;
  gap:7px;
  margin-bottom:14px;
}
.form-group label{
  font-size:12px;
  color:#344054;
  font-weight:800;
}
input,select,textarea{
  width:100%;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  border-radius:12px;
  padding:11px 12px;
  font-size:14px;
  outline:none;
}
textarea{
  min-height:92px;
  resize:vertical;
}

.page-actions{
  display:flex;
  justify-content:flex-end;
  margin-bottom:14px;
}

.filters{
  display:grid;
  grid-template-columns:1.4fr .7fr .9fr .6fr auto;
  gap:12px;
  align-items:end;
}

.table-wrap{overflow:auto}
table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}
th,td{
  border-bottom:1px solid var(--line);
  padding:13px 10px;
  text-align:left;
  vertical-align:middle;
}
th{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.04em;
  background:#fbfdff;
}
tr:hover td{background:#fbfdff}
.table-link{font-weight:800}
.table-sub{font-size:12px;color:var(--muted);margin-top:4px}
.badge{
  display:inline-block;
  border-radius:999px;
  padding:6px 10px;
  background:#eef5ff;
  color:#28518d;
  font-weight:800;
  font-size:12px;
}
.empty-cell{
  text-align:center;
  color:var(--muted);
  padding:30px;
}

.form-card{max-width:1040px}
.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
.form-grid .full{grid-column:1/-1}
.form-footer{
  border-top:1px solid var(--line);
  margin-top:10px;
  padding-top:18px;
  display:flex;
  justify-content:flex-end;
}

.dashboard-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin-top:18px;
}
.mini-card{
  border:1px solid var(--line);
  background:#fbfdff;
  border-radius:16px;
  padding:16px;
  display:grid;
  gap:10px;
}
.mini-card strong{font-size:16px}
.mini-card span{color:var(--muted);font-size:14px;line-height:1.5}
.mini-card.muted{opacity:.72}

@media(max-width:1100px){
  .app-shell{grid-template-columns:1fr}
  .filters{grid-template-columns:1fr 1fr}
  .dashboard-grid{grid-template-columns:1fr}
}
@media(max-width:720px){
  .main{padding:18px}
  .topbar{display:grid}
  .filters,.form-grid{grid-template-columns:1fr}
  .topbar h1{font-size:24px}
}


/* ============================================================
   v0.6c - Lexynex Legal user role switch UI FIX
   Definitive CSS. This must be in assets/css/app.css.
   ============================================================ */

.role-switch-list{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:10px !important;
  margin-top:8px !important;
}

.role-switch-row{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:14px !important;
  width:100% !important;
  min-height:50px !important;
  padding:10px 12px !important;
  border:1px solid var(--line) !important;
  border-radius:14px !important;
  background:#fbfdff !important;
  cursor:pointer !important;
  transition:background .15s ease, border-color .15s ease, box-shadow .15s ease !important;
}

.role-switch-row:hover{
  background:#f7faff !important;
  border-color:#b8cbed !important;
}

.role-switch-input{
  position:absolute !important;
  opacity:0 !important;
  width:1px !important;
  height:1px !important;
  min-width:1px !important;
  max-width:1px !important;
  margin:0 !important;
  padding:0 !important;
  pointer-events:none !important;
  appearance:none !important;
  -webkit-appearance:none !important;
}

.role-switch-toggle{
  position:relative !important;
  display:inline-block !important;
  flex:0 0 46px !important;
  width:46px !important;
  height:26px !important;
  border-radius:999px !important;
  background:#cbd5e1 !important;
  box-shadow:inset 0 0 0 1px rgba(15,23,42,.10) !important;
  transition:background .15s ease !important;
}

.role-switch-toggle::after{
  content:"" !important;
  position:absolute !important;
  top:3px !important;
  left:3px !important;
  width:20px !important;
  height:20px !important;
  border-radius:999px !important;
  background:#fff !important;
  box-shadow:0 2px 5px rgba(15,23,42,.22) !important;
  transition:transform .15s ease !important;
}

.role-switch-input:checked + .role-switch-toggle{
  background:#0f62fe !important;
}

.role-switch-input:checked + .role-switch-toggle::after{
  transform:translateX(20px) !important;
}

.role-switch-input:focus + .role-switch-toggle{
  outline:3px solid rgba(15,98,254,.20) !important;
  outline-offset:2px !important;
}

.role-switch-copy{
  display:flex !important;
  align-items:baseline !important;
  gap:10px !important;
  flex-wrap:wrap !important;
  min-width:0 !important;
}

.role-switch-copy strong{
  font-size:15px !important;
  color:var(--text) !important;
  white-space:nowrap !important;
}

.role-switch-copy small{
  color:var(--muted) !important;
  font-size:13px !important;
  line-height:1.35 !important;
}

.role-switch-row:has(.role-switch-input:checked){
  background:#eef5ff !important;
  border-color:#8bb8ff !important;
}


/* ============================================================
   v0.11m - table action buttons must stay in one horizontal row
   ============================================================ */
.action-cell{
  white-space:nowrap;
}
.table-actions{
  display:inline-flex;
  flex-direction:row;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  white-space:nowrap;
}
.table-actions .btn{
  white-space:nowrap;
  flex:0 0 auto;
}
@media(max-width:720px){
  .table-actions{
    gap:6px;
  }
  .table-actions .btn-small{
    padding:7px 9px;
    font-size:12px;
  }
}
