:root {
    /* Shopware Color Palette */
    --sw-color-primary: #189eff;
    --sw-color-secondary: #787878;
    --sw-color-background: #f5f9fc;
    --sw-color-text: #2a3640;
    --sw-color-border: #d1d9e0;
    --sw-color-success: #4ab785;
    --sw-color-danger: #d93a3a;
    --sw-color-warning: #ffab38;

    /* Typography */
    --sw-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --sw-font-size-base: 16px;
    --sw-border-radius: 4px;
}

body {
    font-family: var(--sw-font-family);
    background-color: var(--sw-color-background);
    color: var(--sw-color-text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container.enterprise-user-management {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

h1, h2, h3 {
    color: var(--sw-color-text);
    margin-bottom: 20px;
}

h2 {
    margin-top: 0;
}

.nav-tabs {
    border-bottom: 2px solid var(--sw-color-border);
    margin-bottom: 20px;
}

.nav-tabs .nav-link {
    color: var(--sw-color-secondary);
    font-weight: 600;
    padding: 10px 15px;
    border: none;
    transition: color 0.2s ease;
}

.nav-tabs .nav-link.active {
    color: var(--sw-color-primary);
    border-bottom: 3px solid var(--sw-color-primary);
    background-color: transparent;
}

#enterprise-selector {
    margin-right: 10px;
}

button {
    border: none;
    font-weight: 600;
    margin-right: 10px;
}

.btn-primary {
    background-color: var(--sw-color-primary);
    border-radius: var(--sw-border-radius);
    transition: all 0.2s ease;
}
.btn {
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
    color: white;
}

.btn-primary:hover {
    background-color: #118cff;
    border-color: #118cff;
    cursor: pointer;
}

.btn-secondary {
    background-color: var(--sw-color-secondary);
    border-color: var(--sw-color-secondary);
    border-radius: var(--sw-border-radius);
    cursor: not-allowed;
}

/* CSS Grid Table Layout */
.table {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 20px;
    background-color: white;
    display: grid;
    border-collapse: separate;
    border-spacing: 0;
}

/* Employee table grid - 4 columns: name, email, balance, actions */
#employees-table {
    grid-template-columns: 3fr 5fr 2fr 2fr;
}

/* Admin table grid - 3 columns: name (same as employee), email (takes space of email+balance), actions (same as employee) */
#admins-table {
    grid-template-columns: 3fr 7fr 2fr;
}

.table thead {
    display: contents;
}

.table tbody {
    display: contents;
}

.table tr {
    display: contents;
}

.table th,
.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--sw-color-border);
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table th {
    background-color: var(--sw-color-background);
    font-weight: 600;
    color: var(--sw-color-secondary);
}

/* Actions column should allow normal white-space for flex container */
.table th:last-child,
.table td:last-child {
    white-space: normal;
    justify-content: center;
}

/* Special handling for single-column spanning rows (like "no data" messages) */
.table td[colspan] {
    grid-column: 1 / -1;
    justify-content: center;
}

.form-control {
    border-color: var(--sw-color-border);
    border-radius: var(--sw-border-radius);
    padding: 10px 12px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: var(--sw-color-primary);
    box-shadow: 0 0 0 2px rgba(24, 158, 255, 0.1);
}

.modal-header {
    border-bottom: 1px solid var(--sw-color-border);
    padding: 0 15px 15px;
}
.modal-body {
    padding: 0 15px;
}

label {
    font-weight: bold;
    font-size: 20px;
}

input[type=text] {
    padding: 6px 3px;
    border-width: 1px;
    margin-top: 8px;
}

input[type=submit] {
    border: none;
    margin-top: 16px;
}

.modal-header h2 {
    margin-bottom: 0;
}

.modal-header .close {
    color: var(--sw-color-secondary);
    opacity: 0.7;
}

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content/Box */
.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px 20px 35px;
    border: 1px solid #888;
    width: 80%;
    border-radius: var(--sw-border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* The Close Button */
.close {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.enterprise-selection,
.shopware-integration {
    background-color: white;
    border-radius: var(--sw-border-radius);
    margin-bottom: 20px;
}

.enterprise-selection {
    border: 1px solid var(--sw-color-border);
    padding: 20px;
}

.sales-channel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--sw-color-border);
}

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

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    margin: 0 2px;
}

.action-btn:hover {
    background-color: #f0f0f0;
}

.delete-btn:hover {
    background-color: #ffebee;
}

.action-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.edit-icon {
    stroke: #666;
}

.delete-icon {
    stroke: #d32f2f;
}

.actions-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

@media (max-width: 768px) {
    .container.enterprise-user-management {
        padding: 10px;
    }

    /* Adjust grid columns for mobile */
    #employees-table {
        grid-template-columns: 1.5fr 1.5fr 0.8fr 0.8fr;
    }

    #admins-table {
        grid-template-columns: 1.5fr 2.3fr 0.8fr;
    }

    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}