/* Шрифты */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Сброс стандартных отступов */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Переменные для удобства */
:root {
    
    --header-height: 80px;
    --sidebar-width: 100px;
    
	--bg-main1: rebeccapurple;
	--bg-main1-hover: #5c2d8f;
	--bg-main1-pressed: #4a2378;
	--bg-main1-light: rgba(102, 51, 153, 0.08);
	--bg-main1-border: rgba(102, 51, 153, 0.2);
	
	--bg-content1: #fefefe;
	
	--bg-menu-el1: rgba(255,255,255,0.50);
	--bgh-menu-el1: rgba(255,255,255,1.00);
	--color-menu-el1: #222222;
	--bg-menu-el1-ava: #d78fd2;
	
    --color-blue: #0000ff;
    --color-green: #00ff00;
    
    --color-body: #F4F6F9;
    --color-body-gr1: #F1F1F1;
    --color-body-gr2: #E1E1E1;
    
    --font-size1: 18pt;
    --font-size2: 10pt;
    --font-size3: 8pt;
    --font-size4: 16px;
	
	--radius-size1: 11pt;
	--radius-size2: 10px;
	--radius-size3: 5px;
    
    --color-text: #222;
    --color-text-secondary: #777;
    --color-border: #ddd;
    --color-danger: #e53e3e;
    --color-danger-hover: #c53030;
    --color-danger-pressed: #9b2c2c;
    --color-success: #38a169;
    --color-success-hover: #2f855a;
    --color-success-pressed: #276749;
    --color-warning: #d69e2e;
    
    --tap-highlight: transparent;
    --transition-tap: 0.1s ease;
}

body, html {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: var(--color-body);
    background: linear-gradient(to bottom right, var(--color-body-gr1) 30%, var(--color-body-gr2) 50%);
    background-attachment: fixed;
    -webkit-tap-highlight-color: var(--tap-highlight);
    -webkit-touch-callout: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.cp { cursor: pointer; }
.cd { cursor: default; }
.w-100 { width: 100%; }
.fs-2 { font-size: var(--font-size2); }
.a-none { text-decoration: inherit; color:inherit; }

.noselect {
    user-select: none; 
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Интерфейс */
.ui-input {
	background-color: #fff;
	padding: 10px 20px;
	font-size: var(--font-size4);
	border: 1px solid #222;
	border-radius: var(--radius-size3);
}

/* Общий контейнер */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.system_info {
	font-size: var(--font-size2);
	text-align: center;
	padding: 0 10px 10px 0;
	color:gray;
}
.system_info spanrs {
	opacity: 0.25;
	padding: 0 10px 0 10px;
}

/* --- HEADER (Шапка) --- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 20px;
    flex-shrink: 0;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

/* 1. Логотип */
.logo {
    width: auto;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bolder;
    font-size: var(--font-size1);
    flex-shrink: 0;
}
.logo img {
    width: 34px;
    height: 34px;
    margin-right: 10px;
    pointer-events: none; 
    -webkit-user-drag: none;
}
.logo span {
    font-weight:lighter;
}

/* 2. Меню №1 */
.menu-primary {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 0 20px;
    flex-grow: 1;
    margin: 0 20px;
    gap: 3rem;
}
.menu-primary a {
    color:#777;
    font-size: var(--font-size2);
    text-decoration: none;
    transition: color 0.15s ease;
}
.menu-primary a:hover {
    color:#000;
}

/* 3. Меню №2 */
.menu-secondary {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 0 0 0 20px;
    flex-shrink: 0;
	position: relative;
}

/* --- ОСНОВНОЙ БЛОК --- */
.main-content {
    display: flex;
    flex: 1;
}

/* 4. Левая колонка */
.sidebar {
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    white-space: nowrap;
    overflow: hidden;
    contain: paint;
    padding-left: env(safe-area-inset-left);
}
.sidebar-pt {
    background-color: rgba(255,255,255,0.21);
    width: 56px;
    height: 56px;
    min-height: 56px;
    min-width: 56px;
    border-radius: 32px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.25s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}
.sidebar-pt:hover {
    background-color: rgba(255,255,255,0.25);
    transform:scale(1.1);
    cursor: pointer;
}
.sidebar-pt:active {
    background-color: rgba(255,255,255,0.38);
    transform:scale(0.95);
    cursor: pointer;
    transition: all 0.05s ease;
}
.sidebar-pt-logo img {
    width: 32px;
    height: 32px;
    pointer-events: none; 
    -webkit-user-drag: none;
}
.sidebar-pt-title {  
    color:#222;
    font-size: var(--font-size2);
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: absolute;
    z-index: 1;
    bottom: -25%;
    right: -50%;
    width: 200%;
    text-align: center;
    border-radius: var(--radius-size2);
    pointer-events: none; 
    -webkit-user-drag: none;
    transition: all 1s ease;
    opacity: 0;
}

/* 5. Основная область */
.content-area {
    flex: 1;
    padding: 10px 20px 20px 0;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.content-block {
	background-color: var(--bg-content1);
	width: 100%;
	border-radius: var(--radius-size1);
	padding: var(--radius-size1);
}

/* Стилизация полосы прокрутки */
body::-webkit-scrollbar {
    width: 4px;
}
body::-webkit-scrollbar-track {
    background: transparent;
}
body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}
body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* ============================================ */
/* ЭЛЕМЕНТЫ ИНТЕРФЕЙСА: БЛОК ПРОФИЛЯ            */
/* ============================================ */
.profile-block {
	background-color: var(--bg-menu-el1);
	color: var(--color-menu-el1);
	border-radius: 50px;
	padding: 10px 20px 10px 10px;
	font-size: var(--font-size2);
	display: flex;
	align-items: center;
	gap: 15px;
	justify-content: space-between;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease, background-color 0.15s ease;
	min-width: 220px;
}
.profile-block:active {
    transform: scale(0.97);
}
.profile-block .profile-content {
    text-align: right;
}
.profile-in-block {
	padding: 10px 20px 10px 10px;
	font-size: var(--font-size2);
	display: flex;
	align-items: center;
	gap: 15px;
    -webkit-tap-highlight-color: transparent;
	min-width: 220px;
}
.profile-block:hover {
	background-color: var(--bgh-menu-el1);
}
.profile-ava {
	background-color: var(--bg-menu-el1-ava);

	width: 50px;
	height: 50px;
	border-radius: 50px;
	flex-shrink: 0; 
    background-size: cover;
    background-position: center center;
	background-repeat: no-repeat;
}
.profile-content {
	flex: 1;
}
.profile-full-block {
	display: flex;
	position: absolute;
	background-color: var(--bg-main1);
	padding: 0px 10px 10px 10px;
	top: -10px;
	right: -10px;
	z-index: 1000;
	border-radius: var(--radius-size1);
	text-align: right;
	width: auto;
	justify-content: flex-end;
	flex-direction: column;
	align-items: flex-end;
}
.profile-full-block .profile-in-block {
	width: fit-content;
}
.profile-btn {
  display: block;
  padding: 10px 16px;
  color: #fff;
  text-align: left;
  text-decoration: none;
  border-radius: 6px;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.profile-btn:hover {
	background-color: rgba(240,248,255,0.05);
}
.profile-btn:active {
    transform: scale(0.97);
    background-color: rgba(240,248,255,0.1);
}

/* ============================================ */
/* ДИЗАЙН СТРАНИЦЫ: ВАРИАНТ 1                   */
/* ============================================ */
.box-1-block {
    display: flex;
    flex-wrap: wrap;
    position: relative;
}

.box-1-block h1 {
    width: 100%;
    margin: 0 0 15px 0;
    font-size: 20px;
    padding-right: 0;
    line-height: 36px;
    display: flex;
    align-items: center;
}

.box-1-mobile-btn-menu {
    display: none;
}

.box-1-menu {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-content1);
    border-radius: var(--radius-size1);
    padding: 15px;
}

.box-1-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.box-1-menu li {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #444;
    font-size: 14px;
    transition: background 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
.box-1-menu li:hover {
    background: rgba(0,0,0,0.04);
}
.box-1-menu li:active {
    transform: scale(0.96);
    background: rgba(0,0,0,0.08);
    transition: background 0.05s ease, transform 0.05s ease;
}
.box-1-menu li.active {
    background: var(--bg-main1);
    color: #fff;
    font-weight: 600;
}
.box-1-menu li.active:active {
    background: var(--bg-main1-pressed);
}

.box-1-main {
    flex: 1;
    min-width: 0;
    background: var(--bg-content1);
    border-radius: var(--radius-size1);
    padding: 15px;
    margin-left: 15px;
}

/* ============================================ */
/* ФОРМЫ И ЭЛЕМЕНТЫ ВВОДА                       */
/* ============================================ */

.form-group {
    margin-bottom: 16px;
}
.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.form-label-required::after {
    content: ' *';
    color: var(--color-danger);
}

.form-hint {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}
.form-error {
    font-size: 11px;
    color: var(--color-danger);
    margin-top: 4px;
}

/* Текстовый ввод */
.form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--color-text);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}
.form-input:focus {
    border-color: var(--bg-main1);
    box-shadow: 0 0 0 3px var(--bg-main1-border);
}
.form-input::placeholder {
    color: #bbb;
}
.form-input:disabled {
    background: #f5f5f5;
    color: #999;

    cursor: not-allowed;
}
.form-input.error {
    border-color: var(--color-danger);
}
.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
}

/* Textarea */
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--color-text);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    -webkit-appearance: none;
}
.form-textarea:focus {
    border-color: var(--bg-main1);
    box-shadow: 0 0 0 3px var(--bg-main1-border);
}

/* Select */
.form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--color-text);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}
.form-select:focus {
    border-color: var(--bg-main1);
    box-shadow: 0 0 0 3px var(--bg-main1-border);
}

/* Чекбокс */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;
    padding: 4px 0;
}
.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--bg-main1);
    cursor: pointer;
    flex-shrink: 0;
}

/* Радио */
.form-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;
    padding: 4px 0;
}
.form-radio input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--bg-main1);
    cursor: pointer;
    flex-shrink: 0;
}

/* Группа */
.form-radio-group,
.form-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.form-radio-group--inline,
.form-checkbox-group--inline {
    flex-direction: row;
    gap: 16px;
    flex-wrap: wrap;
}

/* Переключатель (Switch) */
.form-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;
    padding: 4px 0;
}
.form-switch input {
    display: none;
}
.form-switch-track {
    width: 48px;
    height: 28px;
    background: #ccc;
    border-radius: 14px;
    position: relative;
    transition: background 0.2s ease;
    flex-shrink: 0;
}
.form-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.form-switch input:checked + .form-switch-track {
    background: var(--bg-main1);
}
.form-switch input:checked + .form-switch-track::after {
    transform: translateX(20px);
    box-shadow: 0 1px 3px rgba(102, 51, 153, 0.4);
}
.form-switch:active .form-switch-track::after {
    width: 26px;
    border-radius: 14px;
}

/* ============================================ */
/* КНОПКИ                                       */
/* ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.btn:active {
    transform: scale(0.94);
    transition: transform 0.05s ease, background 0.05s ease;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s, opacity 0.6s;
    opacity: 0;
}
.btn:active::after {
    width: 300px;
    height: 300px;
    opacity: 0;
    transition: 0s;
}

.btn-primary {
    background: var(--bg-main1);
    color: #fff;
}
.btn-primary:hover {
    background: var(--bg-main1-hover);
}
.btn-primary:active {
    background: var(--bg-main1-pressed);
    transform: scale(0.94);
}
.btn-primary:focus-visible {
    box-shadow: 0 0 0 3px var(--bg-main1-border);
}

.btn-outline {
    background: transparent;
    color: var(--bg-main1);
    border: 1px solid var(--bg-main1);
    box-shadow: none;
}
.btn-outline:hover {
    background: var(--bg-main1-light);
}
.btn-outline:active {
    background: rgba(102, 51, 153, 0.15);
    transform: scale(0.94);
}
.btn-outline:focus-visible {
    box-shadow: 0 0 0 3px var(--bg-main1-border);
}

.btn-secondary {
    background: #f0f0f0;
    color: var(--color-text);
    box-shadow: none;
}
.btn-secondary:hover {
    background: #e4e4e4;
}
.btn-secondary:active {
    background: #d9d9d9;
    transform: scale(0.94);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}
.btn-danger:hover {
    background: var(--color-danger-hover);
}
.btn-danger:active {
    background: var(--color-danger-pressed);
    transform: scale(0.94);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}
.btn-success:hover {
    background: var(--color-success-hover);
}
.btn-success:active {
    background: var(--color-success-pressed);
    transform: scale(0.94);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 12px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-group--end {
    justify-content: flex-end;
}

/* ============================================ */
/* КАРТОЧКА ФОРМЫ                               */
/* ============================================ */

.form-card {
    background: var(--bg-content1);
    border-radius: var(--radius-size1);
    padding: 24px;
    max-width: 600px;
}
.form-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 20px;
}
.form-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 20px 0;
}

/* ============================================ */
/* ИНЛАЙН-РЕДАКТИРУЕМОЕ ПОЛЕ                     */
/* ============================================ */

.inline-field {
    position: relative;
    padding: 5px 9px;
    background: var(--bg-content1);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inline-field:hover {
    border-color: var(--color-border);
}

.inline-field.editing {
    border-color: var(--bg-main1);
    box-shadow: 0 0 0 3px var(--bg-main1-border);
}

.inline-field-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.inline-field-row {
    display: flex;
    align-items: center;
    min-height: 32px;
}

.inline-field-value {
    font-size: 15px;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.inline-field-input {
    flex: 1;
    min-width: 0;
    padding: 4px 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--color-text);
    background: #fff;
	border:none;
    border-bottom: 1px solid var(--bg-main1);
    border-radius: 3px;
    outline: none;
    transition: box-shadow 0.2s ease;
    -webkit-appearance: none;
	box-sizing: border-box;
	margin-right: 10px;
}

.inline-field-input:focus {
    box-shadow: 0 0 0 2px var(--bg-main1-border);
}

.inline-field-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.inline-field-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    color: var(--color-text-secondary);
}

.inline-field-icon-btn:hover {
    background: var(--bg-main1-light);
    color: var(--bg-main1);
}

.inline-field-icon-btn:active {
    transform: scale(0.9);
}

.inline-field-icon-btn.save {
    color: var(--color-success);
}

.inline-field-icon-btn.save:hover {
    background: rgba(56, 161, 105, 0.1);
}

.inline-field-icon-btn.cancel {
    color: var(--color-danger);
}

.inline-field-icon-btn.cancel:hover {
    background: rgba(229, 62, 62, 0.08);
}

.inline-field-message {
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.inline-field-message.show {
    display: block;
}

.inline-field-message.error {
    color: var(--color-danger);
}

.inline-field-message.success {
    color: var(--color-success);
}

/* ============================================ */
/* ТАБЛИЦЫ                                      */
/* ============================================ */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-size2);
    border: 1px solid var(--color-border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 600px;
}

.table th {
    background: var(--color-body);
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(0, 0, 0, 0.015);
}

.table .text-right { text-align: right; }
.table .text-center { text-align: center; }
.table .text-secondary { color: var(--color-text-secondary); font-size: 13px; }

.table .badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.table .badge-success { background: #f0fff4; color: var(--color-success); }
.table .badge-warning { background: #fffaf0; color: var(--color-warning); }
.table .badge-danger { background: #fff5f5; color: var(--color-danger); }
.table .badge-info { background: var(--bg-main1-light); color: var(--bg-main1); }

/* Таблица с закреплённым первым столбцом */
.table-sticky-first th:first-child,
.table-sticky-first td:first-child {
    position: sticky;
    left: 0;
    background: var(--bg-content1);
    z-index: 1;
    box-shadow: 2px 0 4px rgba(0,0,0,0.04);
}

.table-sticky-first th:first-child {
    background: var(--color-body);
}

/* Компактная таблица */
.table-compact th,
.table-compact td {
    padding: 8px 12px;
    font-size: 13px;
}

/* ============================================ */
/* КАРТОЧКИ (GRID)                              */
/* ============================================ */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.card {
    background: var(--bg-content1);
    border-radius: var(--radius-size1);
    border: 1px solid var(--color-border);
    padding: 20px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    border-color: var(--bg-main1-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.card-body {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    font-size: 12px;
    color: var(--color-text-secondary);
}

.card-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 20px;
    letter-spacing: 1px;
    transition: background 0.15s ease;
    flex-shrink: 0;
}
.card-menu-btn:hover {
    background: rgba(0,0,0,0.05);
}

/* Меню карточки */
.card-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    background: var(--bg-content1);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border: 1px solid var(--color-border);
    min-width: 160px;
    z-index: 10;
    overflow: hidden;
    animation: dropdown-in 0.15s ease;
}

.card-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s ease;
}
.card-dropdown button:hover {
    background: var(--color-body);
}
.card-dropdown button.danger {
    color: var(--color-danger);
}
.card-dropdown button.danger:hover {
    background: #fff5f5;
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
}
.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}
.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ============================================ */
/* ТИПЫ (BADGES)                                */
/* ============================================ */

.type-badge {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.type-project {
    background: var(--bg-main1-light);
    color: var(--bg-main1);
}

.type-business {
    background: #f0fff4;
    color: var(--color-success);
}

/* ============================================ */
/* АВАТАР-ЗАГРУЗКА                              */
/* ============================================ */

.avatar-upload-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    display: block;
}

.avatar-upload-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--bg-main1);
    transition: filter 0.3s ease, transform 0.3s ease;
    display: block;
    box-sizing: border-box;
}

.avatar-upload-wrapper img.uploading {
    filter: blur(4px) brightness(0.7);
    transform: scale(0.95);
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.avatar-overlay:hover {
    background: rgba(0, 0, 0, 0.4);
}

.avatar-overlay span {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    text-align: center;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.avatar-overlay:hover span {
    opacity: 1;
}

.avatar-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.avatar-upload-wrapper input[type="file"] {
    display: none;
}

/* ============================================ */
/* МОДАЛЬНЫЕ ОКНА                               */
/* ============================================ */

.modal-stack {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10000;
	overflow: hidden;
}

.modal-layer {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: filter 0.3s ease;
}

.modal-layer.behind {
    filter: brightness(0.85);
    pointer-events: none;
}

.modal-layer.front {
    z-index: 10001;
    pointer-events: auto;
}

.modal-layer .modal-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

.modal-layer.front .modal-bg {
    background: rgba(0, 0, 0, 0.5);
}

.modal-layer .modal-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.3s ease;
}

.modal-layer.behind .modal-wrapper {
    transform: scale(0.92);
    filter: blur(4px);
}

.modal-layer .modal {
    background: var(--bg-content1);
    border-radius: var(--radius-size1);
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modal-scale-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-sm { max-width: 380px; }
.modal-md { max-width: 500px; }
.modal-lg { max-width: 700px; }
.modal-xl { max-width: 900px; }
.modal-half { max-width: 50vw; max-height: 50vh; }
.modal-full { max-width: 95vw; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

.modal-close {
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: 8px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 0 24px 20px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.modal-centered { text-align: center; }
.modal-centered .modal-body { padding: 30px 24px; }

.modal-icon { font-size: 48px; margin-bottom: 12px; }

@keyframes modal-scale-in {
    from { transform: scale(0.85) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ============================================ */
/* АНИМАЦИИ                                     */
/* ============================================ */

@keyframes preloader-spin {
    0%   { transform: rotate(0deg); opacity: 0; }
    1%   { opacity: 1; }
    100% { transform: rotate(360deg); opacity: 1; }
}

@keyframes preloader-pulse {
    0%   { transform: translate(-50%, -50%) scale(1); }
    50%  { transform: translate(-50%, -50%) scale(1.25); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.page-wrapper {
    transition: transform 0.35s ease, opacity 0.75s ease;
}

/* ============================================ */
/* ПРЕЛОАДЕРЫ БЛОКОВ                            */
/* ============================================ */

.htmx-loadable {
    position: relative;
    min-height: 100px;
}

.htmx-loadable > *:not(.htmx-loader):not(.htmx-error) {
    transition: filter 0.25s ease 0.25s, opacity 0.25s ease 0.25s;
}

.htmx-loadable.htmx-request > *:not(.htmx-loader):not(.htmx-error) {
    filter: blur(4px);
    opacity: 0.5;
    pointer-events: none;
}

.htmx-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 10;
    width: 36px;
    height: 36px;
    margin-left: -18px;
    margin-top: -18px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: var(--bg-main1);
    border-radius: 50%;
}

.htmx-loadable.htmx-request .htmx-loader {
    display: block;
    animation: preloader-spin 0.8s linear infinite;
    animation-delay: 0.35s;
    animation-fill-mode: forwards;
    opacity: 0;
}

.htmx-loadable.htmx-request .htmx-loadable .htmx-loader {
    display: none;
}

.htmx-error {
    display: none;
    position: absolute;
    top: 10px;
    left: 0;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    align-items: center;
    justify-content: center;
    z-index: 11;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: var(--radius-size1);
}

.htmx-error.show {
    display: flex;
}

/* ============================================ */
/* КАРТОЧКИ ВЫБОРА ТИПА                         */
/* ============================================ */

.type-choice-group {
    display: flex;
    gap: 12px;
}

.type-choice-group label {
    flex: 1;
    cursor: pointer;
}

.type-choice-group input[type="radio"] {
    display: none;
}

.type-choice-card {
    display: block;
    padding: 14px;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.type-choice-card:hover {
    border-color: var(--bg-main1-border);
    background: var(--bg-main1-light);
}

.type-choice-group input[type="radio"]:checked + .type-choice-card {
    border-color: var(--bg-main1);
    background: var(--bg-main1-light);
    box-shadow: 0 0 0 3px var(--bg-main1-border);
}

.type-choice-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.type-choice-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.type-choice-desc {
    font-size: 11px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}




/* ============================================ */
/* Дополнительные стили для загрузки файлов */
/* ============================================ */

.file-upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-size2);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--color-body);
    position: relative;
}

.file-upload-zone:hover {
    border-color: var(--bg-main1);
    background: var(--bg-main1-light);
}

.file-upload-zone.dragover {
    border-color: var(--bg-main1);
    background: var(--bg-main1-light);
    transform: scale(1.01);
}

.file-upload-zone.has-file {
    border-style: solid;
    border-color: var(--color-success);
    background: #f0fff4;
    padding: 16px 20px;
}

.file-upload-zone .upload-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-secondary);
}

.file-upload-zone .upload-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
}

.file-upload-zone .upload-hint {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.file-upload-zone .upload-hint strong {
    color: var(--bg-main1);
}

.file-upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Файл-превью */
.file-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-content1);
    border-radius: var(--radius-size2);
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.file-preview:hover {
    border-color: var(--bg-main1-border);
}

.file-preview .file-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-size2);
    background: var(--bg-main1-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.file-preview .file-icon.image {
    background: transparent;
    padding: 0;
    overflow: hidden;
}

.file-preview .file-icon.image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-size2);
}

.file-preview .file-info {
    flex: 1;
    min-width: 0;
}

.file-preview .file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview .file-size {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.file-preview .file-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.file-preview .file-remove:hover {
    background: #fee;
    color: var(--color-danger);
}

.file-preview .file-remove:active {
    transform: scale(0.9);
}

/* Группа файлов */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.file-list .file-preview {
    padding: 10px 14px;
}

/* Список файлов в таблице */
.file-list-compact .file-preview {
    padding: 8px 12px;
}

.file-list-compact .file-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

.file-list-compact .file-name {
    font-size: 13px;
}

/* Множественная загрузка */
.file-upload-multiple .file-upload-zone {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Прогресс загрузки */
.file-progress {
    width: 100%;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.file-progress-bar {
    height: 100%;
    background: var(--bg-main1);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.file-progress-bar.success {
    background: var(--color-success);
}

.file-progress-bar.error {
    background: var(--color-danger);
}

/* Список с иконками файлов */
.file-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Состояние ошибки для зоны */
.file-upload-zone.error {
    border-color: var(--color-danger);
    background: #fff5f5;
}

.file-upload-zone.error .upload-hint {
    color: var(--color-danger);
}

/* Адаптив */
@media (max-width: 768px) {
    .file-upload-zone {
        padding: 20px 16px;
    }
    
    .file-upload-zone .upload-icon {
        font-size: 36px;
    }
    
    .file-preview {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .file-preview .file-info {
        width: 100%;
    }
    
    .file-preview .file-remove {
        align-self: flex-end;
    }
    
    .file-preview .file-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}