/* Lime Softs Live Chat — manager panel styles.
 * Lime branding (#65a30d), Urdu-friendly system font stack, no external fonts.
 * Matches widget.css so the panel and the visitor widget look like one system.
 */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", "Noto Nastaliq Urdu", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    background: #f3f4f6;
}
.panel-root { max-width: 1100px; margin: 0 auto; padding: 0 12px 24px; min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
.panel-header {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-wrap: wrap;
    padding: 14px 4px; border-bottom: 2px solid #65a30d;
}
.panel-logo { font-size: 20px; font-weight: 800; color: #3f6212; }
.panel-subtitle { font-size: 13px; color: #6b7280; margin-left: 8px; }
.panel-user { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-me { font-weight: 700; }
.panel-role {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    padding: 2px 8px; border-radius: 999px; background: #e5e7eb; color: #4b5563;
}
.panel-role-owner { background: #65a30d; color: #fff; }

/* Buttons */
.panel-btn {
    padding: 9px 16px; border: none; border-radius: 8px;
    background: #65a30d; color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.panel-btn:hover { background: #4d7c0f; }
.panel-btn:disabled { background: #9ca3af; cursor: default; }
.panel-btn-ghost { background: #e5e7eb; color: #374151; }
.panel-btn-ghost:hover { background: #d1d5db; }
.panel-btn-danger { background: #dc2626; }
.panel-btn-danger:hover { background: #b91c1c; }
.panel-toggle {
    padding: 9px 16px; border: none; border-radius: 999px;
    font: inherit; font-weight: 700; cursor: pointer;
}
.panel-toggle-off { background: #dc2626; color: #fff; }
.panel-toggle-on { background: #16a34a; color: #fff; }

/* Login */
.panel-card {
    background: #fff; border: 1px solid #d1d5db; border-radius: 12px;
    padding: 20px; margin-top: 20px;
}
.panel-login { max-width: 420px; margin-left: auto; margin-right: auto; }
.panel-login h1 { margin: 0 0 6px; font-size: 18px; }
.panel-login label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 13px; }
.panel-login input, .panel-inputrow input {
    width: 100%; margin-top: 4px; padding: 10px 12px;
    border: 1px solid #d1d5db; border-radius: 8px; font: inherit;
}
.panel-login input:focus, .panel-inputrow input:focus {
    outline: 2px solid #65a30d; outline-offset: 0; border-color: #65a30d;
}
.panel-login .panel-btn { width: 100%; }
.panel-note { font-size: 12px; color: #6b7280; }
.panel-error {
    margin-top: 16px; padding: 10px 12px; border-radius: 8px;
    background: #fef2f2; color: #b91c1c; font-size: 13px;
}
.panel-empty { color: #6b7280; font-size: 13px; padding: 12px; }

/* Tabs */
.panel-tabs { display: flex; gap: 4px; margin-top: 16px; border-bottom: 1px solid #d1d5db; flex-wrap: wrap; }
.panel-tab {
    padding: 10px 16px; border: none; background: transparent;
    font: inherit; font-weight: 600; color: #4b5563; cursor: pointer;
    border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.panel-tab:hover { color: #1f2937; }
.panel-tab-active { color: #3f6212; border-bottom-color: #65a30d; }
.panel-badge {
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
    background: #dc2626; color: #fff; font-size: 12px; font-weight: 700;
    line-height: 20px; text-align: center; display: inline-block; vertical-align: middle;
}
.panel-tabpane { padding-top: 14px; }

/* Queue layout */
.panel-queue-layout { display: flex; gap: 14px; align-items: flex-start; }
.panel-queue-list {
    flex: 0 0 320px; max-width: 100%;
    background: #fff; border: 1px solid #d1d5db; border-radius: 12px;
    overflow: hidden; max-height: 70vh; overflow-y: auto;
}
.panel-queue-item {
    width: 100%; text-align: left; padding: 12px 14px;
    border: none; border-bottom: 1px solid #e5e7eb; background: #fff;
    font: inherit; cursor: pointer;
}
.panel-queue-item:hover { background: #f9fafb; }
.panel-queue-item-active { background: #f0fdf4; border-left: 4px solid #65a30d; }
.panel-queue-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.panel-queue-name { font-weight: 700; overflow-wrap: anywhere; }
.panel-queue-preview { color: #6b7280; font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.panel-queue-meta { color: #9ca3af; font-size: 12px; margin-top: 4px; }
.panel-pill {
    font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
    background: #e5e7eb; color: #4b5563; white-space: nowrap;
}
.panel-pill-new { background: #dc2626; color: #fff; }
.panel-pill-ai { background: #fef3c7; color: #92400e; }
.panel-pill-active { background: #dcfce7; color: #166534; }
.panel-pill-closed { background: #e5e7eb; color: #6b7280; }

/* Chat pane */
.panel-chat {
    flex: 1; min-width: 0;
    background: #fff; border: 1px solid #d1d5db; border-radius: 12px;
    display: flex; flex-direction: column; height: 70vh;
}
.panel-chat-head { padding: 12px 14px; border-bottom: 1px solid #e5e7eb; }
.panel-chat-head h2 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.panel-chat-head .panel-visitor-line { font-size: 13px; color: #4b5563; margin-top: 2px; overflow-wrap: anywhere; }
.panel-chat-head .panel-visitor-line a { color: #4d7c0f; font-weight: 600; }
.panel-chat-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.panel-chat-messages { flex: 1; padding: 14px; overflow-y: auto; background: #f9fafb; }
.panel-msg { margin-bottom: 10px; max-width: 85%; }
.panel-msg-label { font-size: 11px; font-weight: 700; color: #6b7280; margin-bottom: 2px; }
.panel-msg-body {
    padding: 8px 11px; border-radius: 12px; background: #fff;
    border: 1px solid #d1d5db; border-bottom-left-radius: 4px;
    white-space: pre-wrap; overflow-wrap: break-word;
}
.panel-msg-manager { margin-left: auto; }
.panel-msg-manager .panel-msg-label { text-align: right; }
.panel-msg-manager .panel-msg-body {
    background: #65a30d; color: #fff; border-bottom-right-radius: 4px; border-bottom-left-radius: 12px;
}
.panel-msg-ai .panel-msg-body { background: #fefce8; border-color: #fde68a; }
.panel-msg-system {
    max-width: 100%; padding: 6px 10px; border-radius: 8px;
    background: #e5e7eb; color: #4b5563; font-size: 12px; text-align: center;
}
.panel-inputrow { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e5e7eb; background: #fff; }
.panel-inputrow input { flex: 1; }
.panel-inputrow .panel-btn { width: auto; }
.panel-chat-closed-note { padding: 10px 14px; color: #6b7280; font-size: 13px; text-align: center; }

/* Team */
.panel-team {
    background: #fff; border: 1px solid #d1d5db; border-radius: 12px;
    display: flex; flex-direction: column; height: 70vh;
}
.panel-team-messages { flex: 1; padding: 14px; overflow-y: auto; background: #f9fafb; }

/* Owner */
.panel-tabpane h2 { margin: 18px 0 8px; font-size: 16px; }
.panel-tabpane h2:first-child { margin-top: 0; }
.panel-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #d1d5db; border-radius: 12px; overflow: hidden; }
.panel-table th, .panel-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e5e7eb; font-size: 13px; }
.panel-table th { background: #f9fafb; font-weight: 700; }
.panel-table tr:last-child td { border-bottom: none; }
.panel-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; margin-right: 6px; vertical-align: middle; }
.panel-dot-online { background: #16a34a; }

.panel-footer {
    margin-top: auto; padding-top: 18px; display: flex; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; font-size: 12px; color: #6b7280;
}

@media (max-width: 760px) {
    .panel-queue-layout { flex-direction: column; }
    .panel-queue-list { flex: none; width: 100%; max-height: 40vh; }
    .panel-chat, .panel-team { height: 60vh; }
}
