/* ========== RESET ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background: #f8f9fa;
  color: #333;
}

/* ========== LAYOUT ========== */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: #1e1e2f;
  color: #fff;
  padding: 20px 15px;
  flex-shrink: 0;
}

.sidebar h2 {
  font-size: 20px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
}

.sidebar a {
  display: block;
  padding: 8px 12px;
  margin: 4px 0;
  color: #ccc;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s ease;
  font-size: 14px;
}

.sidebar a:hover {
  background: #2d2d44;
  color: #fff;
}

/* Content wrapper */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header .brand {
  font-size: 18px;
  font-weight: 600;
  color: #222;
}

.header .user {
  font-size: 14px;
  color: #555;
}

/* Topbar */
.topbar {
  background: #f9fafb;
  border-bottom: 1px solid #e0e0e0;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar .title {
  font-weight: 600;
  font-size: 16px;
}

.topbar .user {
  font-size: 14px;
  color: #444;
}

/* Main content */
.main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.section {
  margin-bottom: 30px;
}

.section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #222;
}

/* ========== CARDS ========== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
}

.cards-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  flex: 1;
  min-width: 150px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #777;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}


/* GRID */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.cards-row {
  display: flex;
  gap: 16px;
}

.cards-row .card {
  flex: 1;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
  }

  .sidebar nav ul {
    display: flex;
  }

  .sidebar nav ul li {
    padding: 10px 15px;
    white-space: nowrap;
  }

  .main {
    flex: 1;
  }
}
