/* Базовые переменные по умолчанию (светлая тема, вариант 1) */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #10b981;
    --background: #ffffff;
    --surface: #f9fafb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --nav-bg: #ffffff;
    --card-bg: #ffffff;
}

/* Светлая тема — классическая */
body.theme-light-1 {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #10b981;
    --background: #ffffff;
    --surface: #f9fafb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --nav-bg: #ffffff;
    --card-bg: #ffffff;
}

/* Светлая тема — мягкая, более тёплая */
body.theme-light-2 {
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --secondary-color: #22c55e;
    --background: #fffbeb;
    --surface: #fef3c7;
    --text-primary: #1f2937;
    --text-secondary: #78716c;
    --border-color: #fed7aa;
    --shadow: rgba(148, 81, 0, 0.15);
    --nav-bg: #fffbeb;
    --card-bg: #ffffff;
}

/* Светлая тема — более контрастная */
body.theme-light-3 {
    --primary-color: #0f766e;
    --primary-hover: #115e59;
    --secondary-color: #2563eb;
    --background: #f3f4f6;
    --surface: #ffffff;
    --text-primary: #020617;
    --text-secondary: #4b5563;
    --border-color: #cbd5f5;
    --shadow: rgba(15, 23, 42, 0.18);
    --nav-bg: #ffffff;
    --card-bg: #ffffff;
}

/* Тёмная тема — глубокая */
body.theme-dark-1 {
    --primary-color: #6366f1;
    --primary-hover: #818cf8;
    --secondary-color: #34d399;
    --background: #020617;
    --surface: #020617;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --border-color: #1f2937;
    --shadow: rgba(0, 0, 0, 0.5);
    --nav-bg: #020617;
    --card-bg: #020617;
}

/* Тёмная тема — с неоновыми акцентами */
body.theme-dark-2 {
    --primary-color: #22c55e;
    --primary-hover: #16a34a;
    --secondary-color: #38bdf8;
    --background: #020617;
    --surface: #020617;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: #1f2937;
    --shadow: rgba(0, 0, 0, 0.6);
    --nav-bg: #020617;
    --card-bg: #020617;
}

/* Тёмная тема — мягкая */
body.theme-dark-3 {
    --primary-color: #a855f7;
    --primary-hover: #9333ea;
    --secondary-color: #facc15;
    --background: #111827;
    --surface: #020617;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --border-color: #1f2937;
    --shadow: rgba(0, 0, 0, 0.45);
    --nav-bg: #111827;
    --card-bg: #020617;
}

/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Навигация */
.navbar {
    background-color: var(--nav-bg);
    box-shadow: 0 2px 4px var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-logo:hover {
    color: var(--primary-hover);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.nav-link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-link-button:hover {
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
}
.nav-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
.nav-toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}
.nav-open .nav-toggle .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-open .nav-toggle .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-open .nav-toggle .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Основной контент */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Главная страница */
.home-container {
    text-align: center;
    padding: 3rem 0;
}

.welcome-section {
    margin-bottom: 4rem;
}

.welcome-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.welcome-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.app-card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px var(--shadow);
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--shadow);
    border-color: var(--primary-color);
}

.app-card-disabled {
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: none;
}

.app-card-disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-color);
}

/* Инвентаризация */
.inventory-container {
    max-width: 800px;
    margin: 0 auto;
}

.inventory-empty {
    text-align: center;
    padding: 3rem 2rem;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
}

.inventory-empty-text {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.inventory-profiles {
    margin-top: 2rem;
}

.inventory-subtitle {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.profiles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.profile-card:hover {
    border-color: var(--primary-color);
}

.profile-card-link {
    flex: 1;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.profile-card-link:hover .profile-name {
    color: var(--primary-color);
}

.profile-card-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-card-btn {
    font-size: 0.9rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.profile-card-link-btn {
    font-family: inherit;
}

.profile-card-btn:hover,
.profile-card-settings:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.profile-card-settings {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.profile-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-section {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Редактирование профиля инвентаризации */
.profile-edit-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.profile-edit-header .page-title {
    margin-bottom: 0;
}

.profile-edit-subtitle {
    color: var(--text-secondary);
    margin: 0 auto 0 0;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.btn-icon-only {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.45rem 0.65rem;
    font-size: 1.35rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

.access-toolbar,
.access-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.btn-sm.btn-icon-only {
    min-width: 2.35rem;
    min-height: 2.35rem;
    font-size: 1.15rem;
    padding: 0.35rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.inventory-edit-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Кнопка между блоками "К распределению" / "К учёту" на всю ширину */
.btn-section-nav {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    color: var(--primary-color);
    background-color: var(--surface);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    transition: background-color 0.2s, color 0.2s;
}

.btn-section-nav:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Страница распределения: карточка как инвентарь + блок назначения */
.distribution-item-card {
    flex-wrap: wrap;
}

.distribution-item-card .inventory-item-card-link {
    flex: 1;
    min-width: 0;
}

.distribution-assign-block {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.distribution-assigned {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.distribution-assigned-names {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.btn-assign-edit {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    cursor: pointer;
    font-size: 1rem;
}

.btn-assign-edit:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-assign {
    flex-shrink: 0;
}

/* Выбор сотрудников в модалке — плитками */
.assign-employees-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.assign-employee-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.assign-employee-tile:hover {
    border-color: var(--primary-color);
    background-color: var(--card-bg);
}

.assign-employee-tile input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.assign-one-hint {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.assign-employee-tile:has(input:checked) {
    border-color: var(--primary-color);
    background-color: rgba(var(--primary-rgb, 59, 130, 246), 0.1);
}

.assign-employee-tile-name {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    text-align: center;
}

.assign-employee-tile-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.assign-employees-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.assign-employee-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.assign-employee-label input {
    width: auto;
}

/* Страница учёта: строка товара + скрепка + название капсом + "Вы насчитали" + поле + сохранить */
.accounting-item-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background-color: var(--background);
}

.accounting-item-clip {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
}

.accounting-item-clip:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.accounting-item-clip-empty {
    cursor: default;
    opacity: 0.5;
}

.accounting-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.accounting-item-name {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
}

.accounting-item-name-caps {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1rem;
}

.accounting-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.accounting-item-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-top: 0.5rem;
}

.accounting-field {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.accounting-field .accounting-qty {
    width: 90px;
    padding: 0.35rem 0.5rem;
}

.accounting-item-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.accounting-item-input-wrap .accounting-qty {
    width: 100px;
}

.accounting-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-accounting-save {
    min-width: 6rem;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
}

.btn-accounting-save:hover {
    filter: brightness(1.1);
}

.inventory-edit-section {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.inventory-edit-section .section-title {
    margin-bottom: 0.5rem;
}

.section-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.inventory-edit-block {
    padding: 0.75rem 0;
}

.inventory-edit-placeholder {
    margin: 0 0 0.5rem 0;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Настройки профиля инвентаризации */
.profile-settings-subtitle {
    color: var(--text-secondary);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.profile-settings-audit {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
}

.profile-settings-audit .section-title {
    margin-bottom: 0.5rem;
}

.audit-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 1rem;
}

.audit-log-entry {
    display: grid;
    grid-template-columns: 120px 140px 1fr;
    gap: 1rem;
    align-items: start;
    padding: 0.5rem 0.75rem;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.audit-log-time {
    color: var(--text-secondary);
    white-space: nowrap;
}

.audit-log-actor {
    font-weight: 600;
    color: var(--text-primary);
}

.audit-log-desc {
    color: var(--text-primary);
    word-break: break-word;
}

.audit-log-empty {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .audit-log-entry {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

.profile-settings-danger {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
}

.profile-settings-danger .section-title {
    margin-bottom: 0.5rem;
}

.delete-form {
    margin-top: 1rem;
}

/* Редактирование товара: кол-во до (только показ), кто отредактировал */
.quantity-display {
    padding: 0.75rem;
    background-color: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.item-edit-modified {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}

/* Фото в форме редактирования товара */
.item-photo-preview {
    margin-bottom: 0.75rem;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    background-color: var(--surface);
    padding: 1rem;
    text-align: center;
}

.item-photo-img {
    max-width: 100%;
    max-height: 280px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.form-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
}

/* Сетка сотрудников в профиле */
.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.employee-cell {
    background-color: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.employee-cell-info {
    min-width: 0;
}

.employee-name {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.employee-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.employee-role-admin {
    color: var(--primary-color);
}

.employee-cell-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.employee-cell-clip {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
}

.employee-cell-clip:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.employee-cell-settings {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
}

.employee-cell-settings:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.employee-cell-add {
    justify-content: center;
    border-style: dashed;
}

/* Единая кнопка "+ Добавить" везде на странице редактирования */
.btn-add-block {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--primary-color);
    background-color: var(--surface);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.btn-add-block:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.employee-cell-add .btn-add-block {
    width: 100%;
    min-height: 2.5rem;
}

/* Группы инвентаря (сворачиваемые) */
.inventory-groups {
    margin-bottom: 1rem;
}

.inventory-group {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.inventory-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background-color: var(--surface);
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.inventory-group-header:hover {
    background-color: var(--card-bg);
}

.inventory-group-title {
    flex: 1;
    min-width: 0;
    margin-right: 0.5rem;
}

.inventory-group-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.inventory-group-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inventory-group-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.inventory-group-actions .btn-assign-group {
    cursor: pointer;
    white-space: nowrap;
}

.inventory-group-toggle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.inventory-group-body {
    padding: 0.5rem 1rem 1rem;
    background-color: var(--card-bg);
}

.inventory-item-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background-color: var(--background);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

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

.inventory-item-card-link {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.inventory-item-card-link:hover .inv-name-caps {
    color: var(--primary-color);
}

.inventory-item-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: baseline;
}

.inventory-item-row-1 {
    margin-bottom: 0.25rem;
}

.inv-name-caps {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.inv-sep {
    color: var(--text-secondary);
    margin: 0 0.25rem;
}

.inv-short {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.inventory-item-row-2 {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.inventory-item-row-3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.inventory-item-row .inv-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-right: 0.25rem;
}

.inventory-item-row .inv-label::after {
    content: ':';
}

.inventory-item-row .inv-value {
    margin-right: 0.5rem;
}

.inventory-item-clip {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
}

.inventory-item-clip:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.inventory-item-clip-empty {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    opacity: 0.5;
    font-size: 1rem;
}

.inventory-item-card-view {
    cursor: default;
}

.inventory-item-card-view .inv-name-caps:hover {
    color: inherit;
}

.inventory-item-photo-wrap {
    margin-top: 0.5rem;
}

.inventory-item-photo-thumb {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.modal-photo {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    padding: 1rem;
}

.modal-photo .modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.modal-photo img {
    display: block;
}

.inventory-group-empty,
.inventory-no-groups {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 1rem 0;
    margin: 0;
}

/* Страница ревизии */
.revision-last {
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
}

.revision-item-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--background);
}

.revision-item-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.75rem;
}

.revision-item-header .inv-name-caps {
    font-weight: 700;
    font-size: 1rem;
}

.revision-item-labels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.revision-item-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.5rem 1rem;
    align-items: center;
}

.rev-field {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

.rev-kolvo-do, .rev-kolvo-posle, .rev-itog {
    color: var(--text-primary);
    font-weight: 500;
}

.rev-input {
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.75rem;
}

.revision-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.revision-actions .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

@media (max-width: 640px) {
    .revision-item-labels,
    .revision-item-fields {
        grid-template-columns: 1fr 1fr;
    }
    .revision-item-labels span:nth-child(3),
    .revision-item-fields .rev-kolvo-posle { grid-column: 1; }
    .revision-item-labels span:nth-child(4),
    .revision-item-fields .rev-itog { grid-column: 2; }
}

/* Таблица инвентаря (legacy, если понадобится) */
.inventory-table-wrap {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.inventory-table th,
.inventory-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.inventory-table th {
    background-color: var(--surface);
    font-weight: 600;
    color: var(--text-primary);
}

.inventory-table tbody tr:hover {
    background-color: var(--surface);
}

.inventory-empty-row {
    color: var(--text-secondary);
    text-align: center;
    padding: 1.5rem;
}

.btn-add-item {
    margin-top: 0.5rem;
}

.app-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.app-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.app-description {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Страница настроек */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.settings-section {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 4px var(--shadow);
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.theme-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.theme-btn {
    flex: 1;
    min-width: 150px;
    padding: 1.5rem;
    background-color: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.theme-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.theme-btn.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.theme-icon {
    font-size: 2rem;
}

.theme-variants-wrapper {
    margin-top: 1.5rem;
}

.theme-variants-title {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.theme-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.theme-variant-btn {
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background-color: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-variant-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.theme-variant-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

/* Формы */
.password-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    width: 100%;
    font-family: inherit;
}

.form-input:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* Дополнительные настройки */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Страница графика */
.charts-container {
    max-width: 1400px;
    margin: 0 auto;
}

.charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.charts-actions {
    display: flex;
    gap: 1rem;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #059669;
}

/* Календарь */
.calendar-wrapper {
    max-width: 1000px;
    margin: 2rem auto;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px var(--shadow);
}

.calendar-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.calendar-nav-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    font-size: 2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
}

.calendar-nav-btn:hover {
    background-color: var(--primary-hover);
}

.calendar-month-year {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0;
}

.calendar {
    margin-bottom: 1.5rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.weekday {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 1rem;
    font-size: 1rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.4rem;
}

.calendar-day {
    min-height: 86px;
    height: 86px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--surface);
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.35rem;
    position: relative;
}

.calendar-day:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.calendar-day.empty {
    border: none;
    background-color: transparent;
    cursor: default;
    pointer-events: none;
}

.calendar-day-empty-cell {
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day.today {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--secondary-color);
    font-weight: bold;
}

.day-number {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: inherit;
}

.calendar-day.weekend-day .day-number {
    color: #dc2626;
}

.calendar-day.has-shift .day-number {
    color: inherit;
}

.calendar-day.has-shift.weekend-day .day-number {
    color: inherit;
}

.cell-note-marker {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    font-size: 0.7rem;
    line-height: 1;
    z-index: 1;
    pointer-events: none;
}

.calendar-day.has-shift {
    cursor: pointer;
    border: none;
    position: relative;
}

.shift-header-row {
    width: 100%;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.shift-cell-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.35rem;
    width: 100%;
    margin-top: 0.1rem;
    font-size: 0.62rem;
    line-height: 1.15;
    color: inherit;
    opacity: 0.95;
}

.shift-metric {
    white-space: nowrap;
    font-weight: 500;
}

.shift-inline-name {
    flex: 1;
    width: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    line-height: 1.1;
    color: inherit;
    text-align: left;
}

.shift-cell-row {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.shift-info {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-top: auto;
    font-weight: 500;
    width: 100%;
    text-align: center;
}

/* Список смен */
.shifts-list-section {
    margin-top: 3rem;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 4px var(--shadow);
}

.shifts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shift-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--surface);
    border-radius: 8px;
    gap: 1rem;
}

.shift-financial {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.shift-rate,
.shift-revenue,
.shift-tips {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.shift-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
    font-size: 1rem;
}

.btn-edit:hover {
    background-color: var(--primary-hover);
}

.shift-date {
    font-weight: 600;
    min-width: 100px;
    color: var(--text-primary);
}

.shift-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.shift-name {
    font-weight: 500;
    font-size: 1.1rem;
}

.shift-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-delete {
    background-color: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-delete:hover {
    background-color: #b91c1c;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Доступ (список учётных записей) */
.access-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 720px;
}

.access-account-card {
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.access-account-line1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.access-account-line2 {
    font-size: 0.9rem;
    line-height: 1.4;
    padding-left: 0.05rem;
}

.access-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-shrink: 0;
}

form.inline-form {
    display: inline;
}

.modal-extra-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.modal-extra-check {
    flex-shrink: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.modal-extra-input {
    flex: 1;
    min-width: 0;
}

.modal-extra-title {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Статистика */
.statistics-section {
    margin-top: 3rem;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 4px var(--shadow);
}

.stats-rows {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 900px;
    box-sizing: border-box;
}

.stats-row {
    display: grid;
    gap: 1rem;
}

.stats-row--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-row--1 {
    grid-template-columns: 1fr;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 1070px;
}

.stat-card {
    background-color: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-card-revenue {
    position: relative;
}

.btn-calc {
    margin-top: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

.btn-calc:hover {
    background-color: var(--primary-hover);
}

.form-input-readonly {
    background-color: var(--surface);
    cursor: default;
}

.stats-by-type {
    margin-top: 2rem;
}

.stats-by-type h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.type-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background-color: var(--surface);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.type-stat-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

.type-stat-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.type-stat-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.type-stat-hours {
    color: var(--primary-color);
    font-weight: 600;
}

.type-stat-revenue,
.type-stat-tips {
    color: var(--secondary-color);
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Таблица статистики без видимых границ */
.stats-table {
    width: 100%;
    max-width: 480px;
    border-collapse: collapse;
    border: none;
}
.stats-table td,
.stats-table th {
    border: none;
    padding: 0.5rem 1rem 0.5rem 0;
    vertical-align: top;
}
.stats-table-label {
    color: var(--text-secondary);
    font-weight: 500;
}
.stats-table-value {
    text-align: right;
    font-weight: 600;
    color: var(--primary-color);
}
.stats-by-type-title {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
}
.stats-by-type-table {
    max-width: 100%;
}
.stats-by-type-table .stats-table-label {
    padding-right: 0.75rem;
}
.stats-by-type-table .type-stat-color {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.stats-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn-danger:hover {
    background-color: #b91c1c;
}

/* Страницы авторизации */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
}

.auth-card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 6px var(--shadow);
    width: 100%;
    max-width: 400px;
}

.auth-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn-block {
    width: 100%;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Сообщения об ошибках */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-help {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Формы для смен */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 4px var(--shadow);
}

.form-card-same-width {
    max-width: 560px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-checkboxes {
    align-items: center;
}

.form-label-inline {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.form-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Выбор цвета */
.color-selector {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.color-option {
    position: relative;
    cursor: pointer;
}

.color-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-preview {
    display: block;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

.color-option input[type="radio"]:checked + .color-preview {
    border-color: var(--text-primary);
    transform: scale(1.1);
    box-shadow: 0 4px 8px var(--shadow);
}

.color-option:hover .color-preview {
    transform: scale(1.05);
}

.color-preset-btn {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    border-radius: 10px;
}

.color-preset-btn .color-preview {
    border: 3px solid transparent;
}

.color-preset-btn.active .color-preview {
    border-color: var(--text-primary);
    transform: scale(1.08);
}

/* Секция типов смен */
.shift-types-section {
    margin-top: 2rem;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px var(--shadow);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.shift-types-list {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.shift-type-item {
    min-width: 120px;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: move;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    position: relative;
}

.shift-type-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
    border-color: rgba(255, 255, 255, 0.5);
}

.shift-type-item:active {
    transform: scale(0.95);
}

.shift-type-item.selected {
    box-shadow: 0 0 0 3px var(--primary-color);
    border-color: rgba(255, 255, 255, 0.8);
}

.shift-type-button-content {
    text-align: center;
}

.shift-type-short {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.shift-type-name {
    font-size: 0.85rem;
    opacity: 0.9;
}

.shift-type-actions {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.shift-type-edit-btn,
.shift-type-delete-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
    font-size: 0.75rem;
}

.shift-type-edit-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.shift-type-delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.7);
}

.shift-type-add-btn {
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shift-type-add-btn:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.field-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--surface);
    border-radius: 8px;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.toggle-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 15% auto;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-large {
    max-width: 450px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-shift-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.modal-shift-type-btn {
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow);
    text-align: center;
    border: 2px solid transparent;
}

.modal-shift-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
    border-color: rgba(255, 255, 255, 0.5);
}

.modal-shift-type-short {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.modal-shift-type-name {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Футер */
.footer {
    background-color: var(--nav-bg);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        position: relative;
    }

    .nav-toggle {
        display: flex;
        order: 2;
        margin-left: auto;
    }

    .nav-menu {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        gap: 0;
        background-color: var(--nav-bg);
        box-shadow: 0 4px 12px var(--shadow);
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        border-radius: 8px;
        list-style: none;
        width: 100%;
        order: 3;
        z-index: 100;
    }

    .nav-container.nav-open .nav-menu {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a,
    .nav-menu .nav-link-button {
        display: block;
        padding: 0.75rem 1.5rem;
        text-align: left;
    }

    .nav-menu .nav-logout-form {
        display: block;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 1rem;
    }

    /* Страница графика — планшет */
    .charts-container {
        padding: 0 0.5rem;
    }

    .calendar-wrapper {
        padding: 1.25rem;
        margin: 1rem auto;
    }

    .calendar-month-year {
        font-size: 1.5rem;
    }

    .calendar-nav-btn {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
    }

    .calendar-day {
        min-height: 72px;
        padding: 0.35rem;
    }

    .day-number {
        font-size: 0.95rem;
    }

    .shift-cell-row {
        font-size: 0.6rem;
        font-weight: 600;
    }

    .shift-info {
        font-size: 0.65rem;
        padding: 0.2rem 0.35rem;
    }

    .weekday {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .calendar-days,
    .calendar-weekdays {
        gap: 0.4rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .stats-by-type-table {
        font-size: 0.9rem;
    }

    .shift-types-section {
        padding: 1rem;
    }

    .shift-types-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        width: 100%;
    }

    .shift-type-item {
        min-width: 0;
        width: 100%;
        padding: 0.5rem;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        overflow: hidden;
        min-height: 64px;
    }

    .shift-type-item.shift-type-add-btn {
        min-height: 64px;
    }

    .shift-type-button-content {
        width: 100%;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }

    .shift-type-short {
        font-size: 0.9rem;
        font-weight: bold;
    }

    .shift-type-name {
        font-size: 0.7rem;
        word-break: break-word;
        text-align: center;
        line-height: 1.2;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .shift-type-actions {
        margin-top: 0.25rem;
        padding-top: 0.25rem;
        flex-shrink: 0;
    }

    .shift-type-edit-btn,
    .shift-type-delete-btn {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    .statistics-section {
        padding: 1rem;
    }

    .stats-table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        padding: 0;
    }

    .stats-table {
        min-width: 0;
        width: 100%;
    }

    .stats-by-type-table {
        min-width: 320px;
        width: 100%;
        font-size: 0.85rem;
        table-layout: fixed;
    }

    .stats-by-type-table th,
    .stats-by-type-table td {
        padding: 0.4rem 0.35rem;
        font-size: 0.8rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .stats-by-type-table .stats-table-label:first-child,
    .stats-by-type-table td:first-child {
        max-width: 70px;
        word-break: break-word;
        white-space: normal;
    }

    .modal-content.modal-large {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .form-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    /* Телефон — ещё компактнее */
    .calendar-wrapper {
        padding: 0.75rem;
        margin: 0.5rem auto;
    }

    .calendar-month-year {
        font-size: 1.25rem;
    }

    .calendar-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .calendar-day {
        min-height: 58px;
        height: 58px;
        padding: 0.2rem;
    }

    .day-number {
        font-size: 0.85rem;
    }

    .shift-header-row {
        margin-bottom: 0;
        gap: 0.2rem;
    }

    .shift-inline-name {
        font-size: 0.66rem;
        line-height: 1.0;
    }

    .shift-cell-metrics {
        font-size: 0.52rem;
        gap: 0.15rem 0.25rem;
    }

    .shift-cell-row {
        font-size: 0.55rem;
        font-weight: 600;
    }

    .shift-info {
        font-size: 0.6rem;
        padding: 0.15rem 0.25rem;
    }

    .weekday {
        font-size: 0.7rem;
        padding: 0.35rem;
    }

    .calendar-days,
    .calendar-weekdays {
        gap: 0.3rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        margin-bottom: 1rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .stats-by-type-title {
        font-size: 1rem;
    }

    .statistics-section {
        padding: 0.6rem;
    }

    .stat-card {
        padding: 0.8rem;
    }

    .stat-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .stats-table td,
    .stats-table th {
        padding: 0.35rem 0.4rem 0.35rem 0;
        font-size: 0.8rem;
    }

    .stats-by-type-table {
        min-width: 300px;
        font-size: 0.75rem;
    }

    .stats-by-type-table th,
    .stats-by-type-table td {
        padding: 0.3rem 0.25rem;
        font-size: 0.7rem;
    }

    .stats-by-type-table .stats-table-label:first-child,
    .stats-by-type-table td:first-child {
        max-width: 60px;
    }

    .shift-types-section {
        padding: 0.75rem;
    }

    .shift-types-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        width: 100%;
    }

    .shift-type-item {
        padding: 0.4rem;
        min-height: 56px;
    }

    .shift-type-item.shift-type-add-btn {
        min-height: 56px;
    }

    .shift-type-short {
        font-size: 0.85rem;
    }

    .shift-type-name {
        font-size: 0.65rem;
        -webkit-line-clamp: 2;
    }

    .shift-type-edit-btn,
    .shift-type-delete-btn {
        width: 18px;
        height: 18px;
    }

    .modal-content.modal-large {
        width: 100%;
        max-width: 100%;
        margin: 0.5rem;
        border-radius: 8px;
    }

    .modal-body .form-group label {
        font-size: 0.9rem;
    }

    .form-actions {
        flex-wrap: wrap;
    }

    .form-actions .btn {
        flex: 1;
        min-width: 120px;
    }
}
