*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6fa;
  color: #1a1a2e;
}

#app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: #1a1a2e;
  color: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar .logo { font-weight: 700; font-size: 18px; letter-spacing: 0.5px; }
.topbar .logout-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.layout { display: flex; flex: 1; }

.sidebar {
  width: 200px;
  background: #fff;
  border-right: 1px solid #e8e8e8;
  padding: 16px 0;
  min-height: calc(100vh - 56px);
}
.sidebar a {
  display: block;
  padding: 10px 20px;
  color: #444;
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.sidebar a.router-link-active {
  color: #2563eb;
  border-left-color: #2563eb;
  background: #eff6ff;
  font-weight: 600;
}

.main { flex: 1; padding: 28px; overflow-y: auto; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 20px; }

.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  text-align: center;
}
.stat-card .value { font-size: 32px; font-weight: 700; color: #2563eb; }
.stat-card .label { font-size: 13px; color: #888; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 12px; border-bottom: 2px solid #e8e8e8; color: #666; font-weight: 600; }
td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
tr:hover td { background: #f9fafb; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-active   { background: #dcfce7; color: #166534; }
.badge-expiring { background: #fef9c3; color: #854d0e; }
.badge-expired  { background: #fee2e2; color: #991b1b; }
.badge-revoked  { background: #f3f4f6; color: #6b7280; }
.badge-platform { background: #eff6ff; color: #1d4ed8; }
.badge-vpn      { background: #f0fdf4; color: #15803d; }

.btn { padding: 8px 16px; border-radius: 7px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-primary   { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover  { background: #b91c1c; }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.btn-sm { padding: 5px 11px; font-size: 12px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus { border-color: #2563eb; }

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
}
.checkbox-grid label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; cursor: pointer; }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal h3 { font-size: 18px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.key-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 12px;
  font-family: monospace;
  font-size: 11px;
  word-break: break-all;
  margin-bottom: 8px;
}

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error   { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
}
.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 40px 36px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card h2 { text-align: center; margin-bottom: 8px; font-size: 22px; }
.login-card p  { text-align: center; color: #888; font-size: 13px; margin-bottom: 24px; }

.tab-bar { display: flex; gap: 4px; margin-bottom: 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.flex-gap { display: flex; gap: 10px; }
code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
