/* GENERAL STYLES & RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: #0b0f19;
  background-image: 
    radial-gradient(at 0% 0%, rgba(30, 41, 150, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(20, 80, 200, 0.1) 0px, transparent 50%);
  color: #f1f5f9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* TYPOGRAPHY */
h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff;
}

h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #38bdf8;
}

p.subtitle {
  color: #94a3b8;
  font-size: 14px;
}

.text-center { text-align: center; }
.color-error { color: #f43f5e !important; }

/* CONTAINERS */
.panel-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

#login-container {
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* LOGIN CARD */
.login-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.logo-area {
  text-align: center;
  margin-bottom: 8px;
}

.logo-area h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-area h2 {
  font-size: 16px;
  font-weight: 600;
  color: #38bdf8;
  margin-top: 4px;
  margin-bottom: 0;
}

.login-card .subtitle {
  text-align: center;
  margin-bottom: 30px;
}

/* HEADER */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 30px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo h1 {
  font-weight: 800;
  letter-spacing: 1px;
}

.badge {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 14px;
  color: #cbd5e1;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 24px;
  backdrop-filter: blur(8px);
}

.stat-card h3 {
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 10px;
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: #ffffff;
}

/* LAYOUT GRID */
.layout-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 30px;
  align-items: start;
}

@media (max-width: 1024px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: rgba(30, 41, 59, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

/* FORMS */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input, 
.form-group select {
  width: 100%;
  height: 44px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #ffffff;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.form-group input:focus, 
.form-group select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.row-inline {
  display: flex;
  gap: 10px;
}

.flex-grow { flex-grow: 1; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #fda4af;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-danger:hover {
  background: #f43f5e;
  color: #ffffff;
}

.btn-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-warning:hover {
  background: #f59e0b;
  color: #ffffff;
}

.btn-align {
  margin-top: 20px;
  height: 44px;
}

.btn-block {
  width: 100%;
}

/* TABLES */
.table-section {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.table-scroll {
  overflow-x: auto;
  flex-grow: 1;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #f1f5f9 !important;
}

.data-table td code {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.data-table th {
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* BADGES FOR STATUS */
.status-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-used {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-expired {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-revoked {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* MESSAGES */
.error-text {
  color: #f43f5e;
  font-size: 13px;
  margin-bottom: 15px;
  font-weight: 500;
}

.success-text {
  color: #10b981;
  font-size: 13px;
  margin-bottom: 15px;
  font-weight: 500;
}

/* MODAL DIALOG */
dialog {
  margin: auto;
  border: none;
  background: transparent;
  outline: none;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
}

.modal-content {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  width: 480px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h2 {
  margin-bottom: 0;
  font-size: 20px;
  color: #ffffff;
}

.btn-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: #ffffff;
}

.modal-body {
  padding: 30px;
}

.modal-body svg {
  background: #ffffff;
  padding: 10px;
  border-radius: 8px;
  max-width: 100%;
}

.barcode-key-text {
  margin-top: 15px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
}

.barcode-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* PRINTING MEDIA INSTRUCTION */
@media print {
  body * {
    visibility: hidden;
  }
  
  dialog, dialog::backdrop {
    position: absolute;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff !important;
    backdrop-filter: none !important;
  }

  .modal-content {
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    width: 100% !important;
    height: 100% !important;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .modal-header, .modal-footer, .barcode-hint {
    display: none !important;
  }

  .modal-body {
    visibility: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .modal-body * {
    visibility: visible;
  }

  svg {
    background: transparent !important;
    padding: 0 !important;
    width: 80% !important;
    height: auto !important;
  }

  .barcode-key-text {
    color: #000000 !important;
    font-size: 24px !important;
    margin-top: 20px !important;
  }
}

/* NAV TABS styling */
.nav-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  outline: none;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* PRIVACY LINK */
.privacy-link {
  color: #64748b;
  font-size: 12px;
  text-decoration: none;
  transition: color 0.2s;
}

.privacy-link:hover {
  color: #38bdf8;
}
