body {
  background-color: #f3f4f6;
  font-family: Arial, sans-serif;
}
.header-logo {
  color: #F4A261;
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  margin-left: 16rem;
}
.header-logo img {
  margin-right: 0.5rem;
  width: 40px;
  height: 40px;
}
.tab-button.active {
  color: #F4A261;
  border-bottom: 2px solid #F4A261;
}
.clickable-button {
  background-color: #F6C07A;
  color: #4A4A4A;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
}
.clickable-button:hover {
  background-color: #F5B876;
}
table {
  border-color: #4A4A4A;
  border-collapse: collapse;
}
th, td {
  border-color: #4A4A4A;
  padding: 0.5rem;
}
.bg-gray-200 {
  background-color: #D3D3D3;
}
.status-active {
  color: green;
}
.status-inactive {
  color: red;
}
.hidden {
  display: none;
}
.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem;
}
.grid {
  display: grid;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.md\:grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gap-4 {
  gap: 1rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mt-4 {
  margin-top: 1rem;
}
.p-2 {
  padding: 0.5rem;
}
.w-full {
  width: 100%;
}
.border {
  border-width: 1px;
}
.rounded {
  border-radius: 0.25rem;
}
.text-sm {
  font-size: 0.875rem;
}
.font-medium {
  font-weight: 500;
}
.text-gray-600 {
  color: #4B5563;
}
.cursor-pointer {
  cursor: pointer;
}
.collapsible {
  background: #f5f7fc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 15px;
  color: #222;
  cursor: pointer;
  margin-bottom: 4px;
  margin-top: 12px;
  transition: background 0.2s, border 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.collapsible:hover, .collapsible.active {
  background: #e0e7ff;
  border-color: #b6c3e6;
}
.collapsible.active {
  color: #2563eb;
}
.collapsible-content {
  display: none;
  padding: 1rem;
  background-color: #fff;
  border: 1px solid #4A4A4A;
  margin-top: 0.5rem;
}
.collapsible-content.active {
  display: block;
}

/* Sidebar styles */
.sidebar {
  background: #333231;
  border-right: 1px solid #e5a749;
  min-height: 100vh;
  width: 15rem;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  padding-top: 5.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  max-height: 100vh;
}
.sidebar nav {
  flex: 1 1 auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0 0.5rem 0;
}
.sidebar-logo img {
  max-width: 120px;
  max-height: 48px;
}
.sidebar-link {
  display: block;
  padding: 0.75rem 1rem;
  color: #fff7e6;
  text-decoration: none;
  border-radius: 0.375rem;
  transition: background 0.2s, color 0.2s;
  font-weight: 500;
}
.sidebar-link:hover {
  background: #cc7a00;
  color: #fff;
}
.sidebar-link.active {
  background: #fff;
  color: #ff9900;
}
.sidebar-sublink {
  font-size: 0.92rem;
  color: #ffe0b3;
  font-style: italic;
  font-weight: 400;
  padding-left: 2.2rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  display: block;
  border-radius: 0.375rem;
  transition: background 0.2s, color 0.2s;
}
.sidebar-sublink:hover {
  background: #b36b00;
  color: #fff;
}
.sidebar-sublink.active {
  background: #fff;
  color: #ff9900;
}
.ml-64 {
  margin-left: 16rem;
}
/* Media query disabled to use Bootstrap Offcanvas from base.html */
/*
@media (max-width: 900px) {
  .sidebar {
    width: 100vw;
    min-height: auto;
    position: static;
    padding-top: 0;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ml-64 {
    margin-left: 0;
  }
  .sidebar-logo {
    justify-content: flex-start;
    padding: 0.5rem 1rem;
  }
}
*/

/* Footer с учётом sidebar */
footer {
  margin-left: 16rem;
}
@media (max-width: 900px) {
  footer {
    margin-left: 0;
  }
}

/* Компактные формы */
.form-compact label {
  font-size: 11px;
  margin-bottom: 2px;
}
.form-compact input,
.form-compact select,
.form-compact textarea {
  height: 26px;
  padding: 2px 6px;
  font-size: 13px;
  border-radius: 4px;
  margin-bottom: 4px;
  width: 100%;
  box-sizing: border-box;
}
.form-compact .grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}
.form-compact .grid > div {
  width: 240px;
  min-width: 240px;
  flex-basis: 240px;
  flex-shrink: 0;
  flex-grow: 0;
  margin-right: 0;
}

header, .header-logo {
  margin-left: 16rem;
}
@media (max-width: 900px) {
  header, .header-logo {
    margin-left: 0;
  }
}

.required { color: #d72660; margin-left: 2px; }
.input-error { border: 1px solid #d72660 !important; background: #fff0f3; }
.hint { font-size: 11px; color: #888; margin-top: 2px; margin-bottom: 4px; } 

/* Дополнительные стили для Bootstrap */
.bg-gray-50 {
    background-color: #f9fafb;
}

.border-r {
    border-right: 1px solid #e5e7eb;
}

.border {
    border: 1px solid #e5e7eb;
}

.rounded {
    border-radius: 0.375rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.text-primary {
    color: #0d6efd;
}

.text-success {
    color: #198754;
}

.text-warning {
    color: #ffc107;
}

.text-danger {
    color: #dc3545;
}

.text-info {
    color: #0dcaf0;
}

.bg-success {
    background-color: #198754 !important;
}

.bg-secondary {
    background-color: #6c757d !important;
}

.bg-warning {
    background-color: #ffc107 !important;
}

.bg-info {
    background-color: #0dcaf0 !important;
}

.bg-primary {
    background-color: #0d6efd !important;
}

.bg-danger {
    background-color: #dc3545 !important;
}

.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-info {
    color: #0dcaf0;
    border-color: #0dcaf0;
}

.btn-outline-info:hover {
    color: #000;
    background-color: #0dcaf0;
    border-color: #0dcaf0;
}

.btn-outline-success {
    color: #198754;
    border-color: #198754;
}

.btn-outline-success:hover {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}

.btn-outline-warning {
    color: #ffc107;
    border-color: #ffc107;
}

.btn-outline-warning:hover {
    color: #000;
    background-color: #ffc107;
    border-color: #ffc107;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border-radius: 0.3rem;
}

.me-1 {
    margin-right: 0.25rem;
}

.me-2 {
    margin-right: 0.5rem;
}

.ms-2 {
    margin-left: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-md-9 {
    flex: 0 0 75%;
    max-width: 75%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

@media (max-width: 767.98px) {
    .col-md-3,
    .col-md-4,
    .col-md-6,
    .col-md-8,
    .col-md-9,
    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
}

.card-header {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.card-body {
    flex: 1 1 auto;
    padding: 1rem;
}

.card-title {
    margin-bottom: 0.5rem;
}

.card-text:last-child {
    margin-bottom: 0;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    vertical-align: top;
    border-color: #dee2e6;
}

.table > :not(caption) > * > * {
    padding: 0.5rem 0.5rem;
    background-color: transparent;
    border-bottom-width: 1px;
    box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
}

.table > tbody {
    vertical-align: inherit;
}

.table > thead {
    vertical-align: bottom;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(0, 0, 0, 0.05);
    color: var(--bs-table-striped-color);
}

.table-sm > :not(caption) > * > * {
    padding: 0.25rem 0.5rem;
}

.table-bordered > :not(caption) > * {
    border-width: 1px 0;
}

.table-bordered > :not(caption) > * > * {
    border-width: 0 1px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #212529;
    background-color: #fff;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-control-sm {
    min-height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

.form-select {
    display: block;
    width: 100%;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    appearance: none;
}

.form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-select-sm {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-left: 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-check {
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5em;
    margin-bottom: 0.125rem;
}

.form-check-input {
    width: 1em;
    height: 1em;
    margin-top: 0.25em;
    vertical-align: top;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid rgba(0, 0, 0, 0.25);
    appearance: none;
}

.form-check-input[type=checkbox] {
    border-radius: 0.25em;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-label {
    color: #212529;
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-center {
    justify-content: center !important;
}

.align-items-center {
    align-items: center !important;
}

.align-items-end {
    align-items: flex-end !important;
}

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

.hidden {
    display: none !important;
}

/* Дополнительные утилиты */
.cursor-pointer {
    cursor: pointer;
}

.transition {
    transition: all 0.2s ease-in-out;
}

/* Стили для модальных окон */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.3rem;
    outline: 0;
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.3rem - 1px);
    border-top-right-radius: calc(0.3rem - 1px);
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: calc(0.3rem - 1px);
    border-bottom-left-radius: calc(0.3rem - 1px);
}

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 7.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.375rem;
    opacity: 0.5;
}

.btn-close:hover {
    color: #000;
    text-decoration: none;
    opacity: 0.75;
}

/* Стили для offcanvas */
.offcanvas {
    position: fixed;
    bottom: 0;
    z-index: 1045;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    visibility: hidden;
    background-color: #fff;
    background-clip: padding-box;
    outline: 0;
    transition: transform 0.3s ease-in-out;
}

.offcanvas-start {
    top: 0;
    left: 0;
    width: 400px;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
}

.offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.offcanvas-title {
    margin-bottom: 0;
    line-height: 1.5;
}

.offcanvas-body {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
}

/* Анимации */
.fade {
    transition: opacity 0.15s linear;
}

.fade:not(.show) {
    opacity: 0;
}

.show {
    display: block !important;
}

/* Стили для печати */
@media print {
    .sidebar,
    .sidebar-toggle-btn,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .container {
        max-width: none !important;
    }
}

/* Toast Messages */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    pointer-events: none;
}

.toast-message {
    min-width: 320px;
    padding: 16px 20px;
    margin-top: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    pointer-events: auto;
    border-left: 4px solid transparent;
    background: #ffffff;
    color: #1e293b;
}

.toast-success { border-left-color: #10b981; }
.toast-error { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }
.toast-info { border-left-color: #3b82f6; }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast-message.show {
    animation: slideIn 0.3s ease-out forwards;
} 