/**
 * Staff Management Styles - Modern Minimalist Black & White
 */
:root {
    /* Palette */
    --color-green: #64C493; /* Primary Green */
    --color-green-dark: #4FB07A; /* Slightly darker green for hover */
    --color-navy: #0C1930; /* Primary Navy */
    --color-white: #FFFFFF; /* Secondary White */
    --color-accent-gray: #E6E9EE; /* Accent Gray - subtle dividers/backgrounds */

    /* Typography */
    --font-family-base: "Inter", "Segoe UI", system-ui, -apple-system, "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    --h1-weight: 700; /* Inter Bold */
    --h2-weight: 600; /* Inter Semibold */
    --h3-weight: 600; /* Inter Semibold */
    --h4-weight: 500; /* Inter Medium */
    --body-weight: 400; /* Inter Regular */

    /* Other */
    --radius-button: 8px;
}

.staff-management-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    font-family: var(--font-family-base);
    color: var(--color-navy);
}

/* Header */
.staff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}
.staff-header h2 {
    font-size: 1.5rem;
    font-weight: var(--h2-weight);
    margin: 0;
}

/* Typography specifics */

/* Upload Button & Avatar Styles */
.avatar-preview {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-accent-gray);
    transition: border-color 0.2s ease;
}

.avatar-initial {
    width: 54px;
    height: 54px;
    background: var(--color-accent-gray);
    color: var(--color-navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--h4-weight);
    font-size: 18px;
}

#staff-avatar-upload {
    position: relative;
    transition: all 0.2s ease;
}

#staff-avatar-upload:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#staff-avatar-upload .spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#staff-avatar-clear {
    font-size: 12px;
    padding: 4px 8px;
    margin-top: 4px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

#staff-avatar-clear:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.help-text {
    font-size: 11px;
    color: #666;
    line-height: 1.3;
    margin-top: 2px;
}

/* Improved Popup Styles */
.staff-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease;
    max-width: 300px;
}

.popup-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.popup-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
.staff-management-container h1 { font-weight: var(--h1-weight); }
.staff-management-container h2 { font-weight: var(--h2-weight); }
.staff-management-container h3 { font-weight: var(--h3-weight); }
.staff-management-container h4 { font-weight: var(--h4-weight); }
.staff-management-container, .staff-management-container p, .staff-management-container label { font-weight: var(--body-weight); }

/* Filters */
.staff-filters {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--color-accent-gray);
    border-radius: 10px;
    background: var(--color-white);
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--color-accent-gray);
    border-radius: var(--radius-button);
    background: #fff;
    transition: border 0.2s ease;
}
.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--color-green);
    outline: none;
}

/* Table */
.staff-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
    border-radius: 10px;
    overflow: hidden;
}
.staff-table th,
.staff-table td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid var(--color-accent-gray);
}
.staff-table th {
    font-weight: 500;
    color: var(--color-navy);
    background-color: var(--color-accent-gray);
}
.staff-table td.staff-name,
.staff-table th:first-child {
    width: 30%;
    min-width: 140px;
}
.staff-table td.staff-role,
.staff-table th:nth-child(2) {
    width: 20%;
    min-width: 120px;
}
.staff-table td.staff-email,
.staff-table th:nth-child(3) {
    width: 22%;
    min-width: 140px;
}
.staff-table td.staff-phone,
.staff-table th:nth-child(4) {
    width: 13%;
    min-width: 90px;
}
.staff-table td.staff-email {
    font-size: 12px;
    color: #62708a; /* subtle muted color for contact info */
    line-height: 1.2;
}
.staff-table td.staff-phone {
    font-size: 12px;
    color: #62708a; /* subtle muted color for contact info */
    line-height: 1.2;
}

/* On very small screens keep contact legible and allow wrapping */
@media (max-width: 480px) {
    .staff-table td.staff-email,
    .staff-table td.staff-phone {
        font-size: 11px;
        line-height: 1.25;
        word-break: break-word;
    }
}

/* Stronger specificity to ensure contact font-size applies across admin and frontend tables */
.elite-cuts-table td.staff-email,
.elite-cuts-table td.staff-phone,
.wp-list-table td.staff-email,
.wp-list-table td.staff-phone,
.staff-table td.staff-email,
.staff-table td.staff-phone {
    font-size: 12px !important;
    color: #62708a !important;
    line-height: 1.2 !important;
    font-weight: 400 !important;
}
.staff-table td.staff-status,
/* Combined avatar + name cell styling (shared with admin) */
.staff-cell { display: flex; align-items: center; gap: 0.9rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(201, 167, 77, 0.35); }
.avatar-initial { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; color: var(--color-white, #ffffff); border: 2px solid rgba(100,196,147,0.25); background: linear-gradient(135deg, var(--color-green), var(--color-green-dark)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12); }
.staff-meta { display: flex; flex-direction: column; }
.staff-name-text { font-weight: 600; color: var(--color-navy); }
.staff-table th:nth-child(5) {
    width: 6%;
    min-width: 56px;
}
.staff-table td.staff-actions,
.staff-table th:last-child {
    width: 7%;
    min-width: 70px;
    text-align: right;
}
.staff-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}
.staff-table tbody tr:hover {
    background: #fbfbfc;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}
.status-active {
    background: var(--color-green);
    color: var(--color-white);
}
.status-inactive {
    background: var(--color-accent-gray);
    color: var(--color-navy);
}

/* Role badges (display all roles assigned to a staff) */
.role-badge {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 10px;
    background: #eef6ff;
    color: #0b2540;
    margin-right: 6px;
    font-size: 11px;
}

/* Buttons */
.button {
    border-radius: var(--radius-button) !important;
    padding: 6px 14px !important;
    font-size: 14px;
    border: 1px solid var(--color-navy);
    background: #64C493;
    color: var(--color-navy);
    transition: all 0.25s ease;
    cursor: pointer;
}
.button:hover {
    background: var(--color-navy);
    color: var(--color-white);
}
.button-primary {
    background: var(--color-green) !important;
    color: var(--color-white) !important;
    border-color: var(--color-green) !important;
}
.button-primary:hover {
    background: var(--color-green-dark) !important;
}

/* Actions */
.staff-actions .button {
    margin: 0 2px;
    padding: 3px 6px;
    font-size: 13px;
    line-height: 1;
}
.staff-actions .dashicons {
    font-size: 14px;
    vertical-align: middle;
}

/* Icon button normalization for consistent sizing and centering */
.action-buttons { display: inline-flex; gap: 0.4rem; align-items: center; justify-content: flex-end; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: 6px; box-sizing: border-box; }
.icon-btn i, .icon-btn svg, .icon-btn .dashicons { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; font-size: 14px; line-height: 1; }
.icon-btn svg { width: 14px; height: 14px; fill: currentColor; }
.icon-btn:hover i, .icon-btn:hover svg, .icon-btn:hover .dashicons { color: var(--color-white); }

/* Font Awesome specific tweak: reduce vertical misalignment for some FA icons */
.icon-btn i[class^="fa"], .icon-btn i.fa { display: inline-block; font-size: 16px; width: 18px; height: 18px; line-height: 18px; text-align: center; }

/* Ensure dashicons inside normal buttons inherit size/color */
.dashicons { font-size: 16px; vertical-align: middle; }

/* Ensure action icons in table cells align consistently */
.staff-table td.staff-actions { vertical-align: middle; text-align: right; }
.staff-table .action-buttons .icon-btn { margin-left: 6px; }

/* Compact, uniform action buttons for table rows ---------------------------------- */
/* Ensure buttons align horizontally and have consistent sizing */
.staff-table td.staff-actions { white-space: nowrap; text-align: right; }
.staff-table .action-buttons { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.staff-table .action-buttons .button,
.staff-table .action-buttons .icon-btn,
.staff-actions .button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(12,25,48,0.06) !important;
    color: var(--color-navy) !important;
}
.staff-table .action-buttons .button .dashicons,
.staff-table .action-buttons .icon-btn .dashicons {
    font-size: 16px !important;
    line-height: 1 !important;
}
.staff-table .action-buttons .button:hover,
.staff-table .action-buttons .icon-btn:hover {
    background: var(--color-navy) !important;
    color: var(--color-white) !important;
    border-color: transparent !important;
}
/* Slightly larger tap area on small screens */
@media (max-width: 480px) {
    .staff-table .action-buttons .button,
    .staff-table .action-buttons .icon-btn,
    .staff-actions .button { width: 40px !important; height: 40px !important; }
}

/* Modal */
.staff-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.staff-modal-content {
    background: var(--color-white);
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
}

.staff-modal-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.staff-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: var(--color-navy);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #a0a5aa;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.close-modal:hover {
    color: var(--color-navy);
}

/* Form Elements */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px 12px;
}

.form-group {
    flex: 1 0 100%;
    padding: 0 8px;
    margin-bottom: 12px;
}

@media (min-width: 480px) {
    .form-group {
        flex: 1 0 calc(50% - 16px);
    }
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 13px;
    color: var(--color-navy);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--color-accent-gray);
    border-radius: 6px;
    box-shadow: 0 0 0 transparent;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-green);
    box-shadow: 0 0 0 1px var(--color-green);
    outline: 2px solid transparent;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--color-accent-gray);
}

.form-actions .button {
    margin: 0;
}

.form-actions .button-primary {
    order: 1; /* Add Staff button on the left */
}

.form-actions .button-secondary {
    order: 2; /* Cancel button on the right */
}

/* Pagination */
.staff-pagination {
    text-align: right;
    margin-top: 20px;
}
.tablenav-pages .button {
    min-width: 34px;
    height: 34px;
    line-height: 32px;
    padding: 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    max-width: 600px;
    width: 90%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #23282d;
}

.close {
    color: #72777c;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #23282d;
    text-decoration: none;
}

.modal-body {
    padding: 20px;
}

/* Form Styles */
.staff-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: #0C1930;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-accent-gray);
    border-radius: 6px;
    box-shadow: 0 0 0 transparent;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    color: #000000;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-green);
    box-shadow: 0 0 0 3px rgba(100,196,147,0.08);
    outline: 2px solid transparent;
}

.form-group textarea { min-height: 100px; resize: vertical; }

/* Status Badges (consolidated) */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-active {
    background: rgba(100,196,147,0.12);
    color: var(--color-green);
    border: 1px solid rgba(100,196,147,0.18);
}

.status-inactive {
    background: rgba(12,25,48,0.04);
    color: var(--color-navy);
    border: 1px solid rgba(12,25,48,0.06);
}

/* Buttons (consolidated and improved) */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: var(--radius-button);
    border: 1px solid var(--color-navy);
    background: #64C493;
    color: var(--color-navy);
    cursor: pointer;
    transition: all 0.18s ease;
    vertical-align: middle;
}

.button:hover {
    background: var(--color-navy);
    color: var(--color-white);
}

.button-primary { 
    background: var(--color-green);
    border-color: var(--color-green);
    color: var(--color-white);
}

.button-danger {
    background: #d63638;
    border-color: #d63638;
    color: #fff;
}

.button-small {
    padding: 4px 8px;
    font-size: 13px;
    min-height: 28px;
}

.button + .button { margin-left: 8px; }

/* Form Actions (responsive-ready) */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-accent-gray);
    gap: 8px;
}

/* Message Notices */
#message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.notice {
    position: relative;
    margin-bottom: 10px;
    padding: 12px 15px;
    background: var(--color-white);
    border-left: 4px solid var(--color-navy);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    animation: slideIn 0.28s ease-out;
    pointer-events: auto;
    transition: all 0.22s ease;
    opacity: 0.98;
}

.notice:hover { box-shadow: 0 4px 12px rgba(12,25,48,0.08); }

.notice p { margin: 0; padding-right: 28px; line-height: 1.5; color: var(--color-navy); font-size: 13px; }

.notice.notice-success { border-left-color: var(--color-green); background-color: rgba(100,196,147,0.04); }
.notice.notice-error { border-left-color: #d63638; background-color: rgba(214,54,56,0.04); }

.notice-dismiss { position: absolute; top: 6px; right: 6px; padding: 6px; border: none; background: none; cursor: pointer; color: #68707b; opacity: 0.9; }
.notice-dismiss:hover { color: #d63638; opacity: 1; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 0.98; } }
@keyframes slideOut { to { transform: translateX(100%); opacity: 0; margin: 0; padding: 0; height: 0; overflow: hidden; } }

.notice.notice-leave { animation: slideOut 0.28s ease-out forwards; }

/* =============================================================================
   RESPONSIVE DESIGN - Multi-Device Support
   ============================================================================= */

/* Tablet Landscape (1024px and below) */
@media screen and (max-width: 1024px) {
    .staff-management-container {
        padding: 16px;
    }
    
    .staff-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .staff-header h2 {
        font-size: 1.3rem;
    }
    
    /* Make filters stack better */
    .filter-row {
        gap: 10px;
    }
    
    .filter-group {
        flex: 1 1 calc(50% - 10px);
        min-width: calc(50% - 10px);
    }
    
    .search-filter {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    /* Adjust table for smaller screens */
    .staff-table {
        font-size: 13px;
    }
    
    .staff-table th,
    .staff-table td {
        padding: 10px 8px;
    }
}

/* Tablet Portrait (782px and below) */
@media screen and (max-width: 782px) {
    .staff-management-container {
        padding: 12px;
        border-radius: 8px;
    }
    
    .staff-header h2 {
        font-size: 1.2rem;
    }
    
    /* Full-width filters on smaller tablets */
    .filter-group {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    /* Modal improvements */
    .modal-content,
    .staff-modal-content {
        width: 95%;
        margin: 20px auto;
        max-width: 500px;
    }
    
    /* Form actions stack vertically */
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .button {
        width: 100%;
        margin: 0;
    }
    
    .form-actions .button + .button {
        margin-left: 0;
    }
    
    /* Table adjustments */
    .staff-table th,
    .staff-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .avatar,
    .avatar-initial {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .staff-name-text {
        font-size: 13px;
    }
}

/* Mobile Landscape (640px and below) */
@media screen and (max-width: 640px) {
    .staff-management-container {
        padding: 8px;
        max-width: 100%;
    }
    
    .staff-header {
        padding-bottom: 10px;
        margin-bottom: 12px;
    }
    
    .staff-header h2 {
        font-size: 1.1rem;
    }
    
    /* Filters compact layout */
    .staff-filters {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .filter-row {
        gap: 8px;
    }
    
    /* Convert table to card layout on mobile */
    .staff-table {
        display: block;
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
        border: none;
        width: 100%;
    }
    
    .staff-table thead {
        display: none; /* Hide headers on mobile */
    }
    
    .staff-table tbody {
        display: block;
        width: 100%;
    }
    
    .staff-table tbody tr {
        display: block;
        margin-bottom: 12px;
        padding: 14px;
        border: 1px solid var(--color-accent-gray);
        border-radius: 10px;
        background: var(--color-white);
        box-shadow: 0 2px 4px rgba(0,0,0,0.06);
        width: 100%;
        box-sizing: border-box;
    }
    
    .staff-table tbody tr:hover {
        background: var(--color-white);
        box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    }
    
    .staff-table td {
        display: block;
        text-align: left !important;
        padding: 6px 0;
        border-bottom: none;
        position: relative;
        padding-left: 0;
        min-height: auto;
        width: 100%;
    }
    
    .staff-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
        opacity: 0.8;
    }
    
    /* Special handling for staff name cell - show full width */
    .staff-table td.staff-name {
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        margin-bottom: 8px;
    }
    
    .staff-table td.staff-name::before {
        display: none; /* Hide "STAFF" label, avatar + name is self-explanatory */
    }
    
    .staff-table td.staff-actions {
        padding-left: 0;
        text-align: center !important;
        border-top: 1px solid var(--color-accent-gray);
        padding-top: 12px;
        margin-top: 12px;
    }
    
    .staff-table td.staff-actions::before {
        display: none;
    }
    
    /* Better touch targets for mobile */
    .action-buttons {
        justify-content: center;
        gap: 10px;
        width: 100%;
    }
    
    .icon-btn,
    .staff-table .action-buttons .button,
    .staff-table .action-buttons .icon-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px;
        border-radius: 8px !important;
    }
    
    /* Avatar sizing */
    .staff-cell {
        display: flex;
        align-items: center;
        gap: 12px;
        padding-left: 0 !important;
        width: 100%;
    }
    
    .staff-cell::before {
        display: none;
    }
    
    .avatar,
    .avatar-initial {
        width: 48px;
        height: 48px;
        font-size: 1rem;
        flex-shrink: 0;
    }
    
    /* Contact info layout */
    .contact-cell {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .contact-email,
    .contact-phone {
        font-size: 13px;
        word-break: break-word;
    }
    
    /* Role badges wrap better */
    .staff-table td.staff-role {
        line-height: 1.6;
    }
    
    .role-badge {
        margin-bottom: 4px;
        display: inline-block;
    }
}

/* Mobile Portrait (480px and below) */
@media screen and (max-width: 480px) {
    .staff-management-container {
        padding: 6px;
        margin: 0;
        border-radius: 0;
        max-width: 100%;
    }
    
    .staff-header h2 {
        font-size: 1rem;
    }
    
    /* Compact filters */
    .staff-filters {
        padding: 8px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .filter-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .filter-group input,
    .filter-group select {
        padding: 8px;
        font-size: 14px;
    }
    
    /* Search input optimization */
    .search-input {
        font-size: 14px;
        padding: 10px 10px 10px 36px;
    }
    
    .search-icon {
        left: 10px;
        font-size: 0.85rem;
    }
    
    /* Filter buttons full width */
    .filter-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .filter-actions .button,
    .filter-actions .elite-button {
        width: 100%;
        justify-content: center;
    }
    
    /* Modal full screen on small mobile */
    .modal-content,
    .staff-modal-content,
    .elite-modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        min-height: 100vh;
    }
    
    .modal-header,
    .staff-modal-header,
    .elite-modal-header {
        padding: 12px 15px;
    }
    
    .modal-header h3,
    .staff-modal-header h3,
    .elite-modal-header h3 {
        font-size: 1.1rem;
    }
    
    /* Form improvements */
    .form-group {
        flex: 1 1 100%;
        margin-bottom: 14px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Card-style table rows - full width utilization */
    .staff-table tbody tr {
        padding: 12px;
        margin-bottom: 10px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .staff-table td {
        padding: 6px 0;
        padding-left: 0;
        font-size: 13px;
        width: 100%;
    }
    
    .staff-table td::before {
        font-size: 10px;
        display: block;
        margin-bottom: 4px;
    }
    
    /* Contact info wrapping */
    .staff-table td.staff-email,
    .staff-table td.staff-phone {
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Status and role badges */
    .status-badge {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .role-badge {
        font-size: 11px;
        padding: 3px 8px;
        margin-right: 4px;
        margin-bottom: 4px;
        display: inline-block;
    }
    
    /* Avatar preview in forms */
    .avatar-preview {
        width: 64px;
        height: 64px;
    }
    
    .avatar-initial {
        width: 64px;
        height: 64px;
        font-size: 22px;
    }
    
    /* Increase avatar size in staff cards for better visibility */
    .staff-table .avatar,
    .staff-table .avatar-initial {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
    
    /* Toast/Notice positioning */
    #message-container,
    #elite-toast-container {
        left: 6px;
        right: 6px;
        top: 10px;
        max-width: calc(100% - 12px);
    }
    
    .notice,
    .elite-toast {
        max-width: 100%;
        font-size: 13px;
    }
}

/* Extra Small Devices (360px and below) */
@media screen and (max-width: 360px) {
    .staff-management-container {
        padding: 4px;
        max-width: 100%;
    }
    
    .staff-header h2 {
        font-size: 0.95rem;
    }
    
    .staff-filters {
        padding: 6px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .staff-table tbody tr {
        padding: 10px;
        margin-left: 0;
        margin-right: 0;
    }
    
    .staff-table td {
        padding-left: 0;
        font-size: 12px;
        width: 100%;
    }
    
    .staff-table td::before {
        font-size: 9px;
        display: block;
        margin-bottom: 3px;
    }
    
    .icon-btn,
    .staff-table .action-buttons .button,
    .staff-table .action-buttons .icon-btn {
        width: 40px !important;
        height: 40px !important;
    }
    
    .action-buttons {
        gap: 8px;
    }
    
    .avatar,
    .avatar-initial {
        width: 46px;
        height: 46px;
        font-size: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
        padding: 9px 10px;
    }
}

/* Landscape Orientation Fixes */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .modal-content,
    .staff-modal-content,
    .elite-modal-content {
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .staff-header {
        padding-bottom: 8px;
        margin-bottom: 12px;
    }
    
    .staff-filters {
        padding: 8px;
        margin-bottom: 12px;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .icon-btn,
    .avatar,
    .avatar-initial {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .staff-table {
        border-width: 0.5px;
    }
}

/* Print Styles */
@media print {
    .staff-header,
    .staff-filters,
    .action-buttons,
    .filter-actions,
    #message-container,
    #elite-toast-container,
    .modal,
    .staff-modal,
    .elite-modal {
        display: none !important;
    }
    
    .staff-management-container {
        box-shadow: none;
        padding: 0;
    }
    
    .staff-table {
        border: 1px solid #000;
    }
    
    .staff-table th,
    .staff-table td {
        border: 1px solid #000;
        padding: 8px;
    }
}

/* Accessibility Enhancements for Touch Devices */
@media (hover: none) and (pointer: coarse) {
    /* Enhance touch targets */
    .icon-btn,
    .button,
    .elite-button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .filter-group input,
    .filter-group select,
    .form-group input,
    .form-group select {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .staff-table tbody tr:hover {
        background: var(--color-white);
    }
    
    /* Add active states instead */
    .icon-btn:active,
    .button:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
}

/* Dark Mode Support (if enabled by system) */
@media (prefers-color-scheme: dark) {
    :root {
        --color-white: #1a1a1a;
        --color-navy: #e8e8e8;
        --color-accent-gray: #333333;
    }
    
    .staff-management-container {
        background: #1a1a1a;
        color: #e8e8e8;
    }
    
    .staff-table th {
        background-color: #2a2a2a;
    }
    
    .staff-table tbody tr {
        border-bottom: 1px solid #333;
    }
    
    .staff-table tbody tr:hover {
        background: #252525;
    }
    
    .modal-content,
    .staff-modal-content,
    .elite-modal-content {
        background: #1a1a1a;
        color: #e8e8e8;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #2a2a2a;
        color: #e8e8e8;
        border-color: #333;
    }
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}