:root {
  --bg: #f0f4f8;
  --surf: #fff;
  --prim: #30475e;
  --bor: #e1e7ee;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  color: #333;
}

#menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  margin-right: 12px;
  cursor: pointer;
  color: #556677;
}

#sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 900;
}

#sidebar-overlay.show {
  display: block;
}

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: var(--prim);
  color: #fff;
  padding-top: 20px;
}

#sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#sidebar li {
  padding: 10px 20px;
  cursor: pointer;
}

#sidebar li.active,
#sidebar li:hover {
  background: rgba(255, 255, 255, 0.1);
}

#main {
  margin-left: 240px;
}

#topbar {
  height: 52px;
  background: #fff;
  border-bottom: 1px solid var(--bor);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

#breadcrumb {
  color: #556677;
  font-weight: 600;
}

#searchbox {
  position: relative;
  width: 230px;
}

#searchbox input {
  width: 100%;
  padding: 6px 28px 6px 8px;
  border: 1px solid var(--bor);
  border-radius: 4px;
}

#searchbox .fa-search {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}

#content {
  padding: 32px 40px;
  overflow-y: auto;
  height: calc(100vh - 52px);
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.subtabs button {
  padding: 6px 12px;
  border: 1px solid var(--bor);
  background: var(--surf);
  cursor: pointer;
}

.subtabs button.active {
  background: var(--prim);
  color: #fff;
}

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

.card {
  background: var(--surf);
  border: 1px solid var(--bor);
  border-radius: 6px;
  padding: 16px;
  cursor: pointer;
  position: relative;
}

.badge {
  background: var(--prim);
  color: #fff;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
}

.badge.birthday {
  position: absolute;
  top: 8px;
  right: 8px;
}

.btn {
  margin-top: 16px;
  padding: 8px 16px;
  background: var(--prim);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.btn.add {
  margin-top: 24px;
}

.rating {
  color: gold;
}

#ov {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
}

#ov.show {
  display: flex;
}

#ov .box {
  background: var(--surf);
  width: 760px;
  max-height: 92vh;
  overflow: auto;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

#ov header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--bor);
}

#ov header h2 {
  margin: 0;
}

#ov header #ov-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

#ov #ov-body {
  padding: 16px;
}

#ov footer {
  padding: 16px;
  border-top: 1px solid var(--bor);
  text-align: right;
}

#ov footer .btn {
  margin-left: 8px;
}

.pane {
  display: none;
}

.pane.active {
  display: block;
}

.filter {
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #main {
    margin-left: 0;
  }

  #menu-toggle {
    display: block;
  }

  #topbar {
    position: sticky;
    top: 0;
  }
}

#modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
}

#modal.show {
  display: flex;
}

#modal .box {
  background: var(--surf);
  width: 400px;
  border-radius: 8px;
  overflow: hidden;
}

#modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--bor);
}

#modal header h2 {
  margin: 0;
}

#modal header button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

#modal-body {
  padding: 16px;
}

#modal-body label {
  display: block;
  margin-bottom: 12px;
}

#modal-body input,
#modal-body select,
#modal-body textarea {
  width: 100%;
  padding: 6px 8px;
  margin-top: 4px;
  border: 1px solid var(--bor);
  border-radius: 4px;
}

#modal-body .actions {
  text-align: right;
}
