:root {
    --bg-primary: #081016;
    --bg-tertiary: rgba(255, 255, 255, 0.03);
    --card: rgba(255, 255, 255, 0.04);
    --text-primary: #E6F0F6;
    --text-secondary: rgba(230, 240, 246, 0.7);
    --accent-cyan: #00d4ff;
    --accent-blue: #007bff;
    --radius-md: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.container {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

.header-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

.panel {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 30px;
    width: 100%;
}

h2 {
    margin: 0 0 15px;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    margin: 8px 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all var(--transition);
}

.btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: skewX(-25deg);
    transition: left 0.4s ease;
    z-index: -1;
}

.btn:hover::after {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.btn-logout {
    background: #ff5d5d;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 93, 93, 0.4);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
}

.hidden {
    display: none !important;
}

.msg {
    margin-top: 10px;
    font-size: 14px;
}

.panel-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
}

.panel-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    margin-bottom: 8px;
    background: var(--bg-tertiary);
}

.panel-item:last-child {
    border-bottom: none;
}

.panel-item button {
    margin-left: 5px;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 40px 12px 14px;
    border-radius: 10px;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

select option {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--text-primary);
    padding: 10px;
}

/* Модалки */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background: #111;
    margin: auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    color: #fff;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: white;
}

#modalImages img {
    width: 100px;
    height: auto;
    margin-right: 10px;
    cursor: pointer;
}

/* Картки прев’ю */
.img-preview .gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.img-preview .gallery-image {
    width: 100%;
    height: auto;
    max-height: 140px;
    object-fit: contain;
    transition: transform .3s ease;
}

.img-preview .gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.img-preview .gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: opacity .3s ease;
}

.img-preview .gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Лайтбокс */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity .3s ease;
}

.lightbox.show {
    opacity: 1;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 12px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 20px;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

/* Адаптивність */
@media(max-width: 800px) {
    .panel-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media(max-width: 600px) {
    .container {
        margin: 15px auto;
        padding: 0 10px;
    }

    .btn, input, select, textarea {
        font-size: 14px;
    }

    #usersTable,
    #usersTable thead,
    #usersTable tbody,
    #usersTable th,
    #usersTable td,
    #usersTable tr {
        display: block;
    }

    #usersTable thead tr {
        display: none;
    }

    #usersTable td {
        position: relative;
        padding-left: 50%;
        margin-bottom: 12px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    #usersTable td:before {
        position: absolute;
        left: 12px;
        width: 45%;
        white-space: nowrap;
        font-weight: 600;
        color: var(--text-secondary);
    }

    #usersTable td:nth-of-type(1):before { content: "Імя"; }
    #usersTable td:nth-of-type(2):before { content: "Email"; }
    #usersTable td:nth-of-type(3):before { content: "Действия"; }
}

.header-buttons {
    display: flex;
    justify-content: space-between; /* Лівий вліво, правий вправо */
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap; /* щоб на мобільних не лізли в один ряд */
}

.left-buttons,
.right-buttons {
    display: flex;
    gap: 10px;
}

/* Збільшені кнопки */
.left-buttons .btn,
.right-buttons .btn {
    padding: 12px 24px;
    font-size: 16px;
}