.admin-dashboard-content {
    background: var(--surface);
    border: 1px solid var(--border);
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
}

.admin-tabs::-webkit-scrollbar {
    height: 4px;
}

.admin-tabs::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
}

.admin-tab {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 10px 15px;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
    border-radius: 0;
    height: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (hover: hover) {
    .admin-tab:hover {
        color: var(--text);
        background: var(--surface-hover);
    }
}

.admin-tab.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    font-weight: bold;
}

.admin-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    animation: fadeInTab 0.3s ease;
    touch-action: pan-y;
}

.admin-tab-content.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

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

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding-bottom: 20px;
}

.task-card {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    min-height: 72px;
}

@media (hover: hover) {
    .task-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-color: var(--accent);
    }
}

.task-card.alert {
    border-color: rgba(231, 76, 60, 0.5);
    background: rgba(231, 76, 60, 0.05);
}

.task-card.success {
    border-color: rgba(46, 204, 113, 0.5);
    background: rgba(46, 204, 113, 0.05);
}

.task-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    flex-shrink: 0;
}

.task-card.alert .task-icon {
    color: var(--danger);
    background: rgba(231, 76, 60, 0.1);
}

.task-card.success .task-icon {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.task-info {
    flex: 1;
    min-width: 0;
}

.task-info h5 {
    margin: 0 0 5px 0;
    font-size: 15px;
    color: var(--text);
}

.task-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.task-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--text);
    flex-shrink: 0;
}

.task-card.alert .task-value {
    color: var(--danger);
}

.task-card.task-card-skeleton {
    pointer-events: none;
    cursor: default;
}

.task-skel-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
}

.task-card-skeleton .task-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.task-skel-title {
    height: 15px;
    border-radius: 4px;
}

.task-skel-desc {
    height: 13px;
    border-radius: 4px;
}

.task-skel-value {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .tasks-grid {
        grid-template-columns: 1fr;
    }
}

.recycle-skeleton-row,
.counters-skeleton-row {
    pointer-events: none;
    cursor: default;
}

.recycle-skel-label,
.counters-skel-label {
    display: none;
}

@media (max-width: 768px) {
    #adminRecycleTable tr.recycle-skeleton-row td::before,
    #adminCountersTable tr.counters-skeleton-row td::before {
        display: none !important;
        content: none !important;
    }

    .recycle-skel-label,
    .counters-skel-label {
        display: inline-block !important;
    }
}

#adminRecycleTable {
    table-layout: fixed;
    width: 100%;
}

#adminRecycleTable th:nth-child(1) {
    width: 70px;
}

#adminRecycleTable th:nth-child(2) {
    width: auto;
}

#adminRecycleTable th:nth-child(3) {
    width: 20%;
}

#adminRecycleTable th:nth-child(4) {
    width: 15%;
}

#adminRecycleTable th:nth-child(5) {
    width: 150px;
}

#adminRecycleTable th,
#adminRecycleTable td {
    text-align: center;
}

#adminRecycleTable td {
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    vertical-align: middle;
}

#adminRecycleCountBadge {
    white-space: nowrap;
    flex-shrink: 0;
    width: max-content;
}

.recycle-empty-container,
.admin-empty-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 30px 15px;
    box-sizing: border-box;
    margin: auto 0;
}

.recycle-empty-card,
.log-search-empty-card,
.admin-empty-card {
    max-width: 440px;
    width: 100%;
    padding: 36px 24px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px dashed var(--border);
    box-shadow: 0 6px 24px var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    font-family: inherit;
    font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

.recycle-empty-icon-wrap,
.admin-empty-icon-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--text-muted);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.recycle-empty-title,
.admin-empty-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px 0;
    letter-spacing: -0.2px;
}

.recycle-empty-desc,
.admin-empty-desc {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
    max-width: 360px;
}

.admin-tab-error-card {
    margin-top: -100px;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 20px !important;
    background: transparent;
}

.admin-tab-error-icon-wrap {
    color: var(--danger) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    margin-bottom: 12px !important;
    border-radius: 0 !important;
}

.admin-tab-error-icon-wrap svg {
    width: 38px;
    height: 38px;
}

.admin-tab-error-title {
    color: var(--danger) !important;
    margin: 0 !important;
}

.recycle-empty-icon-wrap svg,
.admin-empty-icon-wrap svg {
    width: 30px;
    height: 30px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.admin-logs-empty-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    min-height: 320px;
    padding: 32px 16px;
    box-sizing: border-box;
    margin: auto 0;
    text-align: center;
}

.log-search-empty-icon-wrap {
    position: relative;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.log-search-empty-icon-wrap > svg {
    fill: currentColor !important;
    stroke: none !important;
}

.log-search-empty-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    box-shadow: 0 2px 8px var(--shadow);
}

.log-search-empty-badge svg {
    width: 13px !important;
    height: 13px !important;
    stroke-width: 2.6 !important;
}

.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    box-sizing: border-box;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: right;
    box-sizing: border-box;
}

#adminUsersTable {
    table-layout: fixed;
    width: 100%;
}

#adminUsersTable th {
    text-align: center;
}

#adminUsersTable th:nth-child(1) {
    width: 18%;
}

#adminUsersTable th:nth-child(2) {
    width: 19%;
}

#adminUsersTable th:nth-child(3) {
    width: 10%;
}

#adminUsersTable th:nth-child(4) {
    width: 12%;
}

#adminUsersTable th:nth-child(5) {
    width: 16%;
}

#adminUsersTable th:nth-child(6) {
    width: 10%;
}

#adminUsersTable th:nth-child(7) {
    width: 15%;
}

#adminUsersTable td {
    text-align: center;
    vertical-align: middle;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.user-name-cell {
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    width: 100%;
    gap: 8px;
    box-sizing: border-box;
}

.user-avatar-wrap {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-wrap img,
.user-avatar-initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
}

.user-avatar-wrap img {
    object-fit: cover;
    display: block;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar-wrap:hover img {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.user-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    user-select: none;
    line-height: 1;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 2px 5px rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar-wrap:hover .user-avatar-initials {
    transform: translateY(-1px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.user-name-text {
    text-align: center;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.user-actions-wrapper {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.user-skeleton-row {
    pointer-events: none;
    cursor: default;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: var(--surface-hover);
    color: var(--text-muted);
    font-weight: 500;
}

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

@media (hover: hover) {
    .admin-table tr:hover {
        background: var(--surface-hover);
    }
}

#adminTabCounters {
    margin-top: -10px;
    height: 100%;
    overflow: hidden;
    min-height: 0;
}

#adminCountersBody {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#adminTabCounters .admin-table-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

#adminCountersTable {
    table-layout: fixed;
    width: 100%;
}

#adminCountersTable th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-hover);
    border-bottom: none;
    box-shadow: inset 0 -1px 0 var(--border);
    text-align: center;
}

#adminCountersTable th:nth-child(1) {
    width: 70px;
}

#adminCountersTable th:nth-child(2) {
    width: auto;
}

#adminCountersTable th:nth-child(3) {
    width: 18%;
}

#adminCountersTable th:nth-child(4) {
    width: 18%;
}

#adminCountersTable th:nth-child(5) {
    width: 18%;
}

#adminCountersTable td {
    text-align: center;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    vertical-align: middle;
}

.delete-btn {
    font-size: 11px;
    padding: 5px 10px;
    height: auto;
    border: none;
    border-radius: 4px;
    transition: 0.2s;
    color: var(--danger);
    background: rgba(231, 76, 60, 0.2);
    cursor: pointer;
    font-family: inherit;
    line-height: normal;
    box-sizing: border-box;
}

.delete-btn:hover {
    background: var(--fav);
    color: white;
}

.change-role-btn {
    font-size: 11px;
    padding: 5px 10px;
    height: auto;
    border: none;
    border-radius: 4px;
    transition: 0.2s;
    color: white;
    background: var(--surface);
}

.change-role-btn:hover {
    background: var(--surface-hover);
}

.mark-btn {
    font-size: 11px;
    padding: 5px 10px;
    height: auto;
    color: white;
    border: none;
    border-radius: 4px;
    margin-left: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    line-height: normal;
    box-sizing: border-box;
    transition: opacity 0.2s, background-color 0.2s, transform 0.1s ease;
}

.mark-btn:hover {
    opacity: 0.88;
}

.admin-log-viewer {
    flex: 1;
    color: var(--text);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow-y: auto;
    line-height: 1.5;
    direction: rtl;
    text-align: right;
    display: flex;
    flex-direction: column;
    padding: 5px;
}

[data-theme="dark"] .admin-log-viewer {
    background: #1e1e1e;
}

[data-theme="light"] .admin-log-viewer {
    background: #f8f9fa;
}

.admin-log-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 10px;
    border-radius: 5px;
    gap: 10px;
    word-break: break-word;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
    margin-bottom: 2px;
}

[data-theme="dark"] .admin-log-line:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .admin-log-line:nth-child(odd) {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .admin-log-line:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .admin-log-line:nth-child(odd) {
    background: rgba(0, 0, 0, 0.05);
}

.copy-log-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    height: auto;
}

@media (hover: hover) {
    .admin-log-line:hover .copy-log-btn {
        opacity: 1;
    }

    .copy-log-btn:hover {
        color: var(--accent);
        background: var(--surface-hover);
    }
}

.admin-log-viewer::-webkit-scrollbar-track {
    background: transparent;
}

.admin-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
    padding-bottom: 10px;
}

.admin-pagination .page-btn {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 13px;
    height: auto;
}

@media (hover: hover) {
    .admin-pagination .page-btn:hover:not(:disabled) {
        background: var(--surface-hover);
    }
}

.admin-pagination .page-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: bold;
}

.admin-pagination .page-btn:disabled,
.admin-pagination .page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--surface);
    color: var(--text-muted);
    border-color: var(--border);
}

.backup-item.latest {
    background: rgba(46, 204, 113, 0.05);
    border: 1px solid rgba(46, 204, 113, 0.2);
    padding: 10px;
    border-radius: 6px;
}

.backup-accordion {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 5px;
    background: var(--bg);
    overflow: hidden;
}

.backup-accordion-header {
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-hover);
    transition: 0.2s;
}

@media (hover: hover) {
    .backup-accordion-header:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}

.backup-accordion-header svg {
    transition: transform 0.3s;
}

.backup-accordion.open .backup-accordion-header svg {
    transform: rotate(180deg);
}

.backup-accordion.open .backup-accordion-header .accordion-header-text {
    display: none;
}

.backup-accordion.open .backup-accordion-header .accordion-header-open-text {
    display: block !important;
}

.backup-accordion-body {
    padding: 0 10px;
    max-height: 0;
    opacity: 0;
    transition: all 0.3s ease-out;
}

.backup-accordion.open .backup-accordion-body {
    padding: 10px;
    max-height: 1000px;
    opacity: 1;
    border-top: 1px solid var(--border);
}

.selection-top-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 2000;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.selection-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 2000;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
}

.image-container.selected-for-bulk {
    outline: 4px solid var(--accent) !important;
    transform: scale(0.95) !important;
    transition: all 0.2s ease !important;
}

.image-container.selected-for-bulk::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.admin-messages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-message-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    position: relative;
    margin-bottom: 0;
}

@media (hover: hover) {
    .admin-message-card:hover {
        border-color: rgba(128, 128, 128, 0.4);
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    }
}

.admin-message-card.unread {
    border-right: 4px solid var(--danger);
    background: rgba(231, 76, 60, 0.03);
}

.admin-message-card.unread .admin-message-header {
    padding-right: 13px;
}

.admin-message-card.open.unread .admin-message-body {
    padding-right: 13px;
}

.admin-message-card.open {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: rgba(128, 128, 128, 0.45);
}

.admin-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    gap: 12px;
    transition: background-color 0.2s;
    user-select: none;
    text-align: right;
    direction: rtl;
    border-radius: 9px;
}

@media (hover: hover) {
    .admin-message-header:hover {
        background: var(--surface-hover);
    }
}

.admin-message-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.admin-message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    user-select: none;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 2px 5px rgba(0, 0, 0, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-message-card:hover .admin-message-avatar {
    transform: translateY(-1px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 4px 8px rgba(0, 0, 0, 0.3);
}

.admin-message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.admin-message-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
    text-align: right;
}

.admin-message-sender-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-message-sender-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-message-new-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid rgba(231, 76, 60, 0.35);
    line-height: 1;
}

.admin-message-purpose-row {
    display: flex;
    align-items: center;
}

.admin-message-purpose-pill {
    font-size: 12px;
    color: var(--accent);
    background: rgba(52, 152, 219, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(52, 152, 219, 0.18);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.admin-message-card.unread .admin-message-purpose-pill {
    font-weight: 600;
}

.admin-message-header-end {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.admin-message-time-group {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

.admin-message-time-sep {
    opacity: 0.5;
}

.admin-message-expand-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, 0.08);
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.admin-message-expand-btn svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-message-card.open .admin-message-expand-btn {
    background: rgba(128, 128, 128, 0.18);
    color: var(--text);
}

.admin-message-card.open .admin-message-expand-btn svg {
    transform: rotate(180deg);
}

.admin-message-body {
    padding: 0 16px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease-out, opacity 0.25s ease-out, padding 0.3s ease;
    text-align: right;
    direction: rtl;
}

.admin-message-card.open .admin-message-body {
    padding: 16px;
    max-height: 1200px;
    opacity: 1;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.admin-message-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.admin-message-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--surface);
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    min-width: 0;
}

.admin-message-detail-item .detail-label,
.admin-message-content-wrapper .detail-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.admin-message-detail-item .detail-value-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 22px;
    min-width: 0;
}

.admin-message-detail-item .detail-chip {
    font-size: 12px;
    color: var(--text);
    background: rgba(128, 128, 128, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-message-detail-item .detail-empty {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.admin-message-content-wrapper {
    margin-bottom: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-message-content-box {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
    font-family: inherit;
}

.admin-message-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
}

.admin-message-quick-contacts,
.admin-message-status-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-message-actions-bar .mark-btn {
    margin-left: 0;
}

@media (max-width: 650px) {
    .admin-message-details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .admin-message-detail-item.detail-email {
        grid-column: 1 / -1;
    }

    .admin-message-detail-item,
    .admin-message-content-wrapper {
        padding: 8px 10px;
    }

    .admin-message-header {
        flex-wrap: wrap;
    }

    .admin-message-header-end {
        width: 100%;
        justify-content: space-between;
        padding-top: 8px;
        border-top: 1px solid rgba(128, 128, 128, 0.1);
    }

    .admin-message-actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .admin-message-quick-contacts,
    .admin-message-status-actions {
        width: 100%;
        display: flex;
        gap: 6px;
    }

    .admin-message-quick-contacts .mark-btn,
    .admin-message-status-actions .mark-btn,
    .admin-message-status-actions .delete-btn {
        flex: 1;
        justify-content: center;
        text-align: center;
        margin-left: 0;
    }
}