/* --- Глобално --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --- Контейнер за цялата страница --- */
.page-container {
  display: flex;
  min-height: 100vh;
  gap: 20px;
  padding: 10px;
  background-color: #f9f9f9;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
}

/* --- Странично меню --- */
.side-menu {
  width: 220px;
  background-color: #fff;
  padding: 15px;
  box-shadow: 1px 0 5px rgba(0,0,0,0.1);
  border-radius: 6px;
  overflow-y: auto;
  position: sticky;
  top: 10px;
  height: calc(100vh - 20px);
}

/* --- Менюто (списък) --- */
.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: #fefefe;
}

.sidebar-menu li {
  margin: 8px 0;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #1a73e8;
  font-weight: 600;
  padding: 10px 15px;
  border-radius: 8px;
  transition: background-color 0.25s ease, color 0.25s ease;
  box-shadow: inset 0 0 0 0 #1a73e8;
}

.sidebar-menu li a:hover,
.sidebar-menu li a:focus {
  background-color: #1a73e8;
  color: white;
  box-shadow: inset 5em 0 0 0 #1a73e8;
}

.sidebar-header {
  font-weight: 700;
  color: #444;
  margin-top: 20px;
  padding: 10px 15px;
  border-bottom: 1px solid #ddd;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  user-select: none;
}

/* --- Основно съдържание --- */
.main-content {
  flex-grow: 1;
  background-color: white;
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  overflow-y: auto;
  max-height: 100vh;
  font-size: 14px;
}

/* --- Форма с две колони --- */
.form-container {
  max-width: 900px;
  margin: 20px auto 60px;
  display: flex;
  gap: 30px;
  font-family: inherit;
  font-size: 14px;
  flex-wrap: wrap;
  background-color: #e6f0ff;
  border-radius: 8px;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
}

.form-column {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  align-items: center;
}

.form-row label {
  width: 150px;
  font-weight: 600;
  color: #333;
  user-select: none;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #a3b0c2;
  border-radius: 6px;
  background: #fafbfc;
  font-size: 13px;
  transition: border-color 0.3s;
  outline: none;
}

.form-row input[type="text"]:focus,
.form-row input[type="email"]:focus,
.form-row input[type="password"]:focus,
.form-row select:focus {
  border-color: #0056b3;
  background: #f0f6ff;
}

.required-star {
  color: red;
  margin-left: 4px;
}

/* --- Контейнер за бутоните --- */
.form-buttons {
  width: 100%;
  display: flex;
  justify-content: center; /* Центриране по хоризонтала */
  gap: 20px;
  margin-top: 30px;
  box-sizing: border-box;
  align-items: center; /* Вертикално центриране */
  position: static;
  padding-left: 0; /* Махаме изместването наляво */
}

.form-buttons button,
.form-buttons a.btn-back-link {
  width: 160px;         /* фиксирана ширина */
  min-width: 160px;
  max-width: 180px;
  padding: 10px 0;      /* равна вътрешна отстояние */
  font-size: 15px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: white;
  border: none;
  transition: background-color 0.25s;
  height: 44px;         /* еднаква височина */
  text-decoration: none;
}

.form-buttons a.btn-back-link {
  background-color: #0056b3;
}

.form-buttons a.btn-back-link:hover {
  background-color: #003d80;
}

.form-buttons button.btn-green {
  background-color: #28a745;
}

.form-buttons button.btn-green:hover {
  background-color: #218838;
}

/* --- Бутон за връщане --- */
.btn-back {
  display: inline-block;
  padding: 8px 18px;
  background-color: #0056b3;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 13px;
  margin: 20px 0 0 20px;
}

/* --- Таблици за активни потребители --- */
.active-users-table {
  border-collapse: collapse;
  font-family: sans-serif;
  font-size: 13px;
  background: #fff;
  width: 100%;
  margin: 0 auto;
  border: 1px solid #ccc;
  overflow-x: auto;
  display: block;
}

.active-users-table th,
.active-users-table td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  vertical-align: middle;
}

.active-users-table th {
  background-color: #f2f2f2;
  color: #003366;
  font-weight: 600;
  text-align: left;
}

.active-users-table th a {
  color: #0056b3;
  text-decoration: none;
}

.active-users-table th a:hover {
  text-decoration: underline;
}

.active-row-online {
  background-color: #e6ffed;
}

.active-row-offline {
  background-color: #ffecec;
}

.center-text {
  text-align: center;
}

.active-users-table a {
  color: #0056b3;
  text-decoration: none;
}

.active-users-table a:hover {
  text-decoration: underline;
}

.rx-bad {
  color: red;
}

/* --- Бар за филтри --- */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 20px 20px 20px;
  font-family: sans-serif;
  font-size: 13px;
}

.filter-bar form {
  margin: auto;
}

.filter-bar label {
  margin-right: 8px;
}

.filter-bar select {
  font-size: 13px;
  padding: 2px 6px;
}

.rx-counter {
  font-weight: 600;
}

/* --- Логин форма --- */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #f0f2f5;
  padding: 10px;
}

.login-form {
  background: #fff;
  padding: 20px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  width: 300px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px;
}

.login-title {
  margin-bottom: 15px;
  text-align: center;
  color: #003366;
  font-weight: 700;
  font-size: 18px;
}

.input-field {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 12px;
  transition: border-color 0.3s;
}

.input-field:focus {
  border-color: #004080;
  outline: none;
}

.errors {
  background-color: #ffe6e6;
  color: #dc3545;
  padding: 8px 10px;
  border-radius: 5px;
  margin-bottom: 12px;
  font-size: 12px;
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 8px 0;
  font-weight: 600;
  font-size: 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.25s ease;
  user-select: none;
}

.btn-green {
  background-color: #28a745;
  color: #fff;
}

.btn-green:hover,
.btn-green:focus {
  background-color: #218838;
  outline: none;
}
.form-buttons button,
.form-buttons a.btn-back,
.form-buttons .btn-green {
  width: 160px !important;
  min-width: 160px !important;
  max-width: 180px;
  padding: 10px 0;
  font-size: 15px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: white;
  border: none;
  transition: background-color 0.25s;
  height: 44px;
  text-decoration: none;
  box-sizing: border-box;
}

.form-buttons {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  box-sizing: border-box;
}

.form-buttons a.btn-back,
.form-buttons button.btn-green {
  width: 160px !important;
  min-width: 160px !important;
  max-width: 180px;
  height: 44px !important;
  padding: 0 !important;
  font-size: 15px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  cursor: pointer;
  display: flex !important;
  justify-content: center;
  align-items: center;
  color: white !important;
  border: none !important;
  transition: background-color 0.25s;
  text-decoration: none !important;
  background-color: #28a745;
  box-sizing: border-box;
}

.form-buttons a.btn-back {
  background-color: #0056b3 !important;
}

.form-buttons a.btn-back:hover {
  background-color: #003d80 !important;
}

.form-buttons button.btn-green {
  background-color: #28a745 !important;
}

.form-buttons button.btn-green:hover {
  background-color: #218838 !important;
}
.form-buttons {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 20px !important;
  margin-top: 30px !important;
  width: 100% !important;
}

.form-buttons a.btn-back,
.form-buttons button.btn-green {
  background: #28a745;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 600;
  border: none !important;
  border-radius: 8px !important;
  width: 150px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  cursor: pointer;
  transition: background 0.2s;
}

.form-buttons a.btn-back {
  background: #0056b3 !important;
}

.form-buttons a.btn-back:hover {
  background: #003d80 !important;
}

.form-buttons button.btn-green:hover {
  background: #218838 !important;
}
