/* ──────────────────────────────────────────────────────────
   0. Quick header tweak
   ────────────────────────────────────────────────────────── */
body > header.container-header {
  background: #1B274F !important;
}

/* ──────────────────────────────────────────────────────────
   1. Root variables
   ────────────────────────────────────────────────────────── */
:root {
  --cassiopeia-body-bg: #f7f8fa;
  --cassiopeia-text-color: #000;
  --cassiopeia-heading-color: #000;
  --cassiopeia-brand-color: #4a90e2;

  --button-bg: #728A7D;
  --button-font-color: #fff;
  --button-hover-bg: #9CBDAB;

  --burger-menu-offset: 20px;
  --burger-dropdown-gap: 3px;
}


/* ──────────────────────────────────────────────────────────
   2. Dark-mode palette
   ────────────────────────────────────────────────────────── */

body.dark-mode > header.container-header {
  background: #222 !important;
}

body.dark-mode {
  --cassiopeia-body-bg: #222;
  --cassiopeia-text-color: #e0e0e0;
  --cassiopeia-heading-color: #fff;

  background: var(--cassiopeia-body-bg);
  color: var(--cassiopeia-text-color);
}

/* ──────────────────────────────────────────────────────────
   3. Buttons (base + colour variants)
   ────────────────────────────────────────────────────────── */
button,
input[type="button"],
input[type="submit"],
.btn,
.button {
  background: var(--button-bg) !important;
  border-color: var(--button-bg) !important;
  color: var(--button-font-color) !important;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  margin-left: 10px;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
.btn:hover,
.button:hover {
  background: var(--button-hover-bg) !important;
}


.btn-primary {
  background: var(--button-bg) !important;
  color: #fff;
}
.btn-primary:hover {
  background: var(--button-hover-bg) !important;
}

.btn-success {
  background: var(--button-bg) !important;
  color: #fff;
}
.btn-success:hover {
  background: var(--button-hover-bg) !important;
}

.btn-info {
  background: var(--button-bg) !important;
  color: #fff;
}
.btn-info:hover {
  background: var(--button-hover-bg) !important;
}

.btn-warning {
  background: var(--button-bg) !important;
  color: #000;
}
.btn-warning:hover {
  background: var(--button-hover-bg) !important;
}

/* ──────────────────────────────────────────────────────────
   4. User-bar helpers
   ────────────────────────────────────────────────────────── */
.dark-mode-container {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 20px;
}

.dark-mode-user-name {
  margin-right: 10px;
  font-weight: bold;
  color: #fff;
}

.dark-mode-plain-link,
.dark-mode-icon-wrapper {
  color: var(--button-font-color) !important;
}

/* ──────────────────────────────────────────────────────────
   5. Card dark-mode tweaks
   ────────────────────────────────────────────────────────── */
body.dark-mode .card,
body.dark-mode .card-body,
body.dark-mode .moduletable,
body.dark-mode .moduletable .card {
  background: #1e1e1e;
  color: var(--cassiopeia-text-color);
  border-color: #333;
}

body.dark-mode .card-header h2,
body.dark-mode .card-header h3,
body.dark-mode .card-title {
  color: var(--cassiopeia-heading-color);
}

/* ──────────────────────────────────────────────────────────
   6. Message boxes
   ────────────────────────────────────────────────────────── */
.message-box,
#messageBox.message-box {
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
}

.message-box.error {
  background: #dc3545;
  color: #fff;
}

.message-box.success {
  background: #28a745;
  color: #fff;
}

/* ──────────────────────────────────────────────────────────
   7. Top controls / pagination
   ────────────────────────────────────────────────────────── */
.top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.bottom-pagination {
  text-align: right;
  margin-top: 10px;
}

/* ──────────────────────────────────────────────────────────
   8. Tables (document, products, basket)
   ────────────────────────────────────────────────────────── */
.document-table,
.gfcode-products-table,
#gfp-basket-sidebar table {
  width: 100%;
  margin: 0 auto;
  border-collapse: collapse;
}

.document-table th,
.document-table td,
.gfcode-products-table th,
.gfcode-products-table td,
#gfp-basket-sidebar table th,
#gfp-basket-sidebar table td {
  border: 1px solid #ccc;
  padding: 20px 8px;
  text-align: center;
  vertical-align: middle;
}

/* zebra – light */
.document-table tbody tr:nth-child(odd),
.gfcode-products-table tbody tr:nth-child(odd),
#gfp-basket-sidebar table tbody tr:nth-child(odd) {
  background: #fff;
}

.document-table tbody tr:nth-child(even),
.gfcode-products-table tbody tr:nth-child(even),
#gfp-basket-sidebar table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

/* zebra – dark */
body.dark-mode .document-table tbody tr:nth-child(odd),
body.dark-mode .gfcode-products-table tbody tr:nth-child(odd),
body.dark-mode #gfp-basket-sidebar table tbody tr:nth-child(odd) {
  background: #222;
}

body.dark-mode .document-table tbody tr:nth-child(even),
body.dark-mode .gfcode-products-table tbody tr:nth-child(even),
body.dark-mode #gfp-basket-sidebar table tbody tr:nth-child(even) {
  background: #171717;
}

/* dark-mode table borders & headers */
body.dark-mode .document-table td,
body.dark-mode .document-table th,
body.dark-mode .gfcode-products-table td,
body.dark-mode .gfcode-products-table th,
body.dark-mode #gfp-basket-sidebar table td,
body.dark-mode #gfp-basket-sidebar table th {
  border-color: #555;
  color: #fff;
}

body.dark-mode .document-table thead th,
body.dark-mode .gfcode-products-table thead th,
body.dark-mode #gfp-basket-sidebar thead th {
  background: #000;
  color: #fff;
}

/* ──────────────────────────────────────────────────────────
   9. Action-menu
   ────────────────────────────────────────────────────────── */
.action-menu {
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  z-index: 1000;
  padding: 10px;
  color: #000;
}

.action-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.action-menu ul li {
  padding: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  color: #000;
}

.action-menu ul li::before {
  content: "- ";
  padding-right: 10px;
}

.action-menu ul li:hover {
  background: #0ca5de;
  color: #fff;
}

/* ──────────────────────────────────────────────────────────
   10. Entity manager / registration
   ────────────────────────────────────────────────────────── */
.gfcode-entity-manager,
.gfcode-entity-registration {
  max-width: 900px;
  margin: 20px auto;
  padding: 20px;
  font-family: sans-serif;
}

form label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
  text-align: left;
}

form input,
form select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.gfcode-entity-registration input,
.gfcode-entity-registration select {
  padding: 8px;
}

.input-error {
  border-color: #dc3545 !important;
}

/* ──────────────────────────────────────────────────────────
   11. Top menu
   ────────────────────────────────────────────────────────── */
.top-menu {
  text-align: center;
  margin-bottom: 20px;
}

.top-menu a {
  text-decoration: none;
  color: inherit;
  margin: 0 15px;
  font-weight: bold;
}

.top-menu a.active {
  text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────
   12. Joomla “edit” icons
   ────────────────────────────────────────────────────────── */
.module-edit,
.system-module-edit,
.edit-icon,
a.module-edit,
a.btn.btn-link.jmodedit,
a.jmodedit {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit !important;
}

/* ──────────────────────────────────────────────────────────
   13. GFCode menu & user controls
   ────────────────────────────────────────────────────────── */
.gfcode-menu-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 10px;
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.gfcode-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gfcode-menu-item {
  margin-right: 20px;
}

.gfcode-menu a,
.user-control-link {
  color: var(--button-font-color) !important;
  text-decoration: none;
  font-weight: bold;
}

/* ──────────────────────────────────────────────────────────
   14. Burger menu
   ────────────────────────────────────────────────────────── */

/* keep the lines, but strip any background / border injected
   by the generic button rule above */
.burger-icon {
  background: transparent !important;   /* no fill */
  border: none !important;              /* no border */
  box-shadow: none !important;          /* just in case Bootstrap adds one */
}

/* optional: tidy focus outline without changing your hover effect */
.burger-icon:focus {
  outline: none;
}

.burger-menu-container {
  width: 115%;
  text-align: right;
  margin-right: var(--burger-menu-offset);
  position: relative;
}

.burger-icon {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
}

.burger-line {
  width: 40px;
  height: 3px;
  background: var(--button-font-color);
  margin: 3px 0;
  transition: all 0.3s;
}

.additional-menu {
  list-style: none;
  position: absolute;
  top: calc(100% + var(--burger-dropdown-gap));
  right: 0;
  background: var(--button-bg) !important;
  display: none;
  z-index: 1000;
}

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

.additional-menu-item {
  padding: 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #000;  
  text-align: left;
}

.additional-menu-item:hover {  
  background: var(--button-hover-bg);
  color: #fff;
}

.additional-menu-item a {
  color: var(--button-font-color) !important;
  text-decoration: none;
  font-weight: bold;
}

/* ──────────────────────────────────────────────────────────
   15. Send-Dox & misc forms
   ────────────────────────────────────────────────────────── */
.gfcode-send-dox {
  margin: 20px auto;
  text-align: left;
}

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

.template-group {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.template-group .btn-primary {
  margin-left: auto;
}

/* ──────────────────────────────────────────────────────────
   16. Toggle switch
   ────────────────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #555;
  transition: 0.4s;
  border-radius: 34px;
}

.slider::before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  transition: 0.4s;
  border-radius: 50%;
}

.toggle-switch input:checked + .slider {
  background: #28a745;
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(26px);
}

/* ──────────────────────────────────────────────────────────
   17. Modals / encryption helper
   ────────────────────────────────────────────────────────── */
textarea {
  width: 100%;
  height: 500px;
  padding: 10px;
  font-size: 14px;
}

.modal-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
}

.modal-content {
  position: relative;
  background: #fff;
  color: #000;
  padding: 20px 30px 30px;
  max-width: 900px;
  width: 90%;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border: 1px solid #ccc;
}

body.dark-mode .modal-content {
  background: #1e1e1e;
  color: #fff;
  border-color: #333;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 26px;
  font-weight: bold;
  cursor: pointer;
}

.modal-pre {
  max-height: 500px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  background: #f7f7f7;
  padding: 12px;
  border: 1px solid #ddd;
}

body.dark-mode .modal-pre {
  background: #2b2b2b;
  border-color: #444;
}

/* ──────────────────────────────────────────────────────────
   18. Org-selector list
   ────────────────────────────────────────────────────────── */
.org-list .org-row {
  width: 100%;
  padding: 12px 10px;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
  border: none;
  background: transparent;
}

.org-list .org-row:nth-child(odd) {
  background: #fff;
}

.org-list .org-row:nth-child(even) {
  background: #f9f9f9;
}

.org-list .org-row:hover,
.org-list .org-row.org-active {
  background: var(--button-hover-bg) !important;
  color: #fff !important;
}

/* ──────────────────────────────────────────────────────────
   19. Misc helpers
   ────────────────────────────────────────────────────────── */
.password-rules li.valid {
  display: none;
}

.loaded-document {
  font-size: 14px;
  margin: 0;
}

.error-message {
  color: red;
  margin-bottom: 10px;
}

#captcha_container {
  margin-top: 10px;
}