body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f3f4f6;
    margin: 0;
}

header, footer {
    padding: 1rem 2rem;
    background: #111827;
    color: #f9fafb;
}

main {
    padding: 2rem;
}

nav a {
    color: #9ca3af;
    text-decoration: none;
    margin-right: .5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

nav a:hover,
nav a:focus {
    color: #f9fafb;
    background-color: rgba(249, 250, 251, 0.08);
}

/* Manage dropdown toggle in header nav */
.nav-manage-toggle {
    color: #9ca3af;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: none;
    background: transparent;
    box-shadow: none;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-manage-toggle:hover,
.nav-manage-toggle:focus {
    color: #f9fafb;
    background-color: rgba(249, 250, 251, 0.08);
    outline: none;
}

/* Slightly darker background when dropdown is open */
.dropdown.show .nav-manage-toggle {
    background-color: rgba(249, 250, 251, 0.16);
    color: #f9fafb;
}

/* Hide default Bootstrap caret on the Manage dropdown */
.nav-manage-toggle.dropdown-toggle::after {
    display: none;
}

/* Company dropdown and nested submenu under navbar */
header .dropdown-submenu {
    position: relative;
}

header .dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -0.125rem;
    margin-left: 0.25rem;
}

/* Show nested menu on hover */
header .dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

/* Dark, navbar-style dropdown menu */
header .dropdown-menu {
    background-color: #111827;
    border: none;
    border-radius: 0;
    padding: 0.25rem 0.25rem;
    margin-top: 0;
    top: 100%;
    transform: translateY(-1px);
    min-width: 11rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

header .dropdown-menu .dropdown-item {
    color: #9ca3af;
    font-size: 0.875rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0;
}

header .dropdown-menu .dropdown-item:hover,
header .dropdown-menu .dropdown-item:focus {
    background-color: rgba(249, 250, 251, 0.08);
    color: #f9fafb;
}

header .dropdown-menu .dropdown-item.active,
header .dropdown-menu .dropdown-item:active {
    background-color: rgba(249, 250, 251, 0.16);
    color: #f9fafb;
}

header .dropdown-menu .dropdown-divider {
    border-top-color: #374151;
}

/* Audit log details styling */
.audit-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.25rem 1.5rem;
    font-size: 0.8rem;
    background: #111827;
    color: #e5e7eb;
    padding: 0.5rem 0.75rem;
    border-radius: 0.35rem;
    max-height: 10rem;
    overflow: auto;
}

.audit-details-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.audit-details-key {
    font-weight: 600;
    color: #9ca3af;
}

.audit-details-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #e5e7eb;
    word-break: break-all;
}

.audit-details {
    max-height: 10rem;
    overflow: auto;
    font-size: 0.8rem;
}

/* Audit log column widths: give Time and User Agent more room, Details less */
.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
    white-space: nowrap;
    width: 11rem;
}

.audit-table th:nth-child(5),
.audit-table td:nth-child(5) {
    width: 9rem;
    word-wrap: break-word;
}

.audit-table th:nth-child(7),
.audit-table td:nth-child(7) {
    width: 18rem;
    min-width: 16rem;
}
