/* ============================================
   ADMIN INTERFACE - SIMPLE & INTUITIVE
   ============================================ */

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

:root {
    --primary-color: #000;
    --text-color: #333;
    --bg-color: #d4cfc4;
    --card-bg: rgba(255, 255, 255, 0.6);
    --border-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* ============================================
   HEADER
   ============================================ */

.admin-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-logo h1 {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 2px;
    letter-spacing: -1px;
}

.admin-logo span {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-nav {
    display: flex;
    gap: 5px;
    align-items: center;
}

.nav-link {
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(0,0,0,0.05);
}

.nav-link.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.nav-link-logout {
    color: #999;
}

.nav-link-logout:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.admin-main {
    padding: 40px 20px;
    min-height: calc(100vh - 80px);
}

.admin-content {
    max-width: 1400px;
    margin: 0 auto;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 40px;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 14px;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(0, 200, 0, 0.1);
    color: #155724;
    border-color: #28a745;
}

.alert-error {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-color: #dc3545;
}

/* ============================================
   DASHBOARD
   ============================================ */

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

.stat-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: 48px;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.stat-sublabel {
    font-size: 13px;
    color: #666;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.action-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

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

.action-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
    flex-shrink: 0;
}

.action-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--primary-color);
}

.action-text h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.action-text p {
    font-size: 14px;
    color: #666;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.dashboard-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.btn-link:hover {
    text-decoration: underline;
}

.list-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(255,255,255,0.5);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-info strong {
    font-size: 15px;
    color: var(--primary-color);
    font-weight: 600;
}

.item-info span {
    font-size: 13px;
    color: #666;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.empty {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 14px;
}

.item-unread {
    background: rgba(255, 193, 7, 0.1) !important;
    border-color: rgba(255, 193, 7, 0.3) !important;
}

.item-subject {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.row-unread {
    background: rgba(255, 193, 7, 0.05) !important;
}

.badge-notification {
    display: inline-block;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    min-width: 18px;
    text-align: center;
}

.filter-select {
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ============================================
   SORTABLE LIST
   ============================================ */

.sortable-container {
    margin-top: 30px;
}

.sortable-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sortable-item {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: move;
    transition: all 0.2s;
}

.sortable-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sortable-item.sortable-ghost {
    opacity: 0.4;
    background: rgba(0,0,0,0.05);
}

.sortable-handle {
    cursor: grab;
    color: #999;
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.sortable-handle:hover {
    background: rgba(0,0,0,0.05);
    color: var(--primary-color);
}

.sortable-handle:active {
    cursor: grabbing;
}

.sortable-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-main strong {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 600;
}

.item-main span {
    font-size: 14px;
    color: #666;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-order {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

.sortable-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   LIST PAGES
   ============================================ */

.list-page {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.page-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.search-bar {
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: var(--text-color);
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-search {
    padding: 14px 20px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-search svg {
    width: 18px;
    height: 18px;
}

.btn-search:hover {
    background: #333;
}

.btn-clear {
    padding: 14px 18px;
    background: rgba(0,0,0,0.05);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-clear svg {
    width: 18px;
    height: 18px;
}

.btn-clear:hover {
    background: rgba(0,0,0,0.1);
}

.table-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

.data-table thead {
    background: rgba(0,0,0,0.03);
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-color);
}

.data-table tbody tr:hover {
    background: rgba(0,0,0,0.02);
}

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

.data-table .empty {
    text-align: center;
    color: #999;
    padding: 60px;
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(0, 200, 0, 0.15);
    color: #155724;
}

.badge-inactive {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.badge-danger {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */

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

.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: #dc3545;
    transition: 0.3s;
    border-radius: 26px;
}

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

.toggle-switch input:checked + .toggle-slider {
    background-color: #28a745;
}

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

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    padding: 14px 28px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
    padding: 14px 28px;
    background: rgba(0,0,0,0.05);
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(0,0,0,0.1);
}

.btn-small {
    padding: 6px 14px;
    background: rgba(0,0,0,0.05);
    color: var(--text-color);
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1.4;
    text-align: center;
}

.btn-small:hover {
    background: rgba(0,0,0,0.1);
}

.btn-danger {
    padding: 14px 28px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #c82333;
    text-decoration: none;
}

.btn-page {
    padding: 10px 20px;
    background: rgba(0,0,0,0.05);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-page:hover {
    background: rgba(0,0,0,0.1);
}

/* ============================================
   FORMS
   ============================================ */

.form-page {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-width: 900px;
}

.admin-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text-color);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Style spécifique pour les checkboxes de techniques */
.technique-checkboxes-container {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    min-height: auto;
}

.technique-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.technique-checkboxes > div {
    position: relative;
    display: block;
    padding: 0;
    margin: 0;
    min-width: 140px;
}

.technique-checkboxes > div label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    transition: all 0.2s ease;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-color);
    user-select: none;
    box-sizing: border-box;
    min-height: 48px;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.technique-checkboxes > div label:hover {
    background: rgba(0,0,0,0.02);
    border-color: #ccc;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.technique-checkboxes > div input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--primary-color);
}

.technique-checkboxes > div:has(input[type="checkbox"]:checked) label {
    background: #fff;
    border-color: var(--primary-color);
    border-width: 2px;
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.form-check-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-group small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.form-group small .add-link {
    color: #666;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.2s;
    border-bottom: 1px solid transparent;
}

.form-group small .add-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 8px;
    display: block;
}

.current-image {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.current-image img {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.form-image-preview {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: inline-block;
}

.form-image-preview img {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

/* ============================================
   DELETE PAGE
   ============================================ */

.delete-page {
    max-width: 600px;
}

.delete-confirm {
    background: var(--card-bg);
    padding: 50px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.delete-confirm h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.delete-confirm p {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 15px;
}

.delete-confirm .warning {
    color: #dc3545;
    font-weight: 700;
    font-size: 18px;
    margin: 30px 0;
    padding: 20px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
}

.delete-form {
    margin-top: 40px;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    padding: 25px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.pagination span {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
}

.login-box {
    background: var(--card-bg);
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-color);
}

.login-box h1 {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 10px;
    text-align: center;
    color: var(--primary-color);
    letter-spacing: -1px;
}

.login-box p {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 14px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 968px) {
    .admin-header-content {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   MESSAGE DETAIL PAGE
   ============================================ */

.detail-page {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.message-detail {
    margin-top: 30px;
}

.message-header {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.message-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.message-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-field span {
    font-size: 16px;
    color: var(--text-color);
}

.message-field a {
    color: var(--primary-color);
    text-decoration: none;
}

.message-field a:hover {
    text-decoration: underline;
}

.message-content {
    margin-top: 30px;
}

.message-content label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.message-text {
    background: rgba(255,255,255,0.5);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-color);
    white-space: pre-wrap;
}

.badge-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
}

/* ============================================
   SORT CONTROLS
   ============================================ */

.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 15px 20px;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
    flex-wrap: wrap;
    transition: all 0.3s ease;
}

.sort-controls label {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 4px;
    flex-shrink: 0;
}

.sort-btn {
    padding: 10px 18px;
    background: #fff;
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.sort-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.1);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.sort-btn:hover::before {
    width: 300px;
    height: 300px;
}

.sort-btn:hover {
    background: rgba(0,0,0,0.03);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sort-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(0);
}

.sort-btn.active:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ============================================
   DATA TABLE
   ============================================ */

.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 30px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: rgba(0,0,0,0.03);
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.data-table th .sort-link {
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
    cursor: pointer;
}

.data-table th .sort-link:hover {
    color: #333;
    text-decoration: underline;
}

.data-table th .sort-indicator {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    opacity: 0.7;
}

.data-table th .sort-link:hover .sort-indicator {
    opacity: 1;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.25s ease;
}

.data-table tbody tr:hover {
    background: rgba(0,0,0,0.03);
    transform: translateX(2px);
    box-shadow: -2px 0 8px rgba(0,0,0,0.05);
}

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

.data-table td {
    padding: 18px 20px;
    vertical-align: middle;
    color: var(--text-color);
    line-height: 1.5;
}

.data-table td strong {
    font-weight: 600;
    color: var(--primary-color);
}

.data-table td small {
    font-size: 13px;
    color: #666;
}

.data-table td .badge {
    display: inline-block;
    vertical-align: middle;
}

.data-table td.actions {
    vertical-align: middle;
    text-align: right;
    white-space: nowrap;
}

.data-table td.actions .actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.data-table td.actions .btn-small,
.data-table td.actions .btn-danger {
    vertical-align: middle;
}

.data-table td.empty {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .admin-main {
        padding: 20px 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions a {
        width: 100%;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .message-meta {
        grid-template-columns: 1fr;
    }
}
