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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f0f2f5;
  color: #333;
}

.page { display: none; }
.page.active { display: block; }

/* Login */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 400px;
}

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

.login-header i {
  font-size: 48px;
  color: #667eea;
  margin-bottom: 10px;
}

.login-header h1 {
  font-size: 24px;
  color: #333;
}

.login-header p {
  color: #666;
  font-size: 14px;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.form-group small {
  display: block;
  margin-top: 4px;
  color: #888;
  font-size: 12px;
}

.section-title {
  font-size: 16px;
  color: #667eea;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e1e5e9;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5a6fd6;
}

.btn-block { width: 100%; justify-content: center; }

.btn-danger {
  background: #e74c3c;
  color: white;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-danger:hover { background: #c0392b; }

/* Messages */
.error-message {
  color: #e74c3c;
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
}

.success-message {
  color: #27ae60;
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
}

/* Sidebar Layout */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  height: 100vh;
  background: #1a1a2e;
  color: white;
  padding: 20px 0;
  z-index: 100;
}

.sidebar-header {
  padding: 0 20px 20px;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-header i { font-size: 28px; color: #667eea; }
.sidebar-header span { font-size: 18px; font-weight: 700; }

.nav-links {
  list-style: none;
  padding: 20px 0;
}

.nav-links li {
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.nav-links li:hover { background: rgba(102,126,234,0.2); }
.nav-links li.active { background: #667eea; }

.main-content {
  margin-left: 250px;
  padding: 30px;
  min-height: 100vh;
}

.view { display: none; }
.view.active { display: block; }

h2 {
  font-size: 24px;
  margin-bottom: 24px;
  color: #1a1a2e;
}

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

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(102,126,234,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #667eea;
}

.stat-icon.today { background: rgba(39,174,96,0.15); color: #27ae60; }
.stat-icon.forwarded { background: rgba(243,156,18,0.15); color: #f39c12; }

.stat-info h3 { font-size: 28px; color: #1a1a2e; }
.stat-info p { font-size: 14px; color: #888; }

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 24px;
}

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid #eee;
}

.card-header h3 { font-size: 16px; color: #333; }

.card-body { padding: 24px; }

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.data-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #555;
}

.data-table tbody tr:hover { background: #f8f9fa; }

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filters input {
  padding: 10px 14px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
}

.filters input:focus {
  outline: none;
  border-color: #667eea;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: center;
}

.pagination button {
  padding: 8px 14px;
  border: 2px solid #e1e5e9;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.pagination button.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.pagination button:hover:not(.active) {
  background: #f0f2f5;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: relative; }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr; }
  .filters { flex-direction: column; }
}
