/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: Arial, Helvetica, sans-serif;
    height: 100%;
    margin: 0;
    color: #111827;
}

body {
    background-color: #f9fafb;
}

/* ===== HEADER NAV MENU ===== */

.app-header-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.nav-menu {
    position: relative;
}

.nav-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1d4ed8;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.nav-menu-button .material-symbols-outlined {
    font-size: 20px;
}

.nav-menu-button:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

.nav-menu-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    min-width: 230px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.2);
    padding: 0.4rem 0;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1000;
}

.nav-menu.is-open .nav-menu-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.875rem;
    color: #0f172a;
    text-decoration: none;
    white-space: nowrap;
}

.nav-menu-item .material-symbols-outlined {
    font-size: 18px;
    color: #94a3b8;
}

.nav-menu-item:hover {
    background: #eff6ff;
}

.nav-menu-item-danger {
    border-top: 1px solid #e2e8f0;
    margin-top: 0.25rem;
    padding-top: 0.6rem;
    color: #b91c1c;
}

.nav-menu-item-danger .material-symbols-outlined {
    color: #ef4444;
}

/* Navbar */
.navbar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;

    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 10px 14px;
    margin: 10px;

    background-color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.navbar-left,
.navbar-right {
    flex: 1;
}

.navbar-center {
    flex: 1;
    text-align: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.menu-button,
.avatar-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.menu-button:hover,
.avatar-button:hover {
    background-color: #e5edff;
    transform: translateY(-1px);
}

.menu-button .material-symbols-outlined {
    font-size: 24px;
    color: #1f2937;
}

.avatar-button img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 200px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    z-index: 1000;
    margin-top: 8px;
    overflow: hidden;
}

.dropdown-right {
    right: 0;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #111827;
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background 0.15s;
}

.dropdown-content a:hover {
    background-color: #f3f4f6;
}

.badge {
    background: #ef4444;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    margin-left: 8px;
    font-weight: 600;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 12px 32px;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 10px;
}

.alert {
    padding: 10px 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;

    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.alert-success {
    border-color: #bbf7d0;
    background-color: #ecfdf3;
    color: #166534;
}

.alert-error {
    border-color: #fecaca;
    background-color: #fef2f2;
    color: #b91c1c;
}

/* Page Header */
.page-header {
    margin: 10px 10px 16px;
    padding: 10px 4px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
}

.subtitle {
    color: #6b7280;
    font-size: 15px;
}

/* Card (generiek) */
.card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    margin: 10px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.card-header {
    padding: 15px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.card-body {
    padding: 20px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.data-table thead {
    background-color: #f3f4f6;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #111827;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #374151;
}

.data-table tbody tr {
    transition: background-color 0.15s;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

.mono {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.text-muted {
    color: #9ca3af;
}

.text-small {
    font-size: 13px;
}

.link {
    color: #2563eb;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

/* Badges */
.badge-role {
    display: inline-block;
    padding: 4px 8px;
    background-color: #eef2ff;
    border-radius: 999px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
    color: #3730a3;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn .material-symbols-outlined {
    font-size: 18px;
}

.btn-primary {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.btn-secondary:hover {
    background-color: #dbeafe;
    border-color: #93c5fd;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.btn-danger:hover {
    background-color: #fecaca;
    border-color: #fca5a5;
    box-shadow: 0 8px 18px rgba(248, 113, 113, 0.35);
    transform: translateY(-1px);
}

.btn-small {
    padding: 5px 10px;
    font-size: 13px;
}

.btn-small .material-symbols-outlined {
    font-size: 16px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 5px;
}

.form-input {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #ffffff;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;

    background-color: rgba(15, 23, 42, 0.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.close-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}

.close-button:hover {
    background-color: #e5edff;
    transform: translateY(-1px);
}

.close-button .material-symbols-outlined {
    font-size: 24px;
    color: #111827;
}

.modal-content form {
    padding: 18px 22px 10px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 22px 18px;
    border-top: 1px solid #e5e7eb;
    margin-top: 10px;
}

/* Dashboard grid en cards (Sales Dashboard) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin: 24px 10px 0;
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.dashboard-card:hover {
    border-color: #2563eb;
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.dashboard-card-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.dashboard-card-disabled:hover {
    transform: none;
    border-color: #e5e7eb;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.dashboard-card-icon {
    width: 70px;
    height: 70px;
    background: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.dashboard-card-icon .material-symbols-outlined {
    font-size: 40px;
    color: #2563eb;
}

.dashboard-card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111827;
}

.dashboard-card p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 8px 12px;
        margin: 8px;
    }

    .container {
        padding: 10px 10px 24px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 26px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button,
    .action-buttons form {
        width: 100%;
    }

    .modal-content {
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* ============ DROPDOWN STYLES ============ */

/* Multi-select and Single-select containers */
.multi-select-container,
.single-select-container {
    position: relative;
    width: 100%;
}

/* Display inputs */
.multi-select-display,
.single-select-display {
    width: 100%;
    cursor: pointer;
    padding-right: 40px !important; /* Space for the arrow icon */
}

/* Dropdown arrow icon using Material Icons */
.multi-select-container .dropdown-arrow,
.single-select-container .dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6b7280;
    font-size: 18px;
    transition: transform 0.2s ease;
}

/* Rotate arrow when dropdown is open */
.multi-select-container.open .dropdown-arrow,
.single-select-container.open .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Dropdown panels - FIXED POSITIONING */
.multi-select-container .dropdown,
.single-select-container .dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px); /* Position just below the input */
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    z-index: 1000;
}

/* Search input inside dropdown */
.dropdown .form-input.dropdown-search {
    margin: 8px;
    width: calc(100% - 16px);
    border-radius: 6px;
}

/* Option items */
.multi-select-option,
.single-select-option {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.15s ease;
}

.multi-select-option:hover,
.single-select-option:hover {
    background-color: #f3f4f6;
}

/* Selected state for single-select options */
.single-select-option.selected {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

/* Checkbox styling for multi-select */
.multi-select-option input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

/* No results message */
.no-results {
    padding: 12px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* Scrollbar styling for dropdown */
.dropdown::-webkit-scrollbar {
    width: 8px;
}

.dropdown::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.dropdown::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 4px;
}

.dropdown::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* ============ CREDENTIAL FIELD STYLES ============ */

.credential-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.credential-text {
    flex: 1;
}

.password-input {
    border: none;
    background: transparent;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    padding: 0;
    flex: 1;
    min-width: 100px;
}

.password-input:focus {
    outline: none;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    color: #6b7280;
}

.btn-icon:hover {
    background-color: #f3f4f6;
    color: #2563eb;
}

.btn-icon .material-symbols-outlined {
    font-size: 18px;
}

.btn-icon:active {
    transform: scale(0.95);
}

/* Copy button success state */
.btn-icon.copied {
    color: #16a34a;
}

/* ============ INFO ICON & TOOLTIP STYLES ============ */

.info-icon-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    vertical-align: middle;
}

.info-icon {
    font-size: 18px;
    color: #6b7280;
    cursor: help;
    transition: color 0.15s ease;
}

.info-icon:hover {
    color: #2563eb;
}

.info-tooltip {
    display: none;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    z-index: 1000;
    width: 420px;
    font-size: 13px;
    line-height: 1.6;
    color: #374151;
    font-weight: normal;
    white-space: normal;
}

.info-tooltip strong {
    color: #111827;
}

.info-icon-container:hover .info-tooltip {
    display: block;
}

/* Arrow pointer for tooltip */
.info-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: #e5e7eb;
}

.info-tooltip::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: -1px;
    border: 7px solid transparent;
    border-right-color: #ffffff;
}

/* Responsive tooltip positioning */
@media (max-width: 768px) {
    .info-tooltip {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        margin-left: 0;
        width: 90%;
        max-width: 350px;
    }
    
    .info-tooltip::before,
    .info-tooltip::after {
        display: none;
    }
}