:root {
    --ms-primary: #2563eb;
    --ms-secondary: #64748b;
    --ms-success: #10b981;
    --ms-warning: #f59e0b;
    --ms-danger: #ef4444;
    --ms-bg: #f8fafc;
    --ms-card-bg: #ffffff;
    --ms-border: #e2e8f0;
    --ms-text-main: #1e293b;
    --ms-text-muted: #64748b;
}

/* --- General Layout --- */
.meta-staff-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ms-text-main);
    background-color: var(--ms-bg);
    padding: 20px;
    border-radius: 8px;
}

/* --- Cards --- */
.meta-card {
    background: var(--ms-card-bg);
    border: 1px solid var(--ms-border);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.2s;
}

.meta-card-header {
    background: #fff;
    border-bottom: 1px solid var(--ms-border);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meta-card-body {
    padding: 20px;
}

/* --- Tables (Admin & Frontend) --- */
.meta-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.meta-table thead th {
    background: #f1f5f9;
    color: var(--ms-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ms-border);
}

.meta-table tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--ms-border);
    vertical-align: middle;
    font-size: 0.9rem;
}

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

.meta-table tbody tr:hover {
    background-color: #f8fafc;
}

/* --- Badges --- */
.meta-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-status-pending { background: #fef3c7; color: #92400e; }
.badge-status-in-progress { background: #dbeafe; color: #1e40af; }
.badge-status-completed { background: #d1fae5; color: #065f46; }

.badge-prio-High, .badge-prio-Urgent { background: #fee2e2; color: #991b1b; }
.badge-prio-Medium { background: #ffedd5; color: #9a3412; }
.badge-prio-Low { background: #f1f5f9; color: #475569; }

/* --- Chat Interface (Modal) --- */
.chat-container {
    background: #f8fafc;
    border: 1px solid var(--ms-border);
    border-radius: 8px;
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-bubble.left {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid var(--ms-border);
    border-bottom-left-radius: 2px;
    color: var(--ms-text-main);
}

.chat-bubble.right {
    align-self: flex-end;
    background: var(--ms-primary);
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-meta {
    font-size: 0.7rem;
    margin-bottom: 4px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-input-area {
    padding: 12px;
    background: white;
    border-top: 1px solid var(--ms-border);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* --- Avatars --- */
.ms-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--ms-border);
}

/* --- Frontend Dashboard Tabs --- */
.meta-nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--ms-border);
    padding-bottom: 1px;
}

.meta-nav-link {
    background: transparent;
    border: none;
    padding: 10px 20px;
    color: var(--ms-text-muted);
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.meta-nav-link.active {
    color: var(--ms-primary);
    border-bottom-color: var(--ms-primary);
}

.meta-nav-link:hover:not(.active) {
    color: var(--ms-text-main);
}

/* --- Client Accordion Customization --- */
.meta-accordion-item {
    border: 1px solid var(--ms-border);
    margin-bottom: 10px;
    border-radius: 8px !important;
    overflow: hidden;
}
.meta-accordion-button {
    background: #fff;
    padding: 15px;
    width: 100%;
    text-align: left;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--ms-text-main);
}
.meta-accordion-button:not(.collapsed) {
    background: #f1f5f9;
    color: var(--ms-primary);
}

/* Targets in Accordion Header */
.meta-accordion-button .badge {
    min-width: 60px;
    font-size: 0.85rem;
}

/* Ad Account Modal Styles */
#adAccountDetailsModal .modal-body {
    background-color: #f8fafc;
}

#adAccountDetailsModal label {
    letter-spacing: 0.5px;
}