* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: #f6f7f9;
  color: #1a1a1a;
}
.screen { min-height: 100vh; }

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  width: 320px;
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.subtitle { color: #666; margin: 0 0 20px; font-size: 14px; }
.login-card input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}
.login-card button {
  width: 100%;
  padding: 10px;
  background: #1a1a1a;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.error { color: #c0392b; font-size: 13px; margin-top: 8px; min-height: 16px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: white;
  border-bottom: 1px solid #e5e5e5;
}
header h1 { font-size: 18px; margin: 0; }
header select, header button {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
  margin-left: 8px;
  font-size: 13px;
  cursor: pointer;
}

.cards {
  display: flex;
  gap: 16px;
  padding: 24px 32px 0;
  flex-wrap: wrap;
}
.card {
  background: white;
  border-radius: 10px;
  padding: 16px 20px;
  min-width: 180px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.card .label { font-size: 12px; color: #888; text-transform: uppercase; }
.card .value { font-size: 22px; font-weight: 600; margin-top: 4px; }

.table-wrap { padding: 24px 32px; }
.table-wrap h2 { font-size: 15px; color: #444; }
table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; font-size: 13px; border-bottom: 1px solid #eee; }
th { background: #fafafa; color: #666; font-weight: 600; }
tr:last-child td { border-bottom: none; }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: white;
  border-radius: 12px;
  padding: 24px 28px;
  width: 560px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; font-size: 18px; }
.icon-btn { background: none; border: none; font-size: 22px; cursor: pointer; color: #888; }
.modal h3 { font-size: 14px; margin: 20px 0 10px; color: #444; }

.apps-table { font-size: 12px; }
.apps-table code { background: #f2f2f2; padding: 2px 5px; border-radius: 4px; }
.apps-table button.deactivate {
  background: none; border: 1px solid #ddd; border-radius: 5px;
  padding: 4px 8px; font-size: 11px; cursor: pointer; color: #c0392b;
}

.add-app-form { display: flex; flex-direction: column; gap: 10px; }
.add-app-form label { font-size: 12px; color: #555; display: flex; flex-direction: column; gap: 4px; }
.add-app-form input {
  padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px;
}
.add-app-form button {
  margin-top: 6px; padding: 10px; background: #1a1a1a; color: white;
  border: none; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.hint { font-size: 12px; color: #666; min-height: 16px; }

.section-header { display: flex; align-items: center; gap: 12px; }
.section-header h2 { margin: 0; }
.small-btn {
  padding: 5px 10px; border-radius: 6px; border: 1px solid #ddd;
  background: white; font-size: 12px; cursor: pointer;
}

.trial-filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px;
}
.trial-filters label {
  font-size: 12px; color: #555; display: flex; flex-direction: column; gap: 4px;
}
.trial-filters input, .trial-filters select {
  padding: 7px 9px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px;
}
.trial-filters select[multiple] { min-width: 160px; }
#compare-table { min-width: 500px; }
#compare-table th:first-child, #compare-table td:first-child {
  text-align: left; white-space: nowrap; position: sticky; left: 0; background: white; z-index: 1;
}
#compare-table th:first-child { background: #fafafa; }
#compare-table th, #compare-table td { text-align: center; white-space: nowrap; }
.trial-filters button {
  padding: 8px 14px; background: #1a1a1a; color: white;
  border: none; border-radius: 6px; cursor: pointer; font-size: 13px; height: 34px;
}

.sub-lookup-form { display: flex; gap: 8px; margin-bottom: 12px; }
.sub-lookup-form input {
  flex: 1; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px;
}
.sub-lookup-form button {
  padding: 8px 14px; background: #1a1a1a; color: white;
  border: none; border-radius: 6px; cursor: pointer; font-size: 13px;
}
#sub-lookup-result .card { margin-bottom: 12px; max-width: 320px; }

.retention-scroll { overflow-x: auto; }
#retention-table { min-width: 700px; }
#retention-table th, #retention-table td { text-align: center; white-space: nowrap; }
#retention-table th:first-child, #retention-table td:first-child {
  text-align: left; position: sticky; left: 0; background: white; z-index: 1;
}
#retention-table th:first-child { background: #fafafa; }
.retention-cell { font-weight: 600; }
.retention-empty { color: #ccc; }
