/*
 * Theme variables
 *
 * The original palette used a very dark colour scheme.  To give the
 * administration panel a cleaner, more professional look we've
 * lightened the backgrounds, introduced a crisp blue accent and
 * softened the supporting colours.  If you wish to fine‑tune the
 * appearance further you can adjust the values below; they control
 * every other colour in this stylesheet via CSS custom properties.
 */
:root {
  /* page and card backgrounds */
  --bg: #f8f9fa;
  --panel: #ffffff;
  /* primary and secondary text colours */
  --text: #343a40;
  --muted: #6c757d;
  /* accent colour used for buttons and links */
  --accent: #0d6efd;
  /* border and focus colours for form elements */
  --input-border: #ced4da;
  --input-focus: #0d6efd;
  /* button hover colour */
  --btn-hover-bg: #0b5ed7;
}

/* Ensure that the page takes up the full viewport and removes default margins */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.header {
  background: #ffffff;
  border-bottom: 1px solid #e9ecef;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.header img {
  height: 42px;
}

.container {
  /* centre the main container and limit its width on large screens */
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.card {
  background: var(--panel);
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.08);
}

.h1 {
  font-size: 24px;
  margin: 0 0 16px;
}

.muted {
  color: var(--muted);
}

.btn {
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.btn:hover,
  .btn:focus {
  background: var(--btn-hover-bg);
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.item {
  background: linear-gradient(180deg, rgba(20, 20, 25, 0.9), rgba(15, 15, 20, 0.8));
  padding: 12px;
  border-radius: 8px;
}

.input {
  width: 100%;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid var(--input-border);
  background: #fff;
  color: var(--text);
  margin-bottom: 16px;
  font-size: 16px;
  transition: all 0.2s ease;
}

.input:focus {
  border-color: var(--input-focus);
  outline: none;
  background-color: #e9ecef;
}

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

.table th,
  .table td {
  padding: 12px 8px;
  border-bottom: 1px solid #e9ecef;
  color: var(--text);
}

/* Adjust table header styling for better readability */
.table th {
  color: var(--text);
  font-weight: 600;
  background-color: #f1f3f5;
  border-bottom: 1px solid #e9ecef;
}

/*
 * Alert messages
 *
 * Flash messages in the dashboard are output with the classes
 * `.alert`, `.alert-success` and `.alert-error`.  These styles give
 * them a subtle background and appropriate text colour based on the
 * alert type.
 */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.4;
}
.alert-success {
  background-color: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
}
.alert-error {
  background-color: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
}

/* Style for small action links in dashboard */
.small-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  margin-right: 6px;
  cursor: pointer;
}
.small-link:hover {
  text-decoration: underline;
  color: var(--btn-hover-bg);
}

.footer {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 24px;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  padding-top: 60px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-content {
  background-color: var(--panel);
  margin: 5% auto;
  padding: 30px;
  border-radius: 12px;
  width: 40%; /* Reduced width for a more compact modal */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  transition: all 0.3s ease-in-out;
}

.modal.open .modal-content {
  transform: scale(1);
}

.close-btn {
  color: #aaa;
  float: right;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-btn:hover,
.close-btn:focus {
  color: var(--accent);
}

.modal.open {
  display: block;
  opacity: 1;
  visibility: visible;
}

.modal.fade {
  opacity: 0;
  visibility: hidden;
}

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

.form-row label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

.form-row input {
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--input-border);
  background: #2d2f38;
  color: var(--text);
  width: 100%;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-row input:focus {
  border-color: var(--input-focus);
  background: #353944;
  outline: none;
}
.alert-error{
    margin-bottom: 20px;
    color: red;    
}
.alert-success{
    margin-bottom: 20px;
    color: green;    
}
