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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

header h1 {
  color: #1a73e8;
  font-size: 24px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-primary {
  background: #1a73e8;
  color: white;
}

.btn-primary:hover {
  background: #1557b0;
}

.btn-secondary {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background: #f5f5f5;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

/* Login */
.login-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.login-box h2 {
  margin-bottom: 20px;
  color: #333;
}

.login-box input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 16px;
}

.login-box input:focus {
  outline: none;
  border-color: #1a73e8;
}

.login-box .btn {
  width: 100%;
}

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

.stat-card {
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 600;
  color: #1a73e8;
}

.stat-label {
  color: #666;
  font-size: 14px;
  margin-top: 4px;
}

/* Table */
.table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  overflow: hidden;
}

.table-container h2 {
  padding: 20px;
  border-bottom: 1px solid #eee;
  font-size: 18px;
}

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

th, td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: #fafafa;
  font-weight: 600;
  color: #555;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

tr:hover {
  background: #fafafa;
}

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

.opens-badge.opened {
  background: #e6f4ea;
  color: #137333;
}

.opens-badge.not-opened {
  background: #f1f3f4;
  color: #5f6368;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: #666;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  font-size: 18px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

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

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.detail-row {
  margin-bottom: 16px;
}

.detail-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 14px;
  color: #333;
}

.opens-list {
  margin-top: 20px;
}

.opens-list h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: #333;
}

.open-item {
  padding: 12px;
  background: #fafafa;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 13px;
}

.open-item-time {
  font-weight: 600;
  color: #1a73e8;
}

.open-item-details {
  color: #666;
  margin-top: 4px;
  font-size: 12px;
  word-break: break-all;
}

/* Links */
.links-list {
  margin-top: 24px;
  border-top: 1px solid #eee;
  padding-top: 16px;
}

.links-list h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: #333;
}

.link-item {
  padding: 12px;
  background: #fafafa;
  border-radius: 4px;
  margin-bottom: 8px;
}

.link-url {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.link-url a {
  color: #1a73e8;
  text-decoration: none;
  font-size: 13px;
  word-break: break-all;
}

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

.click-count {
  background: #e8f0fe;
  color: #1a73e8;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.click-details {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.click-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  padding: 4px 0;
}

.click-time {
  color: #333;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  th, td {
    padding: 10px;
  }

  .hide-mobile {
    display: none;
  }
}
