:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #222631;
  --border: #2d3142;
  --text: #e4e6eb;
  --text-muted: #8b8f9a;
  --primary: #6366f1;
  --primary-hover: #5558e0;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* --- Landing / Centered pages --- */
.center-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.upload-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.card.wide {
  max-width: 640px;
  text-align: left;
}

.card.inline-form {
  margin-bottom: 20px;
  padding: 24px;
  text-align: left;
}

.logo-icon {
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.logo-icon.error {
  color: var(--danger);
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.hint code {
  background: var(--bg);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 0.8rem;
  word-break: break-all;
}

.muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
}

input, textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.15s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

textarea {
  resize: vertical;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

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

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

/* --- Sender Info --- */
.sender-info {
  margin: 20px 0;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* --- Drop Zone --- */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.drop-zone svg {
  margin-bottom: 12px;
  opacity: 0.5;
}

.drop-zone .link-text {
  color: var(--primary);
  font-weight: 500;
}

/* --- File List --- */
.file-list {
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.file-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.file-name {
  flex: 1;
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--text-muted);
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.file-remove:hover {
  color: var(--danger);
}

/* --- Progress --- */
.upload-progress {
  margin-top: 20px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.2s;
  width: 0%;
}

/* --- Success / Error --- */
.success-message {
  text-align: center;
  padding: 30px;
  margin-top: 20px;
}

.success-message svg {
  color: var(--success);
  margin-bottom: 12px;
}

.error-message {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.875rem;
}

/* --- Admin --- */
.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 20px;
}

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

.admin-header h1 {
  font-size: 1.3rem;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-family: inherit;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

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

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* --- Data Table --- */
.data-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:hover td {
  background: var(--surface-hover);
}

td.actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.link-code {
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 4px;
  word-break: break-all;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge-used {
  background: rgba(139, 143, 154, 0.15);
  color: var(--text-muted);
}

.badge-expired {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.footer {
  margin-top: 24px;
  text-align: center;
}

.footer a {
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: color 0.15s;
}

.footer a:hover {
  color: var(--text);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .card {
    padding: 24px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .admin-container {
    padding: 20px 12px;
  }

  th, td {
    padding: 10px 8px;
    font-size: 0.8125rem;
  }
}
