body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f4f6f8;
  color: #222;
}

header {
  background: #fff;
  padding: 24px 32px;
  border-bottom: 1px solid #ddd;
}

header h1 {
  margin: 0;
  font-size: 30px;
}

header p {
  margin: 8px 0 0;
  color: #666;
}

main {
  max-width: 1180px;
  margin: 0 auto;
}

section,
.item,
#card {
  background: #fff;
  padding: 22px;
  margin: 20px;
  border-radius: 14px;
  border: 1px solid #e0e0e0;
}

.hidden {
  display: none !important;
}

h2 {
  margin-top: 0;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  background: transparent;
  border: none;
  padding: 0;
}

.stat-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}

.stat-card span {
  display: block;
  font-size: 34px;
  font-weight: bold;
}

.stat-card p {
  margin: 8px 0 0;
  color: #666;
}

.form-grid,
.filters {
  display: grid;
  gap: 12px;
  max-width: 650px;
}

.row {
  display: flex;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  box-sizing: border-box;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

label {
  font-size: 14px;
  color: #444;
}

button,
.export {
  padding: 11px 16px;
  cursor: pointer;
  font-size: 15px;
  border: 1px solid #999;
  background: #f9f9f9;
  border-radius: 8px;
  text-decoration: none;
  color: #222;
  display: inline-block;
}

button:hover,
.export:hover {
  background: #eee;
}

.primary {
  background: #1f2937;
  color: white;
  border-color: #1f2937;
}

.primary:hover {
  background: #374151;
}

.danger {
  background: #fff5f5;
  border-color: #d33;
  color: #b00000;
}

.buttons {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.item {
  margin-left: 0;
  margin-right: 0;
}

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.item h3 {
  margin: 0 0 10px;
}

.badge {
  background: #eef2f7;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 14px;
}

.status-used {
  background: #e8f5e9;
  color: #1b5e20;
}

.status-repair {
  background: #fff8e1;
  color: #8a6d00;
}

.status-out {
  background: #eeeeee;
  color: #555;
}

.status-new {
  background: #e3f2fd;
  color: #0d47a1;
}

.extra {
  background: #f7f7f7;
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
}

img {
  margin-top: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.item-actions a {
  padding: 11px 16px;
  border-radius: 8px;
  background: #f2f2f2;
  color: #222;
  text-decoration: none;
}

.item-actions a:hover {
  background: #e5e5e5;
}

#reader {
  margin-top: 15px;
  max-width: 420px;
}

.view-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 10px;
}

.view-buttons label {
  background: #f5f5f5;
  padding: 8px 12px;
  border-radius: 8px;
}

.empty {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
}

.card-grid {
  display: grid;
  gap: 8px;
}

.history-item {
  border-left: 4px solid #1f2937;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: #f7f7f7;
  border-radius: 8px;
}

.history-item p {
  margin: 6px 0 0;
}

.toast {
  display: none;
  padding: 14px;
  margin: 20px;
  border-radius: 8px;
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

.toast.error {
  background: #ffebee;
  color: #b71c1c;
  border-color: #ef9a9a;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.dir-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #f7f7f7;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.small {
  color: #666;
  font-size: 14px;
}

@media (max-width: 900px) {
  .dashboard,
  .directory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  header {
    padding: 20px;
  }

  header h1 {
    font-size: 24px;
  }

  section,
  .item,
  #card {
    margin: 12px;
    padding: 16px;
  }

  .dashboard,
  .directory-grid {
    grid-template-columns: 1fr;
    margin: 12px;
  }

  .row {
    flex-direction: column;
  }

  .view-buttons {
    flex-direction: column;
  }
}

@media print {
  header,
  .login-panel,
  .admin-only,
  .filters,
  .view-buttons,
  .buttons,
  button,
  .export {
    display: none !important;
  }

  body {
    background: white;
  }

  .item {
    break-inside: avoid;
  }
}
