:root {
    --bg-color: #08060c;
    --card-bg: rgba(255, 255, 255, 0.02);
    --card-border: rgba(255, 255, 255, 0.05);
    --glow-color: rgba(138, 43, 226, 0.15);
    --primary: #9d4edd;
    --primary-glow: rgba(157, 78, 221, 0.4);
    --primary-hover: #b5179e;
    --text-primary: #f3f0f7;
    --text-secondary: #a39cb4;
    --success: #38b000;
    --danger: #d90429;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Outfit', 'Inter', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Glowing Background Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}
.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(157, 78, 221, 0.15) 0%, transparent 70%);
    top: -10%;
    left: -10%;
}
.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(181, 23, 158, 0.12) 0%, transparent 70%);
    bottom: -10%;
    right: -10%;
}
.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(76, 201, 240, 0.08) 0%, transparent 70%);
    top: 40%;
    left: 45%;
}

/* Glassmorphism General Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    padding: 24px;
}

/* Animation utilities */
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}
.animate-scale-up {
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Scroll Container */
.scroll-container {
    height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 8px;
}
.scroll-container::-webkit-scrollbar {
    width: 6px;
}
.scroll-container::-webkit-scrollbar-track {
    background: transparent;
}
.scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Layout Wrapper */
.dashboard-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    padding: 16px;
    gap: 16px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.dashboard-wrapper.active {
    opacity: 1;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}
.logo-icon {
    font-size: 24px;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}
.sidebar-header h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    margin-bottom: 24px;
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}
.user-details h4 {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}
.badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    margin-top: 4px;
}

.sidebar-nav {
    flex-grow: 1;
}
.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}
.sidebar-nav li.active a, .sidebar-nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 3px 0 0 var(--primary);
}

.btn-logout {
    margin-top: auto;
    width: 100%;
    background: rgba(217, 4, 41, 0.1);
    color: #ff4d6d;
    border: 1px solid rgba(217, 4, 41, 0.2);
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-logout:hover {
    background: var(--danger);
    color: #ffffff;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.header-title h1 {
    font-size: 24px;
    font-weight: 700;
}
.header-title p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Overlay & Login styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.login-card {
    width: 400px;
    max-width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.brand {
    text-align: center;
    margin-bottom: 32px;
}
.brand h2 {
    font-size: 24px;
    margin-top: 8px;
    font-weight: 700;
}
.brand p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.stats-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.stats-label {
    font-size: 13px;
    color: var(--text-secondary);
}
.stats-val {
    font-size: 32px;
    font-weight: 700;
    margin-top: 8px;
}
.status-green {
    color: var(--success);
    text-shadow: 0 0 10px rgba(56, 176, 0, 0.3);
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Forms & Inputs */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
}
.grid-full {
    grid-column: 1 / -1;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.input-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.input-group input, .input-group select, .input-group textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}
.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.5);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}
.btn-block {
    width: 100%;
}
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }

/* Tables */
.table-custom {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}
.table-custom th, .table-custom td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.table-custom th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}
.table-custom tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Call log history items */
.logs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.3s ease;
}
.log-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--primary);
}
.log-meta h4 {
    font-size: 14px;
    font-weight: 600;
}
.log-meta span {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: inline-block;
}
.log-status-tag {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}
.log-status-tag.completed { background: rgba(56, 176, 0, 0.1); color: var(--success); }
.log-status-tag.transferred { background: rgba(157, 78, 221, 0.1); color: var(--primary); }
.log-status-tag.abandoned { background: rgba(217, 4, 41, 0.1); color: var(--danger); }

/* Modal transcript style */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-card {
    width: 600px;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 50vh;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
}

/* Chat bubble styling for transcripts */
.chat-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}
.chat-bubble.user {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}
.chat-bubble.assistant {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.2), rgba(181, 23, 158, 0.2));
    border: 1px solid rgba(157, 78, 221, 0.3);
    color: var(--text-primary);
}
.chat-time {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
    text-align: right;
}

/* Timetable styling */
.timetable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}
.timetable-day-card {
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.timetable-day-card label {
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}
.timetable-day-card input {
    padding: 6px;
    font-size: 12px;
}

/* Doctor card styles */
.doctors-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.doctor-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
}
.doctor-card h4 {
    font-size: 15px;
    font-weight: 600;
}
.doctor-card p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.doctor-workdays-checks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}
.btn-danger-small {
    background: rgba(217, 4, 41, 0.1);
    color: #ff4d6d;
    border: 1px solid rgba(217, 4, 41, 0.2);
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn-danger-small:hover {
    background: var(--danger);
    color: #ffffff;
}

.text-glow {
    text-shadow: 0 0 8px rgba(157, 78, 221, 0.3);
}

.hidden {
    display: none !important;
}

/* Responsive constraints */
@media(max-width: 900px) {
    .dashboard-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .grid-2col {
        grid-template-columns: 1fr;
    }
}

/* Call details header inside transcript modal */
.modal-call-info {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.info-item {
    display: flex;
    flex-direction: column;
}
.info-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    font-weight: 600;
}
.info-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}
.info-full {
    grid-column: span 2;
}

