body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Wyrównanie do góry */
    height: 100vh;
    background-color: #f0f0f0;
}

/* Accessibility helpers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Microsoft branded login button container adjustments */
.ms-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 248px !important; /* stała szerokość dla brandowanego przycisku */
    background: transparent !important; /* grafika zawiera styl */
    box-shadow: none;
    margin: 0 auto; /* wyśrodkuj w kontenerze */
}
.ms-login-btn img { display:block; width:auto; }

/* Wyśrodkowanie przycisku w bloku hint jeśli nie rozciąga się na 100% */
.ms-account-hint .ms-login-btn { 
    display:block; /* aby margin auto zadziałał */
    margin:8px auto 0 auto; 
}
.ms-account-hint { text-align:center; }

/* === Auth / Login Redesign === */
.login-section {
        max-width: 440px;
        margin: 120px auto 0 auto;
        background: #ffffff;
        padding: 40px 32px 48px;
        border-radius: 16px;
        box-shadow: 0 8px 28px rgba(0,0,0,0.08);
        position: relative;
}

.primary-auth-btn {
        width: 100%;
        background: linear-gradient(135deg,#0366d6,#0a84ff);
        color: #fff;
        border: none;
        padding: 16px 20px;
        font-size: 16px;
        border-radius: 10px;
        font-weight: 600;
        letter-spacing: .3px;
        box-shadow: 0 4px 12px rgba(10,132,255,0.35);
        transition: transform .15s ease, box-shadow .2s;
}
.primary-auth-btn:hover { transform: translateY(-2px); box-shadow:0 6px 18px rgba(10,132,255,0.45);} 
.primary-auth-btn:active { transform: translateY(0); box-shadow:0 3px 10px rgba(10,132,255,0.3);} 

.alt-login-wrapper { margin-top: 28px; }

.accordion-item { border:1px solid #e2e8f0; border-radius:12px; background:#fafbfc; overflow:hidden; }
.accordion-toggle { width:100%; background:none; border:none; padding:14px 18px; text-align:left; font-size:15px; font-weight:600; display:flex; align-items:center; justify-content:space-between; cursor:pointer; }
.accordion-toggle i { transition: transform .25s ease; color:#555; }
.accordion-toggle[aria-expanded="true"] i { transform: rotate(180deg); }

.accordion-content { padding:0 18px 18px; animation: fadeSlide .35s ease; }
@keyframes fadeSlide { from { opacity:0; transform:translateY(-6px);} to { opacity:1; transform:translateY(0);} }

.stack-form { display:flex; flex-direction:column; gap:14px; margin-top:12px; }
.stack-form input { padding:12px 14px; border:1px solid #cfd6de; border-radius:8px; font-size:14px; transition:border-color .2s, box-shadow .2s; }
.stack-form input:focus { outline:none; border-color:#0a84ff; box-shadow:0 0 0 3px rgba(10,132,255,.25); }
.stack-form button { background:#0a84ff; color:#fff; border:none; padding:12px 16px; border-radius:8px; font-weight:600; cursor:pointer; }
.stack-form button:hover { background:#006fd1; }

.hint { font-size:12px; color:#6b7280; margin:8px 0 4px; }
.no-account { font-size:13px; margin:14px 0 4px; color:#374151; }
.link-btn { background:none; border:none; padding:0; color:#0a84ff; font-weight:600; cursor:pointer; text-decoration:underline; }
.link-btn:hover { color:#005fad; }

/* Registration side panel */
/* Registration modal */
.secondary-auth-btn { margin-top:32px; width:100%; background:#ffffff; border:1px solid #d1d5db; padding:14px 18px; border-radius:10px; font-size:15px; font-weight:600; cursor:pointer; transition:background .2s, border-color .2s; }
.secondary-auth-btn:hover { background:#f3f4f6; border-color:#c5cad1; }

.registration-modal-backdrop { position:fixed; inset:0; background:rgba(17,24,39,0.55); display:flex; justify-content:center; align-items:flex-start; padding-top:90px; z-index:2000; }
.registration-modal-backdrop[hidden] { display:none !important; }
.registration-modal { width:520px; background:#ffffff; border-radius:18px; box-shadow:0 18px 48px -12px rgba(0,0,0,0.35); padding:34px 40px 40px; position:relative; animation: modalIn .35s cubic-bezier(.4,.16,.3,1); display:flex; flex-direction:column; gap:26px; }
@keyframes modalIn { from { opacity:0; transform:translateY(18px) scale(.96);} to { opacity:1; transform:translateY(0) scale(1);} }
.modal-header { display:flex; justify-content:space-between; align-items:center; }
.modal-header h2 { font-size:22px; font-weight:600; margin:0; letter-spacing:.3px; }
.close-modal { background:none; border:none; font-size:30px; line-height:1; cursor:pointer; color:#4b5563; }
.close-modal:hover { color:#000; }
.modal-form { display:flex; flex-direction:column; gap:20px; }
.modal-form .form-row { display:flex; flex-direction:column; gap:6px; text-align:left; }
.modal-form label { font-size:12px; font-weight:600; letter-spacing:.6px; color:#374151; text-transform:uppercase; }
.modal-form input { padding:12px 14px; border:1px solid #cfd6de; border-radius:10px; font-size:14px; }
.modal-form input:focus { outline:none; border-color:#0a84ff; box-shadow:0 0 0 3px rgba(10,132,255,.25); }
.modal-actions { display:flex; gap:14px; justify-content:flex-end; }
.modal-actions .primary { background:#10b981; color:#fff; border:none; padding:12px 24px; border-radius:10px; font-weight:600; cursor:pointer; }
.modal-actions .primary:hover { background:#0ea271; }
.modal-actions .secondary { background:#f3f4f6; color:#374151; border:1px solid #d1d5db; padding:12px 20px; border-radius:10px; font-weight:500; cursor:pointer; }
.modal-actions .secondary:hover { background:#e5e7eb; }

@media (max-width: 640px) {
    .registration-modal { width:100%; margin:0 16px; padding:28px 26px 34px; }
    .registration-modal-backdrop { align-items:flex-start; padding-top:70px; }
}

@media (max-width: 900px) { .login-section { margin:100px 16px 40px; } }

#app {
    text-align: center;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}

nav {
    width: 100%;
    background-color: #333;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    position: fixed;
    top: 0;
    box-sizing: border-box;
    z-index: 1000; /* Zapewnienie, że nav jest na wierzchu */
}

nav .logo {
    font-size: 24px;
    font-weight: bold;
}

nav .user-info {
    display: none;
    align-items: center;
    margin-left: auto; /* Dodane, aby przesunąć info o użytkowniku na prawo */
    flex-shrink: 0; /* Zapobiega skurczeniu się panelu */
}

nav .user-info.visible {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0; /* Zapobiega skurczeniu się panelu */
    gap: 10px; /* Dodaje odstępy między elementami */
}

nav .user-info img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    flex-shrink: 0; /* Zapobiega skurczeniu się obrazka */
}

nav .user-info span {
    flex-shrink: 0; /* Zapobiega skurczeniu się nazwy użytkownika */
    white-space: nowrap; /* Zapobiega łamaniu tekstu */
    max-width: 150px; /* Maksymalna szerokość dla bardzo długich nazw */
    overflow: hidden;
    text-overflow: ellipsis;
}

nav .user-info button {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px; /* Zaokrąglenie krawędzi */
    flex-shrink: 0; /* Zapobiega skurczeniu się przycisku */
    white-space: nowrap; /* Zapobiega łamaniu tekstu */
}

nav .language-selector {
    position: relative;
    display: inline-block;
    margin-right: 10px; /* Dostosowanie marginesu */
    flex-shrink: 0; /* Zapobiega skurczeniu się selektora */
}

nav .language-selector button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    color: white; /* Zmiana koloru na biały */
    margin-left: 10; /* Usunięcie dziedziczonego lewego marginesu */
}

nav .language-selector button img {
    width: 24px;
    height: 24px;
}

nav .language-selector button i {
    color: white; /* Zmiana koloru ikony na biały */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* Dodanie cienia */
}

nav .language-selector .dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 50px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    left: 0; /* Usunięcie dodatkowej przestrzeni */
}

nav .language-selector .dropdown-content button {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    margin-left: 0; /* Usunięcie marginesu wewnątrz dropdownu */
}

nav .language-selector .dropdown-content button:hover {
    background-color: #f1f1f1;
}

nav .language-selector:hover .dropdown-content {
    display: block;
}

nav .logo-box {
    display: flex;
    align-items: center;
    width: 100%;;
}

nav .logo-box svg {
    width: 36px; /* Powiększenie skali ikonki-logo */
    height: 36px; /* Powiększenie skali ikonki-logo */
}

nav .logo-box span {
    font-family: 'Segoe UI';
    font-weight: 700;
    font-size: 20px; /* Powiększenie czcionki napisu "Relations" */
    line-height: 1;
    display: inline-block;
    margin-left: 5px;
    margin-bottom: 5px;
    color: #FFFFFF;
}

#main {
    display: flex;
    justify-content: flex-start; /* Wyrównanie do góry */
    align-items: flex-start; /* Wyrównanie do góry */
    width: 80%;
    margin: 100px auto 0 auto; /* Dodanie marginesu, aby menu nie było pod paskiem nawigacji */
}

#menu {
    width: 25%;
    background-color: #f0f0f0; /* Lżejsza stylizacja */
    color: #333; /* Lżejsza stylizacja */
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

#menu .menu-item {
    padding: 15px;
    cursor: pointer;
    font-size: 18px;
    border-bottom: 1px solid #ddd; /* Lżejsza stylizacja */
}

#menu .menu-item.active {
    background-color: #ddd; /* Lżejsza stylizacja */
    font-weight: bold;
}

#submenu {
    display: none;
    padding-left: 20px;
}

#submenu .submenu-item {
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 1px solid #ddd;
}

#submenu .submenu-item.active {
    background-color: #ddd;
    font-weight: bold;
}

#raportowanieSubmenu {
    margin-left: 20px;
    display: none;
}

#raportowanieSubmenu .submenu-item {
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#raportowanieSubmenu .submenu-item:hover {
    background-color: #f0f0f0;
}

#content {
    width: 75%;
    padding: 20px;
    background-color: #fff;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

table tr:hover {
    background-color: #f1f1f1;
}

table tr:hover .edit-icon {
    display: inline-block;
}

.edit-icon {
    display: none;
    cursor: pointer;
    margin-left: 10px;
    color: #4CAF50;
}

#addUserButton, #addClippingButton {
    position: relative;
    float: right;
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.popup-content .close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
}

.popup-content form {
    display: flex;
    flex-direction: column;
}

.popup-content form .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.popup-content form .form-group label {
    flex: 1;
    margin-right: 10px;
}

.popup-content form .form-group input {
    flex: 2;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

#userSuggestions {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: calc(100% - 20px);
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
    top: 100%;
    left: 0;
}

#userSuggestions div {
    padding: 8px;
    cursor: pointer;
}

#userSuggestions div:hover {
    background-color: #f1f1f1;
}

.shortened-link {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    margin: 0 5px;
    border-radius: 5px;
}

.pagination button:hover {
    background-color: #45a049;
}

.pagination button.active {
    background-color: #333;
    color: white;
}

#editClippingPopup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

#editClippingPopup .popup-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

#editClippingPopup .popup-content .close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
}

.client-logo {
    width: 100px; /* Szerokość logotypu */
    height: auto;
    display: block;
    margin: 0 auto;
}

#content table th:first-child, #content table td:first-child {
    width: auto;
}

#content table th:first-child input, #content table td:first-child input {
    transform: scale(1.2); /* Powiększenie checkboxów */
}

#content table th:nth-child(2), #content table td:nth-child(2) {
    width: auto;
}

#content table th:nth-child(3), #content table td:nth-child(3) {
    width: auto;
}

#content table th:nth-child(4), #content table td:nth-child(4) {
    width: auto;
}

#content .year-select-container {
    margin-top: 20px; /* Odstęp pod tabelą */
    font-size: 18px; /* Powiększenie tekstu */
}

#content .year-select-container select {
    font-size: 18px; /* Powiększenie pola wyboru */
    padding: 5px;
    margin-left: 10px;
}

#content button.generate-button {
    margin-top: 20px; /* Odstęp nad guziczkiem */
    font-size: 18px;
    padding: 10px 20px;
}

#statusContainer {
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    max-height: 200px;
    overflow-y: auto;
    font-size: 14px;
    color: #333;
    display: none; /* Ukrycie kontenera na początku */
}

#addClientPopup, #editClientPopup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

#addClientPopup .popup-content, #editClientPopup .popup-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

#addClientPopup .popup-content .close, #editClientPopup .popup-content .close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
}

.active-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: green;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.dropdown {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: calc(100% - 20px);
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
    top: 100%;
    left: 0;
}

.dropdown .dropdown-item {
    padding: 8px;
    cursor: pointer;
}

.dropdown .dropdown-item:hover {
    background-color: #f1f1f1;
}

#openFilePickerButton {
    display: block;
    margin: 0 auto;
    width: 70%;
    text-align: center;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 10px;
}

#openFilePickerButton::before {
    content: "📁 ";
}

input[type="file"] {
    display: block;
    margin-top: 10px;
    padding: 10px;
    background-color: lightgray;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    width: 70%; /* Dodanie szerokości 100% */
    margin: auto; /* Wyśrodkowanie */
    margin-bottom: 10px;;
}

.progress-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #4CAF50;
    animation: spin 1s ease-in-out infinite;
    margin-top: 10px;
    margin: auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Relations AI Styles */
.relations-ai-dashboard {
    padding: 20px;
    max-width: 1200px;
}

.company-info-card,
.license-status-card,
.subscription-details-card,
.api-keys-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.company-info-card h3,
.license-status-card h3,
.subscription-details-card h3,
.api-keys-card h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
}

.info-row .label {
    font-weight: bold;
    color: #6c757d;
}

.info-row .value {
    color: #495057;
}

/* Subscription grid layout for tabular display */
.subscription-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.detail-item:hover {
    background-color: #f8f9fa;
}

.detail-item .label {
    font-weight: 600;
    color: #495057;
    margin-right: 10px;
}

.detail-item .value {
    color: #212529;
    font-weight: 500;
}

.detail-item .value.status-active {
    color: #28a745;
    font-weight: 600;
}

.detail-item .value.status-inactive,
.detail-item .value.status-expired {
    color: #dc3545;
    font-weight: 600;
}

/* Responsive grid for smaller screens */
@media (max-width: 768px) {
    .subscription-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.status-indicator {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.status-indicator.active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-indicator.user_not_found,
.status-indicator.subscription_inactive,
.status-indicator.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.status-indicator.active .status-dot {
    background-color: #28a745;
}

.status-indicator.user_not_found .status-dot,
.status-indicator.subscription_inactive .status-dot,
.status-indicator.error .status-dot {
    background-color: #dc3545;
}

.registration-form {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin-top: 15px;
}

.registration-form h4 {
    margin-top: 0;
    color: #007bff;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #495057;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-debug {
    background-color: #fd7e14;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: monospace;
}

/* Style dla wyłączonych przycisków */
button:disabled,
button.disabled {
    background-color: #6c757d !important;
    color: #adb5bd !important;
    cursor: not-allowed !important;
    opacity: 0.65;
    border: 1px solid #6c757d !important;
}

button:disabled:hover,
button.disabled:hover {
    background-color: #6c757d !important;
    color: #adb5bd !important;
    cursor: not-allowed !important;
    opacity: 0.65;
}

.btn-debug:hover {
    background-color: #e8650e;
}

.api-key-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.api-key-row:last-child {
    border-bottom: none;
}

.api-key-row .provider {
    font-weight: bold;
    color: #495057;
}

.api-key-row .key {
    font-family: monospace;
    color: #6c757d;
}

/* Relations AI Users Management */
.relations-ai-users {
    padding: 20px;
}

.users-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.users-table th,
.users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.users-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #495057;
}

.users-table tr:hover {
    background-color: #f5f5f5;
}

.license-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.license-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 34px;
    width: 60px;
    background-color: #ccc;
    border-radius: 34px;
    transition: .4s;
}

.checkmark:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.license-toggle input:checked + .checkmark {
    background-color: #2196F3;
}

.license-toggle input:checked + .checkmark:before {
    transform: translateX(26px);
}

.sync-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.sync-btn:hover {
    background-color: #218838;
}

/* Relations AI - Ustawienia */
.relations-ai-settings {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.settings-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.settings-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0078d4;
    padding-bottom: 10px;
}

.org-info .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.org-info .info-row:last-child {
    border-bottom: none;
}

.api-keys-list {
    margin-top: 15px;
}

.api-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 10px;
}

.key-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.provider-name {
    font-weight: 600;
    color: #333;
    text-transform: capitalize;
}

.key-preview {
    font-family: 'Courier New', monospace;
    color: #666;
    font-size: 12px;
}

.key-actions {
    display: flex;
    gap: 8px;
}

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

.error-message {
    background: #fff2f2;
    border: 1px solid #ffcdd2;
    color: #d32f2f;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

/* Relations AI - Responsywność dla ustawień */
@media (max-width: 768px) {
    .relations-ai-settings {
        padding: 10px;
    }
    
    .api-key-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .key-actions {
        justify-content: center;
    }
    
    .org-info .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Relations AI - Dual Tables System */
.user-management {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.administrators-section,
.licensed-users-section {
    margin-bottom: 40px;
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-description {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}

.admin-actions,
.users-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.admins-table,
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.admins-table th,
.admins-table td,
.users-table th,
.users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.admins-table th,
.users-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.license-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.license-status.licensed {
    background-color: #d4edda;
    color: #155724;
}

.license-status.unlicensed {
    background-color: #f8d7da;
    color: #721c24;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    margin-right: 5px;
}

.btn-primary.btn-small {
    background-color: #007bff;
    color: white;
}

.btn-primary.btn-small:hover {
    background-color: #0056b3;
}

.btn-danger.btn-small {
    background-color: #dc3545;
    color: white;
}

.btn-danger.btn-small:hover {
    background-color: #c82333;
}

.btn-secondary.btn-small {
    background-color: #6c757d;
    color: white;
}

.btn-secondary.btn-small:hover {
    background-color: #545b62;
}

/* Modal dla wyszukiwania administratorów */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    background-color: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #495057;
}

.modal-body {
    padding: 25px;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #000;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 10px;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

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

.user-info {
    flex-grow: 1;
}

.user-name {
    font-weight: 500;
    color: #495057;
}

.user-email {
    font-size: 12px;
    color: #6c757d;
}

.add-button {
    background-color: #28a745;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.access-denied {
    max-width: 600px;
    margin: 50px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.access-denied h2 {
    color: #dc3545;
    margin-bottom: 20px;
}

.access-denied p {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Responsywność dla zarządzania użytkownikami */
@media (max-width: 768px) {
    .user-management {
        padding: 10px;
    }
    
    .administrators-section,
    .licensed-users-section {
        padding: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .admin-actions,
    .users-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .admins-table,
    .users-table {
        font-size: 12px;
    }
    
    .admins-table th,
    .admins-table td,
    .users-table th,
    .users-table td {
        padding: 8px 4px;
    }
    
    .btn-small {
        padding: 4px 8px;
        font-size: 11px;
    }
}

.registration-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin-bottom: 10px;
}

.registration-form .checkbox-label input[type="checkbox"] {
    margin: 0 8px 0 0;
    width: 18px;
    height: 18px;
}

/* Trial activation section */
.trial-activation {
    background: #fff3cd;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
    margin-top: 15px;
    text-align: center;
}

.trial-activation p {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 16px;
}

.trial-activation .btn-primary {
    background-color: #28a745;
    border-color: #28a745;
    font-size: 16px;
    padding: 12px 24px;
}

.trial-activation .btn-primary:hover {
    background-color: #218838;
    border-color: #1e7e34;
}
