/* ===== Базовые стили в стиле kicksout.ru ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Цвета kicksout.ru */
    --color-black: #282b2b;
    --color-white: #ffffff;
    --color-gray-light: #f2f2f2;
    --color-gray-medium: #e4e4e4;
    --color-gray-dark: #9a9a9a;
    --color-text: #282b2b;
    --color-text-secondary: #6c6c6c;

    /* Шрифты */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Gotham', Arial, sans-serif;

    /* Радиусы */
    --radius-small: 10px;
    --radius-medium: 13px;
    --radius-large: 30px;

    /* Тени */
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
}

body {
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-gray-light);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===== Loader ===== */

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-gray-medium);
    border-top-color: var(--color-black);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== App Container ===== */

.app {
    max-width: 100%;
    min-height: 100vh;
    background: var(--color-gray-light);
}

/* ===== Navigation ===== */

.nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: space-evenly;
    background: var(--color-white);
    border-top: 3px solid #282b2b;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
}

.nav-item {
    flex: 1;
    max-width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border: none;
    background: transparent;
    color: var(--color-gray-dark);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.nav-item svg {
    stroke-width: 2;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active {
    color: var(--color-black);
    border-bottom-color: var(--color-black);
}

/* ===== Content ===== */

.content {
    padding: 12px;
    padding-bottom: 80px;
}

/* ===== Cards ===== */

.card {
    background: var(--color-white);
    border-radius: var(--radius-medium);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-black);
}

.card-subtitle {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

/* ===== Metrics Grid ===== */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.metric-card {
    background: var(--color-white);
    border-radius: var(--radius-medium);
    padding: 16px;
    box-shadow: var(--shadow-card);
}

.metric-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-black);
}

.metric-change {
    font-size: 12px;
    margin-top: 4px;
}

.metric-change.positive {
    color: #22c55e;
}

.metric-change.negative {
    color: #ef4444;
}

/* ===== Buttons ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-large);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
}

.btn-primary {
    background: var(--color-black);
    color: var(--color-white);
}

.btn-primary:hover {
    background: #1a1d1d;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-black);
    border: 1px solid var(--color-gray-medium);
}

.btn-secondary:hover {
    border-color: var(--color-black);
}

/* ===== Table ===== */

.table-container {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-gray-medium);
}

.table tbody td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--color-gray-light);
    font-size: 14px;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Badges ===== */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-ip {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-fl {
    background: #fef3c7;
    color: #92400e;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-pending {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== Stats Bar ===== */

.stats-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.stat-item {
    background: var(--color-white);
    padding: 10px 12px;
    border-radius: var(--radius-small);
    box-shadow: var(--shadow-card);
}

.stat-item-label {
    font-size: 10px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-item-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-black);
}

/* ===== Empty State ===== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 15px;
}

/* ===== Filters ===== */

.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: 1px solid var(--color-gray-medium);
    background: var(--color-white);
    color: var(--color-text);
    border-radius: var(--radius-large);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--color-black);
    background: var(--color-black);
    color: var(--color-white);
}

/* ===== Modal ===== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal.show {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: var(--color-gray-light);
}

.modal-content {
    background: var(--color-white);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--color-gray-medium);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--color-gray-light);
}

.modal-body {
    padding: 20px;
}

/* ===== Forms ===== */

.product-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-gray-medium);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-black);
}

.form-group input[readonly] {
    background: var(--color-gray-light);
    cursor: not-allowed;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-gray-medium);
}

.form-actions .btn {
    flex: 1;
}

.form-actions .btn-danger {
    flex: 0 0 auto;
}

/* ===== Buttons ===== */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--color-black);
    color: white;
}

.btn-primary:hover {
    background: #000000;
}

.btn-secondary {
    background: var(--color-gray-medium);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--color-gray-light);
}

/* ===== Clickable Row ===== */

.clickable-row {
    cursor: pointer;
    transition: background 0.2s;
}

.clickable-row:hover {
    background: var(--color-gray-light);
}

/* ===== More Page ===== */

.more-page {
    background: var(--color-white);
    border-radius: var(--radius-medium);
    padding: 16px;
}

.more-menu-item:not(.disabled):hover {
    background: var(--color-gray-light) !important;
}

.more-menu-item:not(.disabled):active {
    transform: scale(0.98);
}

/* ===== Responsive ===== */

@media (max-width: 640px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .header-title {
        font-size: 20px;
    }

    .content {
        padding: 10px;
    }

    .card {
        padding: 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-height: 95vh;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}
