/* ===== DESIGN SYSTEM — eDistrict License Manager ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Primary Brand */
  --primary:        #1E40AF;
  --primary-light:  #3B82F6;
  --primary-dark:   #1E3A8A;
  --primary-glow:   rgba(59,130,246,0.18);

  /* Status Colors */
  --success:        #16A34A;
  --success-bg:     #DCFCE7;
  --warning:        #D97706;
  --warning-bg:     #FEF3C7;
  --danger:         #DC2626;
  --danger-bg:      #FEE2E2;
  --muted:          #6B7280;
  --muted-bg:       #F3F4F6;
  --info:           #0891B2;
  --info-bg:        #CFFAFE;
  --purple:         #7C3AED;
  --purple-bg:      #EDE9FE;

  /* Neutrals */
  --white:          #FFFFFF;
  --surface:        #F1F5F9;
  --surface-card:   #FFFFFF;
  --border:         #E2E8F0;
  --border-strong:  #CBD5E1;
  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;

  /* Sidebar */
  --sidebar-bg:     #0F172A;
  --sidebar-hover:  rgba(255,255,255,0.07);
  --sidebar-active: rgba(59,130,246,0.2);
  --sidebar-accent: #3B82F6;
  --sidebar-text:   #94A3B8;
  --sidebar-text-active: #F1F5F9;

  /* Dimensions */
  --sidebar-w:      260px;
  --sidebar-w-collapsed: 70px;
  --header-h:       64px;
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow:         0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg:      0 10px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-modal:   0 20px 60px rgba(0,0,0,0.25);

  /* Transitions */
  --transition:     all 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.35s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---- Typography ---- */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem;  font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
p  { color: var(--text-secondary); }
a  { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Utilities ---- */
.flex   { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-6  { gap: 1.5rem; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.text-sm  { font-size: 0.8rem; }
.text-xs  { font-size: 0.72rem; }
.text-lg  { font-size: 1.1rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary-color { color: var(--primary-light); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.opacity-0 { opacity: 0; }
.relative { position: relative; }

/* ---- Card ---- */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(30,64,175,0.3);
}
.btn-primary:hover { background: var(--primary-light); box-shadow: 0 4px 16px rgba(59,130,246,0.4); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(220,38,38,0.25);
}
.btn-danger:hover { background: #b91c1c; }

.btn-warning {
  background: var(--warning);
  color: var(--white);
}
.btn-warning:hover { background: #b45309; }

.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-success:hover { background: #15803d; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--text-primary); }

.btn-sm { padding: 0.38rem 0.8rem; font-size: 0.75rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 0.95rem; }
.btn-icon { padding: 0.5rem; width: 2.2rem; height: 2.2rem; justify-content: center; }

/* ---- Status Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-active   { background: var(--success-bg); color: var(--success); }
.badge-expired  { background: var(--danger-bg);  color: var(--danger); }
.badge-notactivated { background: var(--muted-bg); color: var(--muted); }
.badge-suspended { background: var(--warning-bg); color: var(--warning); }
.badge-revoked  { background: var(--purple-bg);  color: var(--purple); }
.badge-bound    { background: var(--info-bg);    color: var(--info); }
.badge-unbound  { background: var(--muted-bg);   color: var(--muted); }

/* ---- Forms ---- */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.1rem; }
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.form-control {
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-card);
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ---- Divider ---- */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.page-header h2 { color: var(--text-primary); }
.page-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ---- Section ---- */
.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ---- Animations ---- */
@keyframes fadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }
@keyframes slideDown { from { opacity:0; transform: translateY(-10px); } to { opacity:1; transform: translateY(0); } }
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:.5; } }
@keyframes spin { to { transform: rotate(360deg); } }

.animate-fade { animation: fadeIn 0.3s ease forwards; }
.animate-slide-right { animation: slideInRight 0.3s ease forwards; }

/* ---- Skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- Empty State ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
  gap: 0.75rem;
}
.empty-state .empty-icon { font-size: 3.5rem; opacity: 0.4; }
.empty-state h3 { color: var(--text-secondary); font-size: 1rem; font-weight: 600; }
.empty-state p { font-size: 0.85rem; }

/* ---- Error State ---- */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem;
  text-align: center;
  gap: 0.75rem;
  color: var(--danger);
}

/* ---- Info Box ---- */
.info-box {
  background: var(--info-bg);
  border: 1px solid #a5f3fc;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--info);
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  line-height: 1.5;
}

/* ---- Colors ---- */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.1rem; }
  .card { padding: 1rem; }
}
@media (max-width: 480px) {
  .btn { padding: 0.5rem 0.9rem; }
  .btn-lg { padding: 0.6rem 1.25rem; }
}
