* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  color: #1f2937;
}

.topbar {
  height: 64px;
  background: #111827;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.brand {
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  text-decoration: none;
}

.topbar a {
  color: #fff;
  text-decoration: none;
  margin-left: 16px;
}

.container {
  max-width: 1150px;
  margin: 28px auto;
  padding: 0 18px;
}

.card {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  margin-bottom: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  margin: 8px 0 14px;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 10px 13px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
}

.btn.gray { background: #6b7280; }
.btn.red { background: #dc2626; }
.btn.green { background: #16a34a; }
.btn.orange { background: #ea580c; }

.btn.small {
  padding: 7px 9px;
  font-size: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}

.table th {
  background: #f9fafb;
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.alert {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.alert-success { background: #dcfce7; }
.alert-danger { background: #fee2e2; }
.alert-warning { background: #fef3c7; }

.preview {
  max-width: 90px;
  max-height: 60px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.muted {
  color: #6b7280;
  font-size: 13px;
}

.login {
  max-width: 420px;
  margin: 60px auto;
}

.code {
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
}

.inline-form {
  display: inline;
}

.rename-form {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rename-form input {
  max-width: 180px;
  padding: 7px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

/* ===== RESPONSIVE HP ===== */

@media (max-width: 768px) {
  .topbar {
    height: auto;
    min-height: 60px;
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .brand {
    font-size: 20px;
  }

  .topbar a {
    margin-left: 0;
    margin-right: 12px;
    font-size: 14px;
  }

  .container {
    width: 100%;
    margin: 16px auto;
    padding: 0 12px;
  }

  .grid {
    display: block;
  }

  .card {
    width: 100%;
    padding: 18px;
    border-radius: 12px;
  }

  .card h2 {
    font-size: 22px;
  }

  input[type="file"],
  input[type="text"],
  input[type="password"],
  select,
  textarea,
  .input {
    width: 100%;
    max-width: 100%;
  }

  .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .table th,
  .table td {
    padding: 10px;
    font-size: 14px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  button,
  input[type="submit"] {
    width: 100%;
    text-align: center;
    margin-bottom: 6px;
  }

  .btn.small {
    width: 100%;
    padding: 9px;
    font-size: 13px;
  }

  .rename-form {
    flex-direction: column;
  }

  .rename-form input {
    max-width: 100%;
    width: 100%;
  }

  .preview {
    max-width: 70px;
    max-height: 50px;
  }

  .code {
    max-width: 220px;
    white-space: normal;
    word-break: break-all;
  }

  .login {
    margin: 30px auto;
    padding: 0 12px;
  }
}