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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.subtitle {
  margin-top: 6px;
  color: #86868b;
  font-size: 0.95rem;
}

.card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.toolbar-info {
  margin-left: auto;
  color: #86868b;
  font-size: 0.875rem;
}

.table-card {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

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

thead {
  background: #fafafa;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.875rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

th {
  color: #86868b;
  font-weight: 600;
}

tbody tr:hover {
  background: rgba(0, 122, 255, 0.03);
}

.col-check {
  width: 44px;
}

.col-no {
  width: 56px;
  color: #86868b;
}

.empty-row td {
  text-align: center;
  color: #86868b;
  padding: 48px 16px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 980px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-primary {
  background: #007aff;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #0071e3;
}

.btn-secondary {
  background: #e8e8ed;
  color: #1d1d1f;
}

.btn-secondary:hover:not(:disabled) {
  background: #d2d2d7;
}

.btn-danger {
  background: #ff3b30;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #e0352b;
}

.btn-link {
  background: transparent;
  color: #007aff;
  padding: 4px 8px;
  border-radius: 8px;
}

.btn-link:hover {
  background: rgba(0, 122, 255, 0.08);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 980px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-outlook {
  background: #e8f1ff;
  color: #007aff;
}

.badge-rambler {
  background: #fff0e8;
  color: #ff6b00;
}

.link-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-text {
  color: #007aff;
  text-decoration: none;
  word-break: break-all;
}

.link-text:hover {
  text-decoration: underline;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #007aff;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.modal h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.modal p {
  color: #515154;
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  padding: 12px 20px;
  border-radius: 980px;
  font-size: 0.875rem;
  z-index: 200;
  max-width: 90vw;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e8e8ed;
  border-top-color: #007aff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .toolbar-info {
    margin-left: 0;
    width: 100%;
  }
}
