
:root {
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --danger-color: #dc3545;
  --danger-hover: #c82333;
  --success-color: #28a745;
  --background-color: #f8f9fa;
  --card-background: #ffffff;
  --text-color: #212529;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --border-radius: 0.3rem;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.5;
}
.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}
a { color: var(--primary-color); text-decoration: none; }
a:hover { text-decoration: underline; }
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
h1 { font-size: 1.75rem; margin: 0; }
h2 { font-size: 1.25rem; margin-top: 0; margin-bottom: 1rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.card {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
}
input[type='url'], input[type='text'], input[type='password'] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
input:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}
.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: var(--border-radius);
  transition: all 0.15s ease-in-out;
}
.btn:disabled { cursor: not-allowed; opacity: 0.65; }
.btn-primary { background-color: var(--primary-color); color: #fff; }
.btn-primary:hover:not(:disabled) { background-color: var(--primary-hover); }
.btn-danger { background-color: var(--danger-color); color: #fff; }
.btn-danger:hover:not(:disabled) { background-color: var(--danger-hover); }
form#newlink .form-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
form#newlink .form-row input[name="slug"] { flex-grow: 1; }
form#newlink .form-row:last-child { margin-bottom: 0; }
.table-container { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
  text-align: left;
  vertical-align: middle;
  font-size: 0.95rem;
}
th { font-weight: 600; background-color: #f8f9fa; }
tbody tr:hover { background-color: rgba(0,0,0,0.025); }
.url-cell { max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions-cell { text-align: right; white-space: nowrap; }
.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  margin-left: 0.5rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  border-radius: 50%;
}
.action-btn:hover { color: var(--text-color); background-color: #e9ecef; }
.action-btn.delete-btn:hover { color: var(--danger-color); }
.action-btn.success { color: var(--success-color) !important; }
.empty-state { text-align: center; padding: 2rem; color: var(--text-muted); }
.login-card { max-width: 400px; margin: 4rem auto 0 auto; }
#login-form { display: flex; flex-direction: column; }
#login-form input { margin-bottom: 1rem; }
#login-form button { margin-top: 0.5rem; }
.login-message { color: var(--danger-color); margin-top: 1rem; font-size: 0.9rem; text-align: center; display: none; }
@media (max-width: 768px) {
  .container { margin: 1rem auto; }
  h1 { font-size: 1.5rem; }
  form#newlink .form-row { flex-direction: column; }
  table, thead, tbody, th, td, tr { display: block; }
  thead tr { position: absolute; top: -9999px; left: -9999px; }
  tr { border: 1px solid var(--border-color); border-radius: var(--border-radius); margin-bottom: 1rem; }
  td { border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 50%; text-align: right; }
  td:before { position: absolute; left: 1rem; width: 45%; padding-right: 1rem; white-space: nowrap; font-weight: 600; text-align: left; }
  td:nth-of-type(1):before { content: "Lien Court"; }
  td:nth-of-type(2):before { content: "Destination"; }
  td:nth-of-type(3):before { content: "Clics"; }
  td:nth-of-type(4):before { content: "Créé le"; }
  td:nth-of-type(5):before { content: "Actions"; }
  .actions-cell { text-align: right !important; }
  td:last-child { border-bottom: none; }
}
