/* ==========================================================================
   Admin CSS — Platform admin pages
   Extracted from inline styles in EJS templates
   ========================================================================== */

/* ==========================================================================
   Organization Detail Page (admin-organization.ejs)
   ========================================================================== */

.org-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.org-header-left {
    flex: 1;
}

.org-header-left h1 {
    color: #2d5f3f;
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.org-description {
    color: #555;
    margin: 0;
    line-height: 1.5;
    font-size: 0.95rem;
    max-width: 600px;
}

.org-description.empty {
    font-style: italic;
    color: #999;
}

.org-header-right {
    text-align: right;
    flex-shrink: 0;
    margin-left: 2rem;
}

.org-header-right-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.org-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.org-status-badge.active {
    background: #e8f5e9;
    color: #28a745;
}

.org-status-badge.inactive {
    background: #fff3e0;
    color: #f57c00;
}

.org-status-badge.archived {
    background: #f8f9fa;
    color: #888888;
}

.edit-org-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-org-btn:hover {
    background: #e8f5e9;
    color: #2d5f3f;
}

.org-updated-date {
    color: #666;
    font-size: 0.85rem;
    display: block;
}

.org-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.org-owners-section {
    flex: 1;
}

.org-owners-section h4 {
    color: #2d5f3f;
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.owners-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.owners-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    color: #333;
    font-size: 0.95rem;
}

.owner-icon {
    color: #2d5f3f;
    font-size: 1rem;
}

.org-seats-section {
    text-align: right;
    flex-shrink: 0;
    margin-left: 2rem;
}

.org-seats-section h4 {
    color: #2d5f3f;
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.seats-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d5f3f;
}

.seats-display .seats-label {
    font-size: 0.85rem;
    font-weight: 400;
    color: #666;
    margin-left: 0.25rem;
}

.org-services-section h4 {
    color: #2d5f3f;
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.services-single-line {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.service-item-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.service-badge-square {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.service-badge-square.enabled {
    background: #2d5f3f;
    color: white;
}

.service-badge-square.disabled {
    background: white;
    border: 1px solid #2d5f3f;
    color: #2d5f3f;
}

.service-name-enabled {
    color: #333;
    font-weight: 400;
}

.service-name-disabled {
    color: #999;
    font-weight: 400;
}

.org-actions-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e0e0;
}

.org-actions-section .cta-button,
.org-actions-section a.cta-button:link,
.org-actions-section a.cta-button:visited,
.org-actions-section a.cta-button:hover,
.org-actions-section a.cta-button:active {
    display: inline-block;
    text-decoration: none;
    color: white !important;
}

.org-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
}

.org-loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.org-error {
    text-align: center;
    padding: 2rem;
}

.org-error p {
    color: #721c24;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .org-page-header {
        flex-direction: column;
    }

    .org-header-right {
        text-align: left;
        margin-left: 0;
        margin-top: 1rem;
    }

    .org-info-row {
        flex-direction: column;
    }

    .org-seats-section {
        text-align: left;
        margin-left: 0;
        margin-top: 1rem;
    }

    .services-compact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Organizations List Page (admin-organizations.ejs)
   ========================================================================== */

.organizations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.org-summary-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    margin-top: 1.5rem;
    overflow: hidden;
}

.org-summary-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.org-summary-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.show-all-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.show-all-toggle input {
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.org-table {
    width: 100%;
    border-collapse: collapse;
}

.org-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.org-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.org-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.org-table tbody tr {
    transition: background-color 0.15s ease;
}

.org-table tbody tr:hover {
    background: #f8f9fa;
}

.org-table tbody tr:last-child td {
    border-bottom: none;
}

.org-name-cell {
    font-weight: 600;
    color: #2d5f3f;
    max-width: 200px;
    position: relative;
    cursor: default;
}

.org-name-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: #333;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    max-width: 300px;
    white-space: normal;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: none;
}

.org-name-cell:hover .org-name-tooltip {
    display: block;
}

.org-partner-cell {
    color: #555;
    font-size: 0.9rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.org-status {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.org-status.active {
    background: #e8f5e9;
    color: #28a745;
}

.org-status.inactive {
    background: #fff3e0;
    color: #f57c00;
}

.org-status.archived {
    background: #f8f9fa;
    color: #888888;
}

.org-stats-cell {
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
}

.org-actions-cell {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}

.action-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    color: #666;
    transition: all 0.2s ease;
}

.action-icon:hover {
    background: rgba(45, 95, 63, 0.1);
    color: #2d5f3f;
    transform: translateY(-1px);
}

.action-icon.archive-icon.archived {
    color: #2d5f3f;
    background: rgba(45, 95, 63, 0.1);
}

.action-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-icon:disabled:hover {
    background: none;
    transform: none;
}

.org-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.org-stat {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
}

.org-stat-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.org-stat-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2d5f3f;
}

.org-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.org-actions .btn {
    flex: 1;
    min-width: fit-content;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

/* #orgModal, #membersModal overlay handled by base .modal class in style.css */

#orgModal .modal-header,
#membersModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

#orgModal .modal-header h2,
#membersModal .modal-header h2 {
    margin: 0;
    color: #2d5f3f;
    font-size: 1.25rem;
    font-weight: 600;
}

#orgModal .modal-close,
#membersModal .modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#orgModal .modal-close:hover,
#membersModal .modal-close:hover {
    background: rgba(45, 95, 63, 0.1);
    color: #2d5f3f;
}

#orgModal .modal-body,
#membersModal .modal-body {
    padding: 2rem 2.5rem;
    flex: 1;
    overflow-y: auto;
}

.form-group label {
    display: block;
    margin-bottom: 0.65rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.service-checkbox {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.service-checkbox:hover {
    background: #e8f5e9;
    border-color: #2d5f3f;
}

.service-checkbox input {
    margin-right: 1rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.service-checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.members-list {
    max-height: 400px;
    overflow-y: auto;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.member-info h4 {
    margin: 0 0 0.25rem 0;
    color: #2d5f3f;
}

.member-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.member-roles {
    display: flex;
    gap: 0.5rem;
}

.role-badge {
    padding: 0.25rem 0.75rem;
    background: #2d5f3f;
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-badge.owner {
    background: #2d5f3f;
}

.members-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.members-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.members-section-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.members-section-header .seat-info {
    font-size: 0.85rem;
    color: #666;
}

.modal-members-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.modal-members-table thead {
    background: #f8f9fa;
}

.modal-members-table th {
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    border-bottom: 1px solid #e0e0e0;
}

.modal-members-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.modal-members-table tbody tr:last-child td {
    border-bottom: none;
}

.modal-members-table .member-name {
    font-weight: 500;
    color: #333;
}

.modal-members-table .member-email {
    color: #666;
    font-size: 0.85rem;
}

.modal-members-table .roles-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.modal-members-table .role-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
}

.modal-members-table .owner-checkbox-cell {
    text-align: center;
}

.modal-members-table .owner-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.members-scroll-container {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-state p {
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .org-table {
        font-size: 0.85rem;
    }

    .org-table th,
    .org-table td {
        padding: 0.65rem 0.5rem;
    }

    .org-name-cell {
        max-width: 150px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Members Page (admin-members.ejs)
   ========================================================================== */

.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: default;
}

.role-badge.assigned {
    background: #2d5f3f;
    color: white;
}

.role-badge.unassigned {
    background: white;
    color: #2d5f3f;
    border: 1px solid #2d5f3f;
    text-transform: uppercase;
}

.service-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: default;
}

.service-badge.assigned {
    background: #2d5f3f;
    color: white;
}

.service-badge.unassigned {
    background: white;
    color: #2d5f3f;
    border: 1px solid #2d5f3f;
}

.action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.action-icon-btn.action-icon-archive:hover {
    background: #fff3e0;
    color: #f57c00;
}

.action-icon-btn.action-icon-unarchive:hover {
    background: #e8f5e9;
    color: #2d5f3f;
}

.action-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-icon-btn:disabled:hover {
    background: transparent;
    color: #666;
}


/* ==========================================================================
   Partners Page (admin-partners.ejs)
   ========================================================================== */

.partners-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.partner-summary-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    margin-top: 1.5rem;
    overflow: hidden;
}

.partner-summary-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.partner-summary-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.partner-table {
    width: 100%;
    border-collapse: collapse;
}

.partner-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.partner-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.partner-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.partner-table tbody tr {
    transition: background-color 0.15s ease;
}

.partner-table tbody tr:hover {
    background: #f8f9fa;
}

.partner-table tbody tr:last-child td {
    border-bottom: none;
}

.partner-name-cell {
    font-weight: 600;
    color: #2d5f3f;
    max-width: 250px;
}

.partner-location-cell {
    color: #666;
    font-size: 0.9rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.partner-phone-cell {
    color: #333;
    font-size: 0.9rem;
}

.partner-status {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.partner-status.active {
    background: #e8f5e9;
    color: #28a745;
}

.partner-status.archived {
    background: #f8f9fa;
    color: #888888;
}

.partner-stats-cell {
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
}

.partner-actions-cell {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.form-row-4 {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .partner-table {
        font-size: 0.85rem;
    }

    .partner-table th,
    .partner-table td {
        padding: 0.65rem 0.5rem;
    }

    .partner-location-cell {
        max-width: 120px;
    }

    .partner-name-cell {
        max-width: 150px;
    }

    .form-row,
    .form-row-3,
    .form-row-4 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Changelog Page (admin-changelog.ejs)
   ========================================================================== */

.changelog-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

#updateNowBtn {
    background: #e8a030;
}

#updateNowBtn:hover {
    background: #e8a030;
}

#updateNowBtn.has-updates {
    background: #e8a030;
}

#updateNowBtn.has-updates:hover {
    background: #e8a030;
}

#updateNowBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.changelog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-top: 0.5rem;
}

.changelog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.changelog-table th {
    background-color: #2d5f3f;
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.changelog-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.changelog-table tr:hover {
    background-color: #f8fdf9;
}

.changelog-table .col-date {
    width: 110px;
    white-space: nowrap;
}

.changelog-table .col-summary {
    width: 35%;
}

.changelog-table .col-modules {
    width: 25%;
}

.changelog-table .col-comment {
    width: 25%;
}

.changelog-table .col-actions {
    width: 90px;
    white-space: nowrap;
    text-align: center;
}

.action-btn.edit-action {
    color: #2d5f3f;
}

.action-btn.delete-action {
    color: #c82333;
}

.comment-cell {
    color: #555;
    font-style: italic;
}

.comment-cell.no-comment {
    color: #999;
    font-style: italic;
}

.modules-cell {
    font-size: 0.8rem;
    color: #555;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal-content h2 {
    margin: 0 0 1.5rem 0;
    color: #2d5f3f;
    font-size: 1.25rem;
}

.modal-content .form-group {
    margin-bottom: 1.25rem;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.modal-content .form-group input,
.modal-content .form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}

.modal-content .form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.modal-content .form-group input:focus,
.modal-content .form-group textarea:focus {
    outline: none;
    border-color: #2d5f3f;
    box-shadow: 0 0 0 2px rgba(45,95,63,0.15);
}

.modal-actions .btn {
    padding: 0 1.5rem;
    height: 38px;
    min-width: 100px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-actions .btn-cancel {
    background-color: #e0e0e0;
    color: #333;
}

.modal-actions .btn-cancel:hover {
    background-color: #dddddd;
}

.modal-actions .btn-save {
    background-color: #2d5f3f;
    color: white;
}

.modal-actions .btn-save:hover {
    background-color: #1e4029;
}

.message-container {
    display: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    position: relative;
}

.message-container.success {
    background-color: #d4edda;
    color: #2d5f3f;
    border: 1px solid #c3e6cb;
}

.message-container.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.25rem;
    color: inherit;
    background: none;
    border: none;
}

.delete-confirm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    justify-content: center;
    align-items: center;
}

.delete-confirm-overlay.active {
    display: flex;
}

.delete-confirm-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.delete-confirm-content p {
    margin: 0 0 1.5rem 0;
    color: #333;
}

.update-modal-content {
    max-width: 850px;
}

.update-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.update-preview-table th {
    background-color: #f0f0f0;
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.update-preview-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.update-preview-table tr:hover {
    background-color: #f8f9fa;
}

.update-preview-table .preview-checkbox {
    width: 30px;
    text-align: center;
}

.update-count {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1rem;
}

.select-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.select-controls a {
    font-size: 0.8rem;
    color: #2d5f3f;
    cursor: pointer;
    text-decoration: underline;
}

.no-updates {
    text-align: center;
    padding: 2rem;
    color: #888;
}

@media (max-width: 768px) {
    .changelog-table th,
    .changelog-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .changelog-table .col-modules {
        display: none;
    }

    .changelog-table th:nth-child(3) {
        display: none;
    }
}

/* ==========================================================================
   App Settings Page (admin-app-settings.ejs)
   ========================================================================== */

.toggle-switch input:checked + .toggle-slider {
    background-color: #e8a030 !important;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* ==========================================================================
   Assets Page (admin-assets.ejs)
   ========================================================================== */

.assets-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

.asset-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
}

.asset-preview {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    overflow: hidden;
}

.asset-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.asset-details {
    flex: 1;
}

.asset-filename {
    font-size: 1rem;
    color: #2d5f3f;
    margin-bottom: 8px;
}

.asset-classes {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 4px;
}

.asset-path {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

.asset-usage {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

.asset-note {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

.asset-color {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

@media (max-width: 768px) {
    .asset-item {
        flex-direction: column;
        text-align: center;
    }

    .asset-preview {
        width: 100px;
        height: 70px;
    }
}

/* ==========================================================================
   Content Management Shared Styles (admin-docs.ejs, admin-headers.ejs)
   ========================================================================== */

.legend-filter {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.2s;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.legend-filter:first-child { margin-left: 0; }

.legend-filter:hover {
    background: #f0f0f0;
}

.legend-filter.active {
    background: #e8f5e9;
    border-color: #2d5f3f;
    font-weight: 600;
    color: #333;
}

.idx-dot { font-size: 0.7rem; line-height: 1; }
.dot-green-solid { color: #2d5f3f; }
.dot-green-outline { color: #2d5f3f; opacity: 0.5; }
.dot-red-outline { color: #dc3545; opacity: 0.7; }
.dot-red-solid { color: #dc3545; }

.img-toolbar-popup {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    padding: 10px 12px;
    z-index: 1000;
    width: 340px;
    font-size: 0.8rem;
}

.img-toolbar-popup .itp-section {
    margin-bottom: 8px;
}

.img-toolbar-popup .itp-section:last-child {
    margin-bottom: 0;
}

.img-toolbar-popup .itp-label {
    font-weight: 600;
    color: #555;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.img-toolbar-popup .itp-row {
    display: flex;
    gap: 3px;
    align-items: center;
    flex-wrap: wrap;
}

.img-toolbar-popup button {
    border: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    padding: 3px 10px;
    font-size: 0.75rem;
    color: #333;
    min-width: 0;
    line-height: 1.4;
}

.img-toolbar-popup button:hover {
    background: #e9ecef;
}

.img-toolbar-popup button.itp-active {
    background: #2d5f3f;
    color: #fff;
    border-color: #2d5f3f;
}

.img-toolbar-popup .itp-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.img-toolbar-popup .itp-input-group label {
    font-size: 0.75rem;
    color: #666;
    min-width: 38px;
}

.img-toolbar-popup input[type="number"] {
    width: 52px;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 0.75rem;
    text-align: center;
}

.img-toolbar-popup .itp-unit {
    font-size: 0.7rem;
    color: #999;
}

/* ==========================================================================
   Documentation Page (admin-docs.ejs)
   ========================================================================== */

.docs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.docs-index {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.docs-index h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #2d5f3f;
    font-weight: 600;
}

.docs-index-legend {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.docs-index-links a.grayed {
    opacity: 0.25;
    pointer-events: none;
}

.doc-card.grayed {
    opacity: 0.2;
    pointer-events: none;
}

.docs-index-section {
    margin-bottom: 0.5rem;
}

.docs-index-section-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.docs-index-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-bottom: 0.5rem;
}

.docs-index-links a {
    font-size: 0.85rem;
    color: #2d5f3f;
    text-decoration: none;
    padding: 2px 0;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.docs-index-links a:hover {
    text-decoration: underline;
}

.docs-tab-section {
    margin-bottom: 2rem;
}

.docs-tab-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d5f3f;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2d5f3f;
    margin-bottom: 1rem;
}

.doc-card {
    scroll-margin-top: 80px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.doc-card-header {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.doc-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.doc-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: #888;
}

.doc-card-meta a {
    color: #2d5f3f;
    text-decoration: none;
}

.doc-card-meta a:hover {
    text-decoration: underline;
}

.doc-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.doc-status-badge.draft {
    background: #fff3cd;
    color: #856404;
}

.doc-status-badge.published {
    background: #d4edda;
    color: #2d5f3f;
}

.doc-card-body {
    padding: 1rem;
}

.doc-card-body .doc-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
}

.doc-content h1 { font-size: 1.25rem; color: #2d5f3f; margin: 0.5rem 0; }
.doc-content h2 { font-size: 1.1rem; color: #333; margin: 0.75rem 0 0.25rem; }
.doc-content h3 { font-size: 1rem; color: #333; margin: 0.5rem 0 0.25rem; }
.doc-content ul, .doc-content ol { padding-left: 1.5rem; margin: 0.25rem 0; }
.doc-content li { margin-bottom: 0.2rem; }
.doc-content p { margin: 0.4rem 0; }
.doc-content img { max-width: 100%; height: auto; border-radius: 4px; margin: 0.5rem 0; }

.doc-card-actions {
    padding: 0.5rem 1rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-doc {
    border: none;
    padding: 0 1.5rem;
    height: 34px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-doc-edit {
    background: #2d5f3f;
    color: white;
}

.btn-doc-edit:hover {
    background: #2d5f3f;
}

.btn-doc-save {
    background: #2d5f3f;
    color: white;
}

.btn-doc-save:hover {
    background: #2d5f3f;
}

.btn-doc-cancel {
    background: #6c757d;
    color: white;
}

.btn-doc-cancel:hover {
    background: #5a6268;
}

.btn-doc-publish {
    background: #28a745;
    color: white;
}

.btn-doc-publish:hover {
    background: #28a745;
}

.btn-doc-unpublish {
    background: #ffc107;
    color: #333;
}

.btn-doc-unpublish:hover {
    background: #ffc107;
}

.doc-feedback-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    font-size: 0.8rem;
    color: #666;
}

.doc-feedback-bar .fb-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.doc-feedback-bar .fb-positive { color: #28a745; }
.doc-feedback-bar .fb-negative { color: #dc3545; }

.fb-comments-waiting {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.doc-feedback-toggle {
    background: none;
    border: none;
    color: #2d5f3f;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
    padding: 0;
}

.doc-feedback-comments {
    display: none;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.8rem;
}

.doc-feedback-comments .fb-comment {
    padding: 0.4rem 0;
    border-bottom: 1px solid #e9ecef;
    color: #555;
}

.doc-feedback-comments .fb-comment:last-child { border-bottom: none; }

.doc-feedback-comments .fb-comment-user {
    font-weight: 600;
    color: #333;
    margin-right: 0.5rem;
}

.doc-feedback-comments .fb-comment-date {
    color: #999;
    font-size: 0.75rem;
}

.quill-editor-container {
    display: none;
}

.quill-editor-container .ql-container {
    min-height: 200px;
    font-size: 0.9rem;
}

.quill-editor-container .ql-editor {
    min-height: 200px;
}

.quill-editor-container .ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.doc-empty-state {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-size: 0.9rem;
}

.doc-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.doc-alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.doc-alert-success {
    background: #d4edda;
    color: #2d5f3f;
    border: 1px solid #c3e6cb;
}

.doc-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.docs-toggle-section {
    cursor: pointer;
    user-select: none;
}

.docs-toggle-section:hover {
    opacity: 0.85;
}

.docs-section-arrow {
    display: inline-block;
    transition: transform 0.2s;
    margin-right: 0.3rem;
    font-size: 0.8rem;
}

.docs-section-arrow.collapsed {
    transform: rotate(-90deg);
}

/* ==========================================================================
   Page Headers Page (admin-headers.ejs)
   ========================================================================== */

.headers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.headers-index {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.headers-index h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #2d5f3f;
    font-weight: 600;
}

.headers-index-legend {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.headers-index-section {
    margin-bottom: 0.5rem;
}

.headers-index-section-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.headers-index-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-bottom: 0.5rem;
}

.headers-index-links a {
    font-size: 0.85rem;
    color: #2d5f3f;
    text-decoration: none;
    padding: 2px 0;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.headers-index-links a:hover {
    text-decoration: underline;
}

.headers-tab-section {
    margin-bottom: 2rem;
}

.headers-tab-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d5f3f;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2d5f3f;
    margin-bottom: 1rem;
}

.header-card {
    scroll-margin-top: 80px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.header-card-header {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.header-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.header-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: #888;
}

.header-card-meta a {
    color: #2d5f3f;
    text-decoration: none;
}

.header-card-meta a:hover {
    text-decoration: underline;
}

.header-card-body {
    padding: 1rem;
}

.header-card-body .header-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
}

.header-content h1 { font-size: 1.25rem; color: #2d5f3f; margin: 0.5rem 0; }
.header-content h2 { font-size: 1.1rem; color: #333; margin: 0.75rem 0 0.25rem; }
.header-content h3 { font-size: 1rem; color: #333; margin: 0.5rem 0 0.25rem; }
.header-content ul, .header-content ol { padding-left: 1.5rem; margin: 0.25rem 0; }
.header-content li { margin-bottom: 0.2rem; }
.header-content p { margin: 0.4rem 0; }
.header-content img { max-width: 100%; height: auto; border-radius: 4px; margin: 0.5rem 0; }

.header-card-actions {
    padding: 0.5rem 1rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-header {
    border: none;
    padding: 0 1.5rem;
    height: 34px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-header-edit {
    background: #2d5f3f;
    color: white;
}

.btn-header-edit:hover {
    background: #2d5f3f;
}

.btn-header-save {
    background: #2d5f3f;
    color: white;
}

.btn-header-save:hover {
    background: #2d5f3f;
}

.btn-header-cancel {
    background: #6c757d;
    color: white;
}

.btn-header-cancel:hover {
    background: #5a6268;
}

.header-card-body .quill-editor-container .ql-container {
    min-height: 150px;
}

.header-card-body .quill-editor-container .ql-editor {
    min-height: 150px;
}

.header-card-body .quill-editor-container .ql-editor h1,
.header-card-body .quill-editor-container .ql-editor h2 {
    color: #2d5f3f;
    margin: 0 0 0.5rem 0;
}

.header-card-body .quill-editor-container .ql-editor h3 {
    color: #2d5f3f;
    margin: 0.75rem 0 0.5rem 0;
}

.header-card-body .quill-editor-container .ql-editor p {
    margin: 0.25rem 0;
    line-height: 1.7;
}

.header-empty-state {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-size: 0.9rem;
}

.header-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.header-alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.header-alert-success {
    background: #d4edda;
    color: #2d5f3f;
    border: 1px solid #c3e6cb;
}

.header-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.headers-toggle-section {
    cursor: pointer;
    user-select: none;
}

.headers-toggle-section:hover {
    opacity: 0.85;
}

.headers-section-arrow {
    display: inline-block;
    transition: transform 0.2s;
    margin-right: 0.3rem;
    font-size: 0.8rem;
}

.headers-section-arrow.collapsed {
    transform: rotate(-90deg);
}

.header-preview-hint {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
    font-style: italic;
}

/* ==========================================================================
   My Settings Page (admin-my-settings.ejs)
   ========================================================================== */

.verification-status {
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 8px;
}

.verification-status.verified {
    color: #2d5f3f;
}

.verification-status.unverified {
    color: #dc3545;
}

.verification-alert {
    margin-top: 12px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px;
    font-size: 0.9rem;
}

.alert-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.resend-link {
    background: none;
    border: none;
    color: #2d5f3f;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}

.resend-link:hover {
    color: #1e4029;
}

.resend-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s;
}

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

.settings-modal-overlay {
    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;
    z-index: 1000;
}

.settings-modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: settingsModalAppear 0.3s ease-out;
}

@keyframes settingsModalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.settings-modal-header {
    padding: 20px 24px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.settings-modal-body {
    padding: 0 24px;
    text-align: center;
}

.success-icon {
    margin-bottom: 16px;
}

.settings-modal-body p {
    margin: 8px 0;
    color: #555555;
}

.modal-subtext {
    font-size: 0.9rem;
    color: #6c757d;
}

.settings-modal-footer {
    padding: 20px 24px 24px 24px;
    text-align: center;
}

.modal-btn {
    background-color: #2d5f3f;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.2s;
}

.modal-btn:hover {
    background-color: #1e4029;
}

.owner-subscriber-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
}

.owner-subscriber-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2d5f3f;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.member-edit-section {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
}

.member-edit-section-heading {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d5f3f;
    margin-bottom: 0.75rem;
}

.member-edit-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.member-edit-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    margin: 0;
    padding: 0.25rem 0;
}

.member-edit-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2d5f3f;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.member-edit-owner-label {
    font-weight: 600;
}

.member-edit-owner-warning {
    color: #f57c00;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .verification-alert {
        font-size: 0.8rem;
        padding: 10px;
    }

    .alert-content {
        gap: 6px;
    }
}

/* ==========================================================================
   App Settings Page (admin-app-settings.ejs)
   ========================================================================== */

.settings-description {
    padding: 0;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#siteModeLabel {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 90px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2d5f3f;
    border-radius: 26px;
    transition: 0.3s;
}

.settings-section-header {
    margin: 1.5rem 0 1rem 0;
    color: #2d5f3f;
    font-weight: bold;
}

.settings-consent-textarea {
    width: 100%;
    min-height: 80px;
    margin-top: 0.5rem;
}


/* ==========================================================================
   Styles moved from style.css — Admin-specific sections
   ========================================================================== */

.admin-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-nav li {
    margin: 0;
}

.admin-nav a {
    display: block;
    padding: 1rem 2rem;
    color: #555555;
    text-decoration: none;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.admin-nav a:hover {
    background: #e9ecef;
    color: #2d5f3f;
}

.admin-nav a.active {
    background: #2d5f3f !important;
    color: white !important;
    border-left: 4px solid #1e4029 !important;
}

.admin-nav a.active:visited,
.admin-nav a.active:link,
.admin-nav a.active:hover,
.admin-nav a.active:focus {
    color: white !important;
}

/* Stronger override for active admin nav items */
.admin-nav li a.active {
    background: #2d5f3f !important;
    color: #ffffff !important;
    border-left: 4px solid #1e4029 !important;
}

.admin-nav li a.active:visited,
.admin-nav li a.active:link,
.admin-nav li a.active:hover,
.admin-nav li a.active:focus {
    color: #ffffff !important;
    background: #2d5f3f !important;
}


/* User Management Styles */
.users-card, .add-user-card, .stats-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    margin-bottom: 2rem;
}

.user-list {
    margin-top: 1rem;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f8f9fa;
}

.user-info h4 {
    margin: 0 0 0.5rem 0;
    color: #2d5f3f;
    font-size: 0.95rem;
}

.user-info p {
    margin: 0.25rem 0;
    font-size: 0.75rem;
    color: #666;
}

.user-actions button {
    background: #2d5f3f;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.user-actions button:hover:not(:disabled) {
    background: #1e4029;
    transform: translateY(-1px);
}

.user-actions button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stat-item h4 {
    margin: 0 0 0.5rem 0;
    color: #555555;
    font-size: 0.9rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d5f3f;
    margin: 0;
}


/* Data Management Styles */
.data-section {
    margin-bottom: 3rem;
}

/* Results section alignment */
#resultsSection {
    margin-top: 0;
    margin-bottom: 2rem;
    order: -1; /* Ensure it appears first in flex layout */
}

#resultsSection .results-card {
    margin-top: 0;
    margin-bottom: 2rem;
    padding: 2rem 2.5rem;
}

#resultsSection .results-card h3 {
    margin-bottom: 0.5rem;
}


/* Results header with Add button */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h3 {
    margin: 0;
}

.results-header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.results-header-actions .checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    white-space: nowrap;
}

.results-header-actions .checkbox-group .form-label {
    margin: 0;
}

@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .results-header-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .results-header-actions .btn-primary {
        width: 100%;
        text-align: center;
    }
}

.upload-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.upload-card, .tables-card, .search-card, .results-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.upload-description {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 1rem;
    text-align: left;
}

.file-name {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #2d5f3f;
    font-weight: bold;
}

.upload-card h3, .tables-card h3, .search-card h3, .results-card h3 {
    color: #2d5f3f;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    text-align: left;
}

.file-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    text-align: left;
}

.file-input:focus {
    outline: none;
    border-color: #2d5f3f;
}

.table-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #2d5f3f;
}

.table-info h4 {
    color: #2d5f3f;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    text-align: left;
}

.table-meta {
    color: #666;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.table-columns {
    color: #555;
    font-size: 0.75rem;
}

.loading-text, .no-data-text, .error-text {
    text-align: left;
    color: #666;
    font-style: italic;
    padding: 2.5rem;
    font-size: 0.9rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.results-table th {
    background: #2d5f3f;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.results-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.results-table tr:nth-child(even) {
    background: #f8f9fa;
}

.results-table tr:hover {
    background: #e8f5e9;
}

/* Statistics Page Styles */
.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-card h3 {
    color: #2d5f3f;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: #2d5f3f;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.stat-description {
    color: #666;
    font-size: 0.75rem;
    margin: 0;
}

.activity-card, .database-status-card, .controls-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.activity-card h3, .database-status-card h3, .controls-card h3 {
    color: #2d5f3f;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

#userActivityContainer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 100%;
    overflow: hidden;
}

.activity-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    min-width: 0; /* Allow items to shrink below their content size */
}

.activity-metric h4 {
    color: #2d5f3f;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: #2d5f3f;
    margin-bottom: 0.25rem;
}

.activity-metric p {
    color: #666;
    font-size: 0.75rem;
    margin: 0;
}

#databaseStatusContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.status-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-item h4 {
    color: #2d5f3f;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    word-break: break-word;
}

.controls-container {
    text-align: center;
}

.control-description {
    color: #666;
    font-size: 0.75rem;
    margin-top: 1rem;
}

/* Mobile responsive adjustments for statistics */
@media (max-width: 768px) {
    .statistics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .activity-card, .database-status-card, .controls-card {
        padding: 1.5rem;
    }
    
    #userActivityContainer, #databaseStatusContainer {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .activity-card, .database-status-card, .controls-card {
        padding: 1rem;
    }
}

/* Users list styles - matching About Me card design */
.users-list {
    margin-top: 1rem;
}

.user-name-display {
    color: #2d5f3f;
    font-weight: 600;
}

.role-selection {
    display: flex;
    align-items: center;
}

/* Role Dropdown Styles */
/* Custom Role Dropdown Styles */
.role-selection {
    position: relative;
    display: inline-block;
}

.role-dropdown-container {
    position: relative;
    width: 140px;
}

.role-dropdown-button {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.role-dropdown-button:hover {
    border-color: #2d5f3f;
}

.role-dropdown-button.active {
    border-color: #2d5f3f;
    box-shadow: 0 0 0 2px rgba(45, 95, 63, 0.1);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.role-dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #666;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.role-dropdown-button.active .role-dropdown-arrow {
    transform: rotate(180deg);
}

.role-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #2d5f3f;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 8px rgba(45, 95, 63, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.role-dropdown-menu.show {
    display: block;
}

.role-dropdown-option {
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.role-dropdown-option:last-child {
    border-bottom: none;
}

.role-dropdown-option:hover {
    background-color: #f8f9fa;
}

.role-dropdown-option.selected {
    background-color: #e8f5e9;
    color: #2d5f3f;
    font-weight: 500;
}

/* Hide the original select dropdown */
.role-dropdown {
    display: none;
}

/* Favorite Items Styling */
.favorite-item {
    position: relative;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    overflow: hidden;
}

/* Removed hover effect to eliminate shading */

.favorite-content {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative; /* Enable absolute positioning for child elements */
    margin: 0; /* Remove any margin to extend full width */
    /* Remove right padding - let icons overlay the content area */
}

.favorite-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    padding-right: 3rem; /* Add padding to title to avoid overlapping with icons */
}

.favorite-date {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* Permalink icon removed from favorites cards */

/* Favorites page save icon container - updated for unified approach */
.favorite-item .card-actions-container {
    position: absolute;
    bottom: 0.75rem;
    right: 10px;
    z-index: 999998;
    display: flex;
    align-items: center;
    gap: 8px;
}


.save-icon-container .save-icon {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.25rem;
    border-radius: 4px;
}

.save-icon-container .save-icon:hover {
    transform: scale(1.1);
}

.save-icon-container .save-icon.saved svg {
    fill: #2d5f3f;
}

.save-icon-container .save-icon:not(.saved) svg {
    fill: none;
    stroke: #666;
    stroke-width: 2;
}

.save-icon-container .save-icon:not(.saved):hover svg {
    stroke: #2d5f3f;
}


/* Old tooltip styles - replaced with enhanced version below */


/* Users header with search */
.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.users-header h3 {
    margin: 0;
}

.search-users-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-users-btn {
    background: #2d5f3f;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-users-btn:hover {
    background: #1e4029;
    transform: translateY(-1px);
}

.search-users-input-container {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.search-users-input {
    width: 180px;
    padding: 0.4rem 0.6rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    transition: all 0.2s ease;
}

.search-users-input:focus {
    outline: none;
    border-color: #2d5f3f;
    box-shadow: 0 0 0 2px rgba(45, 95, 63, 0.1);
}

.clear-search-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: #5a6268;
}

/* Compact Pagination controls for users */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
    gap: 0.25rem;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.pagination-btn {
    background: white;
    color: #24292f;
    border: 1px solid #dddddd;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #2d5f3f;
    color: #2d5f3f;
}

.pagination-btn:disabled {
    background: #f8f9fa;
    color: #999999;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-info {
    color: #24292f;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 0.5rem;
    background: white;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    white-space: nowrap;
}

/* Mobile responsiveness for users list */
@media (max-width: 768px) {
    .role-dropdown {
        width: 120px;
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .user-name-display strong {
        font-size: 0.75rem;
    }
    
    .pagination-controls {
        gap: 0.15rem;
        padding: 0.4rem;
        flex-wrap: wrap;
    }
    
    .pagination-controls .page-info {
        margin-left: 0;
        margin-top: 0.25rem;
        font-size: 0.7rem;
        order: 10;
        flex-basis: 100%;
        text-align: center;
    }
    
    .users-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .search-users-container {
        align-self: flex-end;
    }
    
    .search-users-input {
        width: 140px;
    }

    .users-table th:not(:first-child) {
        width: 25%;
    }
    
    .user-name {
        font-size: 0.9rem;
    }
}

/* Content Analytics Styling */
.content-analytics-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e0e0e0;
}

.analytics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.analytics-row:last-child {
    margin-bottom: 0;
}

.analytics-item h4 {
    color: #2d5f3f;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.analytics-list {
    min-height: 120px;
}

.term-item, .category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.term-item:last-child, .category-item:last-child {
    border-bottom: none;
}

.term-name, .category-name {
    color: #333;
    font-weight: 500;
}

.term-count, .category-percent {
    color: #2d5f3f;
    font-weight: 600;
    font-size: 0.9rem;
}

.engagement-metrics, .search-patterns {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-item, .pattern-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.metric-label, .pattern-label {
    color: #666;
    font-size: 0.9rem;
}

.metric-value, .pattern-value {
    color: #2d5f3f;
    font-weight: 600;
    font-size: 1rem;
}

.no-data, .error-state {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.error-state {
    color: #721c24;
}


/* PROM Analytics Card Styling */
.prom-analytics-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.prom-analytics-card h3 {
    color: #2d5f3f;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

.prom-subcard {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.prom-subcard:last-child {
    margin-bottom: 0;
}

.prom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #ddd;
}

.prom-header h4 {
    color: #2d5f3f;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.prom-survey-count {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #ddd;
}

.prom-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.prom-questions-table {
    overflow-x: auto;
    margin-top: 1rem;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.9rem;
}

.analytics-table thead {
    background: #2d5f3f;
    color: white;
}

.analytics-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
}

.analytics-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.analytics-table tbody tr:last-child {
    border-bottom: none;
}

.analytics-table tbody tr:hover {
    background: #f8f9fa;
}

.analytics-table td {
    padding: 0.75rem;
    vertical-align: top;
}

.analytics-table .question-id {
    color: #666;
    font-weight: 500;
    width: 60px;
}

.analytics-table .question-text {
    color: #333;
    line-height: 1.4;
    max-width: 400px;
}

.analytics-table .question-type {
    color: #666;
    font-size: 0.85rem;
    white-space: nowrap;
}

.analytics-table .response-count {
    color: #2d5f3f;
    font-weight: 600;
    text-align: center;
    width: 80px;
}

.analytics-table .stat-mode,
.analytics-table .stat-mean,
.analytics-table .stat-median {
    text-align: center;
    color: #333;
    font-weight: 500;
    width: 80px;
}

.loading-message {
    color: #666;
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Login Chart, Search Chart, Users Chart, and Sessions Chart Styling */
.login-chart, .search-chart, .users-chart, .sessions-chart {
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.search-chart {
    margin: 0px;
}

.users-chart {
    margin: 0px;
}

.login-chart {
    margin: 0px;
}

.sessions-chart {
    margin: 0px;
}

.activity-metric h4 {
    margin-bottom: 1rem;
    margin-top: 0;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.chart-footer {
    margin: 0px;
    text-align: center;
    padding: 0.25rem;
}

.chart-title {
    font-size: 0.8rem;
    color: #666;
    font-weight: 400;
}

.chart-title .metric-value {
    color: #2d5f3f;
    font-weight: 500;
    font-size: 0.85rem;
}

.chart-container {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Line chart specific styling */
.line-chart {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-svg {
    width: 100%;
    height: 100px;
    max-width: 100%;
    box-sizing: border-box;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    height: 80px;
    width: 100%;
    padding: 0 0.5rem;
}

.bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.bar {
    background: linear-gradient(to top, #2d5f3f, #3d7f5f);
    width: 100%;
    max-width: 25px;
    border-radius: 2px 2px 0 0;
    position: relative;
    transition: opacity 0.2s ease;
    cursor: pointer;
    min-height: 2px;
}

.bar:hover {
    opacity: 0.8;
}

.bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: #2d5f3f;
    white-space: nowrap;
}

.bar-label {
    margin-top: 4px;
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

.chart-error {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Mobile optimization for Content Analytics and Charts */
@media (max-width: 768px) {
    .analytics-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .content-analytics-card {
        padding: 1rem;
    }
    
    .term-item, .category-item {
        padding: 0.25rem 0;
    }
    
    .metric-item, .pattern-item {
        padding: 0.375rem;
    }
    
    .login-chart, .search-chart, .users-chart {
        margin-bottom: 0.5rem;
        padding: 0.5rem;
    }
    
    .search-chart {
        margin: 0px;
    }

    .users-chart {
        margin: 0px;
    }
    
    .login-chart {
        margin: 0px;
    }
    
    .activity-metric h4 {
        margin-bottom: 0.75rem;
        font-size: 0.9rem;
    }
    
    .chart-footer {
        margin: 0px;
        padding: 0.2rem;
    }
    
    .chart-title {
        font-size: 0.75rem;
    }
    
    .chart-title .metric-value {
        font-size: 0.8rem;
    }
    
    .chart-bars {
        gap: 0.25rem;
        height: 60px;
        padding: 0 0.25rem;
    }
    
    .bar {
        max-width: 20px;
    }
    
    .bar-value {
        font-size: 9px;
        top: -16px;
    }
    
    .bar-label {
        font-size: 10px;
    }
}

/* Admin section content headings and text - no padding */
.admin-container .content-card h3,
.admin-container .card-content > p {
    padding: 0;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Templates Page Styling */
.templates-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.template-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.template-card:hover {
    border-color: #2d5f3f;
    box-shadow: 0 4px 8px rgba(45, 95, 63, 0.1);
}

.template-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
}

.template-header h3 {
    color: #2d5f3f;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.template-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.template-content {
    position: relative;
}

.template-content .form-group {
    margin-bottom: 1rem;
}

.template-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.template-content textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.template-content textarea:focus {
    outline: none;
    border-color: #2d5f3f;
    box-shadow: 0 0 0 2px rgba(45, 95, 63, 0.1);
}

.template-actions {
    margin-top: 1rem;
    text-align: right;
}

.template-actions .btn {
    background-color: #2d5f3f;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 120px;
}

.template-actions .btn:hover {
    background-color: #2d5f3f;
    transform: translateY(-1px);
}

.template-actions .btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.template-actions .btn-loading {
    display: none;
}

/* Alert styling for template page */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    max-width: 400px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease;
}

.alert-success {
    background-color: #d4edda;
    color: #2d5f3f;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile responsive adjustments for templates page */
@media (max-width: 768px) {
    .templates-grid {
        margin-top: 1rem;
    }
    
    .template-card {
        padding: 1rem;
    }
    
    .template-header h3 {
        font-size: 1.1rem;
    }
    
    .template-description {
        font-size: 0.85rem;
    }
    
    .template-content textarea {
        min-height: 100px;
        font-size: 0.85rem;
    }
    
    .alert {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        margin: 0;
    }
}

