
/* ==========================================================
   Koloni v4 - Planix Inspired UI
   Mat black, soft borders, coral/amber accents, no cyberpunk palette
   ========================================================== */

:root{
  --bg:#090A0B;
  --bg2:#0C0D0E;
  --sidebar:#050607;
  --panel:#111214;
  --panel2:#171819;
  --panel3:#1D1E20;
  --row:#0E0F10;
  --text:#F0EEE9;
  --text2:#D8D4CC;
  --muted:#8B8984;
  --muted2:#66645F;
  --border:#242628;
  --border2:#1B1D1F;
  --accent:#E87B6B;
  --accent2:#F0B85A;
  --green:#2FC978;
  --blue:#7F98C9;
  --danger:#D95F5C;
  --radius:18px;
  --radius-lg:24px;
  --shadow:0 18px 45px rgba(0,0,0,.34);
  --shadow-sm:0 10px 26px rgba(0,0,0,.22);
}

html[data-theme="light"]{
  --bg:#F4F1EC;
  --bg2:#ECE8E1;
  --sidebar:#F8F5EF;
  --panel:#FFFDF8;
  --panel2:#F6F2EA;
  --panel3:#ECE7DE;
  --row:#FBF8F1;
  --text:#1D1D1B;
  --text2:#2C2B28;
  --muted:#736F68;
  --muted2:#8E887E;
  --border:#D8D1C5;
  --border2:#E7E0D5;
  --accent:#C96558;
  --accent2:#B8833D;
  --green:#249E65;
  --blue:#667EA5;
  --danger:#B84E4B;
  --shadow:0 18px 45px rgba(55,48,40,.11);
  --shadow-sm:0 10px 26px rgba(55,48,40,.08);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  min-height:100vh;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 12% 4%, rgba(232,123,107,.045), transparent 18%),
    radial-gradient(circle at 78% 8%, rgba(240,184,90,.035), transparent 16%),
    linear-gradient(180deg,var(--bg) 0%,var(--bg2) 100%);
  line-height:1.45;
}
body.grid-bg::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.18;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.025) 1px, transparent 1px);
  background-size:32px 32px;
  mask-image:linear-gradient(180deg,rgba(0,0,0,.9),transparent 72%);
}
html[data-theme="light"] body.grid-bg::before{opacity:.22}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}
button{color:inherit}
::selection{background:rgba(232,123,107,.25)}

.shell{
  display:grid;
  grid-template-columns:252px minmax(0,1fr);
  min-height:100vh;
  position:relative;
  z-index:1;
}
.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  padding:18px 12px;
  background:var(--sidebar);
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
  gap:18px;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 8px 12px;
}
.brand .logo{
  width:42px;
  height:42px;
  border-radius:12px;
  display:grid;
  place-items:center;
  color:var(--text);
  background:linear-gradient(145deg,#0A0B0C,#202124);
  border:1px solid #3A3B3D;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.025), 0 10px 24px rgba(0,0,0,.35);
  font-weight:900;
}
html[data-theme="light"] .brand .logo{
  background:linear-gradient(145deg,#26231F,#3C3832);
  color:#F8F5EF;
}
.brand h1{
  margin:0;
  font-size:18px;
  font-weight:850;
  letter-spacing:-.02em;
  line-height:1.05;
}
.brand h1 span{color:var(--text)}
.brand small{
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:11px;
}
.nav-title{
  padding:0 11px;
  color:var(--muted2);
  text-transform:uppercase;
  font-size:10px;
  letter-spacing:.16em;
  font-weight:800;
}
.nav{
  display:grid;
  gap:5px;
}
.nav a{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:44px;
  padding:8px 10px;
  border-radius:13px;
  color:var(--muted);
  border:1px solid transparent;
  font-weight:650;
  transition:.18s ease;
}
.nav a:hover,
.nav a.active{
  color:var(--text);
  background:linear-gradient(135deg,rgba(232,123,107,.16),rgba(240,184,90,.055));
  border-color:rgba(232,123,107,.22);
}
.nav .ico{
  width:30px;
  height:30px;
  flex:0 0 auto;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:var(--panel2);
  border:1px solid var(--border);
  color:var(--text2);
  font-size:14px;
}
.chip{
  margin-left:auto;
  padding:3px 7px;
  border-radius:999px;
  font-size:10px;
  font-weight:850;
  color:var(--accent);
  border:1px solid rgba(232,123,107,.20);
  background:rgba(232,123,107,.10);
}
.chip.blue{
  color:var(--blue);
  border-color:rgba(127,152,201,.18);
  background:rgba(127,152,201,.10);
}
.chip.amber{
  color:var(--accent2);
  border-color:rgba(240,184,90,.18);
  background:rgba(240,184,90,.11);
}
.sidebar-card{
  margin-top:auto;
  border:1px solid var(--border);
  border-radius:18px;
  padding:15px;
  background:linear-gradient(180deg,rgba(232,123,107,.08),rgba(17,18,20,.96));
  box-shadow:var(--shadow-sm);
}
html[data-theme="light"] .sidebar-card{
  background:linear-gradient(180deg,rgba(232,123,107,.10),rgba(255,253,248,.96));
}
.sidebar-card h3{
  margin:0 0 8px;
  font-size:15px;
}
.sidebar-card p{
  margin:0 0 14px;
  color:var(--muted);
  font-size:12px;
}

.main{
  min-width:0;
  padding:14px 18px 28px;
}
.topbar{
  min-height:54px;
  padding:0 0 14px;
  border-bottom:1px solid var(--border2);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.topbar-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.search{
  height:38px;
  min-width:300px;
  display:flex;
  align-items:center;
  gap:9px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--muted);
}
.search input{
  flex:1;
  min-width:0;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
}
.search .kbd{
  padding:3px 7px;
  border-radius:8px;
  border:1px solid var(--border);
  color:var(--muted2);
  font-size:11px;
}
.topbar-right{
  display:flex;
  align-items:center;
  gap:9px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.menu-toggle,.theme-toggle,.icon-btn{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--panel);
  color:var(--muted);
  cursor:pointer;
}
.user-pill{
  display:flex;
  align-items:center;
  gap:10px;
  padding:5px 10px 5px 5px;
  min-height:38px;
  border-radius:13px;
  background:var(--panel);
  border:1px solid var(--border);
}
.avatar{
  width:32px;
  height:32px;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:#1A1410;
  background:#CDB38B;
  border:1px solid rgba(255,255,255,.15);
  font-weight:850;
  font-size:12px;
}
.user-pill strong{
  display:block;
  font-size:13px;
  line-height:1.1;
}
.user-pill small{
  display:block;
  color:var(--muted);
  font-size:11px;
}

.profile-stack{
  display:flex;
  flex-direction:column;
  gap:7px;
}
.upgrade-mini{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:245px;
  padding:8px 11px;
  border-radius:13px;
  background:linear-gradient(135deg,rgba(232,123,107,.16),rgba(240,184,90,.065));
  border:1px solid rgba(232,123,107,.26);
}
.upgrade-mini .left{display:flex;flex-direction:column;gap:1px}
.upgrade-mini strong{
  font-size:12px;
  line-height:1.1;
}
.upgrade-mini span span,
.upgrade-mini .left > span{
  color:var(--muted);
  font-size:10.5px;
  font-weight:700;
}
.upgrade-mini b{
  min-width:32px;
  height:30px;
  padding:0 8px;
  border-radius:9px;
  display:grid;
  place-items:center;
  color:#1B1510;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  font-size:10px;
}
.topbar-user{align-items:flex-start}

.content{
  display:grid;
  gap:16px;
  padding-top:18px;
}
.hero{
  padding:20px;
  border-radius:18px;
  background:var(--panel);
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
}
.hero h2{
  margin:0 0 8px;
  font-size:27px;
  line-height:1.08;
  letter-spacing:-.03em;
}
.hero p{
  margin:0;
  color:var(--muted);
  max-width:760px;
}
.pill-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}
.pill,.tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:26px;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--panel2);
  color:var(--muted);
  font-size:11px;
  font-weight:750;
}
.tag.success{
  color:var(--green);
  background:rgba(47,201,120,.10);
  border-color:rgba(47,201,120,.17);
}
.tag.warn{
  color:var(--accent2);
  background:rgba(240,184,90,.11);
  border-color:rgba(240,184,90,.17);
}
.tag.danger{
  color:var(--danger);
  background:rgba(217,95,92,.11);
  border-color:rgba(217,95,92,.17);
}

.btn,.btn-soft,.btn-ghost{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:0;
  cursor:pointer;
  text-decoration:none;
  transition:.18s ease;
  font-weight:800;
}
.btn{
  min-height:38px;
  padding:9px 15px;
  border-radius:10px;
  color:#1C1410;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  box-shadow:0 12px 22px rgba(232,123,107,.13);
}
.btn-soft,.btn-ghost{
  min-height:36px;
  padding:8px 12px;
  border-radius:10px;
  color:var(--text);
  background:var(--panel2);
  border:1px solid var(--border);
}
.btn:hover,.btn-soft:hover{transform:translateY(-1px)}

.stat-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.stat-card,.panel,.auth-card,.auth-hero{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow-sm);
}
.stat-card{
  padding:18px;
}
.stat-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.stat-label{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.stat-value{
  margin-top:8px;
  color:var(--text);
  font-size:28px;
  font-weight:850;
  letter-spacing:-.03em;
}
.stat-meta{
  margin-top:9px;
  color:var(--muted);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  font-size:11px;
}
.stat-icon,.circle-ico{
  width:42px;
  height:42px;
  border-radius:12px;
  display:grid;
  place-items:center;
  color:var(--accent2);
  background:linear-gradient(145deg,#171819,#22201D);
  border:1px solid rgba(240,184,90,.16);
}
html[data-theme="light"] .stat-icon,
html[data-theme="light"] .circle-ico{
  background:linear-gradient(145deg,#F1ECE4,#E7DFD2);
}
.spark{
  width:100%;
  height:46px;
  margin-top:14px;
}
.spark path{
  stroke:var(--accent)!important;
}
.spark path[stroke-opacity]{
  stroke:var(--accent)!important;
  opacity:.22;
}

.grid-3{
  display:grid;
  grid-template-columns:1.2fr 1.2fr .9fr;
  gap:14px;
}
.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
.panel{
  overflow:hidden;
}
.panel-head{
  padding:17px 17px 0;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.panel-head h3{
  margin:0;
  color:var(--text);
  font-size:18px;
  letter-spacing:-.02em;
}
.panel-head p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:12px;
}
.panel-body{
  padding:17px;
}

.category-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.category-card,.mini-card{
  padding:13px;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--row);
}
.category-card .top,.list-row,.wallet-line,.metric-row,.setting-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.category-card .title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
}
.muted{color:var(--muted)!important}
.small{font-size:12px}

.list{
  display:grid;
  gap:9px;
}
.list-row{
  padding:12px 13px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--row);
}
.list-row strong{
  display:block;
  color:var(--text);
}
.list-row small{
  display:block;
  margin-top:2px;
  color:var(--muted);
}

.wallet-card{display:grid;gap:14px}
.wallet-visual{
  position:relative;
  overflow:hidden;
  height:112px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,rgba(232,123,107,.13),rgba(240,184,90,.07));
  border:1px solid var(--border);
}
.wallet-visual .orb{
  position:absolute;
  border-radius:50%;
  filter:blur(14px);
  opacity:.55;
}
.wallet-visual .orb.one{
  width:130px;height:130px;left:12px;top:-18px;background:rgba(232,123,107,.13)
}
.wallet-visual .orb.two{
  width:150px;height:150px;right:-22px;bottom:-50px;background:rgba(240,184,90,.11)
}
.wallet-visual h4{
  position:relative;
  z-index:1;
  margin:0;
  color:var(--text);
  font-size:25px;
}
.wallet-line{
  padding:9px 0;
  border-bottom:1px solid var(--border2);
}
.wallet-line:last-child{border-bottom:0}

.chart-box{
  height:260px;
  padding:8px 8px 0;
}
.chart-box svg path[stroke^="url"],
.chart-box svg path[stroke="#"],
.chart-box svg path[stroke]{
  stroke:var(--accent)!important;
}
.chart-box svg path[fill^="url"]{
  fill:rgba(232,123,107,.18)!important;
}
.chart-box svg circle{
  fill:var(--accent2)!important;
}

.kpi-strip{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
}
.kpi{
  padding:13px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--row);
}
.kpi strong{
  display:block;
  margin-top:3px;
  color:var(--text);
  font-size:18px;
}

.table-wrap{
  overflow:auto;
  padding:0 17px 17px;
}
.table{
  width:100%;
  min-width:720px;
  border-collapse:separate;
  border-spacing:0 9px;
}
.table th{
  color:var(--muted);
  text-align:left;
  padding:0 13px 6px;
  font-size:11px;
}
.table td{
  padding:12px 13px;
  background:var(--row);
  border-top:1px solid var(--border);
  border-bottom:1px solid var(--border);
}
.table td:first-child{
  border-left:1px solid var(--border);
  border-radius:13px 0 0 13px;
}
.table td:last-child{
  border-right:1px solid var(--border);
  border-radius:0 13px 13px 0;
}

.form{display:grid;gap:13px}
.form.two{grid-template-columns:1fr 1fr}
label{
  display:grid;
  gap:7px;
  color:var(--text);
  font-size:12px;
  font-weight:750;
}
input,select,textarea{
  width:100%;
  min-height:44px;
  padding:0 12px;
  border-radius:11px;
  border:1px solid var(--border);
  outline:0;
  background:var(--row);
  color:var(--text);
}
textarea{
  min-height:118px;
  padding:12px;
  resize:vertical;
}
input:focus,select:focus,textarea:focus{
  border-color:rgba(232,123,107,.35);
  box-shadow:0 0 0 3px rgba(232,123,107,.08);
}
.note{
  padding:13px 14px;
  border-radius:13px;
  border:1px solid var(--border);
  background:rgba(232,123,107,.055);
  color:var(--muted);
  font-size:12px;
}

/* Auth */
.auth-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
}
.auth-wrap{
  width:min(1080px,100%);
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:18px;
}
.auth-hero,.auth-card{
  border-radius:22px;
  background:var(--panel);
  border:1px solid var(--border);
  box-shadow:var(--shadow);
}
.auth-hero{
  padding:30px;
  background:linear-gradient(135deg,rgba(232,123,107,.10),rgba(17,18,20,.97));
}
html[data-theme="light"] .auth-hero{
  background:linear-gradient(135deg,rgba(232,123,107,.11),rgba(255,253,248,.96));
}
.auth-hero h2{
  margin:0 0 12px;
  font-size:40px;
  letter-spacing:-.04em;
  line-height:1.05;
}
.auth-hero p{margin:0;color:var(--muted)}
.auth-points{
  display:grid;
  gap:10px;
  margin-top:26px;
}
.auth-points .point{
  display:flex;
  gap:11px;
  align-items:center;
  padding:13px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--row);
}
.auth-card{padding:26px}
.auth-card .top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}
.auth-card h3{
  margin:0;
  font-size:26px;
  letter-spacing:-.03em;
}
.auth-card p{
  margin:8px 0 0;
  color:var(--muted);
}
.auth-links{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* Right-panel feel for package/card pages */
.bottom-nav{display:none}
.overlay{display:none}

@media (max-width:1180px){
  .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid-3{grid-template-columns:1fr}
  .grid-2,.form.two,.kpi-strip{grid-template-columns:1fr}
}
@media (max-width:900px){
  .shell{grid-template-columns:1fr}
  .sidebar{
    position:fixed;
    z-index:80;
    left:0;top:0;bottom:0;
    width:252px;
    transform:translateX(-105%);
    transition:.22s ease;
  }
  .sidebar.open{transform:translateX(0)}
  .overlay{
    position:fixed;inset:0;
    background:rgba(0,0,0,.55);
    z-index:70;
  }
  .overlay.show{display:block}
  .main{padding:12px 12px 80px}
  .topbar{
    align-items:flex-start;
    flex-wrap:wrap;
  }
  .topbar-left,.topbar-right{width:100%}
  .search{min-width:0;flex:1}
  .topbar-user{width:100%}
  .profile-stack{width:100%}
  .upgrade-mini{width:100%;min-width:0}
  .category-grid{grid-template-columns:1fr}
  .hero{flex-direction:column}
  .bottom-nav{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    position:fixed;
    left:0;right:0;bottom:0;
    z-index:60;
    background:var(--sidebar);
    border-top:1px solid var(--border);
  }
  .bottom-nav a{
    display:grid;
    place-items:center;
    gap:3px;
    padding:9px 3px;
    color:var(--muted);
    font-size:10px;
    font-weight:800;
  }
  .bottom-nav a.active{color:var(--accent)}
  .bottom-nav b{font-size:17px}
}
@media (max-width:680px){
  .hero h2{font-size:23px}
  .stat-grid{grid-template-columns:1fr}
  .auth-wrap{grid-template-columns:1fr}
  .auth-hero h2{font-size:31px}
}
