:root
{
   /* main site variables */
   --primary-color: #2c3e50;
   --secondary-color: #18bc9c;
   --background-color: #FFFFFF;
   --card-background: #ffffff;
   --text-color: #333333;
   --accent-color: #3498db;
   --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
   --header--height: 80px;
   
   /* contact variable */
   --color-background: #ffffff;
   --color-border: #e0e0e0;
   --color-input: #333333;
   --color-placeholder: #999999;
   --color-section-title: #357ab8;
   --color-input-disabled: #ccc;
   
   /* dashboard variables */
   --color-card-bg: #f9f9f9;
   --color-card-bg-dark: #eee;
   --color-text: #333333;
   --color-primary: #357ab8;
   --color-danger: #f44336;
   --color-muted: #777777;
   
   /* modal */
   --card-radius: 1em;
   
   /* invoice table */
   --font-size: 1em;
   --color-white: #ffffff;
   --color-primary-dark: val(--color-primary);
   --border-radius: 0.5em;
   --border-width: 0.05em;
   --padding-cell: 0.5em;
   
   /* input variables */
   --input-border-radius: 0.5em;
   --input-border-color: #ccc;
   
   /* button variables */
   --color-button: #4a90e2;
   --color-button-text: #fff;
   --color-button-hover: #357ab8;
   --color-button-disabled: #aaa;
   --button-border-radius: 0.5em;
   --button-padding-h: 0.5em;
   --button-padding-w: 1em;
   
   /* table variables */
   --table-border-color: #ccc;
   --table-header-bg-color: #eee;
}


body 
{
   overflow: auto;
   margin: 0;
   background-color: var(--background-color);
   font-family: var(--font-family);
   color: var(--text-color);
}

/**********************************/
/****   CONTEXT MENU STUFF     ****/

.custom-context-menu {
    position: absolute;
    display: none;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    padding: 6px 0;
    z-index: 9999;
    font-family: "Segoe UI", Roboto, sans-serif;
    transition: opacity 0.15s ease;
}

.ccm-item {
    padding: 8px 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    font-size: 14px;
}

.ccm-item:hover {
    background: #f3f3f3;
}

.ccm-separator {
    height: 1px;
    margin: 5px 0;
    background: #e2e2e2;
}

.ccm-icon {
    margin-right: 8px;
    opacity: 0.7;
    font-size: 14px;
}

.ccm-label {
    flex: 1;
}

.has-context-menu {
    cursor: pointer;
}

/********************************/
/***  RecipE stuff */

.RecipE-editor .posology
{
   width: 100%;        /* occupe toute la largeur disponible */
   max-width: 900px;
}

.posology .modal-actions
{
   margin-top: 1em;
}

.posology .modal-content input,
.posology .modal-content select
{
   width: 100%;
   box-sizing: border-box;   
}

.posology .encart.free input
{
   width: 100%;
   box-sizing: border-box;   
}

.posology .menu
{
   display: flex;
   gap: 20px;
   margin-bottom: 20px;
}

.posology fieldset.encart {
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.05);
    background: #fff;
    margin-bottom: 20px;
}

.posology .ligne-rythme {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.posology .resume {
    border: 1px solid #ccc;
    padding: 15px;
    border-radius: 8px;
    background: #fff;
    min-height: 40px;
}
.posology .actions {
   text-align: center;   
}

.contact-form.posology select.periodicity,
.contact-form.posology select.duration_unit
{
   width: unset !important;
}

.RecipE-editor .tab
{
   border: 1px solid #ccc;
   border-radius: 1em;
   box-shadow: 0 0.3em 0.2em rgba(0, 0, 0, 0.1);
   padding: 1em;
}
.RecipE-editor .tab-selector 
{
   display: flex;       /* active Flexbox */
   width: 100%;         /* prend toute la largeur disponible */
   gap: 10px;           /* espace entre les divs (optionnel) */
}
.RecipE-editor .tab-selector div
{
   flex: 1;
   color: var(--color-button-text);
   background-color: var(--color-button);
   text-align: center;
   padding: 0.2em;
   margin-bottom: 0.2em;
   border-radius: 0em 0em 0.5em 0em;
}
.RecipE-editor .tab-selector div.selected
{
   background-color: var(--color-button-hover);
}

.RecipE-editor .tab-content textarea
{
   width: 100%;
   height: 3em;
   resize: none;
   box-sizing: border-box;
}
.RecipE-editor .tab-content button
{
   padding: 0.3em;
   width: 100%;
}

.RecipE-editor .buttons 
{
   margin-top: 1em;
}
.RecipE-editor .buttons > div
{
   display: grid;
   grid-template-columns: 1fr 1fr;
   /* border-spacing: 1rem; */
   margin: auto;
   width: fit-content;
   grid-column-gap: 1em;
}

.RecipE-editor .buttons button
{
  display: table-cell;     /* chaque bouton est une cellule */
  padding: 0.5rem 1rem;
  text-align: center;
  width: 100%;
}

.RecipE-editor .tab-content .icon-sidebar
{
   display: flex;
   flex-direction: column;
   justify-content: start;
   grid-row: span 2;
}

.RecipE-editor .tab-content .icon-sidebar svg {
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: #333;             /* couleur par défaut */
  transition: color 0.2s;
}

.RecipE-editor .tab-content .icon-sidebar svg:hover {
  color: #007bff;          /* couleur au survol */
}

.RecipE-editor .tab-content.magistral 
{
   display: grid;
   grid-template-columns: 1fr auto;
}

/******************************/
/****     Dialog style    ****/
/******************************/

.modal
{
   display: none;
   position: fixed;
   z-index: 1000001;
   left: 0;
   top: 0;
   width: 100%;
   height: 100%;
   background-color: rgba(0, 0, 0, 0.6);
   display: flex;
   align-items: center;
   justify-content: center;
}

.modal-content
{
   background-color: var(--color-background);
   padding: 2em;
   border-radius: var(--card-radius);
   box-shadow: 0 0.3em 2em rgba(0, 0, 0, 0.3);
   width: 90%;
   max-width: 400px;
   text-align: center;
   position: relative;
}

.modal-content h2
{
   margin-top: 0;
   margin-bottom: 1em;
   color: var(--color-primary);
   font-size: 1.2em;
}

.modal-content p
{
   margin-bottom: 2em;
   color: var(--color-text);
   font-size: 1em;
}

.modal-content .button-group
{
   display: flex;
   justify-content: center;
   gap: 1em;
}

.modal-content button
{
   background-color: var(--color-button);
   color: var(--color-button-text);
   border: none;
   padding: 0.8em 1.5em;
   border-radius: 0.5em;
   cursor: pointer;
   transition: background-color 0.3s ease;
   font-size: 1em;
}

.modal-content button:hover
{
   background-color: var(--color-button-hover);
}

@media (max-width: 600px)
{
   .modal-content
   {
      padding: 1.5em;
   }
}

/******************************/
/****    Menu bar style    ****/
/******************************/

.menu-bar 
{
   top: 0;
   left: 0;
   position: fixed;
   width: 100%;
    
   display: flex;
   justify-content: center;
   align-items: center;
   gap: 40px;
   background: #ffffff;
   padding: 12px 0;
   box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
   
   z-index: 1000000;
}

.menu-bar a
{
   color: #333;
   text-decoration: none;
   transition: transform 0.2s, color 0.2s;
}

.menu-bar a:hover
{
   transform: scale(1.2);
   color: #000;
}

.menu-bar svg
{
   width: 28px;
   height: 28px;
   stroke-width: 1.8;
}

/******************************/
/****      Main Page       ****/
/******************************/

.page-container
{
   margin: 0;
   padding: 0;
   width: 100%;
}

.page-content
{
   max-width: 1200px;
   margin: 4em auto 1em;
   padding: 2em;
   border-radius: 1em;
   box-shadow: 0 0.3em 0.2em rgba(0, 0, 0, 0.1);
   background: var(--background-color);
}

@media (max-width: 600px)
{
   .page-content
   {
      box-shadow: revert;
   }
}

button
{
  padding: 0.5em 1em;
  padding: var(--button-padding-h) var(--button-padding-w);
  border: none;
  border-radius: var(--button-border-radius);
  background-color: var(--color-button);
  color: var(--color-button-text);
  cursor: pointer;
}

button:hover 
{
  background-color: var(--color-button-hover);
}

button:disabled
{
   background-color: var(--color-button-disabled);
   cursor: not-allowed;
}

input[type="checkbox"]
{
   accent-color: var(--color-button);
}

/****************************************/
/***    Validate prescription screen  ***/
/****************************************/

body.validate-prescription-screen .page-content
{
   display: flex;
   flex-direction: column;
}

body.validate-prescription-screen .page-content > :first-child {
  flex: 0 0 auto;   /* hauteur naturelle */
}

body.validate-prescription-screen .page-content > :last-child {
   flex: 1 1 auto;
   overflow-y: hidden;
}

body.validate-prescription-screen .prescriptions-box
{
   display: flex;
   flex-direction: column;
   height: 100%;
}

body.validate-prescription-screen .existing-prescriptions 
{
   flex: 1 1 auto;
   overflow-y: auto;
}
body.validate-prescription-screen .new-prescription
{
   flex: 0 0 auto;
}

body.validate-prescription-screen .existing-prescriptions
{
   display: flex;
   flex-direction: column;
   height: 100%;
}
body.validate-prescription-screen .existing-prescriptions > :first-child 
{
   flex: 0 0 auto;
}

body.validate-prescription-screen .existing-prescriptions > :last-child
{
   flex: 1 1 auto;
   overflow-y: auto;
}

body.validate-prescription-screen .new-prescription h3,
body.validate-prescription-screen .existing-prescriptions h3
{
   text-align: center;
}

body.validate-prescription-screen .new-prescription-buttons
{
   text-align: center;
   margin-top: 1em;
}

body.validate-prescription-screen .patient-summary
{
   text-align: center;
   background: #ccc;
   width: 90%;
   /* max-width: 900px; */
   background: #eef2f5;
   border: 1px solid #ccc;
   border-radius: 8px;
   padding: 8px 15px;
   margin-bottom: 10px;
   font-size: 14px;
   box-sizing: border-box;
   text-align: center;
}

.RecipE-editor .new-prescriptions
{
   min-height: 2em;
}

.RecipE-editor .new-prescriptions .prescription-item p
{
   text-align: left;
}

.RecipE-editor .new-prescriptions,
body.validate-prescription-screen .new-prescriptions,
body.validate-prescription-screen .ongoing-prescriptions
{
   border: 1px solid var(--table-border-color);
   border-radius: var(--button-border-radius);
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
   padding: 0.2em 0.5em;
}

body.validate-prescription-screen .ongoing-prescriptions .prescription-item
{
   margin-bottom: 1em;
}

body.validate-prescription-screen .ongoing-prescriptions .prescription-item p
{
   margin: 0 1em;
}

body.validate-prescription-screen .ongoing-prescriptions .prescription-item:not(:last-child)::after
{
   content: "";
   grid-column: 1 / -1;
   height: 1px;
   background: var(--table-border-color);
   display: block;
   margin: 1em;
}


/******************************/
/****    Login Screen      ****/
/******************************/

.login-panel
{
   max-width: 500px;
   text-align: center;
}

.login-panel input[type="password"]
{
   padding: 0.8em;
   width: 80%;
   margin-top: 1em;
   border: 1px solid var(--input-border-color);
   border-radius: var(--input-border-radius);
}

.login-panel label
{
   display: block;
   margin-top: 0.8em;
   font-size: 0.7em;
}

.login-panel button 
{
  margin-top: 1em;
}

/******************************************/
/**** Doctor Prescriptions List Screen ****/
/******************************************/

.prescriptions-list h1
{
   font-size: 1.5em;
   margin-bottom: 1em;
}

.prescriptions-list .actions
{
   margin-bottom: 1em;
}

.prescriptions-list .table
{
   width: 100%;
   display: grid;
   grid-template-columns: min-content 1fr 2fr min-content;
}

.prescriptions-list .table-row
{
   display: contents;
}

.prescriptions-list .table-row:not(:last-child)::after
{
  content: "";
  grid-column: 1 / -1;
  height: 1px;
  background: var(--table-border-color);
  display: block;
}

.prescriptions-list .prescriptions-list .table-header 
{
   font-weight: bold;
}

.prescriptions-list .table-header .table-cell 
{
   background: var(--table-header-bg-color);
}

.prescriptions-list .table-cell p
{
   margin: 0px;
}

.prescriptions-list .table-cell 
{
  padding: 0.5rem;
}

.prescriptions-list div.actions
{
   display: flex;
   flex-direction: row;
   gap: 0.5rem;
   align-items: center;
   justify-content: flex-start;
}

@media (max-width: 600px)
{
   .prescriptions-list .actions
   {
      position: relative;
   }
   .prescriptions-list .actions input
   {
      position: absolute;
      right: 0;
      margin: 1em;
   }
   .prescriptions-list .table
   {
      display: block;
   }

   .prescriptions-list .table-row.table-header
   {
      display: none;
   }

   .prescriptions-list .table-row
   {
      position: relative;
      display: block;
      margin-bottom: 1rem;
      padding: 1rem;
      border: 1px solid var(--table-border-color);
      border-radius: var(--button-border-radius);
      background: #fff;
      box-shadow: 0 2px 4px rgba(0,0,0,0.05);
   }

   /* Chaque cellule se stacke */
   .prescriptions-list .table-cell
   {
      display: flex;
      margin-bottom: 0.75rem;
   }

   .prescriptions-list .table-cell:last-child 
   {
      margin-bottom: 0;
   }

   .prescriptions-list .table-cell.actions
   {
      display: flex;             /* active flex */
      flex-direction: row;       /* boutons côte à côte */
      justify-content: center;   /* centre horizontalement */
      align-items: center;       /* centre verticalement */
      gap: 0.5rem;              
    }

   .prescriptions-list .table-row .table-cell:first-child
   {
      position: absolute;
      top: 0;
      right: 0;
   }

   .prescriptions-list .table-row:not(:last-child)::after
   {
       display: none;
   }   
}

.header-logo
{
   cursor: pointer;
}

.card2 a,
.card2 a:link,
.card2 a:visited,
.card2 a:hover,
.card2 a:active,
footer a,
footer a:link,
footer a:visited,
footer a:hover,
footer a:active
{
   text-decoration: none;
   color: var(--color-button);
}

.deactive-div
{
   display: none;
}

.deactive-div,
.block-gui-div,
.loading-div-background,
.modal_block
{
   position:fixed;
   top:0;
   left:0;
   width:100%;
   height:100%;
   z-index: 10000;
}
.loading-div
{
   width: 30px;
   height: 30px;
   text-align:center;
   position:absolute;
   left: 50%;
   top: 50%;
   margin-left:-15px;
   margin-top: -15px;
}

.main-site
{
   max-width: 1200px;
   margin: auto;
   padding: 20px;
}

.main-site .header 
{
   padding: 16px 0px;
   background-color: #ffffff;
   border-bottom: 1px solid #ddd;

   position: fixed;
   top: 0;
   left: 0;
   z-index: 1000;
   width: 100%;
}

.main-site .header-content
{
   max-width: 1200px;
   width: 100%;
   margin: auto;
   display: flex;
   justify-content: space-between;
   align-items: center;
}

.main-site .header-logo
{
   max-width: 50%;
}
.main-site .header-logo img 
{
   max-width: 100%;
   height: 40px;
}

.main-site .burger
{
   margin-right: 1em;
   display: none;
   flex-direction: column;
   cursor: pointer;
   width: 25px;
}

.main-site .burger div
{
   height: 3px;
   background: #333;
   margin: 4px 0;
   width: 100%;
}

.main-site .header-menu a:hover
{
   color: #007BFF;
}

.main-site nav
{
   display: flex;
   gap: 20px;
}

.main-site nav a
{
   text-decoration: none;
   color: #333;
   transition: color 0.3s ease;
}

.main-site nav a:hover
{
   color: #007BFF;
}

@media (max-width: 768px) 
{
   .main-site nav
   {
      position: fixed;
      top: 60px;
      right: 0;
      background: #fff;
      height: calc(100% - 60px);
      width: 200px;
      flex-direction: column;
      align-items: flex-start;
      padding: 20px;
      transform: translateX(100%);
      transition: transform 0.3s ease;
      box-shadow: -2px 0 5px rgba(0,0,0,0.1);
   }

   .main-site nav.active
   {
      transform: translateX(0);
   }

   .main-site .burger
   {
      display: flex;
   }
}

.main-site .banner
{
   margin-top: var(--header--height);
   background-color: var(--accent-color);
   color: white;
   text-align: center;
   padding: 10px 20px;
   border-radius: 8px;
   margin-bottom: 20px;
   font-weight: bold;
}

.main-site h1,
.main-site h2
{
   color: var(--primary-color);
}

.main-site .grid
{
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
   gap: 20px;
   margin-bottom: 40px;
}

.main-site .card
{
   background: var(--card-background);
   border-radius: 12px;
   padding: 20px;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
   text-align: center;
   transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-site .card:hover
{
   transform: translateY(-5px);
   box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.main-site .card svg
{
   height: 50px;
   margin-bottom: 15px;
   fill: var(--accent-color);
}

.main-site .faq
{
   margin-top: 40px;
}

.main-site .faq h2
{
   margin-bottom: 20px;
}

.main-site .faq-item
{
   background: var(--card-background);
   padding: 15px;
   border-radius: 8px;
   margin-bottom: 10px;
   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.main-site footer
{
   text-align: center;
   padding: 20px;
   font-size: 0.9em;
   color: #777;
}

@media (max-width: 600px)
{
   .main-site .banner
   {
      font-size: 0.9em;
   }
   .main-site .card
   {
      padding: 15px;
   }
}



.contact-form,
.buy-pack 
{
   margin-top: var(--header--height);
   margin-left: auto;
   margin-right: auto;
   margin-bottom: auto;
   background: var(--color-background);
   padding: 2em;
   border-radius: 0.5em;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
   font-family: var(--font-family);
}

.contact-form p
{
   text-align: center;
}

.contact-form h2,
.buy-pack h2
{
   margin-top: 0px;
   color: var(--color-section-title);
   text-align: center;
}

.contact-form h3
{
   margin-bottom: 0.5em;
   margin-top: 1.5em;
   color: var(--color-section-title);
   font-size: 1.2em;
}

.contact-form form
{
   display: flex;
   flex-direction: column;
   gap: 1.5em;
}

.contact-form .field-group 
{
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 1em;
   width: 100%;
}
.contact-form .field-group.single_column
{
   grid-template-columns: 1fr;
}

.contact-form label
{
   font-weight: bold;
   color: var(--color-input);
   margin-bottom: 0.3em;
   display: block;
}

.contact-form input::placeholder
{
   color: var(--color-placeholder);
}

.contact-form button 
{
   background: var(--color-button);
   color: var(--color-button-text);
   border: none;
   padding: 0.75em 1.5em;
   border-radius: 0.3em;
   font-size: 1em;
   cursor: pointer;
   transition: background 0.3s ease;
   align-self: center;
}

.contact-form button:hover
{
   background: var(--color-button-hover);
}

.contact-form .bce-input,
.contact-form .text-input
{
   display: flex;
   align-items: center;
   background: white;

   padding: 0.75em;
   border: 1px solid var(--color-border);
   border-radius: 0.3em;
   font-size: 1em;
   color: var(--color-input);
   background: var(--color-background);
}

.contact-form select
{
   padding: 0.75em;
   border: 1px solid var(--color-border);
   border-radius: 0.3em;
   font-size: 1em;
   color: var(--color-input);
   background: var(--color-background);
   
   width: 100%;
   
   -webkit-appearance: none; 
}

.contact-form .bce-input span
{
   line-height: 1em;

   margin-right: 0.5em;
   font-weight: bold;
   white-space: nowrap;
}

.contact-form .bce-input input[type="text"],
.contact-form .text-input input[type="text"],
.contact-form .text-input input[type="email"],
.contact-form .text-input input[type="password"],
.contact-form .text-input input[type="number"],
.contact-form .text-input input[type="date"]
{
   border: none;
   outline: none;
   font-size: 1em;
   background: transparent;
   width: 100%;
   padding: 0em;
}

.contact-form .readonly
{
   background-color: var(--color-input-disabled)
}


@media (max-width: 600px)
{
   .contact-form .field-group 
   {
      grid-template-columns: 1fr;
   }
   .contact-form .form-group-spacer
   {
      display: none;
   }
}

.dashboard 
{
   margin-top: var(--header--height);
   margin-left: auto;
   margin-right: auto;
   margin-bottom: auto;
   display: flex;
   flex-direction: column;
   gap: 1em;
   padding: 1em;
   background: var(--color-background);
   font-family: var(--font-family);
   border-radius: 1em;
}

.dashboard .dashboard-card
{
   background: var(--color-card-bg);
   border: 1px solid var(--color-border);
   border-radius: 0.5em;
   padding: 1em;
   display: flex;
   align-items: center;
   justify-content: space-between;
   box-shadow: 0 2px 4px rgba(0,0,0,0.1);
   transition: background-color 0.3s ease;
}

.dashboard .dashboard-card.clickable
{
   cursor: pointer;
}

.dashboard .dashboard-card.clickable:hover
{
   background: var(--color-card-bg-dark);
}

.dashboard .dashboard-card .left-content
{
   display: flex;
   align-items: center;
   gap: 1em;
}

.dashboard .dashboard-card .icon
{
   width: 2em;
   height: 2em;
   flex-shrink: 0;
}

.dashboard .dashboard-card .icon svg
{
   width: 100%;
   height: 100%;
   color: var(--color-primary);
}

.dashboard .dashboard-card-content h3
{
   margin: 0;
   font-size: 1.1em;
   color: var(--color-text);
}

.dashboard .dashboard-card-content p
{
   margin: 0.2em 0 0;
   font-size: 1em;
   color: var(--color-muted);
}

.dashboard .dashboard-card-action a
{
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 2em;
   height: 2em;
   text-decoration: none;
}

.dashboard .dashboard-card-action svg
{
   width: 100%;
   height: 100%;
   fill: var(--color-primary);
}

.dashboard .dashboard-card.status .icon-ok,
.dashboard .dashboard-card.status .icon-failure
{
   display: none;
}

.dashboard .dashboard-card.status.status-ok .icon-ok
{
   display: block;
}

.dashboard .dashboard-card.status.status-ok .status-text
{
   color: var(--color-primary);
   font-weight: bold;
}

.dashboard .dashboard-card.status.status-failure .icon-failure
{
   display: block;
}

.dashboard .dashboard-card.status.status-failure .status-text
{
   color: var(--color-danger);
   font-weight: bold;
}




.invoice-detail
{
   font-family: var(--font-family);
   font-size: var(--font-size);
   color: var(--color-text);
   
   overflow-x: hidden;
}

.invoice-detail .table-container
{
   width: 100%;
   overflow-x: auto;
   background: var(--color-white);
   border-radius: var(--border-radius);
   border: var(--border-width) solid var(--color-border);
   
   overflow-x: auto;
}

.invoice-detail table
{
   width: 100%;
   border-collapse: collapse;
   min-width: 40em;
}

.invoice-detail thead
{
   background-color: var(--color-primary);
   color: var(--color-white);
}

.invoice-detail th,
.invoice-detail td
{
   padding: var(--padding-cell);
   border: var(--border-width) solid var(--color-border);
   text-align: left;
   white-space: nowrap;
}

.invoice-detail th:nth-child(2),
.invoice-detail td:nth-child(2)
{
   width: 5em;
   min-width: 3em;
}

.invoice-detail th:nth-child(3),
.invoice-detail td:nth-child(3),
.invoice-detail th:nth-child(5),
.invoice-detail td:nth-child(5)
{
   width: 8em;
   min-width: 6em;
}

.invoice-detail th:nth-child(4),
.invoice-detail td:nth-child(4)
{
   width: 6em;
   min-width: 4em;
}

.invoice-detail th:last-child,
.invoice-detail td:last-child
{
   width: 3em;
   text-align: center;
   padding: 0.2em;
}

.invoice-detail input[type="text"],
.invoice-detail input[type="number"]
{
   width: 100%;
   min-width: 0;
   padding: 0.3em;
   border: var(--border-width) solid var(--color-border);
   border-radius: 0.3em;
   font-size: 1em;
   box-sizing: border-box;
   font-family: var(--font-family);
}

.invoice-detail input[type="number"]
{
   text-align: right;
}

.invoice-detail .remove-btn
{
   background: var(--color-primary);
   color: var(--color-white);
   border: none;
   border-radius: 0.3em;
   padding: 0.2em;
   width: 2em;
   height: 2em;
   cursor: pointer;
   font-size: 1em;
   line-height: 1;
}

.invoice-detail .add-btn
{
   background: none;
   border: none;
   color: var(--color-white);
   font-size: 1.4em;
   cursor: pointer;
   padding: 0;
   margin: 0;
}

.invoice-detail .tva-cell
{
   display: flex;
   align-items: center;
   gap: 0.3em;
}

.invoice-detail .recap strong
{
   margin-right: 0.75em;
}

.invoice-detail .recap
{
   background: white;
   padding: 15px;
   width: fit-content;
   margin-left: auto;
   margin-right: auto;
   display: flex;
   flex-direction: column;
   align-items: flex-end;
}

.invoice-detail .recap div
{
   display: flex;
   justify-content: space-between;
   width: 100%;
   min-width: 200px;
   margin-bottom: 8px;
}

.invoice-detail .recap div span:first-child
{
   margin-right: 10px;
}

.invoice-detail input.error
{
   background-color: #ffecec;
   color: #d8000c;
   border: 1px solid #f5c6cb;
}

@media (max-width: 600px)
{
   .invoice-detail table
   {
      min-width: 100%;
   }

   .invoice-detail .recap
   {
      align-items: flex-start;
      margin: 0;
   }
}

.card2
{
   margin-top: var(--header--height);
   margin-left: auto;
   margin-right: auto;
   margin-bottom: auto;

   background: var(--card-background);
   box-shadow: 0 2px 4px var(--card-shadow);
   max-width: 400px;
   width: calc ( 100% - 60px );
   text-align: center;
   border-radius: 8px;
   
   padding: 20px 30px;
}

.card2 h2
{
   margin-top: 0;
   color: var(--primary-color);
   margin-bottom: 15px;
}

.card2 p
{
   margin-bottom: 20px;
   line-height: 1.5;
}

.card2 .button-download:hover
{
   background-color: var(--color-button-hover);
}

.card2 .checkbox-group 
{
   margin-bottom: 15px;
}

.card2 .checkbox-group label
{
   display: flex;
   align-items: flex-start;
   font-size: 0.8em;
   margin-bottom: 10px;
   cursor: pointer;
   line-height: 1.4;
}

.card2 .checkbox-group input 
{
   margin-right: 10px;
   transform: scale(1.2);
   margin-top: 2px;
}

.card2 .checkbox-group a
{
   color: var(--primary-color);
   text-decoration: none;
}

.card2 .checkbox-group a:hover
{
   text-decoration: underline;
}

.card2 .button-confirm
{
   background-color: var(--color-button);
   color: var(--color-button-text);
   border: none;
   padding: 12px 20px;
   font-size: 1em;
   border-radius: 4px;
   cursor: pointer;
   width: 100%;
   transition: background-color 0.3s;
}

.card2 .button-confirm:disabled,
.contact-form button:disabled
{
   background-color: #ccc;
   cursor: not-allowed;
}

.card2 .button-confirm:not(:disabled):hover,
.contact-form button:not(:disabled):hover
{
   background-color: var(--color-button-hover);
}


@media (max-width: 600px)
{
   .card2
   {
      width: calc ( 100% - 40px );
      padding: 15px 20px;
   }

   .card2 .button-download
   {
      width: 100%;
   }
}



.buy-pack .packs {
display: flex;
flex-wrap: wrap;
gap: 1.5em;
justify-content: center;
}

.buy-pack .pack-card {
background-color: var(--color-secondary);
border: 1px solid var(--color-border);
border-radius: var(--card-radius);
padding: var(--card-padding);
width: 100%;
max-width: 18em;
text-align: center;
display: flex;
flex-direction: column;
justify-content: space-between;
transition: transform 0.2s ease, box-shadow 0.2s ease;
box-sizing: border-box;
}

.buy-pack .pack-card:hover {
transform: translateY(-0.2em);
box-shadow: 0 0.5em 1.5em var(--color-shadow);
}

.buy-pack .pack-price {
font-size: 1.8em;
color: var(--color-primary);
margin-bottom: 0.3em;
}

.buy-pack .pack-credits {
font-size: 1.1em;
margin-bottom: 1em;
}

.buy-pack .pack-button {
background-color: var(--color-button);
color: var(--color-button-text);
border: none;
padding: 0.75em;
border-radius: 0.5em;
cursor: pointer;
transition: background-color 0.3s ease;
text-decoration: none;
display: inline-block;
margin-top: auto;
}

.buy-pack .pack-button:hover {
background-color: var(--color-button-hover);
}

@media (max-width: 600px) {
.buy-pack .packs {
  flex-direction: column;
  gap: 1em;
}

.buy-pack .pack-card {
  width: 100%;
  max-width: 100%;
  padding: 1em;
}

}


.invoice_list
{
   margin-top: var(--header--height);
   margin-left: auto;
   margin-right: auto;
   margin-bottom: auto;

   max-width: 600px;
   background: white;
   padding: 20px;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
   border-radius: 12px;
}

.invoice_list h1
{
   text-align: center;
   margin-bottom: 20px;
   color: var(--color-button);
}

.invoice_list  .facture
{
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 16px;
   border-bottom: 1px solid #eee;
   transition: background-color 0.3s;
   border-radius: 12px;
}

.invoice_list .facture:hover
{
   background-color: #eee;
   cursor: pointer;
}

.invoice_list .facture:last-child
{
   border-bottom: none;
}

.invoice_list .facture-info
{
   display: flex;
   flex-direction: column;
}

.invoice_list .facture-info strong
{
   color: #333;
}

.invoice_list .facture-date
{
   font-size: 0.9em;
   color: #777;
}

.invoice_list .facture-action
{
   display: flex;
   align-items: center;
   justify-content: center;
   width: 32px;
   height: 32px;
   cursor: pointer;
   color: var(--color-button);
   text-decoration: none;
   transition: transform 0.2s, color 0.2s;
}

.invoice_list .facture-action:hover
{
   transform: scale(1.2);
   color: var(--color-button-hover);
}

.invoice_list .facture-action svg
{
   width: 24px;
   height: 24px;
   fill: currentColor;
}

@media (max-width: 600px)
{
   .invoice_list
   {
      margin-top: var(--header--height);
      margin-left: 20px;
      margin-right: 20px;
      margin-bottom: 20px;

      padding: 15px;
   }

   .invoice_list .facture
   {
      flex-direction: column;
      align-items: flex-start;
   }

   .invoice_list .facture-action
   {
      margin-top: 8px;
   }
}


 

.main-site-app
{
   margin: 0;
   padding: 0;
   
   height: 100vh;
   width: 100%;
}
.main-site-app .login
{
   height: 100vh;
   
   font-family: var(--font-family);
   background-color: #fff;
   display: flex;
   flex-direction: column;
   justify-content: center;
   align-items: center;
   color: #333;
   text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.main-site-app .login .logo 
{
   position: absolute;
   top: 20%;
   margin-bottom: 1.5em;
}

.main-site-app .login .logo img 
{
   width: auto;
   height: 7em;
}

.main-site-app .login .login-button
{
   padding: 1em 2em;
   font-size: 1em;
   background-color: var(--color-button);
   color: var(--color-button-text);
   border: none;
   border-radius: 2em;
   cursor: pointer;
   opacity: 0;
   transform: translateY(20px);
   animation: fadeInUp 1s ease-out 0.5s forwards;
}

.main-site-app .login .login-button:hover
{
   background-color: var(--color-button-hover);
}

@keyframes fadeInUp
{
   to 
   {
      opacity: 1;
      transform: translateY(0);
   }
}

.main-site-app .dashboard,
.main-site-app .contact-form,
.main-site-app .card2,
.main-site-app .buy-pack
{
   width: calc(100% - 1em);
   padding: 0.5em;
   margin-top: 0.2em;

   box-shadow: none;
}

.language-selector
{
   position: relative;
   display: inline-block;
   cursor: pointer;
}

.language-icon
{
   width: 24px;
   height: 24px;
   color: #333;
}

.language-menu
{
   position: absolute;
   top: 0;
   right: 0;

   background: white;
   border: 1px solid #ddd;
   border-radius: 6px;
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
   padding: 0.25rem 0;
   z-index: 10001;
   
   overflow: hidden;
   pointer-events: none;
   transition: opacity 0.4s ease, width 0.4s ease;
   opacity: 0;
   width: 0px;
}

.language-menu.active
{
   pointer-events: auto;
   display: block;
   opacity: 1;
   width: 3em;
}

.language-option
{
   padding: 1.0rem 1rem;
   font-size: 1.2rem;
   color: #333;
   white-space: nowrap;
}

.language-option:hover
{
   background-color: #f5f5f5;
}



.unsubscribe-form 
{

   margin-top: var(--header--height);
   margin-left: auto;
   margin-right: auto;
   margin-bottom: auto;
   background: var(--color-background);
   padding: 2em;
   border-radius: 0.5em;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
   font-family: var(--font-family);
}

.unsubscribe-form h2
{
   margin-top: 0;
   font-size: 1.5em;
   color: #333;
   display: flex;
   align-items: center;
   gap: 0.5em;
}

.unsubscribe-form h2 svg
{
   width: 1.5em;
   height: 1.5em;
   stroke: var(--color-button);
}

.unsubscribe-form .form-group 
{
   margin: 1.5em 0;
}

.unsubscribe-form .form-group label
{
   display: block;
   margin-bottom: 0.5em;
   color: #555;
   font-weight: bold;
}

.unsubscribe-form .form-group input[type="radio"]
{
   margin-right: 0.5em;
}

.unsubscribe-form .form-group .reason
{
   display: flex;
   align-items: center;
   margin-bottom: 0.5em;
}

.unsubscribe-form .form-group textarea
{
   width: 100%;
   padding: 0.8em;
   border: 1px solid #ccc;
   border-radius: 0.5em;
   resize: vertical;
   display: none;
}

.unsubscribe-form button
{
   background: var(--color-button);
   color: white;
   border: none;
   padding: 0.8em 1.5em;
   border-radius: 0.5em;
   cursor: pointer;
   font-size: 1em;
}

.unsubscribe-form button:disabled
{
   background-color: #ccc;
   cursor: not-allowed;
}

.unsubscribe-form button:hover
{
   background: var(--color-button-hover);
}

#userTableContainer {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-family: 'Segoe UI', Roboto, sans-serif;
}

#addUserBtn {
  background-color: #0078d4;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 20px;
  transition: background-color 0.2s ease;
}
#addUserBtn:hover {
  background-color: #005ea2;
}

table.dataTable {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  background-color: white;
}
table.dataTable thead {
  background-color: #eaeaea;
}
table.dataTable thead th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #333;
}
table.dataTable tbody td {
  padding: 10px;
  border-top: 1px solid #ddd;
  color: #444;
}
table.dataTable tbody tr:hover {
  background-color: #f2f6fc;
}

.dataTableActionButton 
{
   background: var(--color-button);
   color: var(--color-button-text);
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.dataTableActionButton:hover {
   background: var(--color-button-hover);
}

@media screen and (max-width: 768px) {
  #userTableContainer {
    padding: 10px;
  }
  #addUserBtn {
    width: 100%;
    margin-bottom: 10px;
  }
}

.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px;
  margin-left: 8px;
}
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 6px 10px;
  margin: 2px;
  border-radius: 4px;
  background-color: #eee;
  color: #333 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background-color: #0078d4;
  color: white !important;
}

.text-input.warning
{
   background-color: #FFF4E5;
}
button.warning
{
   background-color: #FFD8B0;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  overflow: hidden;
}

#main_page {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  height: 100%;
  padding: 10px;
  box-sizing: border-box;
  overflow-y: auto;
}

.center-box {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  text-align: center;
  max-width: 500px;
  width: 100%;
}

.center-box input[type="password"] {
  padding: 8px;
  width: 80%;
  margin-top: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.center-box label {
  display: block;
  margin-top: 10px;
  font-size: 14px;
}

.center-box button {
  margin-top: 15px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background-color: #007bff;
  color: white;
  cursor: pointer;
}

.center-box button:hover {
  background-color: #0056b3;
}

.patient-summary {
  width: 90%;
  max-width: 900px;
  background: #eef2f5;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px 15px;
  margin-bottom: 10px;
  font-size: 14px;
  box-sizing: border-box;
  text-align: center;
}

.prescriptions-box {
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 900px;
  max-height: 100%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.prescriptions-box h3 {
  text-align: center;
  margin-top: 0;
}

.existing-prescriptions {
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 20px;
  min-height: 120px;
  max-height: 50vh;
  overflow-y: auto;
}

.prescription-item {
  border-bottom: 1px solid #eee;
  padding: 8px 0;
}

.prescription-item:last-child {
  border-bottom: none;
}

.prescription-item p {
  margin: 4px 0;
  word-wrap: break-word;
}

.new-prescription {
  text-align: left;
  border-top: 1px solid #ddd;
  padding-top: 15px;
}

.new-prescription button {
  margin: 5px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background-color: #007bff;
  color: white;
}

.new-prescription button:hover {
  background-color: #0056b3;
}
.new-prescription-buttons {
   text-align: center;
   width: 100%;
}
@media (max-width: 600px) {
  .prescriptions-box {
    padding: 15px;
  }
  .new-prescription button {
    padding: 6px 12px;
    font-size: 14px;
  }
  .patient-summary {
    font-size: 13px;
  }
} 





#progressDialog
{
   position: fixed;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   background: #fff;
   border: 1px solid #ccc;
   padding: 20px;
   box-shadow: 0 2px 8px rgba(0,0,0,0.2);
   border-radius: 8px;
   font-family: Arial, sans-serif;
   text-align: center;
   z-index: 1000;
}