:root {
    --primary: #1d4ed8;
    --primary-dark: #163ea8;
    --bg: #f3f7ff;
    --card: #ffffff;
    --border: #dfe7ff;
    --text: #1f2937;
    --muted: #6b7280;
    --success: #15803d;
    --success-bg: #dcfce7;
    --error: #b91c1c;
    --error-bg: #fee2e2;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #eef4ff 0%, #f8fbff 100%);
    color: var(--text);
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 1.4fr);
    gap: 24px;
    align-items: start;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(29, 78, 216, 0.08);
}

h1, h2 {
    margin-top: 0;
    color: var(--text);
}

.subtitle {
    margin: 0 0 20px;
    color: var(--muted);
}

.field-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

input,
textarea,
button {
    width: 100%;
    border-radius: 10px;
    font: inherit;
}

input,
textarea {
    border: 1px solid var(--border);
    padding: 12px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

button {
    background: #c7c7c7;
    color: #000;
    border: none;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

button:hover {
    background: #dbdbdb;
    transform: translateY(-1px);
}

input[type="file"] {
    display: none;
}

.file-input-wrapper {
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 220px;
}

.file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    width: 100%;
    text-align: center;
}

.file-button:hover {
    background: var(--primary-dark);
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-weight: 600;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(21, 128, 61, 0.25);
}

.alert.error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(185, 28, 28, 0.2);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border-bottom: 1px solid var(--border);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8faff;
    color: var(--text);
}

.empty-state {
    color: var(--muted);
    margin: 0;
}

.suggestion-image {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.suggestion-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.15);
}

.no-image {
    color: var(--muted);
    font-size: 0.85rem;
}

.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
}

.image-modal.active {
    display: flex;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
}

.image-modal-content img {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 12px;
    object-fit: contain;
}

.image-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

@media (max-width: 820px) {
    .container {
        grid-template-columns: 1fr;
        gap: 18px;
        margin: 20px auto;
        padding: 0 14px;
    }

    .card {
        padding: 18px 14px;
        border-radius: 12px;
    }

    h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.45rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    label {
        font-size: 0.95rem;
    }

    input,
    textarea,
    button {
        font-size: 16px;
    }

    button {
        padding: 14px 16px;
    }

    th,
    td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }

    .suggestion-image {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    body {
        background: #f6f9ff;
    }

    .container {
        margin: 12px auto;
        padding: 0 10px;
    }

    .card {
        padding: 14px 12px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .alert {
        font-size: 0.9rem;
        padding: 10px 12px;
    }

    textarea {
        min-height: 100px;
    }
}
