  /* Reset and base */
  * {
    box-sizing: border-box;
  }
  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1100px;
    margin: 40px auto;
    background: #f9fafb;
    color: #333;
  }
  h1 {
    text-align: center;
    color: #222;
    font-weight: 700;
  }

  /* Form styling */
  form.typ {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
  }
  form input, form button {
    padding: 12px 15px;
    font-size: 1rem;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.3s ease;
  }
  form input:focus {
    outline: none;
    border-color: #3b82f6; /* blue */
  }
  form button {
    background: #3b82f6;
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  form button:hover {
    background: #2563eb;
  }

  /* Table styling */
  table {
    width: 100%;
    margin-top: 30px;
    border-collapse: separate;
    border-spacing: 0 12px;
    table-layout: fixed;
  }
  th, td {
    text-align: left;
    padding: 14px 15px;
  }
  td.actions {
  width: 1%;       /* Keeps them only as wide as needed */
  white-space: nowrap;
  padding: 14px 4px;
}
  thead th {
    color: #555;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
  }
  tbody tr {
    background: white;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.06);
    border-radius: 12px;
  }
  tbody tr:not(:last-child) {
    margin-bottom: 10px;
  }
  tbody td {
    vertical-align: middle;
  }
  select {
    padding: 8px 12px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
  }
  select:hover, select:focus {
    border-color: #3b82f6;
    outline: none;
  }
  button {
    padding: 8px 14px;
    background: black;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  button:hover {
    background: #b91c1c;
  }

/* Editable inputs inside table cells */
td input[type="text"],
td input[type="date"],
td select {
  width: 100%;            /* Fill the cell but no bigger */
  max-width: 100%;        /* Don’t spill out of cell */
  box-sizing: border-box; /* Include padding + border in the width */
  padding: 4px 6px;       /* Small padding, matches cell text */
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}
/* Set fixed max widths and truncate overflow with ellipsis */
td.title, td.author {
  max-width: 200px;       /* Adjust width as you like */
  white-space: nowrap;    /* Prevent text wrapping */
  overflow: hidden;       /* Hide overflowing text */
  text-overflow: clip; /* Show "..." at the end */
}

/* Modal overlay */
.modal {
  display: none;            /* start hidden */
  position: fixed !important;
  inset: 0;                 /* top/right/bottom/left: 0 */
  z-index: 1000;
  background: rgba(0,0,0,0.45);
}

/* Modal panel */
.modal-content {
  background: #fff;
  width: 520px;
  max-width: 90vw;
  margin: 6vh auto;
  padding: 18px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  box-sizing: border-box;
}

/* Close button */
.modal-content .close {
  float: right;
  border: none;
  background: transparent;
  color: red;
  font-size: 1.5rem;
  cursor: pointer;
}

/* File list inside modal */
.file-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.file-list a {
  text-decoration: none;
  word-break: break-word;
}

/* Upload section stays contained */
.upload-section {
  border-top: 1px solid #eee;
  margin-top: 5px;
  padding-top: 12px;
}
.upload-section form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.upload-section input[type="file"] {
  max-width: 100%;
}

.file-list button {
    margin-left: 5px;
    padding: 2px 6px;
    cursor: pointer;
}
.download-btn {
    color: blue;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
}
.download-btn:hover {
    background-color: transparent;
}
tr.published {
  opacity: 0.5;         /* makes row look grayed out *
  background-color: #f0f0f0; /* light gray background */
  color: #888888;           /* gray text */
}
th, td {
  box-sizing: border-box;
}

/* Column widths */
td.title, th.title {
  width: 26%;   /* Title takes more space */
}
/* Column widths */
td.status, th.status {
  width: 15%;   /* Title takes more space */
}

td.filescol, th.filescol {
  width: 8%;
  padding: 14px 6px;
}
.user-box {
    position: fixed;           /* stays top-right */
    top: 10px;
    right: 10px;
    background: #3b82f6;       /* blue box */
    color: white;
    display: inline-flex;      /* shrink-wrap content */
    align-items: center;
    gap: 6px;
    padding: 4px 8px;          /* minimal padding */
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 1000;
    height: 25px;
}

.user-box .greeting {
    white-space: nowrap;       /* prevents wrapping */
}

.user-box button {
    padding: 2px 6px;          /* minimal button padding */
    border-radius: 6px;
    border: none;
    background: black;       /* red logout button */
    color: white;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    height: 18px;
}

.user-box button:hover {
    background: #b91c1c;
}
