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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f0f2f5;
  color: #333;
  line-height: 1.6;
  font-size: 14px;
}

.dashboard {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 1px;
}

.sidebar-nav {
  padding: 10px 0;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin: 2px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a0aec0;
  text-decoration: none;
  padding: 12px 20px;
  transition: all 0.2s;
  font-size: 14px;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.sidebar-nav a.active {
  background: #3498db;
  color: #fff;
}

.sidebar-nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
}

.page-header {
  background: #fff;
  padding: 20px 30px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
}

.content-area {
  padding: 30px;
}

h1, h2, h3, h4 {
  color: #2d3748;
}

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #3498db;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn:hover {
  background: #2980b9;
}

.btn-secondary {
  background: #6c757d;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-danger {
  background: #dc3545;
}

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

.btn-primary {
  background: #3498db;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

table {
  width: 100%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: #4a5568;
  font-size: 13px;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f8fafc;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.media-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.media-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.media-info {
  padding: 12px;
}

.media-actions {
  padding: 0 12px 12px;
  display: flex;
  gap: 6px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.template-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  text-align: center;
}

.template-preview {
  height: 150px;
  border-radius: 6px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #666;
}

.template-preview.magazine {
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  color: #fff;
}

.template-preview.typewriter {
  background: #f5f1e8;
  color: #5d4e37;
}

.template-preview.zen {
  background: #fff;
  color: #333;
  border: 1px solid #eee;
}

.template-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.template-desc {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 15px;
}

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

.badge-active {
  background: #27ae60;
  color: #fff;
}

.badge-draft {
  background: #95a5a6;
  color: #fff;
}

.badge-published {
  background: #3498db;
  color: #fff;
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.5rem;
}

.login-box .btn {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
}

.actions {
  display: flex;
  gap: 6px;
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  
  .sidebar-header h2 {
    display: none;
  }
  
  .sidebar-nav a span {
    display: none;
  }
  
  .sidebar-nav a {
    justify-content: center;
    padding: 15px;
  }
  
  .main-content {
    margin-left: 60px;
  }
  
  .content-area {
    padding: 15px;
  }
  
  .page-header {
    padding: 15px;
  }
  
  .grid, .media-grid, .template-grid {
    grid-template-columns: 1fr;
  }
}