/* ── Sidebar ── */
#sidebar {
    width: 85px;
    min-width: 85px;
    background: #a495ff !important;
    height: calc(100vh - 85px - 16px);
    position: fixed;
    top: 85px;
    left: 1px;
    bottom: 8px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px 16px;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(100, 70, 210, 0.20), inset 0 1px 0 rgba(255,255,255,0.14);
    transition: transform 0.3s ease;
    color: #fff !important;
    overflow: hidden;
}

@media (max-width: 768px) {
    .navbar { padding: 0 16px 0 16px; height: 60px; }
    .brand-sub { display: none; }
    .layout-content { margin-left: 0; padding-top: 60px; }
    #sidebar { left: -100px; }
    #sidebar.show-sidebar { left: 8px; }
    #sidebar {
        transform: translateX(-100px);
        position: fixed;
        z-index: 1000;
        top: 0;
        height: 100vh;
        border-radius: 0 14px 14px 0;
    }
    #sidebar.show-sidebar { transform: translateX(0); }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
    gap: 14px;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

#sidebar > ul,
#sidebar .nav.flex-column { width: 100%; padding: 0; }
#sidebar .nav-item { width: 100%; margin-bottom: 0.1rem !important; }

/* sidebar-item */
.sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 6px 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    gap: 5px;
    transition: background 0.17s, color 0.17s, box-shadow 0.17s;
    border-radius: 12px;
    letter-spacing: 0.01em;
}
.sidebar-item svg { flex-shrink: 0; width: 22px; height: 22px; stroke-width: 1.5; }
.sidebar-item i { font-size: 1.3rem; color: #fff; }
.sidebar-item span { font-size: calc(0.62rem + 1px); font-weight: 600; text-align: center; line-height: 1.2; color: #fff; }
.sidebar-item:hover {
    background: rgba(255,255,255,0.16);
    color: #fff;
}
.sidebar-item.active {
    color: #fff;
    background: rgba(255,255,255,0.16);
}

/* profile trigger */
.sidebar-profile-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 6px;
    border-radius: 12px;
    cursor: pointer;
    color: rgba(255,255,255,0.78);
    font-size: 0.62rem;
    font-weight: 600;
    transition: background 0.17s, color 0.17s;
    width: 100%;
}
.sidebar-profile-trigger:hover { background: rgba(255,255,255,0.16); color: #fff; }
.sidebar-profile-trigger::after { display: none; }

/* ── Sidebar bottom (profile) ── */
.sidebar-bottom {
    padding: 12px 0 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.14);
    width: 100%;
}

.sidebar-profile-menu {
    background: #a495ff;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 8px 0;
    box-shadow: 0 12px 32px rgba(60, 44, 170, 0.40);
    min-width: 180px;
    position: fixed !important;
    left: 100px !important;
    bottom: 20px !important;
    top: auto !important;
    transform: none !important;
}
.sidebar-profile-item {
    color: #fff !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.15s;
}
.sidebar-profile-item i { font-size: 1rem; opacity: 0.85; }
.sidebar-profile-item svg { flex-shrink: 0; width: 16px; height: 16px; stroke-width: 1.5; opacity: 0.85; }
.sidebar-profile-item:hover { background: rgba(255,255,255,0.15) !important; color: #fff !important; }
.sidebar-logout-item { color: #ffcfcf !important; }
.sidebar-logout-item:hover { background: rgba(255,80,80,0.18) !important; }
.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2.5px solid rgba(255,255,255,0.55);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.10);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.sidebar-avatar:hover {
    border-color: #fff;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.22);
}

/* ── Top navbar — fixed full width, brand aligns to sidebar centre ── */
.navbar {
    background: #fff;
    padding: 0 40px 0 40px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1045;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    box-shadow: none;
}

.brand-wordmark { display: flex; align-items: center; text-decoration: none; }

.navbar-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ede9fe;
    color: #6c3fd1;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
}
.navbar-balance i { font-size: 0.85rem; opacity: 0.85; }
.navbar-balance strong { color: #4b2fa8; font-weight: 700; }
.brand-logo { font-size: calc(1.81rem + 1px); font-weight: 700; color: #827bff; letter-spacing: 0.5px; white-space: nowrap; margin-left: 4px; -webkit-text-stroke: 0.6px #827bff; }
.brand-logo span, .brand-in { color: #27cdcb; -webkit-text-stroke: 0.6px #27cdcb; }
.brand-sub { color: #7fe9e7; font-weight: 400; font-size: 19px; margin-left: 8px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.02em; }

.layout-content {
    background: #fff;
    margin-left: 92px;
    padding-top: 85px;
    min-height: 100vh;
}

.page-content-wrapper {
    padding: 0 16px 24px 6px;
    min-height: calc(100vh - 85px);
}

.page-content-card {
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 0 0 1px rgba(164, 149, 255, 0.15), 0 4px 24px rgba(164, 149, 255, 0.25), 0 0 60px rgba(164, 149, 255, 0.12);
    padding: 28px;
    height: fit-content;
}

/* Logo styling */
.logo-container {
font-size: 1.5em;
font-weight: bold;
color: #ecf0f1; /* Light gray */
}

/* ── Dashboard: welcome heading, stat tiles, cards ── */
.dash-welcome {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2430;
    margin-bottom: 20px;
}

.stat-tile-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.stat-tile {
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(108, 63, 209, 0.06);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(108, 63, 209, 0.12);
}

.stat-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}
.stat-badge-primary   { background: #dbe7ff; color: #3b6fe0; }
.stat-badge-success   { background: #d9f7e3; color: #1f9d55; }
.stat-badge-danger    { background: #fde0e0; color: #e05252; }
.stat-badge-warning   { background: #fdecd2; color: #d68a10; }
.stat-badge-info      { background: #ece7fd; color: #7c6cf0; }
.stat-badge-secondary { background: #e6e8ec; color: #6b7280; }

.stat-label {
    font-weight: 600;
    color: #4b5563;
    font-size: 0.8rem;
}

.dash-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(108, 63, 209, 0.08);
    padding: 24px;
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.dash-card-header h5 {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1f2430;
    margin: 0;
    text-align: left;
}

.dash-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
    padding: 32px 0;
}

.dash-table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
    border-bottom: 1px solid #eef0f4;
    padding-bottom: 10px;
}
.dash-table td {
    font-size: 0.88rem;
    color: #374151;
    border-bottom: 1px solid #f5f5f8;
    padding: 12px 8px;
}
.dash-table tbody tr:last-child td { border-bottom: none; }

.dash-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}
.dash-status-success { background: #d9f7e3; color: #1f9d55; }
.dash-status-danger  { background: #fde0e0; color: #e05252; }
.dash-status-pending { background: #fdecd2; color: #d68a10; }

.dash-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.dash-quick-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ede9fe;
    color: #6c3fd1;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px 18px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.17s ease, color 0.17s ease;
}
.dash-quick-action:hover {
    background: #a495ff;
    color: #fff;
}
.dash-quick-action i { font-size: 0.85rem; }

.dash-range-filter {
    display: flex;
    gap: 4px;
    background: #f4f2fb;
    border-radius: 50px;
    padding: 4px;
}
.dash-range-btn {
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    transition: background 0.17s ease, color 0.17s ease;
}
.dash-range-btn:hover { color: #6c3fd1; }
.dash-range-btn.active { background: #a495ff; color: #fff; }

.dash-bar-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.dash-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    text-transform: capitalize;
}
.dash-bar-track {
    background: #f1eefb;
    border-radius: 50px;
    height: 10px;
    overflow: hidden;
}
.dash-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8f7ff5, #7c6cf0);
    border-radius: 50px;
}

.dash-chart-sm {
    position: relative;
    height: 240px;
}

.dash-chart-pie {
    display: flex;
    justify-content: center;
}

/* ==========================================================================
   Themed confirmation popup (SweetAlert2 override)
   ========================================================================== */
.swal2-popup {
    border-radius: 20px !important;
    padding: 28px 24px !important;
    font-family: inherit;
}
.swal2-title {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #1f2430 !important;
}
.swal2-html-container {
    font-size: 0.92rem !important;
    color: #374151 !important;
}
.swal2-actions {
    gap: 10px;
}
.swal2-confirm {
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    padding: 10px 22px !important;
    box-shadow: none !important;
}
.swal2-cancel.swal-cancel-btn {
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    padding: 10px 22px !important;
    color: #6c3fd1 !important;
    box-shadow: none !important;
}
.swal2-icon.swal2-warning {
    border-color: #d68a10 !important;
    color: #d68a10 !important;
}

/* Professional color palette */
.text-dark-blue {
    color: #2c3e50; /* Dark navy blue */
}

.bg-dark-blue {
    
    background-color: #2c3e50 !important; /* Dark navy blue */
    color: white !important;
}

.btn-dark-blue {
    background-color: #2c3e50; /* Dark navy blue */
    color: #ffffff;
}

.btn-dark-blue-outline {
    background-color: unset; /* Dark navy blue */
    color: #2c3e50;
    border: 1px #2c3e50 solid;
}

.btn-dark-blue-outline:hover {
    background-color: #1a252f; /* Darker shade for hover */
    color: white;
}

.btn-dark-blue:hover {
    background-color: #1a252f; /* Darker shade for hover */
    color: white;
}

/* Styling for the form card */
#personal-info-form {
    background-color: #f7f9fc; /* Soft off-white */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05) !important; /* Softer shadow for a cleaner look */
}

/* Header styling */
#personal-info-form h2 {
    font-weight: 600;
}

/* Input styling */
.form-control {
    border-radius: 5px;
    border: 1px solid #d1d5db; /* Light gray border */
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: #2c3e50; /* Dark blue for focus */
    box-shadow: 0 0 8px rgba(44, 62, 80, 0.2);
}

/* Button styling */
#next-to-microphone {
    font-weight: 600;
    border-radius: 5px;
}

/* Label styling */
.form-label {
    font-weight: 500;
    color: #5d6d7e; /* Slate gray for a soft, professional tone */
}



/* Navbar container */
.bg-light {
    background-color: #f8f9fa !important; /* Light background for a professional look */
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #343a40; /* Dark gray color for title */
}

/* Profile section styling */
.profile-container {
    display: flex;
    align-items: center;
}

.profile-image {
    border: 2px solid #6c757d; /* Subtle border for profile image */
}

/* Dropdown menu styling */
.dropdown-menu {
    min-width: 150px;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    font-size: 0.9rem;
    padding: 8px 16px;
}

.dropdown-item:hover {
    background-color: #e9ecef; /* Light gray hover effect */
}

.text-danger {
    color: #dc3545 !important; /* Red color for logout */
}


    /* Container styling */
    #microphone-selection {
        background-color: #f4f5f7; /* Light gray background for subtle contrast */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Soft shadow */
    }

    /* Title styling */
    #microphone-selection h2 {
        color: #2d2d2d; /* Dark gray for a more neutral professional look */
        font-weight: 600;
    }

    /* Icon styling */
    .icon-container i {
        color: #a0a4a8; /* Muted gray for icon */
    }

    /* Dropdown styling */
    .form-select {
        text-align: center;
        border-radius: 5px;
        border: 1px solid #d1d5db;
        transition: border-color 0.3s ease, box-shadow 0.3s ease;
        background-color: #ffffff;
    }

    .form-select:focus {
        border-color: #4a90e2; /* Accent blue for focus */
        box-shadow: 0 0 8px rgba(74, 144, 226, 0.2);
    }

    /* Button styling */
    .btn-accent {
        background-color: #4a90e2; /* Soft accent blue */
        border: none;
        font-weight: 600;
        border-radius: 5px;
        transition: background 0.3s;
        color: #ffffff;
    }

    .btn-accent:hover {
        background-color: #3a78c5; /* Slightly darker blue on hover */
    }

    /* File input styling */
    .form-control-file {
        text-align: center;
        color: #4a90e2;
        margin-top: 5px;
    }

    /* Text styling */
    .fw-semibold {
        font-weight: 500;
        color: #495057; /* Slate gray for label text */
    }

    .text-dark-gray {
        color: #2d2d2d; /* Darker gray for main titles */
    }

    .text-muted-gray {
        color: #a0a4a8; /* Muted gray for icon */
    }

    .icon-container{
        background-color: #16a085;
        color: white;
    }




/* Card styling */
#recording-session-view {
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Title and text styling */
.text-primary {
    color: #007bff;
    font-weight: 600;
}

.text-secondary {
    color: #6c757d;
}

.text-dark-gray {
    color: #343a40;
}

.fw-semibold {
    font-weight: 500;
}

/* Icon styling */
.sound-effects-container i {
    color: #a0a4a8; /* Muted gray for icons */
}

/* Timer styling */
.timer {
    font-size: 1.2em;
    color: #495057;
    font-weight: 600;
}

/* Button styling */
#stop-recording-btn {
    font-weight: 600;
    border-radius: 5px;
}

#pause-recording-btn {
    font-weight: 600;
    border-radius: 5px;
}

/* Live transcript preview styling */
#live-preview {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
}

#live-preview h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* Styles for live transcript text */
#speech-text {
    color: #495057;
    font-style: italic;
}



    /* Navbar background and shadow */
    .bg-light {
        background-color: #f8f9fa !important;
    }

    /* Sidebar Toggle Button */
    #sidebarToggle {
        color: #495057;
        border-color: #ced4da;
        transition: all 0.3s;
    }

    #sidebarToggle:hover {
        background-color: #e2e6ea;
        color: #343a40;
    }

    /* Page Title Styling */
    .text-dark-gray {
        color: #343a40;
        font-weight: 600;
    }

    /* Profile Image Styling */
    .profile-img {
        border: 2px solid #ced4da;
    }

    /* Dropdown Menu Styling */
    .dropdown-menu {
        border-radius: 8px;
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
        min-width: 150px;
    }

    .dropdown-item {
        font-size: 0.9rem;
        padding: 8px 16px;
    }

    .dropdown-item:hover {
        background-color: #e9ecef;
    }

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


.profile-main-container{
margin-top: 0;
}

@media (max-width: 768px) {
.main-new-session-container{
    height: calc(115vh);
}    

.profile-main-container{
    margin-top: 3rem;
}
}



/* Table Styling */
.table {
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

/* Header and Row Styling */
.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Badge Styling for Status */
.badge {
    font-size: 0.9rem;
    padding: 0.5em 0.75em;
    border-radius: 12px;
}

/* Button Styling */
.btn-outline-primary {
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: #ffffff;
}

/* Alert Styling for Empty State */
.alert-info {
    background-color: #f0f8ff;
    border: 1px solid #cce5ff;
    color: #31708f;
    border-radius: 8px;
}


.top-up{
    background-color: #2c3e50 !important;
    padding: 5px 15px;
    border-radius: 5px;
    border: 1px solid white;
    color: white !important;
}

.top-up span{
    color: rgb(154, 255, 154) !important;
    margin-left: 5px;
}

.app-defaultnav {
    padding: 16px 6px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.status-indicator .green-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #28a745;
    box-shadow: 0 0 5px 2px rgba(40, 167, 69, 0.5);
    animation: pulse 1.5s infinite;
}

.status-indicator .red-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #dc3545;
    box-shadow: 0 0 5px 2px rgba(220, 53, 69, 0.5);
    animation: pulse-red 1.5s infinite;
}

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

/* Optional Pulse Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 5px 2px rgba(40, 167, 69, 0.5);
    }
    50% {
        box-shadow: 0 0 10px 4px rgba(40, 167, 69, 0.3);
    }
    100% {
        box-shadow: 0 0 5px 2px rgba(40, 167, 69, 0.5);
    }
}

/* General Card Styling */
.card {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #2c3e50;
    color: #ecf0f1;
    font-size: 1rem;
    text-transform: uppercase;
    text-align: center;
    padding: 0.75rem;
}

/* Card Body Text */
.card-body p {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #34495e;
}

/* Statistic Cards */
.display-6-dashboard {
    font-size: 1.5rem;
    margin-top: 4px;
    font-weight: bold;
}

.card.text-center h6 {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
}

/* Statistics Card Hover Effect */
.card.text-center:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease-in-out;
}


/* Pagination Styling */
.pagination-container .pagination {
    margin: 0;
}

.pagination-container .page-item.active .page-link {
    background-color: #2c3e50;
    border-color: #2c3e50;
    color: white;
}

.pagination-container .page-link {
    color: #2c3e50;
    border-radius: 4px;
    margin: 0 2px; 
}

.pagination-container .page-link:hover {
    background-color: #34495e;
    color: #fff;
}


/* Floating Report Issue Button */
.report-issue-container {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1050;
    transition: all 0.3s ease-in-out;
}

.report-issue-button {
    background-color: #dc3545;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 30px 0 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.report-issue-button i {
    margin-left: 120px;
    font-size: 1.5rem;
    transition: all 0.3s ease-in-out;
}

.report-issue-text {
    white-space: nowrap;
    margin-left: 10px;
    opacity: 0;
    transition: all 0.3s ease-in-out;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Hover Effect for Expansion */
.report-issue-container:hover .report-issue-button {
    width: 200px;
    border-radius: 30px 0 0 30px;
}

.report-issue-container:hover .report-issue-button i {
    margin-left: 10px;
}

.report-issue-container:hover .report-issue-text {
    opacity: 1;
}


/* Modal Styling */
.modal-header {
    background-color: #2c3e50;
    color: #fff;
}

.modal-title {
    font-weight: bold;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
}

/* Dot Colors */
.dot-success {
    background-color: #28a745; /* Green */
    box-shadow: 0 0 5px 2px rgba(40, 167, 69, 0.3);
}

.dot-warning {
    background-color: #ffc107; /* Yellow */
    box-shadow: 0 0 5px 2px rgba(255, 193, 7, 0.3);
}

.dot-danger {
    background-color: #dc3545; /* Red */
    box-shadow: 0 0 5px 2px rgba(220, 53, 69, 0.3);
}

.dot-secondary {
    background-color: #6c757d; /* Gray */
    box-shadow: 0 0 5px 2px rgba(108, 117, 125, 0.3);
}

/* Status Text */
.status-text {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: capitalize;
}

/* Clinics Section Styling */
#sidebar .clinics-section {
    border-radius: 6px;
    padding: 5px;
}

/* Main Clinics Link */
#sidebar .clinics-main-link {
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s, color 0.3s;
}

/* Clinics Icon Styles */
#sidebar .clinic-icon-main {
    color: #1abc9c;
    font-size: 1.1rem;
}

#sidebar .clinics-toggle {
    cursor: pointer;
    color: #ecf0f1;
    transition: transform 0.3s;
}

#sidebar .clinics-toggle.collapsed {
    transform: rotate(90deg);
}

/* Dropdown Clinics List */
#sidebar .clinics-dropdown {
    border-left: 2px solid #34495e;
    margin-top: 5px;
    padding-left: 10px;
    border-radius: 4px;
}

/* Individual Clinic Items */
#sidebar .clinic-item {
    margin-bottom: 5px;
}

#sidebar .clinic-link {
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

#sidebar .clinic-link:hover {
    color: #f1c40f;
}

/* Clinic Dropdown Toggle */
#sidebar .clinic-toggle {
    cursor: pointer;
    color: #ecf0f1;
    transition: transform 0.3s;
}

#sidebar .clinic-toggle.collapsed {
    transform: rotate(90deg);
}

/* Clinic Submenu */
#sidebar .clinic-submenu {
    border-left: 2px solid #1abc9c;
    margin-top: 5px;
    padding-left: 10px;
    border-radius: 4px;
}

/* Submenu Links */
#sidebar .clinic-dashboard-link {
    color: #3498db;
}

#sidebar .clinic-reports-link {
    color: #e74c3c;
}

#sidebar .clinic-edit-link {
    color: #f39c12;
}

/* Icons for Submenu */
#sidebar .clinic-icon-dashboard {
    color: #3498db;
}

#sidebar .clinic-icon-reports {
    color: #e74c3c;
}

#sidebar .clinic-icon-edit {
    color: #f39c12;
}

/* Hover Effects */
#sidebar .clinic-dashboard-link:hover,
#sidebar .clinic-reports-link:hover,
#sidebar .clinic-edit-link:hover {
    text-decoration: underline;
}

.dashboard-overview .card {
    border-radius: 8px;
    text-align: center;
}

.dashboard-overview h6 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0;
}

.dashboard-overview .display-6 {
    font-size: 1.5rem;
}

.dashboard-overview .card {
    border-radius: 8px;
    text-align: left;
    background-color: #f9fafc;
    border: 1px solid #e1e5eb;
    transition: transform 0.2s ease-in-out;
}

.dashboard-overview .card:hover {
    transform: translateY(-5px);
}

.dashboard-overview .card h6 {
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c3e50;
    margin: 0;
}

.dashboard-overview .card p {
    font-size: 1.2rem;
    font-weight: 700;
    color: #34495e;
    margin: 0;
}

.dashboard-overview .card i {
    font-size: 1.1rem;
}

.dashboard-overview .text-primary {
    color: #007bff !important;
}

.dashboard-overview .text-success {
    color: #28a745 !important;
}

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

.dashboard-overview .text-warning {
    color: #ffc107 !important;
}

.dashboard-overview .text-info {
    color: #17a2b8 !important;
}

/* Latest Progress and Log Sections */
.progress-list,
.log-list {
    overflow-y: auto;
    padding-right: 5px;
}

.progress-list::-webkit-scrollbar,
.log-list::-webkit-scrollbar {
    width: 5px;
}

.progress-list::-webkit-scrollbar-thumb,
.log-list::-webkit-scrollbar-thumb {
    background-color: #ced4da;
    border-radius: 10px;
}

.progress-list div,
.log-list div {
    margin-bottom: 5px;
}

.progress-list h6,
.log-list h6 {
    font-size: 0.95rem;
    font-weight: 600;
}

.progress-list p,
.log-list p {
    font-size: 0.85rem;
    margin: 0;
}

.progress-list .badge,
.log-list .badge {
    font-size: 0.75rem;
    padding: 5px 8px;
    border-radius: 5px;
}

.card h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.card h5 i {
    font-size: 1.1rem;
}

/* Clinics Overview Section */
.clinics-overview .clinic-card {
    border-radius: 8px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    background-color: #fdfdfd;
    border: 1px solid #e9ecef;
    text-align: left;
}

.clinics-overview .clinic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Clinic Name and Status */
.clinics-overview .clinic-card h6 {
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 2px;
}

.clinics-overview .clinic-status {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 5px;
}

/* Clinic Stats */
.clinics-overview .clinic-stats {
    font-size: 0.85rem;
    color: #6c757d;
}

.clinics-overview .clinic-stats i {
    font-size: 0.9rem;
}

/* Action Buttons */
.clinics-overview .btn {
    font-size: 0.8rem;
    padding: 4px 6px;
    width: 33%;
    text-align: center;
}

.clinics-overview .btn i {
    font-size: 0.85rem;
}

/* Status Colors */
.clinics-overview .badge.bg-success {
    background-color: #28a745 !important;
}

.clinics-overview .badge.bg-danger {
    background-color: #dc3545 !important;
}

.clinics-overview .badge.bg-warning {
    background-color: #ffc107 !important;
}

.nav-link-settings{
    color: #2c3e50 !important;
}

.nav-link-settings.active{
    color: white !important;
    background-color: #2c3e50 !important;;
}

.d-flex.flex-wrap {
    gap: 1rem;
}

.d-flex.flex-wrap a {
    text-decoration: none;
}

.d-flex.flex-wrap i {
    transition: transform 0.2s ease-in-out;
}

.d-flex.flex-wrap a:hover i {
    transform: scale(1.3);
}

/* Spinner Container */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3; /* Light grey border */
    border-top: 2px solid #2c3e50; /* Blue border for animation */
    border-radius: 50%; /* Circular shape */
    animation: spin 0.6s linear infinite; /* Rotation animation */
    margin: 10px auto; /* Center the spinner */
}

/* Spinner Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg); /* Start rotation */
    }
    100% {
        transform: rotate(360deg); /* Full circle rotation */
    }
}

/* Optional: Overlay Spinner for Full Page */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7); /* Semi-transparent background */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* On top of everything */
}

.chat-box {
    max-height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.chat-message {
    display: flex;
    align-items: center;
    max-width: 75%;
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    text-align: right;
}

.chat-bubble {
    padding: 10px 15px;
    border-radius: 10px;
    display: inline-block;
    max-width: 100%;
}

.bot-message .chat-bubble {
    background-color: #f1f1f1;
    border-radius: 10px 10px 10px 2px;
}

.user-message .chat-bubble {
    background-color: #007bff;
    color: white;
    border-radius: 10px 10px 2px 10px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 1rem;
}

.list-group-item {
    border: none;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 5px;
}

/* General Card Style */
.destination-card {
    background: linear-gradient(135deg, #2c3e50 , rgb(85, 109, 133) );
    border-radius: 12px;
    padding: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: white;
    position: relative;
    overflow: hidden;
}
.destination-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.2);
}

/* Header */
.destination-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.destination-title {
    font-size: 18px;
    font-weight: bold;
}
.toggle-fields {
    background: transparent;
    border: none;
    color: white;
}
.toggle-fields:hover {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* Fields */
.destination-body {
    padding-top: 10px;
    display: none;
}
.field-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.field-value {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    color: white !important;
    display: block;
}

/* Footer */
.destination-footer {
    margin-top: 10px;
}
.copy-btn {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    transition: background 0.3s ease;
}
.copy-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.select2-container .select2-selection--single {
    padding: .2rem .75rem !important;
    height: auto !important;
}

/* Sidebar for templates */
.templates-sidebar {
    width: 250px;
    background: #f8f9fa;
    border-radius: 8px;
    height: 550px;
    overflow-y: auto;
    padding: 15px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}

/* Scrollable template list */
.scrollable-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.template-item {
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 5px;
    cursor: grab;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.template-item:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

/* Automation Canvas */
.automation-canvas {
    flex: 1;
    min-height: 550px;
    background: #f4f4f4;
    border: 2px dashed #bbb;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    padding: 15px;
}

.automation-step {
    width: 250px;
    min-height: 60px;
    padding: 15px;
    /* background: white; */
    border-radius: 8px;
    text-align: center;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    border: 2px solid #007bff;
    cursor: pointer;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.remove-step {
    color: red;
    font-weight: bold;
    cursor: pointer;
}

.scrollable-list {
    max-height: 300px; /* Fixed height */
    overflow-y: auto; /* Scroll when overflowing */
}

.group-hover:hover {
    background-color: #f8f9fa; /* Light hover effect */
    cursor: pointer;
}

.selectable-method {
    cursor: pointer;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s ease-in-out;
}

.selectable-method:hover, 
input[type="checkbox"]:checked + .selectable-method {
    background-color: #2c3e50 ;
    color: white !important;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

.custom-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.switch-slider {
    display: inline-block;
    width: 34px;
    height: 18px;
    background: #ccc;
    border-radius: 9px;
    position: relative;
    transition: background 0.3s;
    margin-right: 8px;
}

.switch-slider::before {
    content: "";
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

input:checked + .switch-slider {
    background: #28a745; /* Green when active */
}

input:checked + .switch-slider::before {
    transform: translateX(16px);
}

.switch-label {
    font-size: 14px;
    color: #333;
}

/* Parent container for automation step */
.automation-step {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Custom switch for Start Template */
.custom-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.switch-slider {
    display: inline-block;
    width: 36px;
    height: 18px;
    background: #ddd;
    border-radius: 9px;
    position: relative;
    transition: background 0.3s;
    margin-right: 6px;
}

.switch-slider::before {
    content: "";
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

input:checked + .switch-slider {
    background: #28a745; /* Green when active */
}

input:checked + .switch-slider::before {
    transform: translateX(18px);
}

.switch-label {
    font-size: 14px;
    color: #333;
}

/* Remove button (close "X" icon) */
.remove-step {
    font-size: 20px;
    font-weight: bold;
    transition: color 0.2s ease-in-out;
}

.remove-step:hover {
    color: #dc3545;
}

/* Template Name */
.automation-step .fw-bold {
    font-size: 16px;
    color: #212529;
    text-align: center;
    width: 100%;
}

/* Show Details Button */
.show-details {
    width: 90%;
    font-size: 14px;
    padding: 5px;
    transition: background 0.3s ease;
}

.show-details:hover {
    background: #007bff;
    color: white;
}

#variables-toolbar {
    background: #faf9ff;
    border: 1px solid #ece7fb;
    border-radius: 12px;
    padding: 10px 14px;
}

.insert-token-label {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    color: #6c3fd1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 12px;
}

.insert-token-scroll {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #c9beee transparent;
    padding-bottom: 2px;
}
.insert-token-scroll::-webkit-scrollbar { height: 6px; }
.insert-token-scroll::-webkit-scrollbar-thumb { background-color: #c9beee; border-radius: 10px; }
.insert-token-scroll::-webkit-scrollbar-track { background: transparent; }

.insert-token-divider {
    width: 1px;
    height: 20px;
    flex-shrink: 0;
    background: rgba(108, 63, 209, 0.25);
    margin: 0 2px;
}

.insert-token-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 50px;
    border: 1px solid transparent;
    background: #f4f2fb;
    color: #6c3fd1;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.17s ease, color 0.17s ease;
}
.insert-token-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.insert-token-btn:hover { background: #a495ff; color: #fff; }
.insert-token-btn:active { background: #8f7ff5; }

/* Per-field categorical colors (fixed order, one hue per contact field) */
.insert-token-btn.hue-blue    { background: #e1ecf9; color: #2468bb; border-color: rgba(42, 120, 214, 0.28); }
.insert-token-btn.hue-blue:hover    { background: #cfe1f5; border-color: rgba(42, 120, 214, 0.5); color: #2468bb; }

.insert-token-btn.hue-orange  { background: #fceae3; color: #b94212; border-color: rgba(235, 104, 52, 0.28); }
.insert-token-btn.hue-orange:hover  { background: #fadbcd; border-color: rgba(235, 104, 52, 0.5); color: #b94212; }

.insert-token-btn.hue-aqua    { background: #dff4ec; color: #137a55; border-color: rgba(27, 175, 122, 0.28); }
.insert-token-btn.hue-aqua:hover    { background: #c9ecdf; border-color: rgba(27, 175, 122, 0.5); color: #137a55; }

.insert-token-btn.hue-yellow  { background: #fcf2db; color: #936400; border-color: rgba(237, 161, 0, 0.3); }
.insert-token-btn.hue-yellow:hover  { background: #f8e6bd; border-color: rgba(237, 161, 0, 0.55); color: #936400; }

.insert-token-btn.hue-magenta { background: #fcedf2; color: #cb2362; border-color: rgba(232, 123, 164, 0.3); }
.insert-token-btn.hue-magenta:hover { background: #f9d9e5; border-color: rgba(232, 123, 164, 0.55); color: #cb2362; }

.insert-token-btn.hue-green   { background: #dbeedb; color: #007900; border-color: rgba(0, 131, 0, 0.28); }
.insert-token-btn.hue-green:hover   { background: #c3e4c3; border-color: rgba(0, 131, 0, 0.5); color: #007900; }

.insert-token-btn.hue-violet  { background: #e6e3f3; color: #4a3aa7; border-color: rgba(74, 58, 167, 0.28); }
.insert-token-btn.hue-violet:hover  { background: #d7d2ec; border-color: rgba(74, 58, 167, 0.5); color: #4a3aa7; }

.insert-token-btn.hue-red     { background: #fbe6e5; color: #ca201f; border-color: rgba(227, 73, 72, 0.3); }
.insert-token-btn.hue-red:hover     { background: #f8d3d2; border-color: rgba(227, 73, 72, 0.55); color: #ca201f; }

/* ==========================================================================
   Tags Page
   ========================================================================== */
.tags-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.tags-list-card {
    flex: 1;
    min-width: 0;
}

.tags-add-card {
    width: 420px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
}

.tags-add-card h5 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tags-count-pill {
    background: #ede9fe;
    color: #6c3fd1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
}

.tag-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid #f5f5f8;
}
.tag-row:last-child { border-bottom: none; }

.tag-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    color: #1f2430;
    min-width: 0;
}
.tag-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ede9fe;
    color: #6c3fd1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.tag-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tag-contacts-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f4f2fb;
    color: #6c3fd1;
    border: none;
    border-radius: 50px;
    padding: 7px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.17s ease, color 0.17s ease;
}
.tag-contacts-btn:hover { background: #a495ff; color: #fff; }

.tag-delete-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: #fde0e0;
    color: #e05252;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.17s ease, color 0.17s ease;
}
.tag-delete-btn:hover { background: #e05252; color: #fff; }

.tag-add-form label {
    font-weight: 500;
    color: #5d6d7e;
    font-size: 0.82rem;
    margin-bottom: 6px;
    display: block;
}

.tag-add-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 18px;
    background: #fff;
    color: #1f2430;
    transition: border-color 0.17s ease, box-shadow 0.17s ease;
}
.tag-add-input:focus {
    outline: none;
    border-color: #a495ff;
    box-shadow: 0 0 0 3px rgba(164, 149, 255, 0.15);
}

.tag-add-btn {
    width: 100%;
    background: #a495ff;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 11px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.17s ease;
}
.tag-add-btn:hover { background: #8f7ff5; }
.tag-add-btn i { margin-right: 6px; }

/* Contacts modal restyle */
.tag-contacts-modal .modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(108, 63, 209, 0.18);
}
.tag-contacts-modal .modal-header {
    background: linear-gradient(135deg, #a495ff, #8f7ff5);
    border: none;
    padding: 20px 24px;
}
.tag-contacts-modal .modal-title {
    font-weight: 700;
    font-size: 1.05rem;
}
.tag-contacts-modal .btn-close {
    filter: invert(1) brightness(2);
}
.tag-contacts-modal .modal-body {
    padding: 22px 24px;
}
.tag-contacts-modal .form-control {
    border-radius: 12px;
    padding: 10px 14px;
}
.tag-contacts-modal .table {
    margin-top: 14px;
}
.tag-contacts-modal .table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
    border-bottom: 1px solid #eef0f4;
}
.tag-contacts-modal .table td {
    font-size: 0.88rem;
    color: #374151;
    vertical-align: middle;
}
.tag-contacts-modal .pagination {
    justify-content: center;
    margin-top: 12px;
}
.tag-contacts-modal .page-link {
    border-radius: 50px !important;
    margin: 0 3px;
    border: none;
    color: #6c3fd1;
}
.tag-contacts-modal .page-item.active .page-link {
    background: #a495ff;
    color: #fff;
}

@media (max-width: 900px) {
    .tags-layout {
        flex-direction: column;
    }
    .tags-add-card {
        width: 100%;
        position: static;
    }
}

/* ==========================================================================
   Contacts Page
   ========================================================================== */
.contacts-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.contacts-search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}
.contacts-search i {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.85rem;
}
.contacts-search input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    padding: 9px 14px 9px 36px;
    font-size: 0.85rem;
    background: #fff;
    transition: border-color 0.17s ease, box-shadow 0.17s ease;
}
.contacts-search input:focus {
    outline: none;
    border-color: #a495ff;
    box-shadow: 0 0 0 3px rgba(164, 149, 255, 0.15);
}

.contacts-tag-pill {
    display: inline-block;
    background: #ede9fe;
    color: #6c3fd1;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    margin: 2px 3px 2px 0;
}

.contact-no-tags {
    color: #9ca3af;
    font-size: 0.78rem;
}

.contact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background 0.17s ease, color 0.17s ease;
}
.contact-action-view { background: #f4f2fb; color: #6c3fd1; }
.contact-action-view:hover { background: #a495ff; color: #fff; }
.contact-action-edit { background: #fdecd2; color: #d68a10; }
.contact-action-edit:hover { background: #d68a10; color: #fff; }
.contact-action-delete { background: #fde0e0; color: #e05252; }
.contact-action-delete:hover { background: #e05252; color: #fff; }

.contacts-pagination-container .pagination {
    justify-content: center;
    margin-top: 8px;
}
.contacts-pagination-container .page-link {
    border-radius: 50px !important;
    margin: 0 3px;
    border: none;
    color: #6c3fd1;
}
.contacts-pagination-container .page-item.active .page-link {
    background: #a495ff;
    color: #fff;
}

.contact-details-modal .modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(108, 63, 209, 0.18);
}
.contact-details-modal .modal-header {
    background: linear-gradient(135deg, #a495ff, #8f7ff5);
    border: none;
    padding: 20px 24px;
}
.contact-details-modal .modal-title {
    font-weight: 700;
    font-size: 1.05rem;
}
.contact-details-modal .btn-close {
    filter: invert(1) brightness(2);
}
.contact-details-modal .modal-body {
    padding: 22px 24px;
}
.contact-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f8;
    font-size: 0.88rem;
}
.contact-detail-row:last-child { border-bottom: none; }
.contact-detail-label {
    color: #9ca3af;
    font-weight: 600;
    flex-shrink: 0;
}
.contact-detail-value {
    color: #1f2430;
    text-align: right;
}

@media (max-width: 900px) {
}

/* ==========================================================================
   Contact Form (Create/Edit)
   ========================================================================== */
.contact-form-card .dash-card-header h5 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 20px;
}

.contact-form-span-2,
.contact-form-span-3 {
    grid-column: span 3;
}

.contact-form-group label {
    display: block;
    font-weight: 500;
    color: #5d6d7e;
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.contact-form-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.9rem;
    background: #fff;
    color: #1f2430;
    transition: border-color 0.17s ease, box-shadow 0.17s ease;
}
.contact-form-input:focus {
    outline: none;
    border-color: #a495ff;
    box-shadow: 0 0 0 3px rgba(164, 149, 255, 0.15);
}

.contact-form-textarea {
    min-height: 90px;
    resize: vertical;
}

.contact-form-select {
    min-height: 120px;
}

.contact-form-hint {
    display: block;
    margin-top: 6px;
    color: #9ca3af;
    font-size: 0.76rem;
}
.contact-form-hint a {
    color: #6c3fd1;
    font-weight: 600;
    text-decoration: none;
}
.contact-form-hint a:hover {
    text-decoration: underline;
}

.contact-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.contact-form-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #a495ff;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 11px 22px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.17s ease;
}
.contact-form-save:hover { background: #8f7ff5; }

.contact-form-cancel {
    display: inline-flex;
    align-items: center;
    background: #f4f2fb;
    color: #6c3fd1;
    border-radius: 12px;
    padding: 11px 22px;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.17s ease, color 0.17s ease;
}
.contact-form-cancel:hover { background: #a495ff; color: #fff; }

@media (max-width: 900px) {
    .contact-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .contact-form-span-2,
    .contact-form-span-3 {
        grid-column: span 2;
    }
}

@media (max-width: 700px) {
    .contact-form-grid {
        grid-template-columns: 1fr;
    }
    .contact-form-span-2,
    .contact-form-span-3 {
        grid-column: span 1;
    }
}

.template-public-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 4px;
}
.template-public-check input {
    width: 16px;
    height: 16px;
    accent-color: #a495ff;
    cursor: pointer;
}
.template-public-check label {
    font-weight: 500;
    color: #5d6d7e;
    font-size: 0.85rem;
    margin: 0;
    cursor: pointer;
}

/* ==========================================================================
   Templates Page
   ========================================================================== */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.template-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #f0eefb;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(108, 63, 209, 0.06);
    transition: box-shadow 0.17s ease, transform 0.17s ease;
}
.template-card:hover {
    box-shadow: 0 8px 24px rgba(108, 63, 209, 0.12);
    transform: translateY(-2px);
}

.template-card-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1f2430;
    margin: 0 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-card-text {
    color: #9ca3af;
    font-size: 0.82rem;
    margin: 0 0 16px;
    min-height: 40px;
}

.template-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background 0.17s ease, color 0.17s ease;
}
.template-action-view { background: #f4f2fb; color: #6c3fd1; }
.template-action-view:hover { background: #a495ff; color: #fff; }
.template-action-edit { background: #fdecd2; color: #d68a10; }
.template-action-edit:hover { background: #d68a10; color: #fff; }
.template-action-delete { background: #fde0e0; color: #e05252; }
.template-action-delete:hover { background: #e05252; color: #fff; }

.template-view-modal .modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(108, 63, 209, 0.18);
}
.template-view-modal .modal-header {
    background: linear-gradient(135deg, #a495ff, #8f7ff5);
    border: none;
    padding: 20px 24px;
}
.template-view-modal .modal-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}
.template-view-modal .btn-close {
    filter: invert(1) brightness(2);
}
.template-view-modal .modal-body {
    padding: 22px 24px;
    max-height: 500px;
    overflow-y: auto;
}
.template-view-content {
    padding: 16px;
    border: 1px solid #f0eefb;
    border-radius: 12px;
    background: #fff;
}

@media (max-width: 900px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ==========================================================================
   Messages Page
   ========================================================================== */
.message-content-block {
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f8;
    font-size: 0.88rem;
}
.message-content-block .contact-detail-label {
    display: block;
    margin-bottom: 8px;
}
.message-content-box {
    background: #f9f8fd;
    border: 1px solid #f0eefb;
    border-radius: 12px;
    padding: 14px;
    color: #1f2430;
}

.message-wizard-card .wizard-progress {
    background: #f1eefb;
    border-radius: 50px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}
.wizard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8f7ff5, #a495ff);
    border-radius: 50px;
    transition: width 0.25s ease;
}
.wizard-progress-label {
    text-align: right;
    font-size: 0.76rem;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 20px;
}

.wizard-step-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1f2430;
    margin-bottom: 16px;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}
.wizard-actions-end {
    justify-content: flex-end;
}

/* ==========================================================================
   Automations Page
   ========================================================================== */
.automation-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #d9f7e3;
    color: #1f9d55;
    border: none;
    border-radius: 10px;
    padding: 7px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.17s ease, color 0.17s ease;
}
.automation-toggle-btn.is-active {
    background: #fde0e0;
    color: #e05252;
}

/* Scoped reskin of the automation builder (jsPlumb canvas + step wizard) */
.automation-theme .automation-step-content {
    padding-top: 4px;
}

.automation-theme .card {
    border: 1px solid #f0eefb;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(108, 63, 209, 0.06);
}
.automation-theme .card-header.bg-dark-blue {
    background: linear-gradient(135deg, #a495ff, #8f7ff5) !important;
    border: none;
    border-radius: 16px 16px 0 0;
}
.automation-theme .card-header.bg-dark-blue .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.6);
}

.automation-theme .btn-primary,
.automation-theme .btn-primary.show-details {
    background-color: #a495ff;
    border-color: #a495ff;
}
.automation-theme .btn-primary:hover {
    background-color: #8f7ff5;
    border-color: #8f7ff5;
}

.automation-theme .template-item:hover,
.automation-theme .group-item:hover {
    border-color: #a495ff;
}

.automation-theme .group-item .form-check-input:checked,
.automation-theme .group-checkbox:checked,
.automation-theme .contact-checkbox:checked {
    background-color: #a495ff;
    border-color: #a495ff;
}

.automation-theme .badge.bg-primary {
    background-color: #a495ff !important;
}

.automation-theme .automation-canvas {
    min-height: 400px;
    background: #f9f8fd !important;
    border-color: #f0eefb !important;
}

.automation-theme .automation-step {
    border-radius: 12px !important;
    border-color: #f0eefb !important;
}
.automation-theme .automation-step.border-primary {
    border-color: #a495ff !important;
}

.automation-theme #groupList,
.automation-theme #contactList,
.automation-theme #selectedContacts {
    background: #f9f8fd !important;
    border-color: #f0eefb !important;
}

/* ==========================================================================
   Sending Methods
   ========================================================================== */
.sending-method-type-badge {
    display: inline-block;
    background: #ede9fe;
    color: #6c3fd1;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.sending-method-config-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
}
.sending-method-config-item {
    font-size: 0.82rem;
    color: #374151;
}
.sending-method-config-item strong {
    color: #1f2430;
    font-weight: 600;
}

.sending-method-notes-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    font-size: 0.82rem;
    color: #374151;
}
.sending-method-view-notes {
    display: inline-block;
    margin-top: 4px;
    color: #6c3fd1;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.sending-method-view-notes:hover { color: #8f7ff5; }

.sending-method-no-notes {
    color: #9ca3af;
    font-size: 0.82rem;
}

.sending-method-notes-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f4f2fb;
    color: #6c3fd1;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.85rem;
    margin-bottom: 18px;
}
.sending-method-notes-box i { margin-top: 2px; }

.sending-method-form-header {
    position: relative;
    text-align: center;
    margin-bottom: 24px;
}
.sending-method-form-header h5 {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1f2430;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.sending-method-back-link {
    position: absolute;
    top: 0;
    right: 0;
}

.sending-method-form-subtitle {
    color: #9ca3af;
    font-size: 0.85rem;
    margin: 8px auto 0;
    max-width: 480px;
}

.sending-method-form-inner {
    max-width: 720px;
    margin: 0 auto;
}

.sending-method-form-card .contact-form-grid {
    grid-template-columns: repeat(2, 1fr);
}
.sending-method-form-card .contact-form-group label {
    text-transform: capitalize;
}

.sending-method-config-section {
    margin-top: 22px;
}

.sending-method-config-placeholder {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9f8fd;
    border: 1px dashed #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    color: #9ca3af;
    font-size: 0.85rem;
}
.sending-method-config-placeholder i { color: #a495ff; font-size: 1rem; }

@media (max-width: 700px) {
    .sending-method-form-card .contact-form-grid {
        grid-template-columns: 1fr;
    }
    .sending-method-form-header {
        text-align: left;
    }
    .sending-method-back-link {
        position: static;
        display: inline-flex;
        margin-bottom: 12px;
    }
    .sending-method-form-header h5 {
        justify-content: flex-start;
    }
    .sending-method-form-subtitle {
        margin: 8px 0 0;
    }
}

/* ==========================================================================
   Payment Buttons
   ========================================================================== */
.payment-button-form-subtitle {
    margin: 4px 0 22px;
    max-width: 640px;
}

.payment-button-code-input {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8rem;
}

.payment-button-code-preview {
    display: block;
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    color: #6b7280;
    background: #f9f8fd;
    padding: 6px 10px;
    border-radius: 8px;
}

.payment-button-modal .modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(108, 63, 209, 0.18);
}
.payment-button-modal .modal-header {
    background: linear-gradient(135deg, #a495ff, #8f7ff5);
    border: none;
    padding: 20px 24px;
}
.payment-button-modal .modal-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}
.payment-button-modal .btn-close {
    filter: invert(1) brightness(2);
}
.payment-button-modal .modal-body {
    padding: 22px 24px;
}

.logout-confirm-modal .modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(108, 63, 209, 0.18);
}
.logout-confirm-modal .modal-header {
    background: linear-gradient(135deg, #a495ff, #8f7ff5);
    border: none;
    padding: 18px 24px;
}
.logout-confirm-modal .modal-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
}
.logout-confirm-modal .btn-close {
    filter: invert(1) brightness(2);
}
.logout-confirm-modal .modal-body {
    padding: 22px 24px;
    color: #374151;
    font-size: 0.95rem;
}
.logout-confirm-modal .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 16px 24px;
    gap: 10px;
}
.logout-cancel-btn {
    background: #6b7280;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px 22px;
    font-weight: 600;
    font-size: 0.88rem;
}
.logout-cancel-btn:hover { background: #57606f; color: #fff; }
.logout-confirm-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px 22px;
    font-weight: 600;
    font-size: 0.88rem;
}
.logout-confirm-btn:hover { background: #dc2626; color: #fff; }

@media (max-width: 700px) {
    .payment-button-code-preview {
        max-width: 220px;
    }
}

/* ==========================================================================
   Profile
   ========================================================================== */
.profile-form-card .contact-form-grid {
    grid-template-columns: repeat(2, 1fr);
}

.profile-picture-group {
    grid-column: 1 / -1;
}

.profile-picture-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-picture-dropzone {
    cursor: pointer;
    border-radius: 14px;
    padding: 6px;
    margin: -6px;
    transition: background 0.17s ease;
}
.profile-picture-dropzone:hover {
    background: #f9f8fd;
}
.profile-picture-dropzone.dragging {
    outline: 2px dashed #a495ff;
    outline-offset: 3px;
    background: #f9f8fd;
}

.profile-picture-avatar-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 50%;
}

.profile-picture-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f4f2fb;
    display: block;
}

.profile-picture-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(31, 36, 48, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    opacity: 0;
    transition: opacity 0.17s ease;
    pointer-events: none;
}
.profile-picture-dropzone:hover .profile-picture-overlay,
.profile-picture-dropzone.dragging .profile-picture-overlay {
    opacity: 1;
}

.profile-picture-dropzone-input {
    display: none;
}

.profile-picture-input-wrap {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.profile-picture-upload-text {
    font-size: 0.88rem;
    color: #374151;
}
.profile-picture-upload-text strong {
    color: #6c3fd1;
    font-weight: 600;
}

.profile-avatar-hint {
    color: #9ca3af;
    font-size: 0.78rem;
    margin-top: 4px;
    display: block;
}

.profile-verify-email-text {
    color: #6c3fd1;
    font-size: 0.82rem;
    margin: 0;
}
.profile-verify-email-btn {
    background: none;
    border: none;
    padding: 0;
    color: #6c3fd1;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: underline;
    cursor: pointer;
}
.profile-verify-email-btn:hover { color: #8f7ff5; }

.profile-danger-card .dash-card-header {
    margin-bottom: 4px;
}
.profile-danger-title {
    color: #e05252;
}

.profile-delete-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fde0e0;
    color: #e05252;
    border: none;
    border-radius: 12px;
    padding: 11px 22px;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.17s ease, color 0.17s ease;
    margin-top: 4px;
}
.profile-delete-account-btn:hover { background: #e05252; color: #fff; }

.profile-delete-modal-text {
    color: #6b7280;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

@media (max-width: 560px) {
    .profile-form-card .contact-form-grid {
        grid-template-columns: 1fr;
    }
    .profile-picture-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================================
   Tag Checkbox Picker (checkbox-driven replacement for <select multiple>)
   ========================================================================== */
.tag-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    max-height: 160px;
    overflow-y: auto;
}

.tag-checkbox-item {
    position: relative;
}

.tag-checkbox-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.tag-checkbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 50px;
    background: #f4f2fb;
    color: #6c3fd1;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.17s ease, color 0.17s ease;
}
.tag-checkbox-pill:hover {
    background: #ede9fe;
}
.tag-checkbox-pill.active {
    background: #a495ff;
    color: #fff;
}

.tag-checkbox-check {
    display: none;
    font-size: 0.7rem;
}
.tag-checkbox-pill.active .tag-checkbox-check {
    display: inline-block;
}

.tag-checkbox-input:focus-visible + .tag-checkbox-pill {
    outline: 2px solid #a495ff;
    outline-offset: 2px;
}

/* ==========================================================================
   Contacts Import
   ========================================================================== */
.import-dropzone {
    position: relative;
    border: 2px dashed #e5e7eb;
    border-radius: 14px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: border-color 0.17s ease, background 0.17s ease;
}
.import-dropzone:hover,
.import-dropzone.dragging {
    border-color: #a495ff;
    background: #f9f8fd;
}
.import-dropzone.has-file {
    border-style: solid;
    border-color: #a495ff;
    background: #f4f2fb;
}

.import-dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.import-dropzone-content i {
    display: block;
    font-size: 1.8rem;
    color: #a495ff;
    margin-bottom: 10px;
}

.import-dropzone-text {
    color: #374151;
    font-size: 0.9rem;
}
.import-dropzone-text strong {
    color: #6c3fd1;
}

.import-dropzone-hint {
    color: #9ca3af;
    font-size: 0.78rem;
    margin-top: 4px;
}

.import-file-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #1f2430;
    font-size: 0.9rem;
    font-weight: 600;
}
.import-file-selected i {
    color: #6c3fd1;
    font-size: 1.1rem;
}

.import-columns-hint {
    margin-top: 16px;
}
