* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #1e293b;
}

a {
    text-decoration: none;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: #0f172a;
}

.login-card p {
    margin-bottom: 24px;
    color: #64748b;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select {
    height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #2563eb;
}

.btn {
    border: none;
    cursor: pointer;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    transition: 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.message-box {
    min-height: 20px;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
}

.message-box.success {
    color: #15803d;
}

.message-box.error {
    color: #dc2626;
}

.app-body {
    min-height: 100vh;
    background: #f8fafc;
}

.topbar {
    background: #0f172a;
    color: #fff;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.topbar-left h1 {
    font-size: 24px;
    margin-bottom: 4px;
}

.topbar-left span {
    color: #cbd5e1;
    font-size: 14px;
}

.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.06);
}

.section-header {
    margin-bottom: 18px;
}

.section-header h2 {
    font-size: 22px;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.item-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: space-between;
}

.item-card h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.item-card p {
    color: #475569;
    font-size: 15px;
}

.item-actions {
    margin-top: auto;
}

.loading-box,
.error-box,
.empty-box {
    grid-column: 1/-1;
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    font-weight: 600;
}

.loading-box {
    background: #eff6ff;
    color: #1d4ed8;
}

.error-box {
    background: #fef2f2;
    color: #b91c1c;
}

.empty-box {
    background: #f8fafc;
    color: #475569;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 999;
    padding: 16px;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.18);
    animation: fadeInUp 0.25s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.modal-header h3 {
    font-size: 22px;
}

.close-btn {
    border: none;
    background: transparent;
    font-size: 28px;
    cursor: pointer;
    color: #334155;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 16px;
        align-items: flex-start;
    }

    .topbar-left h1 {
        font-size: 20px;
    }

    .main-container {
        padding: 14px;
    }

    .card {
        padding: 16px;
        border-radius: 16px;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .item-card {
        padding: 16px;
    }

    .item-card h3 {
        font-size: 18px;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 18px;
        padding: 18px;
    }

    .form-group input,
    .form-group select {
        height: 44px;
        font-size: 16px;
    }

    .btn {
        min-height: 44px;
    }
}


.btn-secondary {
    background: #475569;
    color: #fff;
}

.btn-secondary:hover {
    background: #334155;
}

.btn-light {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-light:hover {
    background: #cbd5e1;
}

.btn-sm {
    padding: 10px 14px;
    font-size: 14px;
}

.mt-20 {
    margin-top: 20px;
}

.section-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 16px;
}

.admin-user-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-user-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.admin-user-head h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.admin-user-head p {
    color: #64748b;
    font-size: 14px;
}

.role-badge {
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.role-admin {
    background: #dbeafe;
    color: #1d4ed8;
}

.role-support {
    background: #dcfce7;
    color: #15803d;
}

.admin-user-body label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #475569;
    font-weight: 700;
}

.user-products-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-product-chip {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 13px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.mini-empty {
    color: #94a3b8;
    font-size: 14px;
}

.admin-user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.logs-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.log-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 8px;
}

.log-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.log-row span {
    color: #64748b;
    font-size: 14px;
}

.log-row strong {
    color: #0f172a;
    text-align: right;
    font-size: 14px;
}

@media (max-width: 768px) {
    .admin-users-grid {
        grid-template-columns: 1fr;
    }

    .admin-user-actions {
        flex-direction: column;
    }

    .admin-user-actions .btn {
        width: 100%;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions .btn {
        width: 100%;
    }

    .log-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .log-row strong {
        text-align: left;
    }
}

.btn-nav {
    background: #1e293b;
    color: #fff;
    border: 1px solid #334155;
}

.btn-nav:hover {
    background: #334155;
}

.btn-nav.active {
    background: #2563eb;
    border-color: #2563eb;
}

.logs-table-wrap {
    width: 100%;
    overflow-x: auto;
    display: block;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.logs-table thead th {
    text-align: left;
    background: #f1f5f9;
    color: #0f172a;
    padding: 14px 12px;
    font-size: 14px;
    border-bottom: 1px solid #cbd5e1;
    white-space: nowrap;
}

.logs-table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #334155;
    vertical-align: middle;
}

.logs-table tbody tr:hover {
    background: #f8fafc;
}

.table-message {
    text-align: center;
    padding: 20px !important;
    color: #475569;
    font-weight: 600;
}

.table-message.error {
    color: #b91c1c;
}

#issueLogsMobileList {
    display: none;
}

@media (max-width: 768px) {
    .logs-table-wrap {
        display: none;
    }

    #issueLogsMobileList {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
}