:root{
  --bg:#08090b;
  --bg-2:#0b0c0f;
  --glass:rgba(18,20,24,.72);
  --glass-strong:rgba(20,22,27,.88);
  --panel:#111318;
  --panel-2:#15181d;
  --panel-3:#0d0f12;
  --line:rgba(255,255,255,.085);
  --line-soft:rgba(255,255,255,.055);
  --line-gold:rgba(228,181,68,.24);
  --gold:#e4b544;
  --gold-2:#f3c95e;
  --gold-3:#c99b32;
  --gold-soft:rgba(228,181,68,.11);
  --gold-glow:rgba(228,181,68,.18);
  --text:#f5f5f7;
  --text-2:#d7d9de;
  --muted:#858c99;
  --muted-2:#a1a7b2;
  --danger:#ff9a9a;
  --success:#8ee1ad;
  --radius-xl:26px;
  --radius-lg:20px;
  --radius-md:14px;
  --shadow:0 24px 70px rgba(0,0,0,.34);
  --ease:cubic-bezier(.22,1,.36,1);
}

*{box-sizing:border-box}
html{min-height:100%;background:var(--bg)}
body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  font:14px -apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",Inter,Arial,Helvetica,sans-serif;
  letter-spacing:-.01em;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  background:
    radial-gradient(900px 420px at 50% -10%,rgba(228,181,68,.055),transparent 66%),
    radial-gradient(700px 500px at 100% 100%,rgba(228,181,68,.018),transparent 65%),
    linear-gradient(180deg,#08090b 0%,#090a0d 100%);
}
body:before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:-1;
  opacity:.16;
  background-image:radial-gradient(rgba(255,255,255,.22) .45px,transparent .45px);
  background-size:5px 5px;
  mask-image:linear-gradient(to bottom,black,transparent 78%);
}
button,input,textarea,select{font:inherit}
button,a,.btn{transition:background .24s var(--ease),border-color .24s var(--ease),color .24s var(--ease),box-shadow .24s var(--ease),transform .24s var(--ease),opacity .24s var(--ease)}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid rgba(228,181,68,.78);outline-offset:3px}

/* =========================================================
   IOS-INSPIRED ADMIN SHELL
========================================================= */
.layout{display:flex;min-height:100vh}
.side{
  position:fixed;
  inset:16px auto 16px 16px;
  width:248px;
  padding:16px 12px 12px;
  overflow:auto;
  background:linear-gradient(180deg,rgba(22,24,29,.82),rgba(13,15,19,.82));
  border:1px solid var(--line);
  border-radius:26px;
  box-shadow:0 24px 70px rgba(0,0,0,.42),0 1px 0 rgba(255,255,255,.04) inset,0 0 0 1px rgba(0,0,0,.28);
  backdrop-filter:blur(28px) saturate(145%);
  -webkit-backdrop-filter:blur(28px) saturate(145%);
  z-index:20;
}
.side::-webkit-scrollbar{width:0}
.brand{
  display:flex;
  align-items:center;
  gap:11px;
  min-height:48px;
  padding:2px 10px 15px;
  color:#fff;
  font-size:15px;
  font-weight:750;
  letter-spacing:-.02em;
}
.brand:before{
  content:'KMH';
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  flex:0 0 34px;
  border-radius:11px;
  background:linear-gradient(145deg,#f4cf69 0%,#e4b544 58%,#c79228 100%);
  color:#191307;
  font-size:10px;
  font-weight:900;
  box-shadow:0 8px 22px rgba(228,181,68,.16),0 1px 0 rgba(255,255,255,.42) inset;
}
.side a{
  position:relative;
  display:flex;
  align-items:center;
  gap:11px;
  min-height:44px;
  margin:3px 0;
  padding:0 12px;
  border:1px solid transparent;
  border-radius:14px;
  color:#9299a5;
  text-decoration:none;
  font-size:13px;
  font-weight:520;
}
.side a:before{
  width:19px;
  flex:0 0 19px;
  display:grid;
  place-items:center;
  color:#737b88;
  font-size:12px;
  opacity:.9;
}
.side a[href="index.php"]:before{content:'⌂'}
.side a[href="subscribers.php"]:before{content:'◉'}
.side a[href="notifications.php"]:before{content:'◌'}
.side a[href="create.php"]:before{content:'＋'}
.side a[href="settings.php"]:before{content:'⚙'}
.side a[href="logout.php"]:before{content:'↪'}
.side a:hover{
  color:#f7f7f8;
  background:rgba(255,255,255,.045);
  border-color:rgba(255,255,255,.055);
  transform:translateX(1px);
}
.side a:hover:before{color:var(--gold-2)}
.side a[href="index.php"]{
  color:#fff;
  background:linear-gradient(90deg,rgba(228,181,68,.13),rgba(228,181,68,.045));
  border-color:rgba(228,181,68,.13);
  box-shadow:0 7px 22px rgba(0,0,0,.13),0 1px 0 rgba(255,255,255,.025) inset;
}
.side a[href="index.php"]:after{
  content:"";
  position:absolute;
  left:4px;
  width:3px;
  height:18px;
  border-radius:99px;
  background:var(--gold);
  box-shadow:0 0 14px rgba(228,181,68,.45);
}
.side a[href="logout.php"]{margin-top:18px;color:#777f8c}

.main{
  width:calc(100% - 280px);
  margin-left:280px;
  padding:24px 28px 40px;
  min-width:0;
}
.top{
  position:sticky;
  top:14px;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:68px;
  margin-bottom:18px;
  padding:12px 16px;
  background:rgba(12,14,17,.62);
  border:1px solid var(--line-soft);
  border-radius:20px;
  box-shadow:0 14px 38px rgba(0,0,0,.18),0 1px 0 rgba(255,255,255,.025) inset;
  backdrop-filter:blur(24px) saturate(140%);
  -webkit-backdrop-filter:blur(24px) saturate(140%);
}
.top h1{margin:0;font-size:24px;font-weight:720;letter-spacing:-.035em}
.top .muted{font-size:12px;color:var(--muted-2)}

/* =========================================================
   CARDS / DASHBOARD
========================================================= */
.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.card{
  position:relative;
  overflow:hidden;
  background:linear-gradient(180deg,rgba(20,22,27,.82),rgba(14,16,20,.78));
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  padding:20px;
  margin-bottom:16px;
  box-shadow:var(--shadow),0 1px 0 rgba(255,255,255,.035) inset;
  backdrop-filter:blur(20px) saturate(135%);
  -webkit-backdrop-filter:blur(20px) saturate(135%);
}
.card:before{
  content:"";
  position:absolute;
  left:20px;
  right:20px;
  top:0;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(228,181,68,.42),transparent);
  opacity:.75;
  pointer-events:none;
}
.card:after{
  content:"";
  position:absolute;
  width:150px;
  height:150px;
  right:-90px;
  top:-100px;
  border-radius:50%;
  background:rgba(228,181,68,.045);
  filter:blur(28px);
  pointer-events:none;
}
.card h3{margin:0 0 8px;font-size:15px;font-weight:700;letter-spacing:-.02em}
.metric{font-size:34px;font-weight:760;line-height:1.05;margin-top:9px;color:#fff;letter-spacing:-.055em}
.muted{color:var(--muted)}
code{
  padding:3px 6px;
  border-radius:7px;
  background:rgba(0,0,0,.25);
  color:#d9b75b;
  border:1px solid var(--line-soft);
}

/* =========================================================
   BUTTONS
========================================================= */
.btn,button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:12px;
  background:linear-gradient(180deg,#f3ca61 0%,#e4b544 100%);
  color:#171207;
  padding:9px 16px;
  cursor:pointer;
  font-weight:750;
  text-decoration:none;
  box-shadow:0 8px 22px rgba(228,181,68,.12),0 1px 0 rgba(255,255,255,.35) inset;
}
.btn:hover,button:hover{
  background:linear-gradient(180deg,#f7d273 0%,#e8b94b 100%);
  box-shadow:0 11px 28px rgba(228,181,68,.19),0 1px 0 rgba(255,255,255,.45) inset;
  transform:translateY(-1px);
}
.btn:active,button:active{transform:scale(.985)}

/* =========================================================
   TABLES
========================================================= */
.wrap{overflow:auto}
.table{width:100%;border-collapse:separate;border-spacing:0;min-width:720px}
.table th,.table td{
  text-align:left;
  padding:13px 12px;
  border-bottom:1px solid var(--line-soft);
  white-space:nowrap;
}
.table th{
  color:#8f97a3;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.table td{color:#e4e6ea;font-size:13px}
.table tr:last-child td{border-bottom:0}
.table tbody tr:hover td,.table tr:hover td{background:rgba(255,255,255,.018)}
.table td:first-child,.table th:first-child{padding-left:6px}

/* =========================================================
   FORMS
========================================================= */
.form{display:grid;gap:15px}
.form label{display:grid;gap:7px;color:#aeb5c0;font-size:12px;font-weight:520}
.form input,.form textarea,.form select{
  width:100%;
  min-height:42px;
  background:rgba(7,9,12,.55);
  color:#f5f5f7;
  border:1px solid rgba(255,255,255,.11);
  border-radius:12px;
  padding:10px 12px;
  outline:none;
  box-shadow:0 1px 0 rgba(255,255,255,.025) inset;
}
.form input::placeholder,.form textarea::placeholder{color:#626b79}
.form input:focus,.form textarea:focus,.form select:focus{
  border-color:rgba(228,181,68,.72);
  box-shadow:0 0 0 4px rgba(228,181,68,.075),0 1px 0 rgba(255,255,255,.04) inset;
}
.form textarea{min-height:130px;resize:vertical}
.ok{color:var(--success)}
.err{color:var(--danger)}

/* =========================================================
   LOGIN / AUTH — PREMIUM GLASS
========================================================= */
.auth{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  overflow:hidden;
  position:relative;
  background:
    radial-gradient(520px 330px at 50% 48%,rgba(228,181,68,.052),transparent 68%),
    radial-gradient(700px 400px at 50% -15%,rgba(255,255,255,.025),transparent 70%),
    #08090b;
}
.auth:before,.auth:after{
  content:"";
  position:absolute;
  border-radius:50%;
  pointer-events:none;
  filter:blur(70px);
}
.auth:before{width:260px;height:260px;top:17%;left:18%;background:rgba(228,181,68,.035)}
.auth:after{width:300px;height:300px;right:15%;bottom:10%;background:rgba(255,255,255,.018)}
.authbox{
  position:relative;
  z-index:1;
  width:min(390px,92vw);
  padding:30px 28px 24px;
  background:linear-gradient(180deg,rgba(20,22,27,.86),rgba(13,15,18,.84));
  border:1px solid rgba(255,255,255,.10);
  border-radius:26px;
  box-shadow:0 32px 90px rgba(0,0,0,.52),0 1px 0 rgba(255,255,255,.055) inset,0 0 0 1px rgba(0,0,0,.25);
  backdrop-filter:blur(32px) saturate(150%);
  -webkit-backdrop-filter:blur(32px) saturate(150%);
}
.authbox:before{
  content:"";
  position:absolute;
  left:28px;
  right:28px;
  top:0;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(228,181,68,.62),transparent);
}
.authhead{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:24px;
}
.authlogo{
  display:grid;
  place-items:center;
  flex:0 0 38px;
  width:38px;
  height:38px;
  border-radius:12px;
  background:linear-gradient(145deg,#f5cf6a 0%,#e4b544 58%,#c79228 100%);
  color:#171207;
  font-size:10px;
  font-weight:900;
  box-shadow:0 9px 24px rgba(228,181,68,.17),0 1px 0 rgba(255,255,255,.48) inset;
}
.authcopy h1{
  margin:0 0 4px;
  color:#f5f5f7;
  font-size:17px;
  line-height:1.1;
  font-weight:720;
  letter-spacing:-.025em;
}
.authcopy p{
  margin:0;
  color:#7f8794;
  font-size:11px;
  line-height:1.4;
}
.authbox label{
  display:grid;
  gap:7px;
  margin:0 0 14px;
  color:#aeb6c2;
  font-size:11px;
  font-weight:520;
}
.authbox input{
  width:100%;
  height:43px;
  padding:0 13px;
  background:rgba(10,12,15,.56);
  color:#f2f3f5;
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  outline:none;
  font-size:12px;
  box-shadow:0 1px 0 rgba(255,255,255,.025) inset;
}
.authbox input::placeholder{color:#657080}
.authbox input:focus{
  border-color:rgba(228,181,68,.76);
  box-shadow:0 0 0 4px rgba(228,181,68,.075),0 1px 0 rgba(255,255,255,.035) inset;
}
.authbox button{
  width:100%;
  height:43px;
  min-height:43px;
  margin-top:2px;
  border-radius:12px;
  font-size:12px;
  font-weight:800;
}
.authnote{
  margin:16px 3px 0;
  color:#697382;
  font-size:10px;
  line-height:1.5;
  text-align:center;
}
.authbox .err{
  margin:-7px 0 14px;
  padding:9px 10px;
  border:1px solid rgba(255,120,120,.20);
  border-radius:11px;
  background:rgba(255,80,80,.055);
  font-size:11px;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media(max-width:1100px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .layout{display:block}
  .side{
    position:sticky;
    inset:auto;
    top:10px;
    width:calc(100% - 20px);
    height:auto;
    max-height:none;
    margin:10px;
    padding:10px;
    border-radius:20px;
    display:flex;
    align-items:center;
    gap:6px;
    overflow-x:auto;
    overflow-y:hidden;
    z-index:30;
  }
  .brand{padding:2px 8px;min-height:40px;flex:0 0 auto}
  .brand:before{width:31px;height:31px;flex-basis:31px;border-radius:10px}
  .side a{min-height:40px;margin:0;padding:0 11px;flex:0 0 auto;border-radius:12px;white-space:nowrap}
  .side a:before{width:auto;flex-basis:auto}
  .side a[href="logout.php"]{margin-top:0}
  .side a[href="index.php"]:after{display:none}
  .main{margin:0;width:100%;padding:10px 14px 30px}
  .top{position:relative;top:auto;min-height:62px;margin-bottom:14px}
}
@media(max-width:520px){
  .grid{grid-template-columns:1fr}
  .top{padding:11px 13px;border-radius:17px}
  .top h1{font-size:21px}
  .card{padding:16px;border-radius:18px}
  .auth{padding:16px}
  .authbox{padding:28px 22px 23px;border-radius:23px}
}
@media(prefers-reduced-motion:reduce){
  *,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}
}
