/*


 */

html,
body {
  width: 100%;
  margin: 0;
  padding: 0;
}

.gray-box {
  background: #f0f0f0;
  border-radius: 15px;
  padding: 10px;
  line-height: 20px;
}

.btn {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-success {
  background-color: #5bb75b !important;
  border-color: #5bb75b !important;
  color: white;
}

.btn-success:hover,
.btn-success:focus {
  background-color: #4ca64c !important;
  border-color: #4ca64c !important;
  color: white;
}

.btn-cancel {
  background: #dcdcdc;
  /* a bit darker gray */
  color: #333;
  border: 1px solid #bbb;
  transition: background-color 0.3s, border-color 0.3s;
}

.btn-cancel:hover,
.btn-cancel:focus {
  background: #c0c0c0;
  /* darker gray on hover */
  border-color: #999;
  color: #000;
}

/* Base alert styles */
.alert {
  position: relative;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  box-sizing: border-box;
}

/* Close button */
.alert .close {
  position: absolute;
  top: 0.3rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  font-weight: 700;
  user-select: none;
}

/* Success */
.alert-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

/* Error */
.alert-error {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* Info */
.alert-info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

/* Warning */
.alert-warning {
  background-color: #fff3cd;
  border-color: #ffeeba;
  color: #856404;
}

/* Fade and in (optional for fade-in animation) */
.alert.fade {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.alert.in {
  opacity: 1;
}

header.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background-color: #1976d2;
  /* primary blue */
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header.navbar .brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

header.navbar .brand:hover,
header.navbar .brand:focus {
  text-decoration: underline;
}

header.navbar .user-info {
  text-align: right;
  font-size: 0.9rem;
  line-height: 1.3;
}

header.navbar .user-info div {
  margin-bottom: 0.2rem;
}

header.navbar .user-info a {
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
}

header.navbar .user-info a:hover,
header.navbar .user-info a:focus {
  color: #cce4ff;
  text-decoration: none;
}

/* General table hover effect */
table.table-hover tbody tr:hover {
  background-color: #e6f0ff;
  /* subtle light blue */
  cursor: pointer;
}

a.btn-mini:hover {
  background-color: #125a9c;
}

/* ===== Table Styling (Global) ===== */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: #f9f9f9;
  /* light gray background */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  margin-top: 1rem;
}

thead {
  background-color: #e0e0e0;
  /* slightly darker gray header */
  font-weight: bold;
}

th,
td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  text-align: center;
  font-size: 0.95rem;
  color: #333;
}

tbody tr:hover {
  background-color: #e6f0ff;
  /* subtle highlight on hover */
  cursor: pointer;
}

td.clickable {
  cursor: pointer;
}

/* Rounded corners for table */
thead tr:first-child th:first-child {
  border-top-left-radius: 8px;
}

thead tr:first-child th:last-child {
  border-top-right-radius: 8px;
}

tbody tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

tbody tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

/* Checkbox cell */
td:first-child {
  width: 40px;
  text-align: center;
}

/* Adjust widths of columns */
th:nth-child(2),
td:nth-child(2) {
  width: 60px;
}

/* Buttons inside table */
a.btn-mini {
  background-color: transparent;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
  margin-left: 0.25rem;
  transition: background-color 0.3s ease;
}

a.btn-mini:hover {
  background-color: #125a9c;
}

.full-cell-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
  padding: 1.5em;
  /* optional, to fill nicely */
}

.full-cell-link:hover {
  text-decoration: none;
}
/* ===== Main Containers ===== */
#new_bill_main_container,
#show_bill_main_container {
  width: 1200px;
  background-color: #f0f0f0;
  /* soft light gray */
  padding: 1rem;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  /* contain floats */
}

#new_bill_main_container {
  height: 550px;
}

#new_bill_main_container #left_container,
#show_bill_main_container #left_container {
  float: left;
  width: 650px;
  /* more space */
  background-color: #f0f0f0;
  /* soft gray */
  border-radius: 8px;
  padding: 1rem;
  box-sizing: border-box;
  overflow-y: auto;
}

#new_bill_main_container #left_container {
  height: 100%;
}

#show_bill_main_container #left_container {
  margin-left: 25px;
  margin-top: 20px;
  margin-bottom: 20px;
  padding-bottom: 30px;
  height: auto;
}

#new_bill_main_container #right_container,
#show_bill_main_container #right_container {
  background-color: #f0f0f0;
  /* soft gray */
  border-radius: 8px;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: auto;
  height: auto;
}

#new_bill_main_container #right_container {
  float: right;
  /* align right */
  width: 500px;
  /* remaining space */
  height: 100%;
  padding: 1rem 2rem 1rem 1rem;
  /* top/right/bottom/left */
}

#show_bill_main_container #right_container {
  float: right;
  width: 500px;
  /* remaining space */
  margin-top: 20px;
  margin-bottom: 20px;
  margin-right: 25px;
  padding: 20px 1rem 20px 2rem;
}

/* ===== Form Styling ===== */
.control-group {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
  gap: 1rem;
  /* space between label and input */
}

.control-label {
  flex: 0 0 150px;
  /* fixed width */
  font-weight: bold;
  text-align: right;
}

.controls {
  flex: 1;
  display: flex;
  align-items: center;
}

/* Inputs and Textareas */
.controls input[type="text"],
.controls select,
.controls textarea,
.control-group .controls input[type="text"].text_field,
.control-group .controls input.flatpickr-input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 0.95rem;
  box-sizing: border-box;
  font-family: inherit;
  resize: vertical;
  /* allow vertical resize for textarea */
  height: 2.4rem;
  /* consistent height for inputs/selects */
}

.controls select {
  font-size: 0.9rem;
  /* optional smaller font for selects */
}

.controls textarea {
  min-height: 100px;
  /* textarea specific tweaks */
}

#bill_show_actions {
  text-align: right;
}
.contacts-index .content-container,
#contact-index {
  max-height: none;
  height: auto;
  overflow-y: visible;
  max-width: 1200px;
  width: 95vw;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Tables word wrap */
#contact-index table,
#contact-index table th,
#contact-index table td {
  word-break: break-word;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Vertical scroll handling */
.contacts-index .content-container {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.search-form {
  display: inline-block;
  margin: 0 1rem 1rem 0;
}

.search-form input[type="text"] {
  padding: 0.4rem;
  border: 1px solid #aaa;
  border-radius: 4px;
}

#contacts {
  width: 100%;
  border-collapse: collapse;
}

#contacts th,
#contacts td {
  border-bottom: 1px solid #ccc;
  padding: 0.4rem;
}

#contacts tr {
  cursor: pointer;
}

#contacts tbody tr:hover {
  background: #eee;
  cursor: pointer;
}

/* Contact Form Layout */
#new_contact_main_container {
  display: flex;
  flex-wrap: wrap;
  gap: 2%;
}

#new_contact_main_container .left_container,
#new_contact_main_container .right_container {
  flex: 1;
  min-width: 300px;
}

.gray-box {
  background: #f0f0f0;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.control-group {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
}

.control-label {
  flex: 0 0 150px;
  font-weight: bold;
}

.controls {
  flex: 1;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.4rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 0.95rem;
}

.form-actions {
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: #1976d2;
  color: white;
}

.btn-danger {
  background: #d32f2f;
  color: white;
}

.edit-contact-container {
  margin: 2rem auto;
  padding: 1rem 2rem;
  background: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

/* === Contact Show layout: 3 columns side by side === */
#contact_show_main_container {
  display: flex;
  flex-wrap: nowrap;
  /* No wrapping */
  gap: 1rem;
  width: 95vw;
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem 0.5rem;
  box-sizing: border-box;
  background: #f9f9f9;
  border-radius: 10px;
  overflow-x: auto;
  /* Scroll if needed */
}

#contact_show_main_container>div {
  min-width: 0;
  /* Crucial for flex shrinking */
  padding: 1rem;
  margin: 0;
  box-sizing: border-box;
}

/* Flex grow proportions */
.left_container {
  flex-grow: 1;
  background-color: #e8f0fe;
  /* light blue */
  border-radius: 8px;
  padding: 1rem;
}

.middle_container {
  flex-grow: 2;
  background-color: #fef7e8;
  /* light warm yellow */
  border-radius: 8px;
  padding: 1rem;
}

.right_container {
  flex-grow: 1.5;
  background-color: #e8fef1;
  /* light green */
  border-radius: 8px;
  padding: 1rem;
}

.left_container,
.middle_container,
.right_container {
  background-color: #f0f0f0;
  /* soft light gray */
  border-radius: 8px;
  padding: 1rem;
}

/* Headings center and spacing */
#contact_show_main_container h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons group */
.btn-group {
  display: inline-flex;
  gap: 0.5rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.btn-group .btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
  border-radius: 4px;
  text-decoration: none;
  color: white;
  background-color: #1976d2;
  border: none;
  cursor: pointer;
}

.btn-group .btn:hover {
  background-color: #125a9c;
}

/* Dropdown styling */
.btn-group.dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-group.dropdown .btn {
  cursor: pointer;
  user-select: none;
}

.dropdown-menu {
  display: none;
  /* hidden by default */
  position: absolute;
  background: #fff;
  min-width: 220px;
  /* set a minimum width */
  max-width: 350px;
  /* max width if needed */
  padding: 0.75rem 1rem;
  /* add some padding */
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  max-height: 300px;
  /* scroll if content is too long */
  z-index: 1000;
  box-sizing: border-box;
  /* include padding in width */
}

.dropdown-menu.show {
  display: block;
}

/* If you want the table inside dropdown to fill width */
.dropdown-menu table {
  width: 100%;
  border-collapse: collapse;
}

.dropdown-menu table tr:hover {
  background-color: #eee;
}

.btn-mini {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  color: white;
  background-color: transparent;
  display: inline-block;
}

.btn-mini.btn-danger {
  background-color: transparent;
}

#sessions_table.table {
  width: 100%;
}

.right_container .form-actions {
  width: 75%;
  max-width: 800px;
  margin: 1rem auto;
  padding: 1rem;
  background-color: #f0f0f0;
  border-radius: 10px;
  box-sizing: border-box;
}

table.bureau-legend {
  border-collapse: separate !important;
  border-spacing: 0.5rem 0;
  width: auto !important;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 1rem auto;
  text-align: center;
  table-layout: auto !important;
}

table.bureau-legend td,
#contacts tr[data-bureau] td {
  padding: 0.4rem;
  text-align: center;
}

table.bureau-legend td {
  border: none !important;
  padding: 0.25rem 1rem !important;
  white-space: nowrap;
  cursor: default;
  font-weight: 600;
  color: #333;
  border-radius: 4px;
}

table.bureau-legend td:not([data-bureau]) {
  background-color: transparent !important;
}

table.bureau-legend td[data-bureau="geneva"],
#contacts tr[data-bureau="geneva"] {
  background-color: #f9cb9c;
}

table.bureau-legend td[data-bureau="nyon"],
#contacts tr[data-bureau="nyon"] {
  background-color: #ffe599;
}

table.bureau-legend td[data-bureau="archived"],
#contacts tr[data-bureau="archived"] {
  background-color: #b6d7a8;
}
.pagination {
  display: flex;
  flex-wrap: nowrap;
  /* Prevent wrapping */
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  font-family: Arial, sans-serif;
  white-space: nowrap;
  /* Prevent text wrap inside */
  overflow-x: auto;
  /* Allow horizontal scroll if absolutely needed */
}

.pagination span {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  /* smaller padding */
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center;
  min-width: 1.8rem;
  /* smaller min width */
  font-size: 0.85rem;
  /* smaller font */
  user-select: none;
}

.pagination span a {
  text-decoration: none;
  color: #1976d2;
  display: block;
}

.pagination .current {
  background-color: #1976d2;
  color: white;
  font-weight: bold;
  border-color: #1976d2;
  pointer-events: none;
}

.pagination .gap {
  padding: 0.25rem 0.5rem;
  border: none;
  color: #999;
  cursor: default;
  user-select: none;
}

.pagination span:not(.current):hover {
  background-color: #e3f2fd;
  border-color: #90caf9;
  cursor: pointer;
}

.pagination span:not(.current):hover a {
  color: #0d47a1;
}

.pagination .first,
.pagination .prev,
.pagination .next,
.pagination .last {
  font-weight: 500;
}
.gray-box {
  width: 75%;
  max-width: 800px;
  /* optional max width */
  margin: 1rem auto;
  /* centers horizontally and adds vertical margin */
  background-color: #f0f0f0;
  /* your gray background */
  border-radius: 10px;
  padding: 1rem;
  box-sizing: border-box;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  /* optional spacing between elements */
  flex-wrap: nowrap;
  /* prevent wrapping */
}

.controls.duration_div,
.controls.observations_div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: 100%;
}

.controls.duration_div select,
.controls.duration_div input[type="text"],
.controls.duration_div input[type="number"],
.controls.observations_div select,
.controls.observations_div input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 200px;
  margin: 0;
}

/* Optional: tweak specific inputs */
.controls.duration_div input.custom_duration {
  max-width: 150px;
}

.controls.duration_div input.price {
  max-width: 120px;
}

.controls.observations_div input.custom_observations {
  max-width: 150px;
}

.controls.position_div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: 100%;
}

.controls.position_div input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 300px;
  margin: 0;
}

.controls .datepicker,
.controls .flatpickr-input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 300px;
  margin: 0;
  display: inline-block;
  /* keep it inline */
}
.errors {
  padding: 12px 20px;
  margin-bottom: 15px;
  text-align: center;
  background-color: #f8d7da;
  /* soft red/pink background */
  color: #721c24;
  /* dark red text */
  border: 1px solid #f5c6cb;
  border-radius: 5px;
  font-size: 0.9rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.errors ul {
  padding: 0;
  margin: 0;
  list-style-type: none;
}

.errors ul li {
  line-height: 1.5em;
}

.alert-error {
  background-color: #fdd;
  border: 1px solid #f99;
  color: #900;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
}
.login-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 2rem 3rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
  width: 320px;
  max-width: 90%;
}

.login-container h2 {
  margin-bottom: 1.5rem;
  text-align: center;
  color: #333;
}

.login-container form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-container label {
  font-weight: 600;
  color: #555;
}

.login-container input[type="email"],
.login-container input[type="password"] {
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #f0f0f0;
  border-radius: 5px;
  outline-offset: 2px;
  transition: border-color 0.2s ease;
}

.login-container input[type="email"]:focus,
.login-container input[type="password"]:focus {
  border-color: #3b82f6;
  /* nice blue */
  box-shadow: 0 0 3px #3b82f6;
}

.login-container input[type="submit"] {
  background-color: #3b82f6;
  color: white;
  font-weight: 600;
  border: none;
  padding: 0.75rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.login-container input[type="submit"]:hover {
  background-color: #2563eb;
}

.login-container .flash {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background-color: #fee2e2;
  color: #b91c1c;
  border-radius: 5px;
  font-weight: 600;
  text-align: center;
}
