:root {
  --primary: #1e3a5f;
  --primary-light: #2c5282;
  --primary-dark: #0f2744;
  --accent: #3182ce;
  --accent-hover: #2b6cb0;
  --success: #38a169;
  --danger: #e53e3e;
  --warning: #d69e2e;
  --light: #f7fafc;
  --dark: #2d3748;
  --sidebar-width: 260px;
  --header-height: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f4f8;
  color: #2d3748;
  line-height: 1.6;
  min-height: 100vh;
}

/* Landing Page */
.landing-hero {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.landing-hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  position: relative;
}

.landing-hero .subtitle {
  font-size: 1.35rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  position: relative;
}

.landing-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
}

.landing-cta .btn {
  padding: 0.9rem 2rem;
  font-size: 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary-hero {
  background: white;
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.btn-primary-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.btn-outline-hero {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-outline-hero:hover {
  background: white;
  color: var(--primary);
}

/* Auth Forms */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.auth-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
}

.auth-box h2 {
  color: var(--primary);
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
}

.auth-box .form-group {
  margin-bottom: 1.25rem;
}

.auth-box label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: #4a5568;
}

.auth-box input,
.auth-box select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 1rem;
}

.auth-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49,130,206,0.2);
}

.auth-box .btn-submit {
  width: 100%;
  padding: 0.85rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}

.auth-box .btn-submit:hover {
  background: var(--primary-light);
}

.auth-links {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.95rem;
}

.auth-links a {
  color: var(--accent);
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* Flash messages */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.alert-success { background: #c6f6d5; color: #22543d; }
.alert-error { background: #fed7d7; color: #742a2a; }
.alert-info { background: #bee3f8; color: #2c5282; }
.alert-warning { background: #feebc8; color: #744210; }

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--primary-dark);
  color: white;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav {
  padding: 1rem 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.sidebar-nav .nav-icon {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 1.5rem;
  min-height: 100vh;
}

.header-bar {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: #718096; color: white; }

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

table th {
  background: #f7fafc;
  font-weight: 600;
  color: #4a5568;
}

/* Form controls */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: #4a5568;
}

/* Data preview table */
.preview-table-wrapper {
  max-height: 400px;
  overflow: auto;
}

/* Charts placeholder */
.chart-container {
  height: 280px;
  background: #f7fafc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #718096;
  margin: 1rem 0;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.tabs .tab {
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  color: #718096;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs .tab:hover,
.tabs .tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

/* Badge */
.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #c6f6d5; color: #22543d; }
.badge-danger { background: #fed7d7; color: #742a2a; }
.badge-warning { background: #feebc8; color: #744210; }

/* Input column checkboxes - ensure clickable */
.input-col-label {
  cursor: pointer;
}
.input-col-label input[type="checkbox"] {
  margin-right: 0.35rem;
  cursor: pointer;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .dashboard-layout {
    flex-direction: column;
  }
  
  .landing-hero h1 {
    font-size: 2rem;
  }
}
