* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #e0d6c2;
}

/* ===== ГЛАВНЫЙ ЭКРАН ===== */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    background-color: #1a1a1a;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
}

.hero h1 {
    font-size: 5rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-weight: 800;
    color: #cc2222;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 40px rgba(200, 30, 30, 0.5);
    margin-bottom: 15px;
    word-break: break-word;
}

.hero .subtitle {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: #dd4444;
    text-shadow: 0 2px 10px black;
}

.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: floatDown 2s infinite ease-in-out;
    font-size: 2.5rem;
    color: #cc2222;
    opacity: 0.8;
    cursor: pointer;
    user-select: none;
}

@keyframes floatDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(12px); }
}

/* ===== КАТЕГОРИИ ===== */
.categories-section {
    padding: 80px 20px 100px;
    background-image: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 100%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    min-height: 100vh;
}

.card {
    background: #252525;
    border: 1px solid #3a3a3a;
    border-radius: 20px;
    padding: 50px 30px;
    width: 300px;
    max-width: 90%;
    text-align: center;
    transition: all 0.35s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-12px);
    border-color: #cc2222;
    box-shadow: 0 25px 50px rgba(200, 30, 30, 0.3);
    background: #2f2f2f;
}

.card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #cc2222;
    border-radius: 3px;
    transition: width 0.3s;
}

.card:hover::after {
    width: 120px;
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px black);
}

.card h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #cc2222;
    margin-bottom: 15px;
}

.card p {
    color: #a09a8c;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 300;
}

/* ===== ХЕДЕР ===== */
.header {
    background: #1e1e1e;
    border-bottom: 2px solid #cc2222;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: #cc2222;
    font-size: 1.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== КНОПКИ ===== */
.btn {
    padding: 12px 24px;
    border: 2px solid #cc2222;
    background: transparent;
    color: #cc2222;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}

.btn:hover {
    background: #cc2222;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(200, 30, 30, 0.4);
}

.btn-back { border-color: #8a8a8a; color: #8a8a8a; }
.btn-back:hover { background: #8a8a8a; color: #1a1a1a; }
.btn-add { border-color: #4caf50; color: #4caf50; }
.btn-add:hover { background: #4caf50; color: #1a1a1a; }
.btn-edit { border-color: #ff9800; color: #ff9800; }
.btn-edit:hover { background: #ff9800; color: #1a1a1a; }

/* ===== СТАТИСТИКА ===== */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 20px 30px;
    background: #252525;
    border-bottom: 1px solid #333;
    justify-content: center;
}

.stat-item {
    text-align: center;
    min-width: 100px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #cc2222;
}

.stat-label {
    font-size: 0.8rem;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ===== ГРУППЫ ===== */
.groups-container {
    padding: 40px 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
}

.group-card {
    background: #252525;
    border: 1px solid #3a3a3a;
    border-radius: 16px;
    padding: 35px 30px;
    width: 280px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.group-card:hover {
    border-color: #cc2222;
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

.group-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.group-name {
    font-size: 1.4rem;
    color: #cc2222;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.group-count {
    color: #a0a0a0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.group-count span {
    color: #cc2222;
    font-weight: 600;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

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

.modal {
    background: #1e1e1e;
    border: 1px solid #cc2222;
    border-radius: 16px;
    padding: 30px;
    width: 500px;
    max-width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.modal h2 {
    color: #cc2222;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 0.05em;
}

.modal .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #8a8a8a;
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal .close-btn:hover {
    color: #cc2222;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    color: #a0a0a0;
    margin-bottom: 6px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #e0d6c2;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #cc2222;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ===== ПРОФИЛЬ ПРЕДМЕТА ===== */
.profile-photo {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #2a2a2a;
}

.profile-info p {
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.profile-info strong {
    color: #cc2222;
}

.profile-stats {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.profile-stat {
    background: #252525;
    padding: 12px 18px;
    border-radius: 10px;
    text-align: center;
    flex: 1;
    min-width: 80px;
}

.profile-stat .big {
    font-size: 1.6rem;
    font-weight: 700;
    color: #cc2222;
}

.profile-stat .small {
    font-size: 0.75rem;
    color: #8a8a8a;
    text-transform: uppercase;
}

/* ===== ТАБЛИЦА ===== */
.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.items-table th {
    background: #2a2a2a;
    color: #cc2222;
    padding: 10px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.items-table td {
    padding: 10px;
    border-bottom: 1px solid #2a2a2a;
    font-size: 0.9rem;
}

.items-table tr {
    cursor: pointer;
    transition: background 0.2s;
}

.items-table tr:hover {
    background: #2a2a2a;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-available {
    background: #1b3a1b;
    color: #4caf50;
}

.badge-issued {
    background: #3a2a1b;
    color: #ff9800;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; letter-spacing: 0.15em; }
    .hero .subtitle { font-size: 1.2rem; }
    .categories-section { gap: 25px; padding: 50px 15px 80px; }
    .card { width: 260px; padding: 35px 20px; }
    .header { flex-direction: column; align-items: flex-start; }
    .groups-container { padding: 20px 15px; gap: 15px; }
    .group-card { width: 100%; max-width: 350px; }
    .stats-bar { gap: 15px; padding: 15px; }
}