/* ==========================================================================
  Variables globales
  ========================================================================== */
:root {
  --color-primary: #005f73;
  --color-secondary: #e0f2f1;
  --color-accent: #0a9396;
  --color-accent-light: #94d2bd;
  --color-text: #1a1a1a;
  --color-muted: #555;
  --color-bg: #fdfdfc;

  --color-caramel: #a67c52;

  --white: #fff;
  --LightGray: #eee;
  --black: #000;
  --red: #c0392b;
  --red-light: #f2dede;
  --red-soft: #ff6b6b;
  --shadow: rgba(0, 0, 0, 0.2);
  --min-shadow: rgba(0, 0, 0, 0.1);
  --overlay: rgba(255, 255, 255, 0.85);
  --font-main: 'Poppins', sans-serif;
  --font-ar: 'Cairo', sans-serif;
  --transition: 0.3s ease-in-out;
  --radius: 8px;
}

* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  height: 100%;
  font-size: 16px;
}

a { text-decoration:none; }

.admin-shell { display:flex; flex-direction:column; min-height:100vh; }
.admin-layout { margin-top:80px; display:flex; flex:1; }

.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%; 
    z-index: 1000;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 0.7rem 1.25rem; 
    background: var(--white); 
    box-shadow: 0 2px 0.4rem var(--shadow);
}

.header-logo-container img,
.admin-header img { 
    max-height: 60px;
    max-width: 60px;
}

.header-user-and-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions-group {
    display: flex;
    align-items: center;
    gap: 1rem; 
    order: 2; 
}

.sidebar {
  width: 280px;
  background: var(--color-primary);
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  min-height: 100%;
  box-shadow: 2px 0 0.4rem var(--shadow);
}

.sidebar-nav {
    flex-grow: 1; 
    overflow-y: auto; 
    padding-bottom: 1.25rem; 
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--color-accent-light);
    color: var(--white);
    flex-shrink: 0;
}

.sidebar a.menu-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  height: 100px;
  padding: 0 1.5rem;
  color: var(--white);
  font-weight: 500;
  border-left: 0.5rem solid transparent;
  transition: var(--transition);
}

.sidebar a.menu-item.active {
  background: var(--color-accent); 
  border-left: 0.5rem solid var(--white);
  font-weight: bold; 
}

.sidebar a.menu-item:hover {
  background: var(--color-accent);
  border-left: 0.5rem solid var(--white); 
}

.sidebar a.menu-item.active:hover {
  background: var(--color-accent);
  border-left: 0.5rem solid var(--white);
}

.submenu {
  visibility: hidden;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
}

body.js-loaded .submenu.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.submenu.active {
  display: block;
  justify-content: center;
}

.submenu-item {
  color: var(--white);
  padding: 2.4rem;
  height: 80px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  border-left: 0.8rem solid transparent; 
  transition: border-left 0.3s ease;
}

.submenu-item:hover {
  background: var(--color-accent);
  border-left: 0.8rem solid var(--white); 
}

.submenu-item.active {
  font-weight: bold;
  background: var(--color-accent);
  border-left: 0.8rem solid var(--white);
}

.sidebar-header {
    position: relative;
    height: 60px; 
}

.sidebar-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    display: none; 
}

.sidebar-close-btn:hover {
    color: var(--color-accent-light);
}

.sidebar.is-active .sidebar-close-btn {
    display: block;
}

.admin-main { 
  flex: 1; 
  padding: 2rem 1rem;
}

.main-title {
  display: flex;
  justify-content: space-between;
  align-items: center; 
  margin-bottom: 1rem;
  font-size: 1.5rem; 
  font-weight: 700;
  color: var(--color-primary);
}

.admin-main h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--color-primary);
} 

.admin-main h3 {
  color: var(--color-accent);
  font-size: 1.2rem;
}

.admin-main .media-icon {
  color: var(--color-accent);
  font-size: 2rem;
}

.admin-main h4 {
  color: var(--color-muted);
  font-size: 1rem; 
  margin-top: 0.7rem;
}

.admin-main n {
  color: var(--color-muted);
  font-size: 0.8rem;
  margin-top: 0.7rem;
  font-weight: 500;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 0.4rem var(--min-shadow);
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.4rem 1rem var(--min-shadow);
}

.card:hover i {
  font-size: 2.4rem;
  color: var(--color-accent-light);
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.card i {
  font-size: 2rem;
  color: var(--color-accent);
  margin-bottom: 0.8rem;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; 
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 0.4rem var(--min-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; 
}

th, td {
  padding: 0.8rem 0.7rem; 
  border-bottom: 1px solid var(--color-accent-light);
  text-align: center;
  vertical-align: middle;
  word-wrap: break-word;
}

th {
  background-color: var(--color-secondary);
  color: var(--color-primary);
  font-weight: 600;
  white-space: nowrap;
}

td.image-cell {
  width: 180px;
}

.table-wrapper img {
  max-width: 150px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.content-cell {
  max-width: none;
  white-space: normal;
  line-height: 1.5;
}

td.actions {
  width: 100px;
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.actions a {
  padding: 0.4rem 0.7rem;
  font-size: 0.9rem;
  border: none;
  transition: 0.2s;
  white-space: nowrap;
}

.actions a:hover {
  opacity: 0.9;
}

.table-wrapper tbody tr:hover {
  background: var(--color-accent-light);
}

.table-wrapper tbody tr:hover td {
  color: var(--white);
}

.btn-accent, .btn-danger, .btn-secondary {
  display: inline-block;
  border: none;
  border-radius: 0;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  min-height: 36px;
  min-width: 160px;
  font-size: 1rem;
}

.btn-accent {
  background: var(--color-accent);
  color: var(--white);
}

.btn-accent:hover {
  background: var(--color-primary);
  filter: brightness(.90);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--red);
  color: var(--white);
}

.btn-danger:hover {
  background: var(--red-light);
  color: var(--red);
  filter: brightness(.95);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: var(--color-primary); 
  color: var(--white);
  filter: brightness(.95);
  transform: translateY(-2px)
}

.btn-add,
.btn-manage {
  font-weight: 600;
  font-size: 1rem; 
  padding: 0.7rem 1rem; 
  text-decoration: none;
  transition: background-color 0.3s;
  height: 36px;
  min-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-add {
  background-color: var(--color-primary) !important; 
  color: var(--white);
}

.btn-manage {
  background-color: var(--color-primary) !important;
  color: var(--white);
}

.btn-add:hover {
  background-color: var(--color-accent) !important;
}

.btn-manage:hover {
  background-color: var(--color-accent) !important;
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  justify-content: center;
  align-items: center; 
  z-index: 9999;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  min-height: 200px;
  min-width: 320px;
  max-width: 400px;
  box-shadow: 0 0.5rem 1.25rem var(--shadow);
  animation: fadeIn .25s ease;
  text-align: justify;
  display: flex;  
  flex-direction: column; 
  justify-content: center;
}

.modal-header {
  padding: 0.7rem 1rem;
  background: var(--color-muted);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.modal-header h3 {
  font-size: 1rem;
  margin: 0;
  color: var(--white);
}

.modal-close {
  cursor: pointer;
  font-size: 1.25rem;
}

.modal-body {
  padding: 1.25rem;
  display: flex;   
  justify-content: center;
  align-items: center;
  text-align: center; 
  flex-grow: 1; 
}

.modal-footer {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

.modal-footer .btn-accent {
  background-color: var(--color-accent);
  border: none;
  color: var(--white);
}

.modal-footer .btn-secondary {
  background-color: var(--color-secondary);
  border: 1px solid var(--color-muted);
  color: var(--color-text);
}

.modal-footer .btn-danger {
  background-color: var(--red);
  border: none;
  color: var(--white);
}

.modal-box.notification-box .modal-header.success-header {
    background-color: var(--color-accent);
    color: var(--white);
}

.modal-box.notification-box .modal-header.info-header {
    background-color: var(--color-primary);
    color: var(--white);
}

.modal-box.notification-box {
    max-width: 400px;
    padding: 0;
    text-align: justify;
}

.modal-header h3 i {
    margin-right: 0.7rem;
    color: var(--white);
}

.form-pro {
  width:100%;
  max-width:100%;
  display:flex;
  flex-direction:column;
  gap: 1rem;
  font-size: 0.9rem;
  text-align: justify;
}

.form-pro h3 {
  color: var(--color-accent);
  font-size: 1.2rem;
}

.form-pro h4 {
  color: var(--color-muted);
  font-size: 1rem;
  margin-top: 0.7rem;
}

.form-group-section,
.dynamic-lots-container,
.lot-detail {
  gap: 0.6rem;
}

.form-pro label {
  font-weight:600;
  margin-bottom:auto;
}

.form-pro input[type=text],
.form-pro input[type=number],
.form-pro input[type=date],
.form-pro input[type=datetime-local],
.form-pro input[type=email],
.form-pro select,
.form-pro input[type=file],
.form-pro textarea {
  width:100%;
  height:45px;
  padding:0.7rem;
  font-size: 0.9rem;
  border:1px solid var(--color-muted);
}

.form-pro textarea {
  width: 100%;
  min-height: 150px;
  padding: 0.7rem;
  border: 1px solid var(--color-muted);
  font-size: 0.9rem;
}

.form-actions {
  display:flex;
  justify-content:center;
  gap:1.25rem;
  margin-top:1.25rem;
}

.file-control-container {
    position: relative;
    display: flex;
    align-items: center; 
    justify-content: space-between; 
}

.file-control-container .btn-secondary {
    flex-basis: 90%;
    max-width: 90%;
    flex: 0 0 90%;
    width: 100%; 
}

#video-link {
    flex-basis: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%; 
}

.icon-remove-file {
    position: relative;
    flex: 0 0 10%; 
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 2.4em;
    z-index: 1000;

    top: auto !important;
    right: auto !important;
}

.icon-remove-file i {
    color: var(--red); 
    cursor: pointer; 
}

.icon-remove-file i:hover {
  color: var(--red-soft);
  filter: brightness(.90);
  font-weight: 700;
}

#remove-image {
    position: absolute;
    top: 0.8rem !important; 
    right: 0.8rem !important; 
    display: block !important; 
    flex: none !important; 
    z-index: 1001; 
    width: 1.5em; 
    height: 1.5em; 
    line-height: 1.5em !important;
    text-align: center !important;
}

.file-control-container .file-preview {
    position: relative; 
    display: inline-block; 
}

.admin-footer {
  background: var(--color-primary);
  color: var(--white);
  padding: 1.25rem 0;
  box-shadow: 0 -2px 0.4rem var(--shadow);
  margin-top: auto;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto;
  text-align: center;
}

.footer-logo img {
  max-height: 50px;
  display: block;
}

.footer-text {
  font-size: 1rem;
}

.login-box {
  max-width: 480px;
  width: 100%;
  margin: auto;
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 1rem rgba(0, 0, 0, 0.1);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
}

.section-login {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  background: var(--color-bg-light);
  padding: 1.5rem;
}

.login-box h2 {
  margin-bottom: 1.25rem;
  color: var(--color-primary);
}

.form-pro.input-icon,
.form-pro.password-wrapper {
    position: relative;
    margin-bottom: 2.4rem;
    height: 45px; 
    display: flex; 
    align-items: center;
}

.form-pro input {
    width: 100%;
    height: 100%;
    padding: 0.7rem;
    font-size: 0.9rem;
    border: 1px solid var(--color-muted);
    border-radius: 0;
}

.form-pro.input-icon i.fa-user,
.form-pro.password-wrapper i.fa-lock {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-primary);
    z-index: 2;
}

#nom {
    padding-left: 55px;
}

#mot_de_passe {
    padding-left: 55px;
    padding-right: 55px;
}

.password-wrapper .password-mask {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 55px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    pointer-events: none;
    z-index: 1;
}

.password-wrapper .password-mask .dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: var(--color-primary);
}

.password-wrapper .toggle-pwd {
    position: absolute;
    right: 1.5rem;
    top: 60%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}

.password-wrapper .toggle-pwd i {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 1.2rem;
}

.password-wrapper input::-ms-reveal,
.password-wrapper input::-ms-clear {
    display: none;
}
.password-wrapper input[type="password"]::-webkit-reveal,
.password-wrapper input[type="password"]::-webkit-clear-button {
    display: none;
}
.password-wrapper input[type="text"]::-webkit-reveal,
.password-wrapper input[type="text"]::-webkit-clear-button {
    display: none;
}

.password-wrapper input[type="password"] {
    color: transparent;
    text-shadow: 0 0 0 var(--color-primary);
}

.password-wrapper input:not(:placeholder-shown) {
    color: var(--color-text);
}

.password-wrapper.show-password input[type="text"] {
    color: var(--color-text);
}

.password-wrapper.show-password .password-mask {
    display: none;
}

.password-admin {
    position: relative;
    display: flex;
    align-items: center;
}

.password-admin .toggle-pwd-admin {
    position: absolute;
    right: 0.7rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-accent);
    font-size: 1rem;
}

.error-msg {
  color: var(--red);
  font-size: 0.9rem;
  margin-top: -0.8rem;
}

.quotas-container {
  margin: 2.4rem 0;
  width: 100%;
}

.filters-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.filters-row select,
.filters-row input[type="date"],
.filters-row input[type="number"],
.filters-row button {
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  border: 1px solid var(--color-accent-light);
  box-sizing: border-box;
}

.multiselect-container {
  position: relative;
  border: 1px solid var(--color-muted);
  cursor: pointer;
  margin-bottom: 0.7rem;
  gap: 1.2rem;
  display: flex;
  flex-direction: column;
}

.multiselect-display {
  padding-right: 0.7rem;
  padding-left: 0.7rem;
  background: var(--white);
  height: 45px;
  line-height: 40px;
  align-items: center;
  justify-content: left;
}

.multiselect-options {
  display: none;
  position: absolute;
  background: var(--white);
  border: 1px solid var(--color-muted);
  box-shadow: 0 4px 0.7rem var(--min-shadow);
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

.multiselect-options.open {
  display: block;
}

.multiselect-options label {
  position: relative;
  padding: 0.4rem 0.7rem 0.4rem 2.2rem;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.multiselect-options label input[type="checkbox"] {
  position: absolute; 
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
}

.multiselect-options label:hover {
  background: var(--color-primary);
  color: var(--white);
}

.form-pro label:has(input[name="soumis_quota_max"]) {
  position: relative;
  padding: 0.4rem 0.7rem 0.4rem 2.2rem;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
}

.form-pro label:has(input[name="soumis_quota_max"]) input[type="checkbox"] {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
}

.burger-menu,
.logout-icon {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 1001;
}

.burger-menu {
  color: var(--color-primary);
}

.burger-menu:hover {
  color: var(--color-accent);
}

.logout-icon {
  color: var(--red);
}

.logout-icon:hover {
  filter: brightness(0.85);
}

.admin-header .header-actions .btn-danger {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.admin-header .header-actions .btn-danger i {
    line-height: 1;
}

.header-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.lang-ar {
  font-family: var(--font-ar);
  direction: rtl;
}

.profile-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.7rem;
    font-size: 0.95rem;
}

.profile-info .footer-icon {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    color: var(--color-accent);
}

.profile-name {
    font-weight: 700;
    color: var(--white);
}

.profile-role {
    font-size: 0.8rem;
    color: var(--LightGray);
}

.profile-logs-wrapper {
    max-height: 100vh; 
    overflow-y: auto; 
    border: 1px solid var(--LightGray);
    padding: 0.7rem;
    border-radius: var(--radius);
    background: var(--white);
    text-align: justify;
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-list li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--LightGray);
    font-size:  0.9rem;
    display: flex;
    gap: 0.7rem;
}

.activity-list li:last-child {
    border-bottom: none; 
}

.log-date {
    font-weight: 600;
    color: var(--color-muted);
    flex-shrink: 0; 
}

.profile-container {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 2.4rem;
}

.avatar-preview-group {
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-accent); 
}

.profile-avatar-large {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--color-accent); 
}

.profile-settings {
    flex: 2; 
    padding: 1.25rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px var(--shadow);
}

.profile-logs {
    flex: 1;
    padding: 1.25rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px var(--shadow);
}

.profile-settings h3, .profile-logs h3 {
    border-bottom: 2px solid var(--LightGray);
    padding-bottom: 0.7rem;
    margin-bottom: 1.25rem;
}

.log-action {
    color: var(--color-text);
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--color-accent-light);
}

.admin-name-log {
    color: var(--color-accent);
    font-weight: 600;
}

.logs-table-wrapper {
    max-height: 100vh; 
    overflow-y: auto;
}

.alert-error, .alert-info {
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
    font-weight: 500;
}

.alert-error {
    background-color: var(--red-light);
    color: var(--red);
    border: 1px solid var(--red-light);
}

.alert-info {
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-accent-light);
}

.note-info {
  display: block;
  color: var(--color-muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: justify;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th:nth-child(1), 
.data-table td:nth-child(1) {
    width: 30%; 
    text-align: center;
}

.data-table th:nth-child(2) {
    width: 70%;
    text-align: center;
}

.data-table td:nth-child(2) {
    width: 70%;
    text-align: justify;
}

#produits-table th:nth-child(5), 
#produits-table td:nth-child(5) {
    max-width: 15%; 
}

#media-main-content h3 {
  margin-bottom: 1rem !important;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.media-card {
  background-color: var(--color-bg);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.media-card-header {
  padding: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-primary);
}

.media-title {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  margin-right: 0.6rem;
}

#new-images-preview .media-card-header {
  border-bottom: none;
}

.media-title i {
  font-size: 2rem;
  color: var(--color-accent);
}

.media-preview-container {
  height: 300px;
  overflow: hidden;
  background-color: var(--color-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--color-muted);
  cursor: pointer;
}

.media-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-card-body {
  padding: 1rem;
  font-size: 0.9em;
  line-height: 1.4;
}

.media-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.7rem;
  color: var(--color-muted);
  font-size: 0.85em;
}

.status-published { color: var(--color-accent); font-weight: 600; }
.status-draft { color: var(--color-muted); font-weight: 600; }

.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}

.card-actions .btn-secondary,
.card-actions .btn-danger {
  font-size: 0.9rem;
}

.lightbox{
    position:fixed;
    inset:0;
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:9999;
    background: var(--overlay);
    cursor:default;
}
.lightbox.hidden{ display:none; }

#lightbox-content {
    width: 90vw;
    height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#lightbox-content img,
#lightbox-content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.close-btn {
    position:absolute;
    top: 1.25rem;
    right: 1.5rem;
    font-size: 2rem;
    background:none;
    border:none;
    color:var(--color-primary);
    cursor:pointer;
    z-index:1000;
}

.close-btn:hover {
    color:var(--color-accent)
}

.lightbox-left, .lightbox-right{
    position:absolute; top:0; bottom:0;
    width:50%;
    cursor:pointer;
    z-index:900;
}
.lightbox-left{ left:0; }
.lightbox-right{ right:0; }

#album-preview-container .btn-group {
  display: none
}

.error-content {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; 
}

.admin-main.error-content-area h2,
.admin-main.error-content-area p {
    text-align: center;
    margin: 10px auto;
}

@keyframes submenuFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn { 
  from {opacity:0; transform:scale(.95);} 
  to{opacity:1; transform:scale(1);} 
}

@media (max-width: 768px) {

  body {
    width: 100%;
  }
  
  .admin-layout {
    flex-direction: column; 
  }

  .admin-main {
    padding: 1rem 0.5rem; 
    width: 100%;
    box-sizing: border-box; 
  }

  .admin-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem; 
  }

  .card {
    padding: 0.8rem;
  }

  .admin-header {
    padding: 0.7rem 1rem;
    justify-content: space-between;
    width: 100%;
  }

  .header-icons-container {
      display: flex;
      align-items: center;
      gap: 1rem;
      margin-left: auto;
      margin-right: 1.25rem;
  }

  .burger-menu,
  .logout-icon {
      display: block;
  }

  #logout-desktop {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    transition: left 0.4s ease-in-out;
    z-index: 1200;
  }

  .sidebar.is-active {
    left: 0;
  }

  .sidebar.is-active + .admin-header .burger-menu {
    color: var(--white);
  }

  body.no-scroll {
        overflow: hidden;
  }

  .main-title {
      flex-direction: column;
      align-items: flex-start;
      gap: 1rem;
  }

  .btn-group {
      flex-direction: column;
      width: 100%;
  }

  .btn-group a {
      width: 100%;
      text-align: center;
      margin-right: 0;
  }

  .btn-add .btn-accent, .btn-manage .btn-secondary {
        width: 100%;
        margin-right: 0;
        height: 38px;
  }

  .section-login {
        padding: 0 1.5rem;
  }

  .login-box {
        max-width: 100%;
        width: 100%;
        padding: 1.25rem;
  }

  .form-pro input {
      width: 100%;
      height: 100%;
      padding-left: 55px;
      padding-right: 55px;
      box-sizing: border-box;
      -webkit-text-size-adjust: 100%;
      font-size: 1rem;
  }

  .password-wrapper .password-mask {
      display: flex;
  }

  .password-wrapper input[type="password"] {
      color: transparent;
      text-shadow: 0 0 0 var(--color-primary);
  }
  .password-wrapper input:not(:placeholder-shown) {
      color: var(--color-text);
  }
  .password-wrapper.show-password input[type="text"] {
    color: var(--color-text);
  }
  .password-wrapper.show-password .password-mask {
      display: none;
  }

  .form-pro input[type=text],
  .form-pro input[type=number],
  .form-pro input[type=date],
  .form-pro input[type=datetime-local],
  .form-pro input[type=email],
  .form-pro select,
  .form-pro input[type=file],
  .form-pro textarea {
    height: 45px;
    font-size: 1rem;
    padding: 0.7rem;
  }

  .form-actions {
    padding: 0.7rem;
  }

  .table-wrapper {
    overflow-x: hidden;
    padding: 0;
  }
  
  table {
    border-collapse: separate;
    border-spacing: 0 1rem;
    width: 100%;
  }

  thead {
    display: none;
  }

  tr {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--color-accent-light);
    box-shadow: 0 2px 0.4rem var(--min-shadow);
  }

  td {
    border: none;
    padding: 0.5rem 0;
    text-align: justify;
    word-wrap: break-word;
    display: block;
  }

  td::before {
    content: attr(data-label);
    font-weight: bold;
    color: var(--color-primary);
    display: block;
    margin-bottom: 0.4rem;
  }

  td.actions::before,
  td.image-cell::before {
    display: none;
  }

  td.image-cell {
    text-align: center;
  }

  .table-wrapper img {
    max-width: 100%;
    margin: 0.7rem auto;
  }

  th.lang-ar {
    font-family: var(--font-ar);
    direction: rtl;
    text-align: right;
  }

  td.lang-ar::before {
    direction: ltr;
    text-align: justify;
    font-family: var(--font-main);
  }

  .actions {
    flex-direction: row; 
    align-items: center;
    width: 100%;
    margin-top: 0.7rem;
  }
  
  .actions a {
    flex-grow: 1;
    margin: 0 0.4rem;
  }

  .quotas-container {
    margin: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .filters-row {
    flex-direction: column;
    gap: 0.7rem;
  }
  
  .filters-row select,
  .filters-row input[type="date"],
  .filters-row input[type="number"],
  .filters-row button {
    width: 100%;
  }

  .profile-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
  }

  .profile-settings {
    width: 100%;
  }

  .profile-logs {
    width: 100%;
  }

  .media-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #produits-table th:nth-child(5), 
  #produits-table td:nth-child(5) {
      max-width: 100%; 
  }

  .data-table th:nth-child(1), 
  .data-table td:nth-child(1) {
      width: 100%;
      text-align: justify;
  }

  .data-table th:nth-child(2), 
  .data-table td:nth-child(2) {
      width: 100%;
      text-align: justify;
  }
  
  .actu-actions a,
  .appels-actions a,
  .avis-ventes-actions a,
  .consult-actions a,
  .users-actions a,
  .card-actions a {
        font-size: 0 !important; 
        padding: 0.5rem 0.6rem;
        min-width: 50px;
        width: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        color: transparent !important; 
  }

  .actu-actions a i,
  .appels-actions a i,
  .avis-ventes-actions a i,
  .consult-actions a i,
  .users-actions a i,
  .card-actions a i {
        font-size: 1.4rem !important; 
        color: var(--white) !important; 
        margin-right: 0 !important; 
        margin-left: 0 !important;
  }

  .actu-actions .btn-accent,
  .appels-actions .btn-accent,
  .avis-ventes-actions .btn-accent,
  .consult-actions .btn-accent,
  .users-actions .btn-accent,
  .card-actions .btn-accent,
  .actu-actions .btn-danger,
  .appels-actions .btn-danger,
  .avis-ventes-actions .btn-danger,
  .consult-actions .btn-danger,
  .users-actions .btn-danger,
  .card-actions .btn-danger,
  .actu-actions .btn-secondary,
  .appels-actions .btn-secondary,
  .avis-ventes-actions .btn-secondary,
  .consult-actions .btn-secondary,
  .users-actions .btn-secondary {
    height: 38px; 
  }
}