
:root{
  --navy:#0d1930;
  --navy2:#101d35;
  --mag:#d9007f;
  --cyan:#00a9e0;
  --yellow:#f4c500;
  --green:#15713c;
  --red:#b42318;
  --ink:#1c2230;
  --muted:#6b7280;
  --bg:#f5f7fb;
  --line:#e4e8ef;
  --soft:#f8fafc;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:Arial,Helvetica,sans-serif;
  background:var(--bg);
  color:var(--ink);
}

/* SIDEBAR */
.side{
  position:fixed;
  inset:0 auto 0 0;
  width:245px;
  background:linear-gradient(180deg,#0b1730,#111827);
  padding:24px 18px;
  color:#fff;
  z-index:10;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:30px;
}

.mark{
  width:44px;
  height:44px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-weight:900;
  font-size:24px;
  background:linear-gradient(135deg,var(--mag),var(--cyan),var(--yellow));
  color:white;
}

.brand b{display:block;font-size:22px}
.brand span{display:block;font-size:11px;letter-spacing:2px;color:#cbd5e1}

nav a{
  display:block;
  color:#dbe3f0;
  text-decoration:none;
  padding:12px 14px;
  border-radius:10px;
  margin:5px 0;
}

nav a:hover,
nav a.active{
  background:#1f2a44;
  color:#fff;
}

.logout{
  position:absolute;
  bottom:20px;
  color:#fda4af;
  text-decoration:none;
}

/* MAIN */
.main{
  margin-left:245px;
  padding:28px 30px 50px;
  min-height:100vh;
}

header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin-bottom:24px;
}

h1{
  margin:0;
  font-size:30px;
  color:var(--navy);
}

header p{
  margin:5px 0 0;
  color:var(--muted);
}

.user{
  background:#fff;
  border:1px solid var(--line);
  padding:10px 14px;
  border-radius:12px;
  white-space:nowrap;
}

/* CARDS / DASHBOARD */
.grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}

.card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  box-shadow:0 8px 24px rgba(15,23,42,.035);
}

.metric{
  font-size:30px;
  font-weight:800;
  color:var(--navy);
}

.label{
  color:var(--muted);
  font-size:13px;
}

.section{margin-top:20px}
.section h2{font-size:18px}

/* BUTTONS */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--navy);
  color:#fff;
  text-decoration:none;
  border:0;
  border-radius:10px;
  padding:10px 14px;
  cursor:pointer;
  transition:.15s ease;
  font-weight:600;
  line-height:1;
  min-height:40px;
}

.btn:hover{filter:brightness(.97)}
.btn.mag{background:var(--mag)}
.btn.light{background:#fff;color:var(--navy);border:1px solid var(--line)}
.btn.danger{background:#fff;color:var(--red);border:1px solid #fecaca}
.btn.danger:hover{background:#fef2f2}
.btn.success-btn{background:var(--green);color:#fff}
.btn.success-btn:hover{background:#14532d}

.muted-action{
  color:#9ca3af;
  font-size:13px;
}

/* FORMS */
.form{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px;
  max-width:900px;
}

.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

label{
  font-size:13px;
  font-weight:700;
  color:#475569;
}

input,select,textarea{
  width:100%;
  padding:11px 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  margin:6px 0 14px;
  background:#fff;
  color:var(--ink);
  outline:none;
}

input:focus,select:focus,textarea:focus{
  border-color:var(--cyan);
  box-shadow:0 0 0 3px rgba(0,169,224,.10);
}

textarea{min-height:90px;resize:vertical}

.checks{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:8px;
  margin:8px 0 16px;
}

.checks label{
  font-weight:500;
  background:var(--soft);
  padding:10px;
  border-radius:9px;
}

.topbar{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:18px;
}

.topbar form{
  display:flex;
  gap:8px;
  flex:1;
}

.topbar input{
  margin:0;
}

/* TABLES */
table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  border-radius:14px;
  overflow:hidden;
}

th,td{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  text-align:left;
  font-size:14px;
  vertical-align:middle;
}

th{
  background:var(--soft);
  color:#475569;
}

tr:last-child td{border-bottom:none}

/* STATUS */
.badge{
  display:inline-block;
  padding:5px 9px;
  border-radius:999px;
  font-size:12px;
  background:#e8f7ef;
  color:#137a49;
}

.status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:96px;
  padding:7px 11px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}

.status-active{background:#dcfce7;color:#166534}
.status-suspended{background:#fef3c7;color:#92400e}
.status-revoked{background:#fee2e2;color:#991b1b}
.status-expired{background:#e5e7eb;color:#374151}

/* LICENSE LIST */
.license-list{
  display:grid;
  gap:14px;
}

.license-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) 285px;
  gap:24px;
  align-items:stretch;
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px 22px;
  box-shadow:0 7px 22px rgba(15,23,42,.035);
}

.license-card-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.license-serial{
  font-size:18px;
  font-weight:800;
  color:var(--navy);
  letter-spacing:.1px;
  margin-bottom:6px;
  word-break:break-word;
}

.license-client{
  font-size:16px;
  font-weight:700;
  color:#263244;
  margin-bottom:8px;
}

.license-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  color:var(--muted);
  font-size:13px;
  margin-bottom:13px;
}

.module-wrap{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.module-chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:7px 10px;
  background:#f7f9fc;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  color:#334155;
}

.module-chip::before{
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--mag);
  flex:none;
}

.module-chip:nth-child(2)::before{background:var(--cyan)}
.module-chip:nth-child(3)::before{background:var(--yellow)}
.module-chip:nth-child(4)::before{background:#111}

.module-chip small{
  color:#94a3b8;
  font-weight:600;
}

.license-card-side{
  border-left:1px solid var(--line);
  padding-left:22px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:10px;
}

.date-block{
  color:#64748b;
  font-size:12px;
  line-height:1.65;
}

.date-block b{
  color:#334155;
}

.trial-days{
  margin-top:4px;
  color:#b45309;
  font-weight:800;
}

.license-actions{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}

/* LICENSE DETAIL */
.detail-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px;
}

.back-link{
  color:var(--cyan);
  text-decoration:none;
  font-size:13px;
  font-weight:700;
}

.back-link:hover{text-decoration:underline}

.detail-serial{
  margin:8px 0 2px;
  font-size:26px;
  color:var(--navy);
  word-break:break-word;
}

.detail-sub{color:var(--muted)}

.detail-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.detail-section{margin-top:16px}

.card h3{
  margin:0 0 10px;
  color:var(--navy);
}

.kv{
  display:flex;
  justify-content:space-between;
  gap:20px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
  font-size:14px;
}

.kv:last-child{border-bottom:none}
.kv span{color:var(--muted)}
.kv b{text-align:right;color:var(--ink)}

/* LOGIN */
.login-wrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#0b1730,#111827);
}

.login{
  width:min(430px,92vw);
  background:#fff;
  border-radius:22px;
  padding:30px;
}

.login .logo{text-align:center;margin-bottom:20px}
.login .logo .mark{margin:auto}

.error{
  background:#fee2e2;
  color:#991b1b;
  padding:10px;
  border-radius:9px;
  margin-bottom:12px;
}

.success{
  background:#dcfce7;
  color:#166534;
  padding:12px;
  border-radius:10px;
  margin-bottom:14px;
}

/* RESPONSIVE */
@media(max-width:1100px){
  .license-card{grid-template-columns:1fr 245px}
}

@media(max-width:900px){
  .side{width:190px}
  .main{margin-left:190px}
  .grid{grid-template-columns:1fr 1fr}
  .row{grid-template-columns:1fr}
  .license-card{grid-template-columns:1fr}
  .license-card-side{
    border-left:0;
    border-top:1px solid var(--line);
    padding-left:0;
    padding-top:16px;
  }
  .detail-grid{grid-template-columns:1fr}
}

@media(max-width:700px){
  .side{
    position:relative;
    width:100%;
    height:auto;
  }

  .main{
    margin-left:0;
    padding:18px;
  }

  .grid{grid-template-columns:1fr}

  .topbar{
    flex-direction:column;
    align-items:stretch;
  }

  .topbar form{
    width:100%;
  }

  .detail-head{
    flex-direction:column;
  }

  table{
    display:block;
    overflow-x:auto;
    white-space:nowrap;
  }
}
