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

:root {
  --primary: #0066cc;
  --primary-dark: #004a99;
  --secondary: #666;
  --danger: #cc0000;
  --success: #00cc66;
  --bg: #f5f5f5;
  --border: #ddd;
  --text: #333;
}

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

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen.hidden {
  display: none;
}

/* Profiles Screen */
.profiles-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.profiles-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 40px;
  max-width: 500px;
  width: 100%;
}

.profiles-card h1 {
  font-size: 28px;
  margin-bottom: 10px;
  color: var(--text);
}

.profiles-card .subtitle {
  color: var(--secondary);
  margin-bottom: 30px;
  font-size: 14px;
}

.profiles-list {
  margin-bottom: 20px;
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 10px;
  background: #fafafa;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-weight: 600;
  font-size: 14px;
}

.profile-username {
  font-size: 12px;
  color: var(--secondary);
}

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

.profiles-empty {
  text-align: center;
  color: var(--secondary);
  padding: 30px 0;
}

.profiles-footer {
  display: flex;
  gap: 10px;
}

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

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-small {
  max-width: 400px;
}

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

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

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--secondary);
}

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

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

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

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

.optional {
  color: var(--secondary);
  font-weight: normal;
  font-size: 12px;
}

/* Buttons */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

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

.btn-secondary {
  background: #e0e0e0;
  color: var(--text);
}

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

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

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

.btn-block {
  width: 100%;
}

/* Dashboard */
header {
  background: white;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-left h1 {
  font-size: 24px;
}

.user-badge {
  background: #e3f2fd;
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.container {
  flex: 1;
  padding: 40px 20px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.export-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 40px;
}

.export-card h2 {
  font-size: 22px;
  margin-bottom: 10px;
}

.export-card p {
  color: var(--secondary);
  margin-bottom: 30px;
}

/* Messages */
.error-msg,
.success-msg,
.status-msg {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 14px;
}

.error-msg {
  background: #ffebee;
  color: var(--danger);
  border: 1px solid #ef5350;
}

.success-msg {
  background: #e8f5e9;
  color: var(--success);
  border: 1px solid #4caf50;
}

.status-msg {
  background: #e3f2fd;
  color: var(--primary);
  border: 1px solid #2196f3;
}

.hidden {
  display: none !important;
}
