*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --black:#0a0a0a;--white:#fff;--grey-50:#f8f8f7;--grey-100:#f0efed;
  --grey-200:#e4e2de;--grey-300:#c9c6c0;--grey-500:#8a8680;--grey-700:#4a4740;
  --blue:#2563eb;--blue-light:#eff6ff;--blue-dark:#1d4ed8;
  --red:#dc2626;--red-light:#fef2f2;--green:#059669;--green-light:#f0fdf4;
  --font-sans:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --font-mono:'DM Mono','Fira Mono',monospace;
  --radius:8px;--radius-lg:12px;--shadow:0 1px 3px rgba(0,0,0,0.08);
}
html{-webkit-font-smoothing:antialiased;font-size:16px;}
body{font-family:var(--font-sans);color:var(--black);background:var(--grey-50);line-height:1.6;}
a{color:var(--blue);text-decoration:none;}
a:hover{text-decoration:underline;}

/* Auth layout */
.auth-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;}
.auth-card{width:100%;max-width:420px;background:var(--white);border:1px solid var(--grey-200);border-radius:var(--radius-lg);overflow:hidden;box-shadow:var(--shadow);}
.auth-header{padding:28px 32px;border-bottom:1px solid var(--grey-200);display:flex;align-items:center;gap:10px;}
.auth-logo-mark{width:28px;height:28px;border-radius:50%;background:var(--grey-100);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.auth-logo-mark svg{width:15px;height:15px;}
.auth-wordmark{font-size:15px;font-weight:500;letter-spacing:-0.02em;color:var(--black);}
.auth-body{padding:32px;}
.auth-title{font-size:20px;font-weight:500;letter-spacing:-0.02em;color:var(--black);margin-bottom:6px;}
.auth-sub{font-size:14px;color:var(--grey-500);margin-bottom:28px;}
.auth-footer{padding:16px 32px;background:var(--grey-50);border-top:1px solid var(--grey-200);font-size:13px;color:var(--grey-500);text-align:center;}

/* Form elements */
.form-group{margin-bottom:18px;}
label{display:block;font-size:13px;font-weight:500;color:var(--grey-700);margin-bottom:6px;}
input[type=text],input[type=email],input[type=password],input[type=url],select,textarea{
  width:100%;padding:9px 12px;border:1px solid var(--grey-200);border-radius:var(--radius);
  font-size:14px;font-family:var(--font-sans);color:var(--black);background:var(--white);
  transition:border-color 0.15s;outline:none;
}
input:focus,select:focus,textarea:focus{border-color:var(--blue);}
input.error{border-color:var(--red);}
.field-error{font-size:12px;color:var(--red);margin-top:4px;}
.field-hint{font-size:12px;color:var(--grey-500);margin-top:4px;}
.password-wrap{position:relative;}
.password-wrap input{padding-right:40px;}
.pw-toggle{position:absolute;right:10px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;color:var(--grey-500);padding:2px;}

/* Password strength */
.pw-strength{margin-top:8px;}
.pw-bar{height:3px;border-radius:2px;background:var(--grey-200);margin-bottom:6px;overflow:hidden;}
.pw-bar-fill{height:100%;border-radius:2px;transition:width 0.3s,background 0.3s;}
.pw-rules{display:grid;grid-template-columns:1fr 1fr;gap:4px;}
.pw-rule{font-size:11px;color:var(--grey-500);display:flex;align-items:center;gap:4px;}
.pw-rule.ok{color:var(--green);}
.pw-rule::before{content:'○';font-size:10px;}
.pw-rule.ok::before{content:'●';}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-family:var(--font-sans);font-size:14px;font-weight:500;padding:9px 18px;border-radius:var(--radius);cursor:pointer;border:none;transition:all 0.15s;text-decoration:none;white-space:nowrap;}
.btn-primary{background:var(--black);color:var(--white);width:100%;padding:10px;}
.btn-primary:hover{background:#1a1a1a;}
.btn-primary:disabled{background:var(--grey-300);cursor:not-allowed;}
.btn-secondary{background:var(--white);color:var(--black);border:1px solid var(--grey-200);}
.btn-secondary:hover{background:var(--grey-50);border-color:var(--grey-300);}
.btn-danger{background:var(--red-light);color:var(--red);border:1px solid #fecaca;}
.btn-danger:hover{background:#fee2e2;}
.btn-sm{font-size:13px;padding:6px 12px;}
.btn-blue{background:var(--blue);color:var(--white);}
.btn-blue:hover{background:var(--blue-dark);}

/* Alerts */
.alert{padding:12px 16px;border-radius:var(--radius);font-size:14px;margin-bottom:20px;display:none;}
.alert.show{display:block;}
.alert-error{background:var(--red-light);color:var(--red);border:1px solid #fecaca;}
.alert-success{background:var(--green-light);color:var(--green);border:1px solid #bbf7d0;}
.alert-info{background:var(--blue-light);color:var(--blue-dark);border:1px solid #bfdbfe;}

/* Dashboard layout */
.dash-wrap{display:flex;min-height:100vh;}
.dash-sidebar{width:240px;background:var(--white);border-right:1px solid var(--grey-200);flex-shrink:0;display:flex;flex-direction:column;}
.dash-sidebar-header{padding:20px 24px;border-bottom:1px solid var(--grey-200);display:flex;align-items:center;gap:8px;}
.dash-logo-mark{width:26px;height:26px;border-radius:50%;background:var(--grey-100);display:flex;align-items:center;justify-content:center;}
.dash-logo-mark svg{width:14px;height:14px;}
.dash-wordmark{font-size:14px;font-weight:500;letter-spacing:-0.02em;}
.dash-nav{padding:16px 12px;flex:1;}
.dash-nav-section{font-size:10px;font-weight:500;color:var(--grey-300);letter-spacing:0.08em;text-transform:uppercase;padding:0 12px;margin-bottom:6px;margin-top:16px;}
.dash-nav-section:first-child{margin-top:0;}
.dash-nav a{display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:var(--radius);font-size:14px;color:var(--grey-700);text-decoration:none;transition:all 0.12s;margin-bottom:2px;}
.dash-nav a:hover{background:var(--grey-50);color:var(--black);}
.dash-nav a.active{background:var(--grey-100);color:var(--black);font-weight:500;}
.dash-nav a svg{width:16px;height:16px;flex-shrink:0;}
.dash-sidebar-footer{padding:16px 24px;border-top:1px solid var(--grey-200);}
.dash-user-info{font-size:13px;color:var(--grey-700);margin-bottom:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dash-main{flex:1;display:flex;flex-direction:column;min-width:0;}
.dash-topbar{padding:16px 32px;border-bottom:1px solid var(--grey-200);background:var(--white);display:flex;align-items:center;justify-content:space-between;}
.dash-page-title{font-size:16px;font-weight:500;letter-spacing:-0.01em;}
.dash-content{padding:32px;flex:1;}

/* Cards */
.card{background:var(--white);border:1px solid var(--grey-200);border-radius:var(--radius-lg);overflow:hidden;margin-bottom:24px;}
.card-header{padding:20px 24px;border-bottom:1px solid var(--grey-200);}
.card-title{font-size:15px;font-weight:500;letter-spacing:-0.01em;}
.card-sub{font-size:13px;color:var(--grey-500);margin-top:2px;}
.card-body{padding:24px;}
.card-footer{padding:16px 24px;background:var(--grey-50);border-top:1px solid var(--grey-200);display:flex;align-items:center;justify-content:space-between;}

/* Stats */
.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:24px;}
.stat-card{background:var(--white);border:1px solid var(--grey-200);border-radius:var(--radius-lg);padding:20px 24px;}
.stat-label{font-size:12px;color:var(--grey-500);margin-bottom:6px;font-weight:500;letter-spacing:0.02em;}
.stat-value{font-size:28px;font-weight:300;letter-spacing:-0.03em;color:var(--black);}
.stat-meta{font-size:12px;color:var(--grey-500);margin-top:4px;}

/* License key display */
.license-key{font-family:var(--font-mono);font-size:13px;background:var(--grey-50);border:1px solid var(--grey-200);border-radius:var(--radius);padding:10px 14px;display:flex;align-items:center;justify-content:space-between;gap:12px;word-break:break-all;}
.license-key-text{color:var(--grey-700);}
.copy-btn{background:none;border:none;cursor:pointer;color:var(--grey-500);flex-shrink:0;padding:2px;transition:color 0.12s;}
.copy-btn:hover{color:var(--black);}

/* Table */
table{width:100%;border-collapse:collapse;}
th{font-size:11px;font-weight:500;color:var(--grey-500);letter-spacing:0.06em;text-transform:uppercase;padding:10px 16px;text-align:left;border-bottom:1px solid var(--grey-200);}
td{font-size:14px;padding:12px 16px;border-bottom:1px solid var(--grey-100);color:var(--grey-700);}
tr:last-child td{border-bottom:none;}
tr:hover td{background:var(--grey-50);}

/* Badge */
.badge{display:inline-flex;align-items:center;font-size:11px;font-weight:500;padding:2px 8px;border-radius:20px;font-family:var(--font-mono);letter-spacing:0.02em;}
.badge-green{background:#dcfce7;color:#15803d;}
.badge-blue{background:var(--blue-light);color:var(--blue-dark);}
.badge-grey{background:var(--grey-100);color:var(--grey-700);}

/* Credits bar */
.credits-bar-wrap{margin-top:12px;}
.credits-bar-track{height:6px;background:var(--grey-100);border-radius:3px;overflow:hidden;}
.credits-bar-fill{height:100%;border-radius:3px;background:var(--blue);transition:width 0.5s;}
.credits-bar-fill.low{background:#f59e0b;}
.credits-bar-fill.critical{background:var(--red);}
.credits-bar-labels{display:flex;justify-content:space-between;font-size:11px;color:var(--grey-500);margin-top:4px;}

/* Divider */
.divider{height:1px;background:var(--grey-200);margin:24px 0;}

/* Spinner */
.spinner{display:inline-block;width:14px;height:14px;border:2px solid rgba(255,255,255,0.3);border-top-color:#fff;border-radius:50%;animation:spin 0.6s linear infinite;}
@keyframes spin{to{transform:rotate(360deg);}}

/* Responsive */
@media(max-width:768px){
  .dash-sidebar{display:none;}
  .dash-content{padding:20px;}
  .stats-grid{grid-template-columns:1fr;}
}
