:root{
  --bg:#f6f7f9;
  --panel:#fff;
  --line:#e6e8ec;
  --text:#14171f;
  --muted:#6b7280;
  --dark:#121722;
  --dark2:#1b2433;
  --accent:#16b8d9;
  --accent2:#0ea5c6;
  --soft:#e8f8fc;
  --green:#22c55e;
  --red:#ef4444;
  --orange:#f97316;
}

*{box-sizing:border-box}

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

a{text-decoration:none;color:inherit}
button,input,select{font:inherit}

/* LOGIN */
.login-body{
  min-height:100vh;
  overflow-x:hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(22,184,217,.18), transparent 30%),
    radial-gradient(circle at 95% 90%, rgba(18,23,34,.12), transparent 34%),
    #f6f7f9;
}

.login-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(520px,1fr) 520px;
}

.login-visual{
  position:relative;
  padding:42px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  background:
    linear-gradient(135deg, rgba(18,23,34,.98), rgba(18,23,34,.94)),
    radial-gradient(circle at 70% 20%, rgba(22,184,217,.35), transparent 34%);
  color:#fff;
  overflow:hidden;
}

.login-visual:before{
  content:"";
  position:absolute;
  inset:auto -140px -160px auto;
  width:460px;
  height:460px;
  border-radius:50%;
  background:rgba(22,184,217,.16);
  filter:blur(6px);
}

.login-brand{
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  gap:14px;
}

.login-logo{
  width:46px;
  height:46px;
  border-radius:15px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(22,184,217,.45);
  color:#fff;
  font-weight:850;
  letter-spacing:.02em;
}

.login-brand-name{
  font-size:20px;
  font-weight:850;
}

.login-brand-sub{
  margin-top:3px;
  font-size:12px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:rgba(255,255,255,.58);
}

.login-hero{
  position:relative;
  z-index:2;
  max-width:670px;
}

.login-kicker{
  display:inline-flex;
  align-items:center;
  height:30px;
  padding:0 12px;
  border-radius:999px;
  background:rgba(22,184,217,.14);
  border:1px solid rgba(22,184,217,.34);
  color:#8eeaff;
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
}

.login-hero h1{
  max-width:680px;
  margin:22px 0 16px;
  font-size:54px;
  line-height:1.02;
  letter-spacing:-.045em;
}

.login-hero p{
  max-width:610px;
  margin:0;
  color:rgba(255,255,255,.72);
  font-size:17px;
  line-height:1.7;
}

.login-preview{
  position:relative;
  z-index:2;
  min-height:245px;
  margin-top:34px;
  display:grid;
  grid-template-columns:58px 1fr;
  gap:0;
  border:1px solid rgba(255,255,255,.12);
  border-radius:28px;
  overflow:hidden;
  background:rgba(255,255,255,.055);
  box-shadow:0 32px 90px rgba(0,0,0,.3);
  backdrop-filter:blur(18px);
}

.preview-rail{
  padding:18px 10px;
  background:rgba(0,0,0,.22);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
}

.preview-rail span{
  width:32px;
  height:32px;
  border-radius:11px;
  background:rgba(255,255,255,.12);
}

.preview-rail span:nth-child(2){
  background:rgba(22,184,217,.85);
  box-shadow:0 0 0 6px rgba(22,184,217,.12);
}

.preview-content{
  padding:20px;
}

.preview-top{
  height:36px;
  width:64%;
  border-radius:14px;
  background:rgba(255,255,255,.12);
  margin-bottom:18px;
}

.preview-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-bottom:16px;
}

.preview-grid i{
  display:block;
  height:64px;
  border-radius:18px;
  background:rgba(255,255,255,.1);
}

.preview-board{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}

.preview-board b{
  height:92px;
  border-radius:18px;
  background:linear-gradient(180deg,rgba(255,255,255,.13),rgba(255,255,255,.07));
}

.login-status{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:26px;
}

.login-status div{
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  padding:14px;
  background:rgba(255,255,255,.055);
}

.login-status b{
  display:block;
  font-size:18px;
}

.login-status span{
  display:block;
  margin-top:5px;
  color:rgba(255,255,255,.58);
  font-size:12px;
}

.login-panel{
  display:grid;
  place-items:center;
  padding:42px;
}

.login-card{
  width:100%;
  max-width:430px;
  border:1px solid var(--line);
  border-radius:28px;
  padding:30px;
  background:#fff;
  box-shadow:0 28px 80px rgba(18,23,34,.09);
}

.mobile-brand{
  display:none;
  align-items:center;
  gap:12px;
  margin-bottom:24px;
}

.mobile-brand .login-logo{
  background:var(--dark);
}

.mobile-brand .login-brand-sub{
  color:var(--muted);
}

.login-card-head h2{
  margin:0;
  font-size:30px;
  letter-spacing:-.035em;
}

.login-card-head p{
  margin:10px 0 24px;
  color:var(--muted);
  line-height:1.55;
}

.field{
  display:grid;
  gap:8px;
  margin:16px 0;
}

.field label{
  font-size:13px;
  color:#4b5563;
  font-weight:700;
}

.field input,.field select{
  width:100%;
  height:48px;
  border:1px solid var(--line);
  border-radius:15px;
  padding:0 14px;
  background:#fff;
  outline:none;
  transition:.16s;
}

.field input:focus,.field select:focus{
  border-color:rgba(22,184,217,.8);
  box-shadow:0 0 0 4px rgba(22,184,217,.12);
}

.btn{
  height:44px;
  border:0;
  border-radius:15px;
  background:var(--accent);
  color:#fff;
  padding:0 18px;
  font-weight:800;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.btn:hover{
  background:var(--accent2);
}

.login-submit{
  width:100%;
  margin-top:8px;
}

.btn.secondary{
  background:#fff;
  color:var(--text);
  border:1px solid var(--line);
}

.btn.danger{
  background:#fff;
  color:var(--red);
  border:1px solid #fecaca;
}

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

.first-access{
  margin-top:20px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fafbfc;
  padding:14px;
}

.first-access-title{
  margin-bottom:10px;
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:800;
}

.first-access div:not(.first-access-title){
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:7px 0;
  font-size:13px;
}

.first-access span{
  color:var(--muted);
}

/* APP BASE */
.app{
  min-height:100vh;
  display:grid;
  grid-template-columns:64px 250px 1fr;
}

.rail{
  background:var(--dark);
  padding:14px 10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:9px;
}

.logo{
  width:40px;
  height:40px;
  border:1px solid rgba(22,184,217,.5);
  border-radius:13px;
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:850;
  margin-bottom:10px;
}

.rail-btn{
  width:42px;
  height:42px;
  border-radius:13px;
  border:0;
  background:transparent;
  color:#b8c0cc;
  display:grid;
  place-items:center;
  position:relative;
  cursor:pointer;
  font-size:18px;
}

.rail-btn.active,.rail-btn:hover{
  background:var(--dark2);
  color:#fff;
}

.rail-btn.active:before{
  content:"";
  position:absolute;
  left:-10px;
  width:3px;
  height:22px;
  border-radius:99px;
  background:var(--accent);
}

.rail-btn:hover:after{
  content:attr(data-tip);
  position:absolute;
  left:54px;
  top:50%;
  transform:translateY(-50%);
  white-space:nowrap;
  background:#0e1420;
  color:#fff;
  font-size:12px;
  padding:8px 10px;
  border-radius:9px;
  box-shadow:0 14px 30px rgba(0,0,0,.22);
  z-index:20;
}

.side{
  background:#fff;
  border-right:1px solid var(--line);
  padding:22px 18px;
}

.brand{
  font-size:23px;
  font-weight:850;
}

.brand b{
  color:var(--accent);
}

.side-sub{
  font-size:11px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.12em;
  margin-top:2px;
}

.side-section{
  margin-top:28px;
}

.side-title{
  font-size:11px;
  color:#9aa3af;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin:0 0 10px;
}

.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:13px;
  font-size:14px;
  color:#2a303b;
  margin-bottom:5px;
}

.nav a.active{
  background:var(--soft);
  color:#0788a5;
  font-weight:700;
}

.main{
  padding:24px 28px 42px;
  overflow-x:auto;
}

.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:24px;
}

.title h1{
  margin:0;
  font-size:27px;
}

.title p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:14px;
}

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

.search{
  width:360px;
  max-width:35vw;
  height:42px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:13px;
  padding:0 14px;
  color:var(--muted);
}

.card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:19px;
  padding:18px;
}

.hero{
  background:linear-gradient(120deg,#effcff,#fff);
  border:1px solid var(--line);
  border-radius:22px;
  padding:28px;
  margin-bottom:18px;
}

.hero h2{
  font-size:28px;
  margin:0 0 8px;
}

.hero p{
  color:var(--muted);
  line-height:1.55;
  margin:0 0 18px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}

.metric strong{
  display:block;
  font-size:28px;
  margin:8px 0;
}

.metric small{
  color:var(--muted);
}

.section-title{
  font-size:20px;
  margin:26px 0 14px;
}

.service-card{
  min-height:130px;
}

.service-icon{
  width:38px;
  height:38px;
  border-radius:13px;
  background:var(--soft);
  color:#0788a5;
  display:grid;
  place-items:center;
  font-weight:850;
  margin-bottom:12px;
}

.service-card h3{
  margin:0 0 8px;
}

.service-card p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.table-wrap{
  overflow:auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:19px;
}

table{
  width:100%;
  border-collapse:collapse;
  min-width:900px;
}

th,td{
  padding:13px 14px;
  border-bottom:1px solid #eef0f3;
  text-align:left;
  font-size:14px;
  vertical-align:middle;
}

th{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:#7b8492;
  background:#fafbfc;
}

tr:last-child td{
  border-bottom:0;
}

.badge{
  display:inline-flex;
  border-radius:999px;
  padding:5px 9px;
  background:var(--soft);
  color:#0788a5;
  font-size:12px;
  font-weight:700;
}

.status{
  display:inline-flex;
  align-items:center;
  gap:7px;
  color:var(--green);
  font-size:13px;
}

.status:before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--green);
}

.toggle{
  width:42px;
  height:24px;
  border-radius:99px;
  border:1px solid var(--line);
  background:#e5e7eb;
  position:relative;
  cursor:pointer;
  transition:.2s;
}

.toggle:before{
  content:"";
  position:absolute;
  width:18px;
  height:18px;
  border-radius:50%;
  background:#fff;
  left:2px;
  top:2px;
  box-shadow:0 2px 6px rgba(0,0,0,.15);
  transition:.2s;
}

.toggle.on{
  background:var(--accent);
  border-color:var(--accent);
}

.toggle.on:before{
  left:20px;
}

.log-row{
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding:12px 0;
  border-bottom:1px solid #eef0f3;
  font-size:14px;
}

.log-row:last-child{
  border-bottom:0;
}

.muted{
  color:var(--muted);
}

.empty{
  padding:38px;
  text-align:center;
  color:var(--muted);
}

@media(max-width:1100px){
  .login-shell{grid-template-columns:1fr}
  .login-visual{display:none}
  .login-panel{padding:22px}
  .mobile-brand{display:flex}
  .app{grid-template-columns:64px 1fr}
  .side{display:none}
  .grid{grid-template-columns:1fr}
  .search{display:none}
}

/* CLEAN LOGIN OVERRIDE */
.login-shell-clean{
  grid-template-columns:minmax(460px,1fr) 500px;
}

.login-side-clean{
  min-height:100vh;
  padding:48px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  background:#121722;
  color:#fff;
}

.login-side-clean:before,
.login-side-clean:after{
  display:none !important;
}

.login-hero-clean{
  max-width:640px;
  position:relative;
  z-index:2;
}

.login-hero-clean h1{
  margin:22px 0 16px;
  font-size:52px;
  line-height:1.04;
  letter-spacing:-.045em;
}

.login-hero-clean p{
  max-width:570px;
  margin:0;
  color:rgba(255,255,255,.68);
  font-size:17px;
  line-height:1.7;
}

.login-shell-clean .login-preview,
.login-shell-clean .login-status,
.login-shell-clean .first-access{
  display:none !important;
}

.login-shell-clean .login-card{
  box-shadow:0 28px 80px rgba(18,23,34,.08);
}

.login-shell-clean .login-card-head h2{
  font-size:32px;
}

.login-shell-clean .login-card-head p{
  margin-bottom:26px;
}

@media(max-width:1100px){
  .login-shell-clean{
    grid-template-columns:1fr;
  }

  .login-side-clean{
    display:none;
  }
}

/* SVG ICONS FIX */
.rail-btn svg,
.service-icon svg{
  width:21px;
  height:21px;
  display:block;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.service-icon svg{
  width:20px;
  height:20px;
}

.rail-btn{
  font-size:0 !important;
}

.service-icon{
  font-size:0 !important;
}

/* FIXED LEFT RAIL + USER AVATAR */
.app{
  min-height:100vh;
  display:grid;
  grid-template-columns:78px 250px 1fr;
}

.rail{
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  width:78px;
  background:var(--dark);
  padding:14px 10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  z-index:100;
  border-right:1px solid rgba(255,255,255,.04);
}

.rail-nav{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:9px;
}

.rail-bottom{
  margin-top:auto;
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  padding-bottom:10px;
}

.rail-user{
  width:42px;
  height:42px;
  border-radius:50%;
  background:linear-gradient(180deg,#1cc3e4,#109fbd);
  color:#fff;
  display:grid;
  place-items:center;
  font-size:13px;
  font-weight:800;
  letter-spacing:.04em;
  cursor:default;
  position:relative;
  box-shadow:0 8px 20px rgba(22,184,217,.25);
}

.rail-user:hover::after{
  content:attr(data-tip);
  position:absolute;
  left:54px;
  bottom:50%;
  transform:translateY(50%);
  white-space:nowrap;
  background:#0e1420;
  color:#fff;
  font-size:12px;
  padding:8px 10px;
  border-radius:9px;
  box-shadow:0 14px 30px rgba(0,0,0,.22);
  z-index:20;
}

.side{
  margin-left:78px;
  min-height:100vh;
  background:#fff;
  border-right:1px solid var(--line);
  padding:22px 18px;
}

.main{
  min-width:0;
  padding:24px 28px 42px;
  overflow-x:auto;
}

.logo{
  width:40px;
  height:40px;
  border:1px solid rgba(22,184,217,.5);
  border-radius:13px;
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:850;
  margin-bottom:6px;
}

@media(max-width:1100px){
  .app{
    grid-template-columns:78px 1fr;
  }

  .side{
    display:none;
  }

  .main{
    margin-left:0;
  }
}

/* FINAL DESKTOP LAYOUT FIX V7 */
body{
  overflow-x:hidden;
}

.app{
  min-height:100vh !important;
  display:grid !important;
  grid-template-columns:250px minmax(0,1fr) !important;
  margin-left:78px !important;
  width:calc(100vw - 78px) !important;
}

.rail{
  position:fixed !important;
  top:0 !important;
  left:0 !important;
  bottom:0 !important;
  width:78px !important;
  height:100vh !important;
  margin:0 !important;
  flex-shrink:0 !important;
  z-index:1000 !important;
}

.side{
  margin-left:0 !important;
  width:250px !important;
  min-width:250px !important;
  max-width:250px !important;
  min-height:100vh !important;
  grid-column:1 !important;
  overflow-y:auto !important;
}

.main{
  grid-column:2 !important;
  min-width:0 !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
}

.top{
  width:100% !important;
}

.hero,
.table-wrap,
.card{
  max-width:100% !important;
}

@media(max-width:1100px){
  .app{
    grid-template-columns:minmax(0,1fr) !important;
    margin-left:78px !important;
    width:calc(100vw - 78px) !important;
  }

  .side{
    display:none !important;
  }

  .main{
    grid-column:1 !important;
    width:100% !important;
  }
}

/* CORE POLISH V8 */
.compact-hero{
  padding:24px !important;
  margin-bottom:18px !important;
}

.compact-hero h2{
  font-size:24px !important;
}

.compact-grid{
  grid-template-columns:repeat(2,minmax(0,300px)) !important;
  align-items:stretch;
}

.services-grid{
  grid-template-columns:repeat(4,minmax(220px,1fr)) !important;
}

.service-card{
  transition:.16s ease;
}

.service-card:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 40px rgba(18,23,34,.07);
  border-color:#d9edf2;
}

.info-card{
  margin-bottom:12px;
  background:#fbfdfe;
}

.info-card p{
  margin:6px 0 0;
  color:var(--muted);
  line-height:1.5;
}

.user-cell{
  display:flex;
  align-items:center;
  gap:12px;
}

.avatar-small{
  width:34px;
  height:34px;
  border-radius:50%;
  background:var(--soft);
  color:#0788a5;
  display:grid;
  place-items:center;
  font-size:12px;
  font-weight:850;
}

.btn-sm{
  height:34px !important;
  border-radius:11px !important;
  padding:0 12px !important;
  font-size:13px !important;
}

.status.off{
  color:var(--muted);
}

.status.off:before{
  background:var(--muted);
}

.access-matrix th,
.access-matrix td{
  text-align:center;
}

.access-matrix th:first-child,
.access-matrix td:first-child{
  text-align:left;
  position:sticky;
  left:0;
  background:#fff;
  z-index:1;
}

.access-matrix th:first-child{
  background:#fafbfc;
  z-index:2;
}

.js-user-search{
  color:var(--text);
}

@media(max-width:1300px){
  .services-grid{
    grid-template-columns:repeat(3,minmax(220px,1fr)) !important;
  }
}

@media(max-width:900px){
  .services-grid,
  .compact-grid{
    grid-template-columns:1fr !important;
  }
}

/* USER ADMIN FINAL V9 */
.row-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.row-actions .muted{
  font-size:13px;
  white-space:nowrap;
}

.table-wrap td:last-child,
.table-wrap th:last-child{
  min-width:220px;
}

.field input,
.field select{
  color:var(--text);
}

/* ACCESS MATRIX FIX V11 */
.toggle.saving{
  opacity:.65;
  cursor:wait;
}

.toggle.locked{
  opacity:.55;
  cursor:not-allowed;
}

.toggle.locked.on{
  background:var(--accent);
  border-color:var(--accent);
}

.access-matrix .muted{
  font-size:12px;
}

/* AUDIT RUSSIAN V12 */
.audit-card .log-row b{
  font-size:14px;
}

.audit-user{
  color:#8b95a5;
}

.audit-date{
  white-space:nowrap;
  font-size:13px;
}

/* CRM V13 */
.crm-tabs{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:0 0 18px;
}

.crm-tabs a{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  padding:0 14px;
  border-radius:13px;
  border:1px solid var(--line);
  background:#fff;
  color:#2a303b;
  font-size:14px;
  font-weight:700;
}

.crm-tabs a.active{
  background:var(--soft);
  border-color:#d9edf2;
  color:#0788a5;
}

.crm-metrics{
  grid-template-columns:repeat(5,minmax(150px,1fr)) !important;
  margin-bottom:18px;
}

.crm-empty-main{
  text-align:left;
}

.crm-empty-main .btn{
  margin-top:14px;
}

@media(max-width:1300px){
  .crm-metrics{
    grid-template-columns:repeat(3,minmax(150px,1fr)) !important;
  }
}

@media(max-width:900px){
  .crm-metrics{
    grid-template-columns:1fr !important;
  }
}

/* CRM V14 PIPELINES + STAGES */
.crm-stages-list{
  display:grid;
  grid-template-columns:repeat(3,minmax(240px,1fr));
  gap:14px;
}

.stage-card{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

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

.stage-head h3{
  margin:0;
}

.stage-dot{
  width:12px;
  height:12px;
  border-radius:50%;
  display:inline-block;
  border:1px solid rgba(0,0,0,.08);
}

@media(max-width:1300px){
  .crm-stages-list{
    grid-template-columns:repeat(2,minmax(240px,1fr));
  }
}

@media(max-width:900px){
  .crm-stages-list{
    grid-template-columns:1fr;
  }
}

/* AMO STYLE CRM V14 */
.crm-top{
  margin-bottom:14px;
}

.crm-pipeline-bar{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding:2px 0 14px;
  margin-bottom:10px;
}

.pipeline-pill{
  min-width:190px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:16px;
  padding:11px 13px;
  display:flex;
  flex-direction:column;
  gap:4px;
  color:var(--text);
}

.pipeline-pill.active{
  border-color:#bfeef6;
  background:var(--soft);
}

.pipeline-pill span{
  font-weight:850;
}

.pipeline-pill small{
  color:var(--muted);
  font-size:12px;
}

.amo-board{
  height:calc(100vh - 245px);
  min-height:520px;
  display:flex;
  gap:14px;
  overflow-x:auto;
  padding-bottom:20px;
}

.amo-column{
  min-width:310px;
  max-width:310px;
  background:#f8fafc;
  border:1px solid var(--line);
  border-radius:20px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.amo-column.drag-over{
  border-color:#16b8d9;
  background:#eefcff;
}

.amo-column-head{
  padding:14px;
  border-bottom:1px solid var(--line);
  background:#fff;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.amo-column-head h3{
  margin:0;
  font-size:15px;
}

.amo-column-head p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:12px;
}

.amo-column-body{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  overflow-y:auto;
}

.amo-empty{
  border:1px dashed #d7dde5;
  border-radius:14px;
  padding:16px;
  color:var(--muted);
  text-align:center;
  font-size:13px;
}

.deal-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:13px;
  cursor:grab;
  box-shadow:0 10px 28px rgba(17,24,39,.04);
}

.deal-card.dragging{
  opacity:.5;
}

.deal-card b{
  display:block;
  margin-bottom:7px;
}

.deal-amount{
  font-weight:850;
  margin-bottom:6px;
}

.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(9,14,24,.42);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:3000;
  padding:24px;
}

.modal-backdrop.show{
  display:flex;
}

.modal-card{
  width:min(560px,100%);
  background:#fff;
  border-radius:22px;
  padding:18px;
  box-shadow:0 30px 90px rgba(0,0,0,.28);
}

.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px;
}

.modal-head h3{
  margin:0;
}

.modal-head button{
  width:34px;
  height:34px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  cursor:pointer;
}

.field.two{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.drag-dock{
  position:fixed;
  left:50%;
  bottom:28px;
  transform:translateX(-50%) translateY(120px);
  background:#101722;
  border:1px solid rgba(255,255,255,.12);
  border-radius:20px;
  padding:10px;
  display:flex;
  gap:8px;
  z-index:2500;
  box-shadow:0 20px 60px rgba(0,0,0,.28);
  transition:.2s ease;
  opacity:0;
  pointer-events:none;
}

.drag-dock.show{
  transform:translateX(-50%) translateY(0);
  opacity:1;
  pointer-events:auto;
}

.drag-dock button{
  border:0;
  border-radius:13px;
  background:rgba(255,255,255,.08);
  color:#fff;
  padding:11px 14px;
  font-weight:800;
  cursor:pointer;
}

.drag-dock button:hover{
  background:rgba(255,255,255,.14);
}

@media(max-width:900px){
  .amo-board{
    height:auto;
    min-height:0;
    flex-direction:column;
    overflow-x:visible;
  }

  .amo-column{
    min-width:0;
    max-width:none;
  }

  .field.two{
    grid-template-columns:1fr;
  }
}

/* REAL CORE SHELL SERVICE FRAME */
.service-frame-shell{
  width:100%;
  height:calc(100vh - 138px);
  min-height:560px;
  border:1px solid var(--line);
  border-radius:22px;
  overflow:hidden;
  background:#fff;
}

.service-frame{
  width:100%;
  height:100%;
  border:0;
  display:block;
  background:#f5f6f8;
}
