/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a1a1a; /* Dark background */
    color: #e0e0e0; /* Light text */
    line-height: 1.6;
    display: flex; /* Use flexbox for layout */
}

a {
    color: #64b5f6; /* Light blue links */
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.container {
    display: flex;
    width: 100%;
    max-width: 1600px; /* Max width for larger screens */
    margin: 0 auto; /* Center container */
}

/* --- Navigation (Right Hand Side) --- */
.main-nav {
    background-color: #262626;
    padding: 20px 15px;
    width: 220px; /* Fixed width for RHS nav */
    order: 1; /* Move nav to the left */
    height: 100vh; /* Full height */
    position: sticky; /* Stick to the top */
    top: 0;
    overflow-y: auto; /* Allow scrolling if content exceeds height */
}

.main-nav ul {
    list-style: none;
}

.main-nav li {
    margin-bottom: 10px;
}

.main-nav a {
    display: block;
    padding: 8px 10px;
    color: #ccc;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active { /* Add .active class via PHP for current page */
    background-color: #3a3a3a;
    color: #fff;
    text-decoration: none;
}

/* Navigation dividers */
.main-nav hr {
    margin: 10px 0;
    border: none;
    border-top: 1px solid #444;
    opacity: 0.5;
}

.main-nav .nav-divider {
    margin: 10px 0;
    border-top: 1px solid #444;
    opacity: 0.5;
    list-style: none;
}

.mobile-menu-toggle {
    display: none; /* Hidden by default */
    background: #444;
    color: #eee;
    border: none;
    font-size: 1.5em;
    padding: 5px 10px;
    cursor: pointer;
    margin-bottom: 15px;
}

/* --- Main Content Area --- */
.main-content {
    flex-grow: 1; /* Take remaining space */
    padding: 20px 30px;
    order: 2; /* Place content on the right */
}


h1, h2, h3 {
    color: #ffffff;
    margin-bottom: 0.8em;
    border-bottom: 1px solid #444;
    padding-bottom: 0.3em;
}

/* --- Search --- */
.search-container {
    position: relative; /* For positioning live results */
}

/* Global search bar shown at the top of every page */
.search-container.global-search {
    padding: 12px 0 14px;
    margin-bottom: 20px;
    border-bottom: 1px solid #383838;
}

.search-container input[type="search"] {
    padding: 8px 12px;
    border: 1px solid #444;
    background-color: #2f2f2f;
    color: #e0e0e0;
    border-radius: 4px;
    width: 100%;
    max-width: 480px;
}

.search-results-live {
    position: absolute;
    top: 100%; /* Position below the input */
    left: 0;
    background-color: #333;
    border: 1px solid #555;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
    display: none; /* Hidden initially */
    width: 100%;
    max-width: 480px;
}
.search-results-live ul {
     list-style: none;
     padding: 0;
     margin: 0;
}
.search-results-live .search-results-divider {
    padding: 6px 12px;
    background-color: #2b2b2b;
    border-top: 1px solid #555;
    border-bottom: 1px solid #555;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #b0b0b0;
}
.search-results-live li.fuzzy-match a {
    color: #b9c6d4;
}
.search-results-live li a {
    display: block;
    padding: 8px 12px;
    color: #ccc;
}
.search-results-live li a:hover {
    background-color: #4a4a4a;
    color: #fff;
    text-decoration: none;
}
.search-results-live .status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 6px;
}
.search-results-live .status-badge.lost-stolen {
    background-color: #dc3545;
    color: #fff;
}
.search-results-live .status-badge.destroyed {
    background-color: #6c757d;
    color: #fff;
}
.search-results-live .status-badge.admin-error {
    background-color: #fd7e14;
    color: #fff;
}
.search-results-live li.status-lost-stolen,
.search-results-live li.status-destroyed,
.search-results-live li.status-admin-error {
    opacity: 0.75;
}
.strikethrough {
    text-decoration: line-through;
    opacity: 0.7;
}
.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 6px;
}
.status-badge.lost-stolen {
    background-color: #dc3545;
    color: #fff;
}
.status-badge.destroyed {
    background-color: #6c757d;
    color: #fff;
}
.status-badge.admin-error {
    background-color: #fd7e14;
    color: #fff;
}
.status-badge.active {
    background-color: #28a745;
    color: #fff;
}
.status-lost-stolen,
.status-destroyed,
.status-admin-error {
    opacity: 0.75;
}
.search-results-live p { /* Style for 'No results' */
    padding: 8px 12px;
    font-style: italic;
    color: #999;
}
.search-results-live .view-all-results {
    text-align: center;
    padding: 8px;
    background-color: #404040;
    border-top: 1px solid #555;
}
.search-results-live .view-all-results a {
    font-weight: bold;
    color: #8bc34a; /* Different color for distinction */
}

/* -----------------------------------------------------------------------
   Omnibox: Type badges and site/project result rows (live search & results.php)
   ----------------------------------------------------------------------- */

/* Small coloured pill before the result name */
.omni-type-badge {
    display: inline-block;
    font-size: 0.68em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
    line-height: 1.6;
}
.omni-badge-site    { background-color: #1a3a4a; color: #5bbfdf; border: 1px solid #2a5a6a; }
.omni-badge-project { background-color: #2a2a4a; color: #9b8fe8; border: 1px solid #3a3a6a; }

/* Muted contextual metadata shown inline (provider, RFNSA, etc.) */
.omni-meta {
    font-size: 0.82em;
    color: #7a8a9a;
}

/* Secondary line (address / site name under project) */
.omni-subtext {
    display: block;
    font-size: 0.78em;
    color: #6a7a8a;
    margin-top: 1px;
    padding-left: 2px;
}

/* Live search: site and project rows */
.search-results-live li.omni-result-site a,
.search-results-live li.omni-result-project a {
    padding: 6px 12px;
    line-height: 1.4;
}

/* Divider colour variants for sites/projects in the live dropdown */
.search-results-live .omni-divider-site    { color: #5bbfdf; }
.search-results-live .omni-divider-project { color: #9b8fe8; }

/* results.php: omni result list */
.omni-results-list {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
}
.omni-results-list li {
    padding: 7px 0;
    border-bottom: 1px solid #333;
    line-height: 1.5;
}
.omni-results-list li:last-child { border-bottom: none; }

/* results.php divider colour variants */
.omni-divider-site    { color: #5bbfdf !important; }
.omni-divider-project { color: #9b8fe8 !important; }

/* -----------------------------------------------------------------------
   Site & Project view pages (.sv- prefix for site, .pv- prefix for project)
   ----------------------------------------------------------------------- */

/* Shared breadcrumb */
.sp-breadcrumb {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 0.85em;
    color: #888;
    text-decoration: none;
}
.sp-breadcrumb:hover { color: #ccc; text-decoration: none; }
.sp-breadcrumb + .sp-breadcrumb::before { content: ' › '; color: #555; }

/* Page title row */
.sp-title-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}
.sp-title-row h1 { margin: 0; flex: 1; min-width: 0; }
.sp-edit-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 12px; border: 1px solid #3a3a4a; border-radius: 4px;
    background: #1e1e2e; color: #9b8fe8; font-size: 0.82em; font-weight: 500;
    text-decoration: none; white-space: nowrap; align-self: center;
    transition: background 0.15s, border-color 0.15s;
}
.sp-edit-link:hover { background: #2a2a4a; border-color: #6a5fcf; color: #b8aff5; text-decoration: none; }

/* Info grid (metadata cards) */
.sp-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.sp-info-card {
    background: #252525;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    padding: 12px 14px;
}
.sp-info-card .nic-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #777;
    margin-bottom: 4px;
}
.sp-info-card .nic-value {
    font-size: 1em;
    color: #e0e0e0;
    font-weight: 500;
    word-break: break-word;
}
.sp-info-card a.nic-value,
.sp-info-card .nic-value a {
    color: #6ea8fe;
    text-decoration: none;
}
.sp-info-card a.nic-value:hover,
.sp-info-card .nic-value a:hover { text-decoration: underline; }

/* Section heading */
.sp-section-heading {
    font-size: 1.1em;
    font-weight: 600;
    color: #ccc;
    border-bottom: 1px solid #3a3a3a;
    padding-bottom: 6px;
    margin: 24px 0 12px;
}

/* Projects table on site_view */
.sp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92em;
}
.sp-table th {
    background: #2a2a2a;
    color: #bbb;
    font-weight: 600;
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #444;
}
.sp-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #333;
    vertical-align: top;
    color: #ddd;
}
.sp-table tbody tr:hover { background: #2a2a2a; }
.sp-table .sp-file-count {
    font-size: 0.82em;
    color: #777;
}

/* File list on project_view */
.sp-file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sp-file-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #2e2e2e;
    flex-wrap: wrap;
}
.sp-file-list li:last-child { border-bottom: none; }
.sp-file-icon {
    font-size: 1.2em;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.sp-file-name {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    color: #e0e0e0;
}
.sp-file-meta {
    font-size: 0.78em;
    color: #666;
    white-space: nowrap;
}
.sp-file-download {
    font-size: 0.82em;
    color: #6ea8fe;
    text-decoration: none;
    white-space: nowrap;
    padding: 3px 8px;
    border: 1px solid #2a4a7a;
    border-radius: 4px;
    background: #0d2040;
    transition: background 0.15s;
}
.sp-file-download:hover { background: #1a3a60; text-decoration: none; color: #a8c8ff; }

.sp-empty { color: #666; font-style: italic; padding: 12px 0; }

/* Mobile tweaks for nexus pages */
@media (max-width: 768px) {
    .sp-info-grid { grid-template-columns: 1fr 1fr; }
    .sp-table thead { display: none; }
    .sp-table tbody tr {
        display: block;
        background: #2a2a2a;
        border: 1px solid #3a3a3a;
        border-radius: 6px;
        margin-bottom: 8px;
        padding: 10px 12px;
    }
    .sp-table td {
        display: flex;
        gap: 8px;
        padding: 4px 0;
        border-bottom: none;
        font-size: 0.88em;
    }
    .sp-file-list li { flex-direction: column; align-items: flex-start; gap: 4px; }
    .sp-file-meta { white-space: normal; }
}

.duplicate-warnings {
    margin-bottom: 20px;
    padding: 12px 15px;
    border-radius: 6px;
    background-color: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.5);
    color: #f2c94c;
}

.duplicate-warnings-header {
    font-weight: 600;
    margin-bottom: 8px;
}

.duplicate-warnings ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.duplicate-warnings li {
    margin-bottom: 6px;
}

.duplicate-warnings li:last-child {
    margin-bottom: 0;
}

/* Forms */
input, textarea, select, button {
    font-family: inherit;
    font-size: 1em;
    background-color: #2f2f2f;
    color: #e0e0e0;
    border: 1px solid #444;
    padding: 8px;
    border-radius: 4px;
}
button {
    cursor: pointer;
    background-color: #0d6efd; /* Example button color */
    border-color: #0d6efd;
    color: white;
    padding: 8px 15px;
}
button:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Utilities */
.error {
    color: #f44336; /* Red for errors */
    font-weight: bold;
}
.success {
     color: #4CAF50; /* Green for success */
     font-weight: bold;
}

/* =============================================
   Logs Page
   ============================================= */

.logs-filters {
    margin-bottom: 20px;
    padding: 16px;
    background-color: #262626;
    border: 1px solid #444;
    border-radius: 6px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}

.filter-group label {
    display: block;
    margin-bottom: 6px;
    color: #bfc7cf;
    font-size: 0.9em;
}

.filter-group input {
    width: 100%;
}

.filter-group-wide {
    grid-column: span 2;
}

.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.logs-summary {
    margin-bottom: 15px;
    color: #9aa3ab;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92em;
}

.logs-table th,
.logs-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #3f3f3f;
    vertical-align: top;
}

.logs-table th {
    text-align: left;
    background-color: #2f2f2f;
    color: #e0e0e0;
    font-weight: 600;
}

.logs-table tbody tr:nth-child(odd) {
    background-color: #262626;
}

.logs-table tbody tr:hover {
    background-color: #343434;
}

.logs-table .timestamp {
    white-space: nowrap;
    color: #c7c7c7;
    width: 160px;
}

.logs-table .user {
    color: #b5b5b5;
    width: 140px;
}

.logs-table .action-type {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    color: #caa6ff;
    width: 180px;
}

.logs-table .item .item-id {
    color: #888;
    font-size: 0.85em;
    margin-top: 4px;
}

.logs-table .description {
    color: #e0e0e0;
    line-height: 1.45;
}

.logs-table .muted {
    color: #777;
}

.logs-row {
    border-left: 4px solid transparent;
}

.logs-row.log-login {
    border-left-color: #4ea1ff;
    background-color: rgba(78, 161, 255, 0.08);
}

.logs-row.log-item {
    border-left-color: #3fcf8e;
    background-color: rgba(63, 207, 142, 0.08);
}

.logs-row.log-stocktake {
    border-left-color: #b08cff;
    background-color: rgba(176, 140, 255, 0.08);
}

.logs-row.log-error {
    border-left-color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.12);
}

.logs-row.log-other {
    border-left-color: #6c757d;
    background-color: rgba(108, 117, 125, 0.08);
}

.logs-pagination {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logs-pagination .pagination-info {
    color: #b0b0b0;
}

.button-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* =============================================
   Flash Message Styles (site-wide)
   ============================================= */

.flash-message {
    position: relative;
    padding: 14px 44px 14px 18px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid transparent;
    opacity: 1;
    transition: opacity 0.5s ease-out;
    font-size: 0.97em;
}

.flash-message.success {
    color: #dff0d8;
    background-color: #3c763d;
    border-color: #2b542c;
}

.flash-message.error {
    color: #f2dede;
    background-color: #a94442;
    border-color: #843534;
}

.flash-message.info {
    color: #d9edf7;
    background-color: #1c5a7a;
    border-color: #155975;
}

.flash-message.warning {
    color: #fcf8e3;
    background-color: #856404;
    border-color: #6d5303;
}

/* Link embedded inside flash banner */
.flash-message-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 8px;
    white-space: nowrap;
}

.flash-message-link:hover {
    opacity: 0.85;
    text-decoration: underline;
}

/* Dismiss button inside flash */
.flash-dismiss {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.2em;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
    opacity: 0.7;
    border-radius: 3px;
}

.flash-dismiss:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.15);
}

/* =============================================
   Item Form (item_form.php)
   ============================================= */

#item-form .form-group { margin-bottom: 15px; }
#item-form label { display: block; margin-bottom: 5px; font-weight: bold; }
#item-form input[type="text"],
#item-form input[type="number"],
#item-form input[type="date"],
#item-form select,
#item-form textarea {
    width: 100%;
    max-width: 450px;
    padding: 10px;
    border: 1px solid #444;
    background-color: #2f2f2f;
    color: #e0e0e0;
    border-radius: 4px;
    box-sizing: border-box;
}
#item-form input[readonly] { background-color: #404040; cursor: not-allowed; }
#item-form textarea { height: 80px; }
#item-form .required { color: #ff6666; font-weight: bold; margin-left: 4px; }
#item-form small { display: block; margin-top: 4px; color: #aaa; font-size: 0.9em; }

#feedback-area .message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid transparent;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}
#feedback-area .message.success { color: #dff0d8; background-color: #3c763d; border-color: #2b542c; }
#feedback-area .message.error   { color: #f2dede; background-color: #a94442; border-color: #843534; }

#single-item-fields {
    border-left: 3px solid #555;
    padding-left: 15px;
    margin-top: 10px;
    margin-bottom: 15px;
}

/* Inline action/cancel buttons */
.button-link.cancel {
    display: inline-block;
    padding: 8px 15px;
    margin-left: 10px;
    background-color: #555;
    color: #eee;
    border: 1px solid #444;
    border-radius: 4px;
    text-decoration: none;
    vertical-align: middle;
    line-height: normal;
    box-sizing: border-box;
}
.button-link.cancel:hover {
    background-color: #666;
    text-decoration: none;
    color: #fff;
}

.form-group button,
.form-group .button-link {
    vertical-align: middle;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Inspection period option colours */
#inspection_period option.period-red    { color: #ff6666; }
#inspection_period option.period-green  { color: #66ff66; }
#inspection_period option.period-blue   { color: #6666ff; }
#inspection_period option.period-yellow { color: #ffff66; }
#inspection_period option.period-overdue{ color: #ff9966; }

.inspection-out-of-date {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ff9966;
    font-size: 0.9em;
}

/* Special status action buttons */
.special-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #444;
}

.button-link.danger {
    background-color: #a94442;
    border-color: #843534;
    color: #fff;
}
.button-link.danger:hover { background-color: #c9302c; }

.button-link.found {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
}
.button-link.found:hover { background-color: #218838; }

/* Confirmation modal dialogs */
.modal-dialog {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #2f2f2f;
    border: 1px solid #444;
    border-radius: 5px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #444;
}
.modal-header h3 { margin: 0; color: #e0e0e0; }

.modal-body { padding: 15px; }

.modal-footer {
    padding: 15px;
    border-top: 1px solid #444;
    text-align: right;
}
.modal-footer button { margin-left: 10px; }

/* LLM name suggestion pill */
#name-suggestion-container {
    display: none;
    margin-top: 7px;
    max-width: 450px;
    background-color: #1e2d1e;
    border: 1px solid #3a6b3a;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    align-items: center;
    gap: 8px;
}
#name-suggestion-container:hover {
    background-color: #274527;
    border-color: #4caf50;
}
#name-suggestion-label {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6dbf6d;
    font-weight: 600;
    white-space: nowrap;
    margin-right: 6px;
}
#name-suggestion-text {
    color: #c8e6c9;
    font-weight: 500;
}
#name-suggestion-loading {
    display: none;
    margin-top: 6px;
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}
#name-suggestion-loading span {
    animation: suggestionPulse 1.2s ease-in-out infinite;
    display: inline-block;
}
@keyframes suggestionPulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1;   }
}

/* --- Responsive (Mobile Menu) --- */
@media (max-width: 768px) {
    .container {
        flex-direction: column; /* Stack elements vertically */
    }

    .main-nav {
        width: auto;
        order: 1;
        position: fixed;
        top: 0;
        left: 0;
        height: auto;
        padding: 0;
        background: none;
        border: none;
        z-index: 1000;
    }

    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1001;
        background: rgba(38, 38, 38, 0.92);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        border: 1px solid #444;
        border-radius: 6px;
        padding: 6px 10px;
        font-size: 1.3em;
        margin-bottom: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    }

    .main-nav ul {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        background: #262626;
        padding: 60px 15px 20px;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
        z-index: 1000;
        border-right: 1px solid #3a3a3a;
    }

    .main-nav ul.open {
        display: flex;
    }

    /* Overlay backdrop when menu is open */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .nav-overlay.open {
        display: block;
    }

     .main-content {
        order: 2;
        padding: 15px;
    }

    .search-container input[type="search"] {
        width: 100%;
        max-width: none;
    }
    .search-results-live {
        max-width: none;
    }
}

/* =============================================
   Admin Suite (/admin/)
   ============================================= */

/* Dashboard stat cards */
.adm-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.adm-card {
    background-color: #262626;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 22px 24px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.2s, background-color 0.2s;
}

.adm-card:hover {
    border-color: #64b5f6;
    background-color: #2c2c2c;
    text-decoration: none;
    color: inherit;
}

.adm-card-icon { font-size: 1.8em; margin-bottom: 10px; }
.adm-card-title { font-size: 1.05em; font-weight: 600; color: #e0e0e0; margin-bottom: 4px; }
.adm-card-stat  { font-size: 1.6em; font-weight: 700; color: #64b5f6; margin-bottom: 4px; }
.adm-card-desc  { font-size: 0.85em; color: #888; }

/* Admin panel box (create-user / add-location) */
.adm-panel {
    background-color: #262626;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 28px;
}

.adm-panel h2 {
    font-size: 1em;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 14px;
    border-bottom: none;
    padding-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.adm-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.adm-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.adm-form-group label {
    font-size: 0.85em;
    color: #bbb;
    font-weight: 500;
}

.adm-form-group input,
.adm-form-group select {
    padding: 8px 10px;
    background-color: #2f2f2f;
    border: 1px solid #484848;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 0.95em;
    min-width: 160px;
}

.adm-form-group input:focus,
.adm-form-group select:focus {
    outline: none;
    border-color: #64b5f6;
}

/* Admin management table */
.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93em;
}

.adm-table th,
.adm-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #363636;
    vertical-align: middle;
}

.adm-table th {
    text-align: left;
    background-color: #2a2a2a;
    color: #bbb;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.adm-table tbody tr:hover { background-color: #2d2d2d; }

.adm-table .adm-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.adm-table tr.adm-inactive td { opacity: 0.5; }

/* Role badges */
.adm-role-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.adm-role-guest    { background-color: #1e3347; color: #7ab5e8; }
.adm-role-employee { background-color: #1e3325; color: #72c472; }
.adm-role-admin    { background-color: #3a1e47; color: #c87dc8; }

.adm-status-active   { color: #72c472; font-size: 0.85em; }
.adm-status-inactive { color: #888;    font-size: 0.85em; }
.adm-loc-active      { color: #72c472; font-size: 0.85em; font-weight: 500; }
.adm-loc-inactive    { color: #888;    font-size: 0.85em; font-weight: 500; }

/* Admin action buttons */
.adm-btn {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.83em;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    background: none;
    color: inherit;
}

.adm-btn-primary   { background-color: #0d6efd; border-color: #0d6efd; color: #fff; }
.adm-btn-primary:hover  { background-color: #0b5ed7; text-decoration: none; color: #fff; }

.adm-btn-secondary { background-color: #3a3a3a; border-color: #555; color: #ccc; }
.adm-btn-secondary:hover { background-color: #484848; text-decoration: none; color: #fff; }

.adm-btn-danger    { background-color: transparent; border-color: #6b2b2b; color: #eb8080; }
.adm-btn-danger:hover   { background-color: #6b2b2b; color: #fff; text-decoration: none; }

.adm-btn-success   { background-color: transparent; border-color: #2b5c2b; color: #72c472; }
.adm-btn-success:hover  { background-color: #2b5c2b; color: #fff; text-decoration: none; }

/* Generated login link box */
.adm-link-box {
    background-color: #1a2a1a;
    border: 1px solid #2d5c2d;
    border-radius: 5px;
    padding: 12px 16px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.adm-link-box code {
    flex: 1;
    font-size: 0.82em;
    color: #8de88d;
    word-break: break-all;
    background: none;
    border: none;
    padding: 0;
}

/* Inline rename form */
.adm-rename-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.adm-rename-form input {
    padding: 5px 8px;
    font-size: 0.88em;
    background-color: #2f2f2f;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 4px;
    width: 200px;
}

.adm-section-sep { border: none; border-top: 1px solid #3a3a3a; margin: 28px 0 20px; }

.adm-back { display: inline-block; margin-bottom: 16px; color: #888; font-size: 0.9em; text-decoration: none; }
.adm-back:hover { color: #ccc; text-decoration: none; }

.adm-count-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    background-color: #2f2f2f;
    color: #aaa;
    border: 1px solid #444;
}

.adm-section-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #ddd;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #3a3a3a;
}

@media (max-width: 768px) {
    .adm-cards { grid-template-columns: 1fr; }
    .adm-form-row { flex-direction: column; align-items: stretch; }
    .adm-form-group input,
    .adm-form-group select { min-width: unset; width: 100%; }
    .adm-table th, .adm-table td { padding: 8px 10px; font-size: 0.85em; }
}

/* Admin search bar (sites filter row) */
.adm-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}
.adm-search-bar input[type="text"] {
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 8px 10px;
    font-size: 0.9em;
}
.adm-search-bar input[type="text"]:focus {
    outline: none;
    border-color: #64b5f6;
}
.adm-search-bar select {
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 8px 10px;
    font-size: 0.9em;
}
.adm-search-bar select:focus { outline: none; border-color: #64b5f6; }

/* Admin filter tabs (projects status tabs) */
.adm-filter-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.adm-filter-tab {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.88em;
    color: #999;
    text-decoration: none;
    border: 1px solid #333;
    background-color: #1e1e1e;
    transition: background 0.15s, color 0.15s;
}
.adm-filter-tab:hover { background-color: #2a2a2a; color: #ccc; text-decoration: none; }
.adm-filter-tab-active {
    background-color: #2a3a4a;
    border-color: #4a7fa0;
    color: #64b5f6;
}
.adm-tab-count {
    display: inline-block;
    background-color: #333;
    border-radius: 10px;
    padding: 0 6px;
    font-size: 0.82em;
    color: #888;
    margin-left: 4px;
}
.adm-filter-tab-active .adm-tab-count { background-color: #1a3a5a; color: #5bbfdf; }

/* Admin pagination (sites page) */
.adm-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin: 18px 0 24px;
}
.adm-page-btn {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 4px;
    font-size: 0.88em;
    color: #aaa;
    text-decoration: none;
    border: 1px solid #333;
    background-color: #1e1e1e;
    transition: background 0.15s;
}
.adm-page-btn:hover { background-color: #2a2a2a; color: #e0e0e0; text-decoration: none; }
.adm-page-current {
    background-color: #2a3a4a;
    border-color: #4a7fa0;
    color: #64b5f6;
    cursor: default;
}
.adm-page-gap { color: #555; padding: 0 4px; font-size: 0.9em; }

/* Admin AJAX site search dropdown (project form) */
.adm-form-group textarea {
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 8px 10px;
    font-size: 0.9em;
    font-family: inherit;
}
.adm-form-group textarea:focus { outline: none; border-color: #64b5f6; }

.adm-site-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 4px 4px;
    min-width: 300px;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}
.adm-site-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9em;
    border-bottom: 1px solid #2a2a2a;
    color: #ccc;
}
.adm-site-dropdown-item:last-child { border-bottom: none; }
.adm-site-dropdown-item:hover { background-color: #2a3a4a; }
.adm-site-dropdown-empty { color: #666; cursor: default; font-style: italic; }
.adm-site-dropdown-empty:hover { background-color: transparent; }

/* Inline project status select (admin/projects.php table) */
.adm-proj-status-select {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #888;
    padding: 4px 8px;
    font-size: 0.83em;
    font-weight: 500;
    cursor: pointer;
    min-width: 100px;
    transition: border-color 0.2s;
}
.adm-proj-status-select:focus { outline: none; }
