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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 40px;
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 {
  color: #667eea;
  font-size: 2em;
  margin-bottom: 30px;
  text-align: center;
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #555;
  font-size: 0.95em;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s ease;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select {
  cursor: pointer;
  background-color: white;
}

.date-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

button,
input[type="submit"] {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 14px 30px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:hover,
input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

button:active,
input[type="submit"]:active {
  transform: translateY(0);
}

a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

a:hover {
  color: #764ba2;
  text-decoration: underline;
}

.message {
  background: #f8f9ff;
  border-left: 4px solid #667eea;
  padding: 20px;
  margin: 25px 0;
  border-radius: 6px;
  line-height: 1.6;
}

hr {
  border: none;
  border-top: 2px solid #f0f0f0;
  margin: 25px 0;
}

.result-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  margin: 20px 0;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.result-box h2 {
  font-size: 1.8em;
  margin-bottom: 15px;
  font-weight: 600;
}

.result-box .stats {
  font-size: 1.4em;
  font-weight: 700;
  margin: 10px 0;
}

.result-box .total-days {
  font-size: 3em;
  font-weight: 800;
  margin: 20px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.back-link {
  text-align: center;
  margin-top: 20px;
  padding: 15px;
  background: #f8f9ff;
  border-radius: 8px;
}

.admin-section {
  background: #f8f9ff;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table td {
  padding: 10px 5px;
  vertical-align: middle;
}

table td:first-child {
  font-weight: 600;
  color: #555;
  width: 120px;
}

/* Records table styling */
.records-table-wrapper {
  overflow-x: auto;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.records-table th,
.records-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.records-table th {
  background: #667eea;
  color: white;
  font-weight: 600;
  font-size: 0.9em;
}

.records-table th:first-child {
  border-radius: 6px 0 0 0;
}

.records-table th:last-child {
  border-radius: 0 6px 0 0;
}

.records-table tbody tr:hover {
  background: #f8f9ff;
}

.records-table tbody tr:last-child td {
  border-bottom: none;
}

.actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-edit,
.btn-delete {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
}

.btn-edit {
  background: #667eea;
  color: white;
}

.btn-edit:hover {
  background: #5a6fd6;
  color: white;
  text-decoration: none;
}

.btn-delete {
  background: #e74c3c;
  color: white;
}

.btn-delete:hover {
  background: #c0392b;
}

.delete-form {
  display: inline;
  margin: 0;
  padding: 0;
}

/* Button group for edit form */
.button-group {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.button-group input[type="submit"] {
  flex: 1;
  margin-top: 0;
}

.btn-cancel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #95a5a6;
  color: white;
  border: none;
  padding: 14px 30px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-cancel:hover {
  background: #7f8c8d;
  color: white;
  text-decoration: none;
}

/* Error message styling */
.error-message {
  background: #fee;
  border: 1px solid #e74c3c;
  color: #c0392b;
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
}

/* Duplicate notice styling */
.duplicate-notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: center;
  font-weight: 500;
}

/* Logout bar styling */
.logout-bar {
  text-align: right;
  margin-bottom: 10px;
}

.btn-logout {
  display: inline-block;
  padding: 8px 16px;
  background: #95a5a6;
  color: white;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #7f8c8d;
  color: white;
  text-decoration: none;
}

@media (max-width: 600px) {
  .container {
    padding: 25px;
  }

  .date-fields {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.6em;
  }

  .actions-cell {
    flex-direction: column;
    gap: 5px;
  }

  .btn-edit,
  .btn-delete {
    width: 100%;
    text-align: center;
  }

  .button-group {
    flex-direction: column;
  }
}
