:root{
  --bg:#08111f;
  --bg-soft:#101a2d;
  --panel:rgba(15,23,42,0.58);
  --panel-strong:rgba(15,23,42,0.78);
  --panel-light:rgba(255,255,255,0.08);
  --line:rgba(255,255,255,0.12);
  --text:#e5eefc;
  --muted:#9fb0cd;
  --heading:#ffffff;
  --accent:#5eead4;
  --accent-strong:#38bdf8;
  --accent-warm:#f59e0b;
  --danger:#fb7185;
  --success:#34d399;
  --shadow:0 24px 80px rgba(0,0,0,0.35);
  --radius-lg:28px;
  --radius-md:20px;
  --radius-sm:14px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  font-family:'Manrope', 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56,189,248,0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(94,234,212,0.16), transparent 24%),
    linear-gradient(160deg, #060b16 0%, #0b1221 48%, #111a2d 100%);
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size:32px 32px;
  mask-image:linear-gradient(to bottom, rgba(0,0,0,0.38), transparent 75%);
}

a{color:inherit}
img{display:block;max-width:100%}

.wrapper{
  display:flex;
  min-height:100vh;
  position:relative;
}

.sidebar{
  width:290px;
  padding:28px 18px;
  border-right:1px solid var(--line);
  background:rgba(8,13,24,0.68);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
  position:sticky;
  top:0;
  height:100vh;
}

.ide-logo{
  display:flex;
  align-items:center;
  gap:14px;
  padding:16px;
  margin-bottom:20px;
  border-radius:24px;
  background:linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  border:1px solid rgba(255,255,255,0.12);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.08);
}

.brand-logo{
  width:64px;
  height:64px;
  object-fit:contain;
  border-radius:18px;
  padding:10px;
  background:rgba(255,255,255,0.9);
}

.sidebar h2{
  margin:0;
  font-size:20px;
  line-height:1.2;
  color:var(--heading);
}

.sidebar a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  margin:8px 0;
  border:1px solid transparent;
  border-radius:18px;
  color:var(--muted);
  text-decoration:none;
  transition:all .18s ease;
}

.sidebar a .icon{
  width:20px;
  text-align:center;
}

.sidebar a:hover,
.sidebar a.active{
  color:var(--heading);
  border-color:rgba(94,234,212,0.18);
  background:linear-gradient(135deg, rgba(94,234,212,0.12), rgba(56,189,248,0.12));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.08), 0 12px 32px rgba(0,0,0,0.16);
}

.content{
  flex:1;
  padding:28px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:24px;
  padding:18px 22px;
  border-radius:24px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.07);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  box-shadow:var(--shadow);
}

.topbar strong{
  color:var(--heading);
  font-size:20px;
  font-weight:800;
  letter-spacing:-0.02em;
}

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

.sidebar-toggle{
  display:none;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,0.08);
  color:var(--heading);
  cursor:pointer;
}

.grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:20px;
  margin-bottom:20px;
}

.card{
  position:relative;
  padding:24px;
  border-radius:var(--radius-lg);
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.card::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(135deg, rgba(255,255,255,0.1), transparent 36%);
}

.card > *{
  position:relative;
  z-index:1;
}

.card h3{
  margin:0 0 8px;
  font-size:20px;
  color:var(--heading);
  letter-spacing:-0.02em;
}

.card p{
  margin:0;
  color:var(--muted);
}

.card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}

.actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 16px;
  border:1px solid transparent;
  border-radius:16px;
  background:linear-gradient(135deg, var(--accent-strong), var(--accent));
  color:#04111d;
  text-decoration:none;
  font-weight:800;
  cursor:pointer;
  transition:transform .16s ease, box-shadow .16s ease, opacity .16s ease;
  box-shadow:0 14px 34px rgba(56,189,248,0.2);
}

.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 18px 40px rgba(56,189,248,0.28);
}

.btn-muted,
.btn.secondary{
  background:rgba(255,255,255,0.08);
  border-color:var(--line);
  color:var(--heading);
  box-shadow:none;
}

.btn-danger{
  background:linear-gradient(135deg, #fb7185, #ef4444);
  color:#fff;
  box-shadow:0 14px 34px rgba(239,68,68,0.18);
}

.btn-ghost{
  background:transparent;
  border-color:var(--line);
  color:var(--heading);
  box-shadow:none;
}

.stat{
  display:flex;
  align-items:center;
  gap:14px;
}

.stat .icon{
  width:58px;
  height:58px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#04111d;
  background:linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow:0 12px 30px rgba(56,189,248,0.24);
}

.stat .meta .value{
  font-size:24px;
  font-weight:800;
  color:var(--heading);
}

table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}

table thead th{
  padding:0 14px 8px;
  text-align:left;
  color:#c8d7ef;
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
}

table tbody tr{
  background:rgba(6,11,22,0.42);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.05);
}

table tbody td{
  padding:14px;
  color:var(--text);
  vertical-align:middle;
}

table tbody tr td:first-child{
  border-radius:16px 0 0 16px;
}

table tbody tr td:last-child{
  border-radius:0 16px 16px 0;
}

input,
select,
textarea{
  width:100%;
  padding:12px 14px;
  margin-bottom:14px;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:16px;
  background:rgba(255,255,255,0.08);
  color:var(--text);
  outline:none;
}

input::placeholder,
textarea::placeholder{
  color:#9fb0cd;
}

input:focus,
select:focus,
textarea:focus{
  border-color:rgba(94,234,212,0.55);
  box-shadow:0 0 0 4px rgba(94,234,212,0.12);
}

label{
  display:block;
  margin-bottom:8px;
  font-size:13px;
  font-weight:700;
  color:#d8e4f7;
}

code{
  display:inline-block;
  padding:6px 10px;
  border-radius:12px;
  background:rgba(255,255,255,0.08);
  color:#d7f7f2;
}

hr{
  border:none;
  border-top:1px solid var(--line);
  margin:20px 0;
}

.modal-backdrop{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(2,6,23,0.6);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  z-index:60;
}

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

.modal{
  width:760px;
  max-width:100%;
  max-height:calc(100vh - 40px);
  overflow:auto;
  padding:24px;
  border-radius:28px;
  border:1px solid rgba(255,255,255,0.14);
  background:linear-gradient(180deg, rgba(15,23,42,0.88), rgba(8,13,24,0.94));
  box-shadow:var(--shadow);
}

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

.modal-header h3{
  margin:0;
}

.close-btn{
  width:40px;
  height:40px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,0.08);
  color:var(--heading);
  font-size:22px;
  cursor:pointer;
}

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

.catalog-delete-btn{
  position:absolute;
  top:10px;
  right:10px;
  padding:8px 10px;
  border-radius:12px;
  font-size:12px;
}

.footer{
  padding:20px;
  text-align:center;
  color:var(--muted);
  font-size:13px;
}

.panel-row{
  display:grid;
  grid-template-columns:repeat(12, minmax(0,1fr));
  gap:18px;
}

.panel-row > *{
  grid-column:span 12;
}

.notice{
  margin-bottom:18px;
  padding:14px 16px;
  border-radius:18px;
  border:1px solid;
  font-weight:700;
}

.notice-success{
  color:#c7ffe8;
  border-color:rgba(52,211,153,0.3);
  background:rgba(52,211,153,0.12);
}

.notice-error{
  color:#ffe1e7;
  border-color:rgba(251,113,133,0.35);
  background:rgba(251,113,133,0.12);
}

.toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}

.toolbar .search{
  min-width:220px;
  padding:0;
  background:transparent;
  box-shadow:none;
}

.table-wrap{
  overflow:auto;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  color:#dffdf8;
  background:rgba(94,234,212,0.1);
  border:1px solid rgba(94,234,212,0.18);
  font-size:12px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}

@media (max-width: 1024px){
  .sidebar{
    position:fixed;
    left:-310px;
    z-index:80;
    transition:left .2s ease;
  }
  .sidebar.open{
    left:0;
  }
  .content{
    padding:18px;
    width:100%;
  }
  .sidebar-toggle{
    display:inline-flex;
  }
  .grid{
    grid-template-columns:1fr;
  }
}

@media (max-width: 768px){
  .content{
    padding:14px;
  }
  .topbar{
    padding:16px;
    border-radius:20px;
    flex-direction:column;
    align-items:flex-start;
  }
  .card{
    padding:18px;
    border-radius:22px;
  }
  .card-header,
  .toolbar,
  .actions{
    flex-direction:column;
    align-items:stretch;
  }
  .btn{
    width:100%;
  }
  table{
    min-width:620px;
  }
  .modal{
    padding:18px;
    border-radius:22px;
  }
}
