/* ============================================
   Лига Чемпионов Бизнеса - Общие стили
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

/* === CSS Variables === */
:root {
    --bg-color: #F1F5F9; /* Slate 100 */
    --surface-color: #FFFFFF;
    --text-primary: #0F172A; /* Slate 900 */
    --text-secondary: #64748B; /* Slate 500 */
    --border-color: #E2E8F0; /* Slate 200 */
    --primary-color: #4F46E5; /* Indigo 600 */
    --primary-hover: #4338CA; /* Indigo 700 */
    --primary-light: #EEF2FF; /* Indigo 50 */
}

/* === Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure all form elements use Montserrat */
input, textarea, select, button {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* === Lucide Icons === */
svg.lucide {
    padding-left: 0px;
}

/* === Custom Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* === Card Component === */
.card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.card-no-padding {
    padding: 0;
}

.card-padding {
    padding: 1.5rem;
}

/* === Button Component === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border-radius: 0.75rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.95);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #4F46E5;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background-color: #4338CA;
}

.btn-secondary {
    background-color: white;
    color: #334155;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #F8FAFC;
    border-color: #CBD5E1;
}

.btn-ghost {
    color: #64748B;
    background: transparent;
}

.btn-ghost:hover:not(:disabled) {
    color: #1E293B;
    background-color: rgba(148, 163, 184, 0.1);
}

.btn-danger {
    background-color: #FEF2F2;
    color: #DC2626;
}

.btn-danger:hover:not(:disabled) {
    background-color: #FEE2E2;
}

.btn-unconfirm {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #B45309;
    border: 1.5px solid #FCD34D;
    box-shadow: 0 2px 4px -1px rgba(245, 158, 11, 0.2);
    font-weight: 600;
    position: relative;
}

.btn-unconfirm:hover:not(:disabled) {
    background: linear-gradient(135deg, #FDE68A 0%, #FCD34D 100%);
    color: #92400E;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

/* === Input Component === */
.input-group {
    margin-bottom: 1rem;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.375rem;
}

.input-field {
    display: block;
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border: 1px solid #CBD5E1;
    border-radius: 0.75rem;
    background-color: #F8FAFC;
    transition: all 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: #4F46E5;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* === Badge Component === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid;
}

.badge-success {
    background-color: #D1FAE5;
    color: #047857;
    border-color: #A7F3D0;
}

.badge-warning {
    background-color: #FEF3C7;
    color: #B45309;
    border-color: #FDE68A;
}

.badge-danger {
    background-color: #FEE2E2;
    color: #DC2626;
    border-color: #FECACA;
}

.badge-info {
    background-color: #E0F2FE;
    color: #0369A1;
    border-color: #BAE6FD;
}

.badge-neutral {
    background-color: #F1F5F9;
    color: #475569;
    border-color: #E2E8F0;
}

/* === Modal Component === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeIn 0.2s ease-out;
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1E293B;
}

.modal-close {
    padding: 0.25rem;
    color: #94A3B8;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.modal-close:hover {
    color: #475569;
    background-color: #F1F5F9;
}

.modal-body {
    padding: 1.5rem;
}

/* === Toast Component === */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast-success {
    background-color: #10B981;
}

.toast-error {
    background-color: #EF4444;
}

.toast-info {
    background-color: #475569;
}

/* === Layout Components === */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 18rem;
    background-color: #0F172A;
    display: flex;
    flex-direction: column;
    z-index: 30;
    transition: width 0.2s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle-wrap {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #94A3B8;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.sidebar-toggle-btn:hover {
    color: white;
    background: #1E293B;
}

.sidebar-header {
    height: 5rem;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid #1E293B;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    background-color: #4F46E5;
    padding: 0.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.025em;
}

.sidebar-user {
    padding: 1.5rem;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: rgba(30, 41, 59, 0.5);
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(30, 41, 59, 0.5);
}

.sidebar-user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background-color: rgba(79, 70, 229, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A5B4FC;
    font-weight: 700;
    border: 1px solid rgba(79, 70, 229, 0.3);
}

.sidebar-user-info {
    overflow: hidden;
}

.sidebar-user-role {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-id {
    font-size: 0.75rem;
    color: #94A3B8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 0 1rem;
    overflow-y: auto;
}

.sidebar-nav-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border-radius: 0.75rem;
    transition: all 0.2s;
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.sidebar-nav-link:not(.active) {
    color: #94A3B8;
}

.sidebar-nav-link:not(.active):hover {
    background-color: #1E293B;
    color: white;
}

.sidebar-nav-link.active {
    background-color: #4F46E5;
    color: white;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.2);
}

.sidebar-nav-icon {
    width: 1.5rem !important;
    height: 1.5rem !important;
    min-width: 1.5rem;
    min-height: 1.5rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #1E293B;
}

.main-content {
    margin-left: 18rem;
    min-height: 100vh;
    padding: 2rem;
    width: calc(100% - 18rem);
    transition: margin-left 0.2s ease, width 0.2s ease;
}

/* Свёрнутая левая панель (только десктоп) */
@media (min-width: 1025px) {
    body[data-sidebar-collapsed="true"] .sidebar {
        width: 4.5rem;
    }
    body[data-sidebar-collapsed="true"] .main-content {
        margin-left: 4.5rem;
        width: calc(100% - 4.5rem);
    }
    body[data-sidebar-collapsed="true"] .sidebar-header {
        padding: 0 0.75rem;
        justify-content: center;
    }
    body[data-sidebar-collapsed="true"] .sidebar-logo {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
    .sidebar-logo-expanded {
        display: block;
    }
    .sidebar-logo-collapsed {
        display: none;
    }
    body[data-sidebar-collapsed="true"] .sidebar-logo-expanded {
        display: none;
    }
    body[data-sidebar-collapsed="true"] .sidebar-logo-collapsed {
        display: block;
        height: 2rem;
        width: auto;
        max-width: 2.5rem;
        object-fit: contain;
    }
    body[data-sidebar-collapsed="true"] .sidebar-logo-text,
    body[data-sidebar-collapsed="true"] .sidebar-user-info,
    body[data-sidebar-collapsed="true"] .sidebar-nav-title,
    body[data-sidebar-collapsed="true"] .sidebar-nav-link-text {
        display: none !important;
    }
    body[data-sidebar-collapsed="true"] .sidebar-user {
        padding: 0.75rem;
        justify-content: center;
    }
    body[data-sidebar-collapsed="true"] .sidebar-user-card {
        justify-content: center;
        padding: 0.5rem;
    }
    body[data-sidebar-collapsed="true"] .sidebar-user-avatar {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 2.5rem;
        min-height: 2.5rem;
        border-radius: 9999px;
        flex-shrink: 0;
    }
    body[data-sidebar-collapsed="true"] .sidebar-user-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 9999px;
    }
    body[data-sidebar-collapsed="true"] .sidebar-nav-link {
        justify-content: center;
        padding: 0.875rem;
    }
    body[data-sidebar-collapsed="true"] .sidebar-nav-icon {
        margin-right: 0;
    }
    body[data-sidebar-collapsed="true"] .sidebar-footer .sidebar-nav-link {
        justify-content: center;
    }
}

.content-container {
    max-width: 80rem;
    margin: 0 auto;
}

/* === Stat Card === */
.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    color: white;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card-bg-1 {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
}

.stat-card-bg-2 {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
}

.stat-card-bg-3 {
    background: linear-gradient(135deg, #34D399 0%, #14B8A6 100%);
}

.stat-card-decoration {
    position: absolute;
    border-radius: 9999px;
    pointer-events: none;
}

.stat-card-content {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-card-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.stat-card-number {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.stat-card-suffix {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.stat-card-icon {
    padding: 1rem;
    min-width: 3.5rem;
    min-height: 3.5rem;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.stat-card-icon svg {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
}

/* === Table Styles === */
.table-container {
    background-color: white;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* Table as cards on mobile (add .table-mobile-cards to table) */
@media (max-width: 768px) {
    .table-mobile-cards,
    .table-container .table-mobile-cards {
        display: block;
    }

    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards tbody {
        display: block;
    }

    .table-mobile-cards tr {
        display: block;
        border: 1px solid #E2E8F0;
        border-radius: 0.75rem;
        margin-bottom: 0.75rem;
        padding: 1rem;
        background: #F8FAFC;
    }

    .table-mobile-cards td {
        display: block;
        padding: 0.5rem 0;
        padding-left: 0;
        border: none;
        border-bottom: 1px solid #E2E8F0;
    }

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

    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: #64748B;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        display: block;
        margin-bottom: 0.25rem;
    }

    .table-mobile-cards td[data-label=" "]::before {
        display: none;
    }

    /* Кнопки управления в одну строку на мобилке */
    .table-mobile-cards td[data-label="Управление"] > div {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 0.5rem;
        min-width: 0;
    }
}

thead {
    background-color: rgba(248, 250, 252, 0.5);
}

th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr {
    border-top: 1px solid #F1F5F9;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: rgba(248, 250, 252, 0.8);
}

td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
}

/* === Print Styles === */
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    body {
        background: white;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }
}

/* === Utility Classes === */
.hidden {
    display: none !important;
}

.grid {
    display: grid;
}

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

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

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

.gap-4 {
    gap: 1rem;
}

.gap-5 {
    gap: 1.25rem;
}

.gap-6 {
    gap: 1.5rem;
}

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

.w-full {
    width: 100%;
}

.flex {
    display: flex;
}

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

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

.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.space-y-8 > * + * {
    margin-top: 2rem;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* === Mobile Menu Button (сверху страницы, прокручивается с контентом) === */
.mobile-menu-button {
    display: none;
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 40;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background-color: #0F172A;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
}

.mobile-menu-button:hover {
    background-color: #1E293B;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 35;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: fadeIn 0.2s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar slide animation */
.sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Responsive === */
@media (max-width: 1024px) {
    /* Кнопка бургера внутри main — в потоке, контент начинается под ней */
    .mobile-menu-button {
        display: flex;
        position: static;
        margin-top: 0;
        margin-bottom: 10px;
        margin-left: 0;
        margin-right: 0;
        align-self: flex-start;
        z-index: 30; /* ниже сайдбара (40), чтобы при открытом меню кнопка была за сайдбаром */
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 40;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Шапка сайдбара: отступ справа под кнопку закрытия, чтобы лого не перекрывалось */
    .sidebar-header {
        padding-right: 3rem;
    }

    /* На мобильном в шапке сайдбара — только logo-g.svg, большое logo-w.png скрыто */
    .sidebar-logo {
        display: flex;
        align-items: center;
    }
    .sidebar-logo-expanded {
        display: block !important;
        height: 2rem;
        width: auto;
    }
    .sidebar-logo-collapsed {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: 0;
        display: flex;
        flex-direction: column;
    }

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

    .content-container {
        padding: 0 0.5rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .card {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-button {
        margin-top: 0;
        margin-bottom: 10px;
        margin-left: 0;
        margin-right: 0;
        padding: 0.625rem;
    }

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

    .main-content {
        padding: 0.25rem 0.75rem 1rem; /* минимальный отступ сверху над кнопкой меню */
    }

    .content-container {
        padding: 0;
    }

    .sidebar {
        width: 16rem;
    }

    .sidebar-header {
        height: 4rem;
        padding: 0 1rem;
        padding-right: 3rem; /* место под кнопку закрытия, лого не перекрывается */
    }

    .sidebar-user {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .card {
        padding: 0.875rem;
    }

    .card-padding {
        padding: 1.25rem;
    }

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

    .input-field {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }

    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 8rem);
        overflow-y: auto;
    }

    .input-field,
    .btn {
        min-height: 44px;
    }

    .sidebar-nav-link {
        min-height: 44px;
    }

    .space-y-4 > * + * {
        margin-top: 16px;
    }

    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 12px;
    }

    .card img {
        max-width: 80px;
        height: auto;
    }

    .cropper-container {
        max-height: 60vh !important;
    }

    .cropper-view-box {
        outline: 2px solid #4F46E5;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.25rem !important;
    }

    h3 {
        font-size: 1.125rem !important;
    }

    /* Адаптация flex контейнеров */
    .flex {
        flex-wrap: wrap;
    }

    /* Адаптация карточек с flex layout */
    .card > div[style*="display: flex"] {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Адаптация кнопок в группах */
    div[style*="display: flex"][style*="gap"] {
        flex-wrap: wrap;
    }

    /* Адаптация поиска и фильтров */
    input[type="text"],
    input[type="search"] {
        width: 100%;
        min-width: 0;
    }

    /* Адаптация селектов */
    select {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem 0.5rem;
        padding-top: 20px;
    }

    .stat-card {
        padding: 0.875rem;
    }

    .card {
        padding: 0.75rem;
    }

    .card-padding {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
        gap: 0.375rem;
    }

    .badge {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }

    .input-group {
        margin-bottom: 0.875rem;
    }

    .input-label {
        font-size: 0.8125rem;
        margin-bottom: 0.375rem;
    }

    .input-field {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }

    /* Адаптация карточек игроков */
    .grid {
        gap: 0.75rem;
    }

    /* Адаптация тулбаров */
    .content-container > div:first-child {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Адаптация кнопок в карточках */
    .card button,
    .card .btn {
        width: 100%;
        justify-content: center;
    }

    /* Адаптация форм в модальных окнах */
    .modal-body form {
        gap: 0.875rem;
    }

    .modal-body .input-group {
        margin-bottom: 0.875rem;
    }

    /* Адаптация таблиц и списков */
    table {
        font-size: 0.8125rem;
    }

    table th,
    table td {
        padding: 0.5rem 0.375rem;
    }
}

/* === Action Button Styles === */
.action-btn {
    transition: all 0.2s ease;
    position: relative;
}

.action-btn i,
.action-btn svg {
    transition: stroke 0.2s ease, fill 0.2s ease;
    position: relative;
    z-index: 1;
}

.action-btn-bordered {
    position: relative;
}

.action-btn-bordered::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: transparent;
    transition: background-color 0.2s ease;
    z-index: 0;
}

.action-btn-bordered:hover {
    background-color: white !important;
    border-color: #CBD5E1 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.action-btn-bordered:hover::before {
    background-color: transparent !important;
}

.action-btn-bordered:hover svg,
.action-btn-bordered:hover svg path,
.action-btn-bordered:hover svg line,
.action-btn-bordered:hover svg circle,
.action-btn-bordered:hover svg polyline {
    stroke: #475569 !important;
}

.action-btn-transparent {
    position: relative;
}

.action-btn-transparent::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: transparent;
    transition: background-color 0.2s ease;
    z-index: 0;
}

.action-btn-transparent:hover::before {
    background-color: rgba(71, 85, 105, 0.1);
}

.action-btn-transparent:hover svg,
.action-btn-transparent:hover svg path,
.action-btn-transparent:hover svg line,
.action-btn-transparent:hover svg circle,
.action-btn-transparent:hover svg polyline {
    stroke: #475569 !important;
}

.action-btn-power:hover::before {
    background-color: rgba(71, 85, 105, 0.1);
}

.action-btn-power[style*="#10B981"]:hover::before {
    background-color: rgba(16, 185, 129, 0.1);
}

.action-btn-power[style*="#EF4444"]:hover::before {
    background-color: rgba(239, 68, 68, 0.1);
}

.action-btn-power:hover svg,
.action-btn-power:hover svg path,
.action-btn-power:hover svg line,
.action-btn-power:hover svg circle,
.action-btn-power:hover svg polyline {
    stroke: currentColor !important;
}

.action-btn-lock:hover::before {
    background-color: rgba(15, 23, 42, 0.1);
}

.action-btn-lock:hover svg,
.action-btn-lock:hover svg path,
.action-btn-lock:hover svg line,
.action-btn-lock:hover svg circle,
.action-btn-lock:hover svg polyline {
    stroke: #0F172A !important;
}

.action-btn-danger:hover {
    background-color: #FEF2F2 !important;
}

.action-btn-danger:hover svg,
.action-btn-danger:hover svg path,
.action-btn-danger:hover svg line,
.action-btn-danger:hover svg circle,
.action-btn-danger:hover svg polyline {
    stroke: #DC2626 !important;
}

/* === Touch-friendly (Apple HIG) === */
@media (max-width: 1024px) {
    .btn,
    .input-field,
    .sidebar-nav-link {
        min-height: 44px;
    }

    .btn:not(.sidebar-toggle-btn) {
        min-width: 44px;
    }
}

/* Reduce hover transforms on touch devices */
@media (hover: none) {
    .btn:hover,
    .card:hover,
    .stat-card:hover {
        transform: none;
    }
}

/* Toast position on mobile */
@media (max-width: 768px) {
    .toast-container {
        bottom: auto;
        top: 1rem;
        left: 1rem;
        right: 1rem;
    }
}
