@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Manrope:wght@400;600;800&display=swap');

:root {
  --c-bg: #ffffff;
  --c-fg: #000000;
  --f-ui: 'Manrope', sans-serif;
  --f-mono: 'JetBrains Mono', monospace;
  --border-width: 2px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--c-bg);
  color: var(--c-fg);
  font-family: var(--f-ui);
  min-height: 100vh;
  background-image: radial-gradient(#000 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ================= Layout ================= */
.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: var(--border-width) solid var(--c-fg);
}

.logo {
  font-family: var(--f-mono);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -1px;
}

/* ================= Stats ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  border: var(--border-width) solid var(--c-fg);
  padding: 24px;
  background: var(--c-bg);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0 var(--c-fg);
}

.stat-label {
  font-family: var(--f-mono);
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.stat-value {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
}

/* ================= Table ================= */
.table-container {
  border: var(--border-width) solid var(--c-fg);
  background: var(--c-bg);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: var(--border-width) solid var(--c-fg);
  background: #f0f0f0;
  font-family: var(--f-mono);
  font-size: 12px;
}

.search-box {
  display: flex;
  gap: 8px;
}

.search-box input {
  width: 250px;
  height: 36px;
  border: 1px solid #ccc;
  padding: 0 12px;
  font-family: var(--f-mono);
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  font-family: var(--f-mono);
  font-size: 12px;
  text-align: left;
  padding: 16px 20px;
  border-bottom: var(--border-width) solid var(--c-fg);
  background: #f8f8f8;
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
}

/* ================= Badge ================= */
.badge {
  display: inline-block;
  padding: 4px 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.badge-active {
  color: #22c55e;
  background: #f0fdf4;
}

.badge-expired {
  color: #ef4444;
  background: #fef2f2;
}

/* ================= Elements ================= */
.btn {
  height: 40px;
  padding: 0 24px;
  border: var(--border-width) solid var(--c-fg);
  background: var(--c-bg);
  font-family: var(--f-mono);
  font-weight: bold;
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn:hover {
  background: #f0f0f0;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--c-fg);
  color: var(--c-bg);
}

.btn-primary:hover {
  background: #333;
}

.input-seamless {
  width: 100%;
  border: none;
  border-bottom: 1px dashed #ccc;
  background: transparent;
  font-family: var(--f-mono);
  font-size: 14px;
  padding: 8px 0;
  outline: none;
  color: var(--c-fg);
  transition: all 0.2s;
}

.input-seamless:focus {
  border-bottom: 2px solid var(--c-fg);
  background: rgba(0,0,0,0.02);
  padding-left: 8px;
}

/* ================= Modals ================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--c-bg);
  border: var(--border-width) solid var(--c-fg);
  padding: 32px;
  width: 100%;
  max-width: 500px;
  box-shadow: 8px 8px 0 var(--c-fg);
}

.hidden {
  display: none !important;
}

/* ================= Mobile ================= */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  .table-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .search-box {
    width: 100%;
    flex-wrap: wrap;
  }
  
  .search-box input {
    width: 100%;
  }
  
  table, thead, tbody, th, td, tr {
    display: block;
  }
  
  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  tr {
    border: 2px solid var(--c-fg);
    margin-bottom: 20px;
  }
  
  td {
    position: relative;
    padding-left: 50%;
    text-align: right;
    border-bottom: 1px solid #eee;
  }
  
  td:before {
    position: absolute;
    left: 12px;
    content: attr(data-label);
    font-family: var(--f-mono);
    font-weight: bold;
    font-size: 12px;
  }
}
