/* ==========================================================================
   Karachi Punching Designer - Executive Dark Dashboard & Admin UI Stylesheet
   ========================================================================== */

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--bg-darker);
}

/* Sidebar */
.dash-sidebar {
    width: 270px;
    background: #0B0E17;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.5);
}

.dash-brand {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.dash-menu {
    padding: 24px 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-menu-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.dash-menu-link:hover, .dash-menu-link.active {
    background: rgba(245, 158, 11, 0.15);
    color: var(--gold-light);
    border-left: 3px solid var(--gold);
}

.dash-user-card {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Main Dashboard Body */
.dash-main {
    margin-left: 270px;
    flex-grow: 1;
    padding: 30px 40px;
    background: var(--bg-main);
    min-height: 100vh;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 35px;
}

.dash-title {
    font-size: 2rem;
    color: #FFFFFF;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 35px;
}

.metric-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: rgba(18, 24, 38, 0.75);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
}

.metric-val {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gold-light);
    margin: 10px 0 4px 0;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.custom-table th, .custom-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.custom-table th {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    background: rgba(6, 8, 15, 0.8);
}

.custom-table tr:hover td {
    background: rgba(245, 158, 11, 0.05);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: capitalize;
}

.status-pending { background: rgba(245, 158, 11, 0.18); color: #FCD34D; border: 1px solid rgba(245, 158, 11, 0.4); }
.status-in_progress { background: rgba(0, 242, 254, 0.18); color: #00F2FE; border: 1px solid rgba(0, 242, 254, 0.4); }
.status-completed { background: rgba(16, 185, 129, 0.18); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.4); }
.status-cancelled { background: rgba(239, 68, 68, 0.18); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.4); }

/* Live Chat Box */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    border-radius: var(--radius-md);
    background: rgba(18, 24, 38, 0.85);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.chat-header {
    padding: 16px 24px;
    background: #06080F;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-messages {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #0B0E17;
}

.chat-msg-row {
    display: flex;
    gap: 12px;
    max-width: 75%;
}

.chat-msg-row.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-row.received {
    align-self: flex-start;
}

.chat-bubble {
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-msg-row.sent .chat-bubble {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #000000;
    font-weight: 700;
    border-bottom-right-radius: 2px;
}

.chat-msg-row.received .chat-bubble {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 2px;
}

.chat-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.chat-footer {
    padding: 16px 24px;
    background: #06080F;
    border-top: 1px solid var(--border-color);
}

.chat-input-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 1024px) {
    .dash-sidebar { width: 80px; }
    .dash-sidebar .brand-text, .dash-sidebar .dash-menu-link span, .dash-user-card .user-info { display: none; }
    .dash-main { margin-left: 80px; padding: 20px; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .metrics-grid { grid-template-columns: 1fr; }
}
