/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    padding: 0 20px;
    min-height: 100vh;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Карточка */
.card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.1);
    padding: 32px;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Заголовок */
.main-title {
    display: flex;
    text-align: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #1a2a3a;
    letter-spacing: -0.3px;
}

.card:has(table) .main-title {
    text-align: left;
    justify-content: flex-start;
    margin: 0 0 24px 0;
}

/* Кнопки */
.btn,
.delete-btn {
    background: #008B8B;
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    border-radius: 40px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn:hover,
.delete-btn:hover {
    background: #006f6f;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.btn:active,
.delete-btn:active {
    transform: translateY(1px);
}

.delete-btn {
    background: #B22222;
    border-color: #B22222;
    width: 150px;
}

.delete-btn:hover {
    background: #8B0000;
}

/* Форма */
.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
    width: 100%;
    max-width: 500px;
}

/* Поля ввода */
.text-field {
    padding: 12px 16px;
    border: 1px solid #ddd;
    font-size: 14px;
    font-family: inherit;
    border-radius: 40px;
    transition: all 0.2s ease;
    background: #fefefe;
}

.text-field:focus {
    outline: none;
    border-color: #008B8B;
    box-shadow: 0 0 0 3px rgba(0, 139, 139, 0.1);
}

/* Таблица */
#inventory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

thead {
    background: #1a2a3a;
    color: white;
}

th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

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

tr:hover td {
    background-color: #f8f9fa;
}

/* Стили для карточки добавления */
.home-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.home-card .main-title {
    text-align: center;
    margin-bottom: 24px;
}

.home-card .form {
    width: 100%;
    max-width: 500px;
    margin-bottom: 20px;
}

.home-card .form input {
    width: 100%;
    box-sizing: border-box;
}

.home-card .btn {
    width: 100%;
    max-width: 500px;
}

/* Лоадер */
.loader,
.loader div {
    box-sizing: border-box;
}

.loader {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
    left: calc(50% - 40px);
    top: calc(50% - 40px);
}

.loader div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 64px;
    height: 64px;
    margin: 8px;
    border: 8px solid #008B8B;
    border-radius: 50%;
    animation: loader 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #008B8B transparent transparent transparent;
}

.loader div:nth-child(1) {
    animation-delay: -0.45s;
}

.loader div:nth-child(2) {
    animation-delay: -0.3s;
}

.loader div:nth-child(3) {
    animation-delay: -0.15s;
}

@keyframes loader {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
