:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --accent: #f59e0b;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--bg);
  position: relative;
  overflow-x: hidden;
}

/* Views System */
.view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Login View */
#view-login {
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 24px;
  color: var(--text-main);
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-muted);
}

.login-form {
  background: var(--card-bg);
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-form .input-group label {
  font-weight: 600;
}

.login-btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px !important;
  font-size: 16px !important;
}

.login-tip {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  line-height: 1.6;
}

/* Common App Header */
.app-header {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  padding: 24px 20px 48px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  flex-shrink: 0;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.app-header p {
  font-size: 13px;
  opacity: 0.9;
}

.btn-text {
  background: none;
  border: none;
  color: white;
  font-size: 14px;
  opacity: 0.9;
  cursor: pointer;
  padding: 4px 8px;
}
.btn-text:hover { opacity: 1; }

.btn-icon {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-content {
  padding: 0 20px 40px;
  margin-top: -24px;
  flex: 1;
}

.mt-4 { margin-top: -24px; }

/* Lists & Dashboards */
.search-bar {
  margin-bottom: 20px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  box-shadow: var(--shadow);
}

.search-bar input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary);
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.list-header h3 {
  font-size: 16px;
  color: var(--text-main);
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.card-item:hover {
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.card-item-info h4 {
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.card-item-info p {
  font-size: 13px;
  color: var(--text-muted);
}

.card-item-action {
  color: var(--primary);
  font-size: 20px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* Forms */
.form-group-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.grid-2-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.grid-2-col .input-group {
  margin-bottom: 0;
}

.form-group-card h3, .form-group-card h4 {
  margin-bottom: 16px;
  color: var(--primary);
  display: flex;
  align-items: center;
}
.form-group-card h3 { font-size: 16px; }
.form-group-card h4 { font-size: 15px; }

.form-group-card h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--primary);
  margin-right: 8px;
  border-radius: 2px;
}

.input-group {
  margin-bottom: 16px;
}
.input-group:last-child { margin-bottom: 0; }

.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 8px;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: #fafafa;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.highlight-input {
  background: #f0fdf4;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #bbf7d0;
}
.highlight-input label {
  color: #166534;
}

/* Dynamic Zone Form Styles */
.zone-card {
  border: 1px solid var(--border);
  background-color: #f8fafc; /* slightly different tint */
  margin-bottom: 16px;
  box-shadow: none;
}
.zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.zone-grid {
  display: flex;
  gap: 12px;
}
.zone-grid > .input-group {
  flex: 1;
}
.zone-sub-section {
  background: #ffffff;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 12px;
}
.zone-sub-section:last-child {
  margin-bottom: 0;
}
.zone-sub-section h5 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}


/* Media Upload */
.requirements-card {
  background: #f0fdf4;
  border-left: 4px solid var(--success);
}
.requirements-card h3 { color: var(--success); }
.requirements-card h3::before { display: none; }

.upload-zone {
  border: 2px dashed #93c5fd;
  background: #eff6ff;
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.upload-zone:hover {
  background: #e0f2fe;
  border-color: var(--primary);
}
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone p { color: var(--primary); font-weight: 500; font-size: 14px; }
.hide-input {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.preview-container { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.preview-item {
  position: relative; width: calc(33.333% - 8px); aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #e2e8f0;
}
.preview-item img, .preview-item video {
  width: 100%; height: 100%; object-fit: cover;
}
.preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: all 0.2s;
  z-index: 10;
}
.preview-remove:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: scale(1.1);
}

/* Actions */
.form-actions { display: flex; gap: 12px; margin-top: 24px; margin-bottom: 40px; }
.btn-primary, .btn-small {
  border: none; border-radius: var(--radius); font-weight: 600; cursor: pointer; transition: transform 0.1s, opacity 0.2s;
  background: var(--primary); color: white;
}
.btn-primary { padding: 14px 24px; font-size: 16px; flex: 1; box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3); }
.btn-small { padding: 8px 16px; font-size: 13px; box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2); }
.btn-primary:active, .btn-small:active { transform: scale(0.98); }

/* Animations */
.fade-in { animation: fadeIn 0.3s ease-out forwards; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* User Management Specifics */
.focus-card {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  background: white;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.checkbox-item {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
  transform: scale(1.2);
  cursor: pointer;
}

.checkbox-item span {
  font-size: 14px;
  color: var(--text-main);
}

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

.modal-content {
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  animation: fadeIn 0.3s ease-out;
}

.modal-content h3 {
  margin-bottom: 20px;
  color: var(--primary);
  text-align: center;
}
