/**
 * Projects Dashboard Styles
 * Extends admin-dashboard.css with project-specific styling
 */

/* Stats Section - Override admin-dashboard.css grid */
/* Stats Section - Override admin-dashboard.css grid */
.stats-section {
    display: block;
    margin-bottom: 1.5rem;
}

/* Stats Grid - 4 columns × 2 rows = 8 cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.stat-icon .material-icons {
    color: white;
    font-size: 1.25rem;
}

.stat-icon.demo {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.stat-icon.model {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-icon.active {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-icon.users {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-icon.layouts {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
}

.stat-icon.layouts-online {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-icon.tickets {
    background: linear-gradient(135deg, #c471ed 0%, #f64f59 100%);
}

.stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.2rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Owner Info Display */
.owner-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.owner-id-badge {
    font-size: 0.75rem;
    color: var(--admin-primary);
    font-weight: 600;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    display: inline-block;
    width: fit-content;
}

.owner-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.3;
}

.owner-email {
    font-size: 0.8rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    line-height: 1.3;
}

.owner-unknown-text {
    font-size: 0.7rem;
    color: var(--text-light);
    font-style: italic;
}

.owner-label {
    font-size: 0.6rem;
    color: var(--admin-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Shared section */
.shared-section {
    margin-top: 0.35rem;
}

.shared-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    background: rgba(156, 39, 176, 0.15);
    color: #9c27b0;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.shared-btn:hover {
    background: rgba(156, 39, 176, 0.25);
}

.shared-btn .material-icons {
    font-size: 0.8rem;
}

/* Shared detail dropdown */
.shared-detail {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(156, 39, 176, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(156, 39, 176, 0.2);
}

.shared-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.shared-item-name {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-dark);
}

.shared-item-email {
    font-size: 0.65rem;
    color: var(--text-light);
    flex: 1;
}

.shared-item-perm {
    font-size: 0.55rem;
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.shared-item-perm.edit {
    background: rgba(67, 233, 123, 0.15);
    color: #27ae60;
}

.shared-item-perm.view {
    background: rgba(142, 154, 171, 0.15);
    color: #8e9aab;
}

/* User Info Display (new structure) - compact */
.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.users-table {
    font-size: 0.875rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
    line-height: 1.3;
}

.user-email {
    font-size: 0.8rem;
    color: #1a1a2e !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
    line-height: 1.3;
}

.user-unknown-text {
    font-size: 0.65rem;
    color: #1a1a2e !important;
    font-style: italic;
}

/* Role badges - compact */
.role-badge {
    font-size: 0.5rem;
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
    width: fit-content;
    margin-bottom: 0.15rem;
}

.role-owner {
    background: rgba(102, 126, 234, 0.15);
    color: var(--admin-primary);
}

.role-shared {
    background: rgba(156, 39, 176, 0.15);
    color: #9c27b0;
}

/* Permission badges - compact */
.perm-badge {
    font-size: 0.45rem;
    padding: 0.05rem 0.2rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.15rem;
}

.perm-edit {
    background: rgba(67, 233, 123, 0.15);
    color: #27ae60;
}

.perm-view {
    background: rgba(142, 154, 171, 0.15);
    color: #8e9aab;
}

/* Shared count indicator - compact */
.shared-count {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.55rem;
    color: #9c27b0;
    background: rgba(156, 39, 176, 0.1);
    padding: 0.05rem 0.25rem;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 0.1rem;
    width: fit-content;
}

.shared-count .material-icons {
    font-size: 0.6rem;
}

/* Shared toggle button */
.shared-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: rgba(156, 39, 176, 0.1);
    border: 1px solid rgba(156, 39, 176, 0.2);
    border-radius: 12px;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 0.15rem;
}

.shared-toggle-btn:hover {
    background: rgba(156, 39, 176, 0.2);
    border-color: rgba(156, 39, 176, 0.4);
}

.shared-toggle-btn.expanded {
    background: rgba(156, 39, 176, 0.15);
}

.shared-toggle-btn .expand-shared-icon {
    font-size: 0.875rem !important;
    color: #9c27b0;
    transition: transform 0.2s ease;
}

.shared-toggle-btn .shared-count {
    margin-top: 0;
    background: none;
    padding: 0;
}

/* Shared row styling - subordinate to owner */
.shared-row {
    background: rgba(156, 39, 176, 0.03) !important;
    border-left: 3px solid #9c27b0 !important;
}

.shared-row:hover {
    background: rgba(156, 39, 176, 0.08) !important;
}

/* Shared rows - keep text readable but subtle styling */
.shared-row .project-id,
.shared-row .project-name,
.shared-row .type-badge,
.shared-row .layouts-cell,
.shared-row .status-badge,
.shared-row .date-cell {
    opacity: 1;
    color: var(--text-dark);
}

/* Keep user info prominent in shared rows */
.shared-row .user-cell {
    opacity: 1;
}

/* Indent shared row content */
.shared-row td:first-child {
    padding-left: 1.25rem !important;
}

/* Animation for showing/hiding shared rows */
.shared-child {
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User cell */
.user-cell {
    min-width: 160px;
}

/* Table row alignment fixes - compact */
/* Table row alignment fixes */
.users-table tbody tr.project-row {
    height: auto;
}

/* Keep badges colored but remove global text color forcing */
.users-table tbody td .type-badge.type-demo {
    color: #f5576c;
}

.users-table tbody td .type-badge.type-model {
    color: #4facfe;
}

.users-table tbody td .status-badge.status-active {
    color: #27ae60;
}

.users-table tbody td .status-badge.status-inactive {
    color: #e74c3c;
}

/* Keep project specific text readable */
.project-id {
    font-weight: 600;
    color: var(--text-dark);
}

.project-name {
    font-weight: 600;
    color: var(--text-dark);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Date cells */
.date-cell {
    white-space: nowrap;
}

.date-cell .date-main {
    display: block;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.date-cell .date-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
}

.project-id {
    white-space: nowrap;
    font-size: 0.85rem;
    color: #1a1a2e !important;
}

.project-name {
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 600;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1a1a2e !important;
}

.owner-cell {
    min-width: 150px;
}

.layouts-cell {
    min-width: 80px;
}

/* Date cells compact */
.date-cell {
    font-size: 0.85rem !important;
    color: #1a1a2e !important;
}

.date-cell .date-main {
    font-size: 0.85rem;
    color: #1a1a2e !important;
}

.date-cell .date-time {
    font-size: 0.75rem;
    color: #1a1a2e !important;
}

/* Layouts Column */
.layouts-cell {
    text-align: center;
}

.layout-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.layout-expand-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.layout-count {
    font-weight: 700;
    color: var(--admin-primary);
    font-size: 0.75rem;
}

.layout-count.empty {
    color: var(--text-light);
    font-weight: 400;
}

.online-indicator {
    font-size: 0.55rem;
    background: rgba(67, 233, 123, 0.2);
    color: #27ae60;
    padding: 0.1rem 0.3rem;
    border-radius: 8px;
    font-weight: 600;
}

.expand-icon {
    font-size: 0.875rem !important;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

/* Layouts Detail Row */
.layouts-detail-row {
    background: rgba(102, 126, 234, 0.03);
}

.layouts-detail-row td {
    padding: 0 !important;
}

.layouts-container {
    padding: 1rem 1.5rem;
    border-top: 1px dashed rgba(102, 126, 234, 0.2);
}

.layouts-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--admin-primary);
    margin-bottom: 1rem;
}

.layouts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
}

.layout-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 0.8125rem;
}

.layout-id {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.75rem;
}

.layout-name {
    font-weight: 500;
    color: var(--text-dark);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layout-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.layout-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.layout-status.online {
    background: rgba(67, 233, 123, 0.15);
    color: #27ae60;
}

.layout-status.online .status-dot {
    background: #27ae60;
}

.layout-status.offline {
    background: rgba(142, 154, 171, 0.15);
    color: var(--text-light);
}

.layout-status.offline .status-dot {
    background: var(--text-light);
}

.layout-dates {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.65rem;
    color: var(--text-light);
    text-align: right;
}

/* Additional button styles for project management */
.btn-danger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.btn-danger:active {
    transform: translateY(0);
}

/* Icon buttons in table - compact */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-light);
    color: var(--admin-primary);
}

.btn-icon.btn-danger:hover {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger-color);
}

/* Renders gallery button (parity with user dashboard accent) */
.btn-icon.btn-renders:hover {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.btn-icon .material-icons {
    font-size: 1.125rem;
}

/* Project id chip in the renders modal header */
.renders-modal-pid {
    font-weight: 400;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Project type badges - compact */
.type-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.type-demo {
    background: rgba(245, 87, 108, 0.15);
    color: #f5576c;
}

.type-model {
    background: rgba(79, 172, 254, 0.15);
    color: #4facfe;
}

/* Status badges - compact */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge .status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.status-active {
    background: rgba(67, 233, 123, 0.15);
    color: #27ae60;
}

.status-active .status-dot {
    background: #27ae60;
}

.status-inactive {
    background: rgba(142, 154, 171, 0.15);
    color: #8e9aab;
}

.status-inactive .status-dot {
    background: #8e9aab;
}

/* Project stats styling */
.project-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-item .stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Utilities for JS cleanup */
.btn-icon-small {
    width: 24px;
    height: 24px;
    padding: 2px;
    margin-left: auto;
}

.icon-small {
    font-size: 16px !important;
}

.display-none {
    display: none;
}

.stat-item .stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Owner link styling */
.owner-link {
    color: var(--admin-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-weight: 500;
}

.owner-link:hover {
    text-decoration: underline;
    color: var(--admin-secondary);
}

/* Date formatting */
.date-cell {
    font-size: 0.8125rem;
    color: var(--text-medium);
    white-space: nowrap;
    min-width: 100px;
}

.date-cell .date-main {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.3;
}

.date-cell .date-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.125rem;
    line-height: 1.3;
}

/* Inactive project row */
.inactive-project {
    opacity: 0.6;
    background: rgba(142, 154, 171, 0.05) !important;
}

/* Empty state improvements */
.empty-projects {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-projects .material-icons {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-projects h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-projects p {
    color: var(--text-light);
}

/* Loading state improvements */
.loading-projects {
    text-align: center;
    padding: 3rem 2rem;
}

.loading-projects .loading-spinner {
    margin: 0 auto 1rem;
}

/* Error state improvements */
.error-projects {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--danger-color);
}

.error-projects .material-icons {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Modal improvements */
.modal-body .project-info {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.modal-body .project-info strong {
    color: var(--text-dark);
    display: block;
    margin-bottom: 0.25rem;
}

.modal-body .project-info small {
    color: var(--text-light);
}

/* Responsive improvements */
/* Responsive Design - Inherit from admin-dashboard.css where possible */
@media (max-width: 768px) {
    /* Project specific overrides only */

    /* Table mobile - hide columns specific to projects */
    .users-table th:nth-child(3),
    .users-table td:nth-child(3),
    .users-table th:nth-child(4),
    .users-table td:nth-child(4),
    .users-table th:nth-child(7),
    .users-table td:nth-child(7),
    .users-table th:nth-child(8),
    .users-table td:nth-child(8) {
        display: none !important;
    }

    /* Shared row indent mobile */
    .shared-row td:first-child {
        padding-left: 0.75rem !important;
    }

    /* Layouts detail mobile */
    .layouts-list {
        grid-template-columns: 1fr !important;
    }
}

/* Tablet/iPad Optimization (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Hide Created column on tablet */
    .users-table th:nth-child(9),
    .users-table td:nth-child(9) {
        display: none;
    }
}

/* Custom scrollbar for table */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-medium);
}

/* Toast Notification Override - Project Specific Colors */
.toast.toast-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.toast.toast-error {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

/* Tooltips */
[title] {
    position: relative;
}

/* Desktop layout optimization - compact */
@media (min-width: 1025px) {
    .admin-main {
        padding: 1rem 1.5rem;
    }

    .stats-section {
        margin-bottom: 1rem;
    }

    .users-section {
        padding: 1rem;
    }

    .section-header {
        margin-bottom: 0.75rem;
    }

    .section-header h2 {
        font-size: 1.125rem;
    }

    .filters-bar {
        margin-bottom: 0.75rem;
        gap: 0.75rem;
    }
}

/* Large desktop */
@media (min-width: 1400px) {
    .admin-main {
        padding: 1rem 2rem;
    }
}

/* ============================================================
   NEW: Scadenza badges
   ============================================================ */
.scadenza-cell { white-space: nowrap; }

.scad-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.scad-expired  { background: rgba(244, 67, 54, 0.12); color: #e53935; }
.scad-warning  { background: rgba(255, 152, 0, 0.15); color: #e65100; }
.scad-ok       { background: rgba(67, 233, 123, 0.12); color: #2e7d32; }
.scad-none     { background: rgba(0,0,0,0.06); color: #9e9e9e; font-style: italic; }

.inactive-flag {
    display: inline-block;
    margin-left: 0.3rem;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(244,67,54,0.1);
    color: #c62828;
}

/* ============================================================
   NEW: Ticket badge
   ============================================================ */
.tickets-cell { text-align: center; min-width: 60px; }

.ticket-badge {
    display: inline-block;
    background: linear-gradient(135deg, #c471ed 0%, #f64f59 100%);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    min-width: 24px;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    text-align: center;
}

.ticket-zero {
    color: var(--text-light);
    font-size: 0.75rem;
}

/* ============================================================
   NEW: Project name cell with description subtitle
   ============================================================ */
.project-name-td { min-width: 160px; max-width: 220px; }

.project-name-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.project-desc-sub {
    font-size: 0.72rem;
    color: var(--text-light);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    cursor: default;
}

.desc-truncated {
    font-size: 0.8rem;
    color: var(--text-medium);
    cursor: default;
}

.desc-empty { color: var(--text-light); font-size: 0.8rem; }

/* ============================================================
   NEW: Layout item enhancements
   ============================================================ */
.layout-item {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.layout-color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.layout-flag {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.1rem 0.3rem;
    border-radius: 5px;
    letter-spacing: 0.3px;
}

.layout-flag.pub  { background: rgba(0, 174, 239, 0.12); color: #0077b6; }
.layout-flag.bin  { background: rgba(244, 67, 54, 0.12); color: #e53935; }
.layout-flag.str  { background: rgba(102,126,234,0.12); color: var(--admin-primary); }
.layout-flag.pno  { background: rgba(67,233,123,0.12); color: #2e7d32; }

.layout-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-left: auto;
    text-align: right;
}

.layout-owner, .layout-modby {
    font-size: 0.62rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.layout-desc {
    font-size: 0.68rem;
    color: var(--text-light);
    font-style: italic;
    cursor: default;
}

/* Layouts header meta */
.layouts-header-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 400;
    margin-left: 0.5rem;
}

/* ============================================================
   Responsive – tablet (stats 2 columns)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Print styles */
@media print {

    .header-actions-right,
    .filters-bar,
    .user-actions,
    .pagination,
    .main-header {
        display: none !important;
    }

    .users-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
    }
}