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

body {
  font-family: "Avenir", "Avenir Next", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: #58595b;
  background: #f5f5f5;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2rem;
  background: #58595b;
  border-bottom: 2px solid #adadad;
}

nav .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #adadad;
  font-weight: 700;
  font-size: 1.1rem;
}

nav .logo:hover {
  color: #fff;
}

nav .logo img {
  height: 32px;
  width: 32px;
  border-radius: 4px;
}

nav a {
  color: #adadad;
  text-decoration: none;
  margin-left: 1rem;
  font-weight: 500;
  transition: color 0.15s;
}

nav a:hover {
  color: #fff;
}

main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #58595b;
}

h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
  color: #58595b;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 500;
}

input {
  padding: 0.5rem;
  border: 1px solid #adadad;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: #58595b;
}

input:focus {
  outline: none;
  border-color: #58595b;
  box-shadow: 0 0 0 2px rgba(88, 89, 91, 0.2);
}

button {
  padding: 0.6rem 1.2rem;
  background: #58595b;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover {
  background: #3d3e40;
}

hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid #adadad;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.message.error {
  background: #ffeaea;
  color: #cc0000;
}

.message.success {
  background: #eaffea;
  color: #007700;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
}

th {
  font-weight: 600;
  background: #58595b;
  color: #fff;
}

section {
  margin-bottom: 2rem;
}

.filters {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

select {
  padding: 0.4rem;
  border: 1px solid #adadad;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: #58595b;
}

/* Tool grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-decoration: none;
  color: #58595b;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tool-card:hover {
  border-color: #adadad;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tool-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.tool-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.tool-desc {
  font-size: 0.85rem;
  color: #888;
}

/* Home layout */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 768px) {
  .home-layout {
    grid-template-columns: 1fr;
  }
}

/* Quick links sidebar */
.quick-links {
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.25rem;
  font-size: 0.85rem;
}

.quick-links h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: #58595b;
}

.quick-links h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  margin: 1rem 0 0.25rem;
}

.quick-links h4:first-of-type {
  margin-top: 0;
}

.quick-links ul {
  list-style: none;
  padding: 0;
}

.quick-links li {
  padding: 0.2rem 0;
}

.quick-links a {
  color: #58595b;
  text-decoration: none;
}

.quick-links a:hover {
  text-decoration: underline;
  color: #333;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  body {
    background: #1a1a1a;
    color: #d4d4d4;
  }

  nav {
    background: #2a2a2a;
    border-bottom-color: #444;
  }

  h1, h2 {
    color: #e0e0e0;
  }

  input {
    background: #2a2a2a;
    border-color: #555;
    color: #d4d4d4;
  }

  input:focus {
    border-color: #adadad;
    box-shadow: 0 0 0 2px rgba(173, 173, 173, 0.2);
  }

  select {
    background: #2a2a2a;
    border-color: #555;
    color: #d4d4d4;
  }

  button {
    background: #adadad;
    color: #1a1a1a;
  }

  button:hover {
    background: #c0c0c0;
  }

  th {
    background: #333;
    color: #e0e0e0;
  }

  td {
    border-bottom-color: #333;
  }

  hr {
    border-top-color: #444;
  }

  .message.error {
    background: #3a1a1a;
    color: #ff6666;
  }

  .message.success {
    background: #1a3a1a;
    color: #66cc66;
  }

  .tool-card {
    background: #2a2a2a;
    border-color: #444;
  }

  .tool-card:hover {
    border-color: #adadad;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }

  .tool-desc {
    color: #999;
  }
}
