/* ============================================
   IP Call BD - Workflow Office
   Clean & Functional CSS
   ============================================ */

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

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    background: #f0f0f0;
    color: #333;
    line-height: 1.5;
}

a {
    color: #3b5998;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---- Layout ---- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 220px;
    background: #3b5998;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    position: relative;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.sidebar-close-btn {
    display: none;
}

.sidebar-overlay {
    display: none;
}

.mobile-menu-btn {
    display: none;
}

.sidebar-header img {
    max-width: 150px;
    height: auto;
}

.sidebar-header .logo-text {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
}

.sidebar-nav {
    padding: 10px 0;
    flex: 1;
}

.sidebar-nav .nav-item {
    display: block;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

.sidebar-nav .nav-item.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-left-color: #fff;
    font-weight: bold;
}

.sidebar-nav .nav-item.disabled {
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

.sidebar-nav .nav-item.disabled:hover {
    background: none;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-nav .nav-group-toggle {
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.sidebar-nav .nav-group-chevron {
    font-size: 11px;
    opacity: 0.85;
    transition: transform 0.15s ease;
}

.sidebar-nav .nav-group.is-open .nav-group-chevron {
    transform: rotate(180deg);
}

.sidebar-nav .nav-subitems {
    display: none;
    padding-bottom: 4px;
}

.sidebar-nav .nav-group.is-open .nav-subitems {
    display: block;
}

.sidebar-nav .nav-subitem {
    padding-left: 32px;
    font-size: 13px;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: calc(100% - 220px);
    box-sizing: border-box;
}

/* ---- Top Header ---- */
.top-header {
    background: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #3b5998;
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.top-header .header-title {
    font-size: 16px;
    font-weight: bold;
    color: #3b5998;
}

.top-header .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.top-header .user-info span {
    color: #555;
}

/* ---- Content Body ---- */
.content-body {
    padding: 20px;
    flex: 1;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    line-height: 1.5;
}

.btn:hover {
    text-decoration: none;
    opacity: 0.85;
}

.btn-primary {
    background: #3b5998;
    color: #fff;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ---- Tables ---- */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}

table th,
table td {
    padding: 8px 10px;
    text-align: left;
    border: 1px solid #ddd;
}

table th {
    background: #3b5998;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
}

table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

/* ---- Clickable Rows (search results etc.) ---- */
.clickable-row {
    cursor: pointer;
}

/* Row link styling only when hovering non-phone cells (not when cursor is on Phone column) */
.clickable-row:hover td:not(.phone-with-dial-cell) {
    color: #0000ee;
    text-decoration: underline;
}

.clickable-row:has(.phone-with-dial-cell:hover) td:not(.phone-with-dial-cell) {
    color: #333;
    text-decoration: none;
}

.phone-with-dial-cell {
    white-space: nowrap;
    cursor: default;
    color: #333 !important;
    text-decoration: none !important;
}

.clickable-row:hover .phone-with-dial-cell,
.clickable-row:hover .phone-with-dial-cell .phone-with-dial-number {
    color: #333 !important;
    text-decoration: none !important;
}

.phone-dial-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.phone-with-dial-number {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    user-select: text;
}

button.softphone-dial-btn {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 1px;
    margin: 0;
    border: 1px solid #b8c4d0;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
    cursor: pointer;
    line-height: 0;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

button.softphone-dial-btn:hover {
    border-color: #28a745;
    box-shadow: 0 0 0 1px rgba(40, 167, 69, 0.2);
}

button.softphone-dial-btn:active {
    transform: scale(0.96);
}

button.softphone-dial-btn:focus-visible {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

button.softphone-dial-btn img.softphone-dial-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
    pointer-events: none;
    display: block;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
    font-size: 13px;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    font-family: Arial, Helvetica, sans-serif;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b5998;
}

/* ---- Stat Boxes ---- */
.stat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px 20px;
    min-width: 180px;
    flex: 1;
}

.stat-box .stat-label {
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.stat-box .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #3b5998;
}

.stat-box .stat-value a {
    color: #3b5998;
    text-decoration: none;
}

.stat-box .stat-value a:hover {
    text-decoration: underline;
}

.stat-box.green .stat-value,
.stat-box.green .stat-value a { color: #28a745; }

.stat-box.red .stat-value,
.stat-box.red .stat-value a { color: #dc3545; }

.stat-box.orange .stat-value,
.stat-box.orange .stat-value a { color: #fd7e14; }

.stat-box.blue .stat-value,
.stat-box.blue .stat-value a { color: #3b5998; }

.stat-box.active {
    border-color: #fd7e14;
    box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.2);
    background: #fff8f1;
}

@media (min-width: 992px) {
    .customers-stat-grid {
        flex-wrap: nowrap;
    }

    .customers-stat-grid .stat-box {
        min-width: 0;
        flex: 1 1 0;
        padding: 12px 8px;
    }

    .customers-stat-grid .stat-box .stat-label {
        font-size: 10px;
        line-height: 1.25;
    }

    .customers-stat-grid .stat-box .stat-value {
        font-size: 20px;
    }
}

.dept-pending-section {
    margin-bottom: 16px;
}

.dept-pending-heading {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dept-pending-grid {
    gap: 8px;
    margin-bottom: 0;
}

.dept-pending-grid .stat-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    width: auto;
    flex: 0 0 auto;
    padding: 8px 14px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.dept-pending-grid .stat-box:hover {
    transform: translateY(-1px);
    border-color: #c5cdd8;
    background: #f8fafc;
}

.dept-pending-grid .stat-box .stat-label {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0;
    line-height: 1.25;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.dept-pending-grid .stat-box .stat-value,
.dept-pending-grid .stat-box .stat-value a {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
}

.dept-pending-grid .stat-box.zero {
    border-color: #b7e4c7;
    box-shadow: none;
    background: #f6fff8;
}

.dept-pending-grid .stat-box.zero:hover {
    border-color: #86d39b;
    background: #edfbf1;
}

.dept-pending-grid .stat-box.zero .stat-value,
.dept-pending-grid .stat-box.zero .stat-value a {
    color: #28a745;
}

.dept-pending-grid .stat-box.active {
    border-color: #fd7e14;
    box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.18);
    background: #fff8f1;
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 3px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* ---- Alerts ---- */
.alert {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 3px;
    font-size: 13px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ---- Login Page ---- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #3b5998;
}

.login-box {
    background: #fff;
    padding: 30px;
    border-radius: 5px;
    width: 350px;
    text-align: center;
}

.login-box img {
    max-width: 180px;
    margin-bottom: 15px;
}

.login-box h2 {
    margin-bottom: 5px;
    color: #3b5998;
    font-size: 18px;
}

.login-box p {
    margin-bottom: 20px;
    color: #777;
    font-size: 13px;
}

.login-box .form-group {
    text-align: left;
}

/* ---- Section Headers ---- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3b5998;
}

.page-header h2 {
    font-size: 18px;
    color: #3b5998;
    margin: 0;
}

/* ---- Panel ---- */
.panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.panel-header {
    font-size: 15px;
    font-weight: bold;
    color: #3b5998;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* ---- Customer Details ---- */
.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table th {
    background: transparent;
    color: #555;
    font-weight: bold;
    text-align: right;
    padding: 6px 10px;
    width: 40%;
    border: none;
    font-size: 13px;
    text-transform: none;
}

.detail-table td {
    padding: 6px 10px;
    border: none;
    font-size: 13px;
    color: #333;
}

.detail-table tr {
    border-bottom: 1px solid #f0f0f0;
}

/* ---- Ticket Log (legacy) ---- */
.ticket-log {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 15px;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    line-height: 1.8;
    border-radius: 3px;
}

/* ---- Ticket details workspace ---- */
.td-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.td-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.td-back {
    display: inline-block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.td-topbar h2 {
    font-size: 22px;
    color: #111827;
    letter-spacing: -0.02em;
}

.td-topbar-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.td-wait {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f2adad;
    color: #222;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 22px;
    border-radius: 0;
    min-width: 160px;
    text-align: center;
    line-height: 1.2;
}

.td-assigned-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.td-assigned-row {
    font-size: 14px;
    line-height: 1.4;
    color: #111827;
}

.td-assigned-dept {
    display: inline;
    color: #9ca3af;
    font-weight: 500;
}

.td-dept-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 2px;
}

.td-dept-pill {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    line-height: 1.25;
}

.td-dept-list strong {
    font-size: 13px;
    color: #111827;
}

.td-summary .td-assigned-row strong {
    display: inline;
}

.td-summary {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr 1.6fr;
    gap: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 16px;
    align-items: start;
}

.td-summary span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
    margin-bottom: 3px;
}

.td-summary strong {
    display: block;
    font-size: 14px;
    color: #111827;
}

.td-summary small {
    display: block;
    margin-top: 2px;
    color: #6b7280;
    font-size: 12px;
}

.ticket-view-filter {
    margin-bottom: 15px;
    display: flex;
    gap: 8px;
}

.ticket-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
    align-items: stretch;
    min-height: calc(100vh - 250px);
}

.ticket-chat-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    min-height: 560px;
    height: calc(100vh - 250px);
}

.ticket-actions-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-actions-panel form {
    margin: 0;
}

.ticket-actions-panel select {
    width: 100%;
    margin-bottom: 5px;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
}

.td-action-status {
    font-size: 13px;
    line-height: 1.4;
    color: #374151;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 10px 12px;
}

.td-action-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.td-action-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ticket-actions-panel .td-action-group {
    gap: 5px;
}

.td-btn {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}

.ticket-actions-panel .td-btn {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}

.td-btn:hover {
    background: #f9fafb;
    text-decoration: none;
    opacity: 1;
}

.td-btn-primary {
    background: #3b5998;
    border-color: #3b5998;
    color: #fff;
}

.td-btn-primary:hover {
    background: #324b82;
}

.td-btn-success {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.td-btn-success:hover {
    background: #15803d;
}

.td-btn-danger {
    background: #fff;
    border-color: #fecaca;
    color: #b91c1c;
}

.td-btn-link {
    text-align: center;
    color: #3b5998;
}

.action-error {
    font-size: 11px;
    color: #dc3545;
}

.chat-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 12px 0;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.chat-tab {
    padding: 10px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.chat-tab.active {
    color: #3b5998;
    border-bottom-color: #3b5998;
    background: #fff;
    border-radius: 8px 8px 0 0;
}

.tab-badge {
    background: #3b5998;
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.chat-tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.chat-tab-content.active {
    display: flex;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 18px 8px;
    background: #eef2f7;
    min-height: 0;
}

.chat-ticket-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 auto 16px;
    max-width: 640px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.chat-ticket-card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 6px;
}

.chat-ticket-card p {
    font-size: 14px;
    color: #111827;
    margin: 0;
}

.chat-ticket-card-meta {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.chat-event {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 14px 0;
    color: #6b7280;
    font-size: 12px;
}

.chat-event span {
    background: #e5e7eb;
    border-radius: 999px;
    padding: 4px 10px;
}

.chat-event time {
    color: #9ca3af;
}

.chat-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    max-width: 78%;
}

.chat-row.is-theirs {
    margin-right: auto;
}

.chat-row.is-mine {
    margin-left: auto;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 18px;
}

.chat-col {
    min-width: 0;
}

.chat-name {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.chat-row.is-mine .chat-name {
    text-align: right;
}

.chat-name time {
    margin-left: 6px;
    color: #9ca3af;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.chat-row.is-theirs .chat-bubble {
    border-top-left-radius: 4px;
}

.chat-row.is-mine .chat-bubble {
    background: #3b5998;
    color: #fff;
    border-top-right-radius: 4px;
}

.chat-row.is-mine .chat-mention {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.chat-bubble-resolved {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.chat-bubble-traceless,
.chat-bubble-reschedule {
    background: #fffbeb !important;
    color: #92400e !important;
}

.chat-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 4px;
}

.chat-body {
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.chat-mention {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 600;
}

.chat-compose {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 12px 14px 14px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.mention-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: flex-end;
}

.chat-compose textarea {
    width: 100%;
    display: block;
    height: 48px;
    min-height: 48px;
    max-height: 140px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 22px;
    resize: none;
    font-family: inherit;
    box-sizing: border-box;
    overflow-y: auto;
}

.chat-compose textarea:focus {
    outline: none;
    border-color: #3b5998;
    box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.15);
}

.chat-send {
    background: #3b5998;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0 22px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    height: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.05s ease;
}

.chat-send:hover {
    background: #2d4373;
}

.chat-send:active {
    transform: scale(0.98);
}

.chat-send:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.chat-compose-hint {
    padding: 0 16px 12px;
    font-size: 11px;
    color: #9ca3af;
    background: #fff;
}

.chat-closed {
    padding: 14px;
    text-align: center;
    color: #6b7280;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}



.mention-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    max-height: 220px;
    overflow-y: auto;
    z-index: 20;
}

.mention-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.mention-item:hover,
.mention-item.active {
    background: #eef2ff;
}

.mention-item strong {
    font-size: 13px;
}

.mention-item small {
    color: #6b7280;
    font-size: 11px;
}

.update-log-messages {
    background: #fff;
}

.update-log-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.update-log-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.update-log-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}

.update-log-header strong {
    color: #3b5998;
}

.update-log-body {
    font-size: 13px;
    color: #444;
}

.ticket-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.ticket-modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.ticket-modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.ticket-modal-content .form-group {
    margin-bottom: 12px;
}

.ticket-modal-content select,
.ticket-modal-content input[type="datetime-local"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.emp-dept-group {
    margin-bottom: 24px;
}

.emp-dept-group h4 {
    margin-bottom: 8px;
    color: #3b5998;
}

.emp-dept-group h4 small {
    color: #888;
    font-weight: normal;
}



/* ---- Action Buttons Row ---- */
.action-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    gap: 5px;
    margin-top: 15px;
    justify-content: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #ddd;
    font-size: 12px;
    color: #3b5998;
    background: #fff;
    border-radius: 3px;
    text-decoration: none;
}

.pagination a:hover {
    background: #e8f0fe;
    text-decoration: none;
}

.pagination .current {
    background: #3b5998;
    color: #fff;
    border-color: #3b5998;
}

/* ---- Search Form Inline ---- */
.search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.search-row label {
    width: 120px;
    font-weight: bold;
    font-size: 13px;
    color: #555;
    flex-shrink: 0;
}

.search-row input {
    flex: 1;
    max-width: 300px;
}

/* ---- Inline Form Grid ---- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ---- Misc ---- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

.hidden {
    display: none;
}

/* ---- Server Cards ---- */
.server-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 15px;
}

.server-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.server-card.expired {
    border-left: 3px solid #dc3545;
}

.server-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.server-card-header .server-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.server-card-header .server-actions {
    display: flex;
    gap: 5px;
}

.server-card-body {
    padding: 15px;
}

.server-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.server-info-item {
    display: flex;
    flex-direction: column;
}

.server-info-item .info-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.server-info-item .info-value {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.server-update-log {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.server-update-log .info-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

/* ---- Info Icon Button ---- */
.btn-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8f4fd;
    color: #3b82f6;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-info-icon:hover {
    background: #3b82f6;
    color: #fff;
    text-decoration: none;
    transform: scale(1.1);
}

.btn-refresh-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #059669;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-refresh-icon svg {
    width: 14px;
    height: 14px;
}

.btn-refresh-icon:hover {
    background: #059669;
    color: #fff;
    text-decoration: none;
    transform: scale(1.1);
}

/* ---- Server Detail Page ---- */
.server-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.server-detail-item {
    display: flex;
    flex-direction: column;
}

.server-detail-item .detail-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.server-detail-item .detail-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.text-danger {
    color: #dc3545 !important;
}

/* ---- Action Bar ---- */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-setup {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-setup:hover:not(.disabled) {
    background: #1d4ed8;
    text-decoration: none;
}

.btn-setup.disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-log {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-log:hover {
    background: #e9ecef;
    text-decoration: none;
}

/* ---- Setup Status Badge ---- */
.setup-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-none {
    background: #f1f5f9;
    color: #64748b;
}

.status-pending {
    background: #f1f5f9;
    color: #64748b;
}

.status-running {
    background: #eff6ff;
    color: #2563eb;
    animation: pulse-status 1.5s ease-in-out infinite;
}

.status-completed {
    background: #f0fdf4;
    color: #16a34a;
}

.status-failed {
    background: #fef2f2;
    color: #dc2626;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ---- Log Modal ---- */
.log-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.log-modal-content {
    background: #1e1e2e;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.log-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #2d2d3f;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
}

.log-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
}

.log-modal-close:hover {
    color: #fff;
}

.log-modal-body {
    padding: 20px;
    margin: 0;
    overflow-y: auto;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #a6e3a1;
    background: #1e1e2e;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ============================================================
   SETUP DASHBOARD STYLES
   ============================================================ */

/* ---- Status Badges ---- */
.setup-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.setup-badge-none {
    background: #f1f3f5;
    color: #868e96;
}

.setup-badge-running {
    background: #e7f5ff;
    color: #1971c2;
    border: 1px solid #74c0fc;
}

.setup-badge-completed {
    background: #ebfbee;
    color: #2b8a3e;
    border: 1px solid #69db7c;
}

.setup-badge-failed {
    background: #fff5f5;
    color: #c92a2a;
    border: 1px solid #ff8787;
}

.setup-badge-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1971c2;
    animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* ---- Action Bar ---- */
.setup-action-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.setup-btn-start {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #4263eb, #3b5bdb);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(66, 99, 235, 0.3);
}

.setup-btn-start:hover:not(.disabled) {
    background: linear-gradient(135deg, #3b5bdb, #364fc7);
    box-shadow: 0 4px 16px rgba(66, 99, 235, 0.4);
    transform: translateY(-1px);
}

.setup-btn-start.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.setup-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.setup-cred-warning {
    color: #e03131;
    font-size: 13px;
    font-weight: 500;
}

/* ---- Info Cards Grid ---- */
.setup-info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

.setup-info-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 14px 18px;
    min-width: 0;
    box-sizing: border-box;
}

.setup-info-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #868e96;
    margin-bottom: 4px;
}

.setup-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
}

.setup-info-value.text-running {
    color: #1971c2;
}

.setup-info-value.text-completed {
    color: #2b8a3e;
}

.setup-info-value.text-failed {
    color: #c92a2a;
}

/* ---- Progress Bar ---- */
.setup-progress-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

.setup-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.setup-progress-header span {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
}

#setupProgressPercent {
    font-size: 15px;
    font-weight: 700;
    color: #4263eb;
}

.setup-progress-track {
    height: 10px;
    background: #dee2e6;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.setup-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4263eb, #5c7cfa, #748ffc);
    background-size: 200% 100%;
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: progressShimmer 2s linear infinite;
    position: relative;
}

.setup-progress-fill.complete {
    background: linear-gradient(90deg, #2b8a3e, #40c057, #51cf66);
    animation: none;
}

.setup-progress-fill.failed {
    background: linear-gradient(90deg, #c92a2a, #e03131, #f03e3e);
    animation: none;
}

@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.setup-progress-step {
    font-size: 12px;
    color: #868e96;
    margin-top: 8px;
}

/* ---- Step Timeline ---- */
.setup-timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

.setup-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    min-width: 0;
    box-sizing: border-box;
}

.setup-timeline-item.active {
    background: #e7f5ff;
    border-color: #74c0fc;
}

.setup-timeline-item.completed {
    background: #ebfbee;
    border-color: #b2f2bb;
}

.setup-timeline-item.error {
    background: #fff5f5;
    border-color: #ffa8a8;
}

.setup-timeline-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #dee2e6;
    color: #868e96;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.setup-timeline-item.completed .setup-timeline-icon {
    background: #2b8a3e;
    color: #fff;
}

.setup-timeline-item.completed .setup-timeline-icon .step-number {
    display: none;
}

.setup-timeline-item.completed .setup-timeline-icon::after {
    content: '✓';
    font-size: 14px;
}

.setup-timeline-item.active .setup-timeline-icon {
    background: #1971c2;
    color: #fff;
    animation: activeStepPulse 1.5s ease-in-out infinite;
}

@keyframes activeStepPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(25, 113, 194, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(25, 113, 194, 0); }
}

.setup-timeline-item.error .setup-timeline-icon {
    background: #c92a2a;
    color: #fff;
}

.setup-timeline-item.error .setup-timeline-icon .step-number {
    display: none;
}

.setup-timeline-item.error .setup-timeline-icon::after {
    content: '✗';
    font-size: 14px;
}

.setup-timeline-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.setup-timeline-title {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.setup-timeline-item.completed .setup-timeline-title {
    color: #2b8a3e;
}

.setup-timeline-item.active .setup-timeline-title {
    color: #1971c2;
}

.setup-timeline-item.error .setup-timeline-title {
    color: #c92a2a;
}

.setup-timeline-msg {
    font-size: 10px;
    color: #adb5bd;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Terminal Log Viewer ---- */
.setup-terminal-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.setup-terminal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #2d2d3f;
    border-bottom: 1px solid #383850;
}

.setup-terminal-dots {
    display: flex;
    gap: 6px;
}

.setup-terminal-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.setup-terminal-dots .dot.red { background: #ff5f57; }
.setup-terminal-dots .dot.yellow { background: #febc2e; }
.setup-terminal-dots .dot.green { background: #28c840; }

.setup-terminal-title {
    flex: 1;
    font-size: 12px;
    color: #cdd6f4;
    font-weight: 500;
}

.setup-terminal-actions {
    display: flex;
    gap: 6px;
}

.setup-terminal-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #cdd6f4;
    background: #45475a;
    border: 1px solid #585b70;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.setup-terminal-btn:hover {
    background: #585b70;
    color: #fff;
}

.setup-terminal-btn.scroll-btn {
    background: #4263eb;
    border-color: #4263eb;
    color: #fff;
    animation: scrollBtnPulse 2s ease-in-out infinite;
}

@keyframes scrollBtnPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.setup-terminal {
    background: #1e1e2e;
    min-height: 200px;
    max-height: 420px;
    overflow-y: auto;
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.7;
    scroll-behavior: smooth;
}

/* Custom scrollbar for terminal */
.setup-terminal::-webkit-scrollbar {
    width: 6px;
}

.setup-terminal::-webkit-scrollbar-track {
    background: #181825;
}

.setup-terminal::-webkit-scrollbar-thumb {
    background: #45475a;
    border-radius: 3px;
}

.setup-terminal::-webkit-scrollbar-thumb:hover {
    background: #585b70;
}

.setup-terminal-welcome {
    padding: 20px 0;
    text-align: center;
}

.terminal-dim {
    color: #585b70;
    font-style: italic;
}

.terminal-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
    animation: lineSlideIn 0.2s ease-out;
}

@keyframes lineSlideIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.terminal-time {
    color: #585b70;
    font-size: 11px;
    min-width: 65px;
    flex-shrink: 0;
}

.terminal-icon {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    font-size: 12px;
}

.terminal-icon.success { color: #a6e3a1; }
.terminal-icon.error { color: #f38ba8; }
.terminal-icon.warning { color: #f9e2af; }
.terminal-icon.progress { color: #89b4fa; }
.terminal-icon.info { color: #585b70; }
.terminal-icon.complete { color: #f9e2af; }

.terminal-message {
    color: #cdd6f4;
    word-break: break-word;
}

.terminal-line.terminal-success .terminal-message {
    color: #a6e3a1;
}

.terminal-line.terminal-error .terminal-message {
    color: #f38ba8;
}

.terminal-line.terminal-warning .terminal-message {
    color: #f9e2af;
}

.terminal-line.terminal-progress .terminal-message {
    color: #89b4fa;
}

.terminal-line.terminal-complete .terminal-message {
    color: #f9e2af;
    font-weight: 600;
}

.terminal-line.terminal-failed .terminal-message {
    color: #f38ba8;
    font-weight: 600;
}

.terminal-line.terminal-info .terminal-message {
    color: #a6adc8;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .setup-timeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .setup-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 250px;
        max-width: 80vw;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1200;
        box-shadow: none;
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    }

    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 12px;
        top: 12px;
        width: 32px;
        height: 32px;
        font-size: 24px;
        color: #fff;
        background: rgba(255, 255, 255, 0.15);
        border: none;
        border-radius: 6px;
        cursor: pointer;
        line-height: 1;
    }

    .sidebar-close-btn:hover {
        background: rgba(255, 255, 255, 0.25);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1100;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-btn {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        width: 34px;
        height: 34px;
        background: #f8fafc;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        cursor: pointer;
        padding: 5px;
        flex-shrink: 0;
    }

    .mobile-menu-btn span {
        display: block;
        width: 18px;
        height: 2px;
        background: #334155;
        border-radius: 2px;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0;
    }

    .top-header {
        padding: 8px 12px;
        gap: 8px;
    }

    .top-header .user-info {
        gap: 6px;
        margin-left: auto;
    }

    .top-header .user-info .user-welcome {
        display: none;
    }

    .btn-header-action {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }

    .content-body {
        padding: 12px 10px;
    }

    .ticket-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
        min-height: auto;
    }

    .ticket-chat-panel {
        height: auto;
        min-height: auto;
    }

    .chat-messages {
        height: 52vh;
        min-height: 320px;
        max-height: 520px;
        padding: 14px 10px;
    }

    .td-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .td-topbar-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: wrap;
        width: 100%;
    }

    .td-wait {
        min-width: auto;
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 6px;
    }

    .td-summary {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }

    .td-summary span {
        font-size: 10px;
    }

    .td-summary strong {
        font-size: 13px;
    }

    .chat-row {
        max-width: 90%;
        gap: 8px;
    }

    .chat-avatar {
        width: 28px;
        height: 28px;
        font-size: 10px;
        margin-top: 14px;
    }

    .chat-bubble {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 12px;
    }

    .chat-compose {
        padding: 10px 10px;
        gap: 8px;
    }

    .chat-compose textarea {
        padding: 10px 12px;
        font-size: 13px;
        height: 44px;
        min-height: 44px;
        border-radius: 10px;
    }

    .chat-send {
        height: 44px;
        min-height: 44px;
        padding: 0 16px;
        font-size: 13px;
        border-radius: 10px;
    }

    .ticket-actions-panel {
        padding: 14px;
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .stat-grid {
        flex-direction: column;
    }
    .customers-stat-grid {
        flex-direction: column;
        flex-wrap: wrap;
    }
    .customers-stat-grid .stat-box {
        min-width: 180px;
        flex: 1;
        padding: 15px 20px;
    }
    .customers-stat-grid .stat-box .stat-label {
        font-size: 12px;
    }
    .customers-stat-grid .stat-box .stat-value {
        font-size: 24px;
    }
    .dept-pending-grid {
        flex-direction: row;
    }
    .dept-pending-grid .stat-box {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        padding: 8px 10px;
    }
    .dept-pending-grid .stat-box .stat-label {
        white-space: normal;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .server-cards {
        grid-template-columns: 1fr;
    }
    .server-info-grid {
        grid-template-columns: 1fr;
    }
    .setup-timeline {
        grid-template-columns: minmax(0, 1fr);
    }
    .setup-info-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .setup-action-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 6px 10px;
    }

    .header-title {
        font-size: 14px;
    }

    .td-topbar h2 {
        font-size: 18px;
    }

    .chat-row {
        max-width: 95%;
    }

    .chat-bubble {
        padding: 7px 10px;
        font-size: 12px;
    }

    .chat-name {
        font-size: 11px;
    }

    .btn-header-action {
        padding: 4px 6px !important;
        font-size: 10px !important;
    }
}


/* ============================================
   FAQ (faq.php, faq_view.php, faq_edit.php, faq_requests.php)
   ============================================ */
.faq-page {
    max-width: 980px;
}

.faq-page-header {
    flex-wrap: wrap;
    gap: 10px;
}

.faq-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.faq-count {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 10px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
}

.faq-search {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.faq-search input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    font-size: 14px;
}

.faq-search .btn {
    padding: 8px 18px;
}

.faq-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid #ddd;
}

.faq-tab {
    padding: 7px 14px;
    color: #555;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-weight: bold;
}

.faq-tab:hover {
    text-decoration: none;
    color: #3b5998;
}

.faq-tab.active {
    color: #3b5998;
    border-bottom-color: #3b5998;
}

.faq-tab span,
.faq-chip span {
    font-weight: normal;
    color: #888;
    font-size: 12px;
}

.faq-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.faq-chip {
    padding: 3px 12px;
    border: 1px solid #ccd3e3;
    border-radius: 14px;
    background: #fff;
    color: #3b5998;
    font-size: 13px;
}

.faq-chip:hover {
    text-decoration: none;
    background: #eef2fa;
}

.faq-chip.active {
    background: #3b5998;
    border-color: #3b5998;
    color: #fff;
}

.faq-chip.active span {
    color: rgba(255, 255, 255, 0.8);
}

.faq-result-line {
    margin-bottom: 10px;
    color: #666;
    font-size: 13px;
}

.faq-list {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.faq-group-title {
    padding: 8px 16px;
    background: #f4f6fb;
    border-top: 1px solid #e3e7f0;
    color: #3b5998;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.faq-list > .faq-group-title:first-child {
    border-top: none;
}

.faq-item {
    display: block;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    color: #333;
}

.faq-list > .faq-item:first-child,
.faq-group-title + .faq-item {
    border-top: none;
}

.faq-item:hover {
    text-decoration: none;
    background: #fafbfe;
}

.faq-item-q {
    font-size: 15px;
    font-weight: bold;
    color: #3b5998;
    margin-bottom: 3px;
}

.faq-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    font-size: 12px;
    color: #888;
}

.faq-snippet {
    margin-top: 4px;
    color: #555;
    font-size: 13px;
}

.faq-cat {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.faq-cat-technical {
    background: #d1ecf1;
    color: #0c5460;
}

.faq-cat-marketing {
    background: #fff3cd;
    color: #856404;
}

.faq-empty p {
    margin-bottom: 8px;
}

.faq-footnote {
    margin-top: 14px;
    color: #666;
    font-size: 13px;
}

.faq-muted {
    color: #888;
    font-weight: normal;
}

.faq-optional {
    color: #999;
    font-weight: normal;
}

.faq-static-field {
    padding: 7px 0;
    font-size: 13px;
}

/* Article page */
.faq-topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.faq-article-panel {
    padding: 24px 28px;
}

.faq-article-title {
    margin: 8px 0 6px;
    font-size: 22px;
    line-height: 1.3;
    color: #222;
}

.faq-byline {
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid #eee;
}

.faq-article {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    overflow-wrap: break-word;
}

.faq-article > *:first-child {
    margin-top: 0;
}

.faq-article p,
.faq-article ul,
.faq-article ol,
.faq-article pre,
.faq-article blockquote {
    margin: 0 0 12px;
}

.faq-article h2 {
    margin: 22px 0 10px;
    font-size: 19px;
    color: #3b5998;
}

.faq-article h3,
.faq-article h4 {
    margin: 18px 0 8px;
    font-size: 16px;
    color: #333;
}

.faq-article ul,
.faq-article ol {
    padding-left: 26px;
}

.faq-article li {
    margin-bottom: 4px;
}

.faq-article li > ul,
.faq-article li > ol {
    margin: 4px 0 0;
}

.faq-article a {
    text-decoration: underline;
}

.faq-article blockquote {
    padding: 8px 14px;
    border-left: 4px solid #3b5998;
    background: #f4f6fb;
    color: #444;
}

.faq-article code {
    padding: 1px 5px;
    border-radius: 3px;
    background: #f1f3f5;
    font-family: Menlo, Consolas, monospace;
    font-size: 13px;
    color: #c7254e;
}

.faq-article pre {
    padding: 12px 14px;
    border-radius: 4px;
    background: #1f2430;
    color: #e6e6e6;
    font-family: Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-x: auto;
}

.faq-article pre code {
    padding: 0;
    background: none;
    color: inherit;
}

.faq-article img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: zoom-in;
}

.faq-article hr {
    margin: 18px 0;
    border: none;
    border-top: 1px solid #ddd;
}

.faq-related ul {
    padding-left: 20px;
}

.faq-related li {
    margin-bottom: 4px;
}

/* Editor */
.faq-radio {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: normal !important;
    color: #333 !important;
    cursor: pointer;
}

.faq-radio input {
    margin-top: 3px;
}

.faq-editor-wrap {
    background: #fff;
}

.faq-editor-wrap .ql-toolbar.ql-snow {
    border-color: #ccc;
    border-radius: 3px 3px 0 0;
}

.faq-editor-wrap .ql-container.ql-snow {
    border-color: #ccc;
    border-radius: 0 0 3px 3px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

.faq-editor-wrap .ql-editor {
    min-height: 320px;
    max-height: 70vh;
    overflow-y: auto;
    line-height: 1.6;
}

.faq-editor-wrap .ql-editor img {
    max-width: 100%;
}

.faq-editor-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

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

/* Requests */
.faq-request-box .faq-request-q {
    margin-top: 6px;
}

.faq-request-list {
    border-top: 1px solid #eee;
}

.faq-request {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
}

.faq-request:last-child {
    border-bottom: none;
}

.faq-request-own {
    background: #fbfcf4;
}

.faq-request-new {
    background: #f1faf3;
}

.faq-request-main {
    flex: 1;
    min-width: 0;
}

.faq-request-q {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.faq-request-details {
    margin-bottom: 6px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 3px;
    font-size: 13px;
    color: #555;
    white-space: normal;
    overflow-wrap: break-word;
}

.faq-request-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.faq-request-answer {
    margin-top: 8px;
}

.faq-private-label {
    font-size: 12px;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 4px;
}

.faq-private-body {
    padding: 10px 14px;
    border-left: 3px solid #28a745;
    background: #fff;
    font-size: 14px;
}

.faq-private summary {
    cursor: pointer;
    color: #3b5998;
    font-size: 13px;
}

.faq-private .faq-article {
    margin-top: 6px;
    padding: 10px 14px;
    border-left: 3px solid #28a745;
    font-size: 14px;
}

.faq-new {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 3px;
    background: #28a745;
    color: #fff;
    font-size: 11px;
    vertical-align: middle;
}

/* Language switch (English / Bangla) */
.faq-lang-switch {
    display: inline-flex;
    border: 1px solid #3b5998;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.faq-lang-switch a {
    padding: 5px 12px;
    font-size: 13px;
    color: #3b5998;
    line-height: 1.5;
}

.faq-lang-switch a + a {
    border-left: 1px solid #3b5998;
}

.faq-lang-switch a:hover {
    text-decoration: none;
    background: #eef2fa;
}

.faq-lang-switch a.active {
    background: #3b5998;
    color: #fff;
}

.faq-lang-note {
    margin-bottom: 14px;
    padding: 8px 12px;
    border-radius: 3px;
    background: #fff3cd;
    color: #856404;
    font-size: 13px;
}

.faq-en-only {
    padding: 0 6px;
    border-radius: 3px;
    background: #e2e3e5;
    color: #555;
    font-size: 11px;
}

[lang="bn"] {
    font-family: 'Noto Sans Bengali', 'Hind Siliguri', 'SolaimanLipi', 'Kalpurush', Arial, sans-serif;
}

.faq-lang-tabs {
    display: flex;
    gap: 4px;
    margin: 4px 0 12px;
    border-bottom: 1px solid #ddd;
}

.faq-lang-tab {
    padding: 7px 14px;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: none;
    color: #555;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.faq-lang-tab.active {
    color: #3b5998;
    border-bottom-color: #3b5998;
}

@media (max-width: 768px) {
    .faq-article-panel {
        padding: 16px;
    }
    .faq-article-title {
        font-size: 19px;
    }
    .faq-request {
        flex-direction: column;
    }
    .faq-search .btn {
        padding: 8px 12px;
    }
}
