/* Global Reset & Base */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f7fb;
  color: #112;
  line-height: 1.5;
}

.app-wrapper {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  transition: all 0.3s ease;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: #2564ce;
  color: #fff;
  padding: 18px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}
.brand h2 {
  margin: 0 0 12px;
  font-size: 20px;
  letter-spacing: 0.5px;
}
.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.menu li {
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  background: linear-gradient(90deg, #0b66c2, #0a5ab0);
  opacity: 0.95;
  transition: all 0.2s ease;
}
.menu li:hover {
  opacity: 1;
  background: linear-gradient(90deg, #0b66c2, #0a6be0);
  transform: translateY(-1px);
}
.menu li.active {
  box-shadow: 0 8px 24px rgba(2, 33, 71, 0.12);
  transform: translateY(-1px);
}

/* Main */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid #e6eef9;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar .search {
  font-weight: 600;
  color: #0b66c2;
  font-size: 18px;
}
.topbar .actions button {
  background: #0b66c2;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}
.topbar .actions button:hover {
  background: #094f98;
}

/* Content */
.content-area {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

/* Footer */
.footer {
  padding: 12px 20px;
  background: #fff;
  border-top: 1px solid #e6eef9;
  text-align: center;
  color: #667;
  font-size: 14px;
}

/* Cards */
.card-row {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.card {
  flex: 1;
  background: #fff;
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(9, 30, 66, 0.04);
  transition: all 0.3s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(9, 30, 66, 0.08);
}

/* Lists */
#taskList,
#recentTasks {
  list-style: none;
  padding: 0;
  margin: 0;
}
#taskList li,
#recentTasks li {
  background: linear-gradient(90deg, #eaf4ff, #d9eefc);
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  transition: background 0.2s ease;
}
#taskList li:hover,
#recentTasks li:hover {
  background: linear-gradient(90deg, #d9eefc, #bfe2fa);
}

/* Forms */
.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.form-row input,
.form-row select,
.form-row textarea {
  padding: 10px;
  border: 1px solid #e4e8f2;
  border-radius: 6px;
  flex: 1;
  min-width: 180px;
}

/* Buttons */
.btn {
  background: #0b66c2;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}
.btn:hover { background: #094f98; }
.small {
  padding: 6px 8px;
  border-radius: 6px;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.table th, .table td {
  padding: 8px;
  border-bottom: 1px solid #eef3fb;
  text-align: left;
}
.table th {
  background: #f8fbff;
  font-weight: 600;
}

/* Responsive Enhancements */
@media (max-width: 1024px) {
  .sidebar {
    width: 200px;
  }
  .topbar .search {
    font-size: 16px;
  }
}

@media (max-width: 900px) {
  .app-wrapper {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
    flex-direction: row;
    padding: 10px;
    gap: 10px;
  }
  .menu {
    display: flex;
    flex-direction: row;
    gap: 8px;
  }
  .menu li {
    flex: 1;
    text-align: center;
    white-space: nowrap;
  }
  .card-row {
    flex-direction: column;
  }
  .content-area {
    padding: 15px;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .brand h2 {
    font-size: 18px;
  }
  .card {
    padding: 14px;
  }
  .topbar .search {
    font-size: 15px;
  }
  .footer {
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  .sidebar {
    flex-wrap: wrap;
  }
  .menu li {
    font-size: 13px;
    padding: 8px;
  }
  .topbar .actions button {
    padding: 6px 10px;
    font-size: 13px;
  }
}
