/* ==== RESET & GLOBAL ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(120deg, #192653 0%, #232e4d 100%);
  color: #E0E0E0;
  display: flex;
  height: 100vh;
  overflow-x: hidden;
}
button, input, select {
  font-family: inherit;
}

/* ==== SIDEBAR ==== */
#sidebar {
  width: 240px;
  background: #ffffff0d;
  border: 1px solid #ffffff1a;
  color: #E0E0E0;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100vh;
  transition: right 0.3s ease, left 0.3s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}
#sidebar h2,
#sidebar .date {
  text-align: center;
  margin: 0 auto 2rem;
  display: block;
}
#sidebar .date {
  background: #232e4d;
  color: #ccc;
  padding: 0.3em 1em;
  border-radius: 4px;
  font-size: 0.9rem;
}
#sidebar button {
  --tw-gradient-from: #3170d9 var(--tw-gradient-from-position, 0%);
  --tw-gradient-to: #0783a1 var(--tw-gradient-to-position, 100%);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
  color: white;
  font-weight: bold;
  border: none;
  padding: 0.6em 1em;
  margin: 0.4em 0;
  width: 100%;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: none;
  text-align: center !important;
  transition: background 0.2s, filter 0.2s, transform 0.1s;
}
#sidebar button:hover {
  filter: brightness(1.15) contrast(1.1);
  transform: scale(1.04);
}
#btnBack {
  margin-top: auto;
  background: #555;
}
#sidebar #btnLogout {
  background: linear-gradient(135deg, #dc3545, #a71d2a);
  color: #fff;
  font-weight: bold;
}

/* ==== MAIN ==== */
#main {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(120deg, #192653 0%, #232e4d 100%);
}

/* ==== HEADER & HAMBURGER ==== */
#header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}
#hamburger {
  order: 1;
  margin-right: 1rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #E0E0E0;
  cursor: pointer;
  z-index: 999;
}
#header h1 {
  order: 2;
  flex: 1;
  font-size: 1.5rem;
}

/* ==== CARDS ==== */
.card {
  background: #ffffff0d;
  border: 1px solid #ffffff1a;
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px 0 #0002;
  transition: box-shadow 0.2s, transform 0.2s;
  text-align: left;
}
.card:hover {
  box-shadow: 0 6px 24px 0 #0004;
  transform: scale(1.015);
}
.card h2 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: #ccc;
}
.card p {
  font-size: 2rem;
  margin: 0;
}

/* ==== STATISTICS LAYOUT ==== */
#stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
#stats .card {
  flex: 1;
  min-width: 180px;
}

/* ==== TABLE (UTILIZATORI) ==== */
#usersList {
  background: #ffffff0d;
  border: 1px solid #ffffff1a;
  /* border-radius removed */
  padding: 1rem;
  margin-top: 1rem;
  overflow-x: auto;
  box-shadow: 0 2px 12px 0 #0002;
}
#usersList table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: #ffffff0d;
  border: 1px solid #ffffff1a;
  /* border-radius removed */
  box-shadow: 0 2px 12px 0 #0002;
}
#usersTable th, #usersTable td {
  border-bottom: 1px solid #ffffff1a;
  padding: 0.4em 0.3em;
  text-align: left;
  font-size: 0.95em;
  max-width: 90px;
  word-break: break-word;
}
#usersTable th {
  background: #232e4d;
  color: #fff;
  font-weight: 600;
  border-bottom: 1.5px solid #3170d9;
}
#usersTable td {
  background: transparent;
  color: #e0e0e0;
}
#usersTable tr:hover {
  background: #232e4d;
  cursor: pointer;
  color: #fff;
}

/* ==== DELETE BUTTON ==== */
.btn-action.delete {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 0.3em 0.6em;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s, filter 0.2s, transform 0.1s;
  box-shadow: 0 4px 0 #9e1b0d;
}
.btn-action.delete:hover {
  background: #c0392b;
  filter: brightness(1.1);
}

/* ==== GENERIC MODAL ==== */
.modal,
#userModalOv {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content,
#userModalOv .form-container {
  background: #ffffff0d;
  border: 1px solid #ffffff1a;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 800px; width: 95%;
  color: #E0E0E0;
  position: relative;
  box-shadow: 0 2px 12px 0 #0002;
  box-sizing: border-box;
  backdrop-filter: blur(12px);
}
.close-modal,
#userModalClose {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  cursor: pointer; font-size: 1.2rem;
  color: #ccc;
}

/* ==== FORM ELEMENTS IN MODAL ==== */
.modal-content label,
#userModalOv .form-container label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  color: #e0e0e0;
  font-weight: 500;
}
.modal-content .form-group input,
.modal-content .form-group select,
#userModalOv .form-container input,
#userModalOv .form-container select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ffffff1a;
  border-radius: .5rem;
  background: #232e4d;
  color: #E0E0E0;
  font-size: 1rem;
  transition: border 0.2s, background 0.2s;
}
.modal-content .form-group input:focus,
.modal-content .form-group select:focus,
#userModalOv .form-container input:focus,
#userModalOv .form-container select:focus {
  outline: none;
  border: 1.5px solid #3170d9;
  background: #192653;
}

/* ==== BUTTON UTILS ==== */
.btn, .btn-primary, .btn-success {
  --tw-gradient-from: #3170d9 var(--tw-gradient-from-position, 0%);
  --tw-gradient-to: #0783a1 var(--tw-gradient-to-position, 100%);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
  color: #fff;
  font-weight: 600;
  box-shadow: none;
  transition: background 0.2s, filter 0.2s, transform 0.1s;
}

.btn:hover, .btn-primary:hover, .btn-success:hover {
  filter: brightness(1.15) contrast(1.1);
  transform: scale(1.04);
}
.mt-4 {
  margin-top: 1rem;
}

/* ==== TOAST ==== */
.toast {
  visibility: hidden;
  min-width: 200px;
  margin-left: -100px;
  background: #3170d9;
  color: #fff;
  text-align: center;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  position: fixed;
  left: 50%;
  bottom: 2rem;
  font-size: 1rem;
  z-index: 7000;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  box-shadow: 0 2px 12px 0 #0002;
}
.toast.show {
  visibility: visible;
  opacity: 1;
}

/* ==== RESPONSIVE: MOBILE ==== */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0; right: -100%;
    width: 60%; height: 100%;
    transition: right 0.3s ease;
  }
  #sidebar.open {
    right: 0;
  }
  #main {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
    overflow-x: hidden;
  }
}

/* Stil pentru dropdown-ul din coloana Rol */
#usersTable select.role-select {
  background-color: #232e4d;
  color: #E0E0E0;
  border: 1px solid #ffffff1a;
  padding: 0.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  width: 100%;
  max-width: 80px;
  box-sizing: border-box;
  transition: border 0.2s, background 0.2s;
}
#usersTable select.role-select:focus {
  outline: none;
  border: 1.5px solid #3170d9;
  background-color: #192653;
}

/* ==== MODAL TARIFE: DOUĂ COLOANE ==== */
.pricing-columns {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
}
.pricing-col {
  flex: 1 1 0;
  min-width: 220px;
  max-width: 340px;
  background: #ffffff0d;
  border: 1px solid #ffffff1a;
  border-radius: 1rem;
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  box-shadow: 0 2px 8px #0001;
  margin-bottom: 1rem;
  box-sizing: border-box;
}
.pricing-col h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #ffffff;
  font-weight: 800;
  text-align: center;
  font-size: 24px;
}
.pricing-col .form-group {
  margin-bottom: 0.8rem;
}
.pricing-col label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.98em;
}
.pricing-col input[type="number"] {
  width: 100%;
  padding: 0.3em 0.5em;
  border: 1px solid #bcd;
  border-radius: 0.5rem;
  font-size: 1em;
  box-sizing: border-box;
  background: #232e4d;
  color: #E0E0E0;
  transition: border 0.2s, background 0.2s;
}
.pricing-col input[type="number"]:focus {
  outline: none;
  border: 1.5px solid #3170d9;
  background: #192653;
}

.toast.show {
  display: block !important;
  opacity: 1;
  animation: fadeInOut 3s forwards;
}

@media (max-width: 700px) {
  .pricing-columns {
    flex-direction: column;
    gap: 0.5rem;
  }
  .pricing-col {
    min-width: 0;
    width: 100%;
    padding: 1rem 0.5rem;
  }
}

/* Centrare buton "Aplică" în modalul de tarife */
#updatePricingForm .btn {
  display: block;
  margin: 2rem auto 0 auto;
}

@media (max-width: 600px) {
  #updatePricingModal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
    width: 98vw;
    min-width: 0;
    box-sizing: border-box;
  }
  #updatePricingModal {
    align-items: flex-start !important;
    padding-top: 2vh;
  }
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 22px;
  text-decoration: none;
  color: #E0E0E0;
  font-size: 15px;
  border-radius: 8px;
  margin: 4px 12px;
  transition: background 0.2s, color 0.2s;
  font-weight: 500;
  gap: 10px;
  position: relative;
}
.menu-item .menu-icon {
  font-size: 1.2em;
  margin-right: 8px;
  display: inline-flex;
}
.menu-item:hover {
  background: #232e4d;
  color: #00e6c3;
}
.menu-item.active, .menu-item.selected {
  background: linear-gradient(90deg, #3170d9 0%, #0783a1 100%);
  color: #fff;
}
.bottom-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding: 0 12px 18px 12px;
}
#btnBack {
  background: none;
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; right: -100%;
    width: 60%; height: 100%;
    z-index: 1001;
    transition: right 0.3s ease;
  }
  .sidebar.open {
    right: 0;
  }
}