* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f4f6;
}

/* Floating launcher */
.chat-widget-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b7ff, #1495ff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
    z-index: 9999;
}

/* Chat popup */
.chat-widget {
    position: fixed;
    right: 24px;
    bottom: 100px;
    width: 420px;
    max-width: calc(100vw - 30px);
    height: 720px;
    max-height: calc(100vh - 130px);
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0,0,0,0.20);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #19a8f5, #1489e8);
    color: white;
    padding: 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e9f5ff;
    color: #1489e8;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.chat-title {
    font-size: 18px;
    font-weight: bold;
}

.chat-status {
    font-size: 14px;
    opacity: 0.95;
}

.chat-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 34px;
    cursor: pointer;
    line-height: 1;
}

/* Body */
.chat-body {
    flex: 1;
    background: #f5f7fb;
    overflow-y: auto;
}

/* Intro message */
.bot-intro {
    display: flex;
    gap: 10px;
    padding: 18px;
    background: #eef1f5;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9f5ff;
    color: #1489e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.bot-avatar.small {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.bot-bubble {
    background: white;
    border-radius: 16px;
    padding: 16px 18px;
    line-height: 1.5;
    color: #222;
    box-shadow: 0 1px 5px rgba(0,0,0,0.08);
}

/* Welcome card */
.welcome-card {
    padding: 24px 20px 20px;
    background: #fff;
}

.welcome-card h2 {
    text-align: center;
    color: #173b67;
    margin: 0 0 8px;
}

.welcome-card p {
    text-align: center;
    color: #63748b;
    margin: 0 0 24px;
}

.welcome-card input {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid #d8dee9;
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 15px;
    outline: none;
}

.welcome-card input:focus {
    border-color: #17a7f5;
}

.consent-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 14px;
    color: #324b6b;
    line-height: 1.5;
    margin: 6px 0 20px;
}

.consent-row input {
    width: auto;
    margin-top: 3px;
}

.start-btn {
    width: 100%;
    background: linear-gradient(90deg, #79c3e9, #77d4c7);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.secure-note {
    text-align: center;
    color: #8b97a8;
    font-size: 13px;
    margin-top: 14px;
}

/* Chat screen */
.messages {
    padding: 16px;
    height: 470px;
    overflow-y: auto;
    background: #f5f7fb;
}

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

.message.user {
    justify-content: flex-end;
}

.message.user .bubble {
    background: #daf2ff;
    border-bottom-right-radius: 6px;
}

.message.bot .bubble {
    background: white;
    border-bottom-left-radius: 6px;
}

.bubble {
    max-width: 78%;
    padding: 12px 14px;
    border-radius: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    box-shadow: 0 1px 5px rgba(0,0,0,0.06);
}

/* Quick buttons */
.quick-actions {
    padding: 10px 14px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
}

.quick-actions button {
    border: 1px solid #d8e2ef;
    background: #fff;
    color: #2563eb;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
}

/* Input */
.chat-input-row {
    display: flex;
    gap: 10px;
    padding: 14px;
    background: #fff;
    border-top: 1px solid #e8edf5;
}

.chat-input-row input {
    flex: 1;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    padding: 14px;
    font-size: 15px;
    outline: none;
}

.send-btn {
    width: 52px;
    border: none;
    border-radius: 12px;
    background: #1495ff;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

/* Feedback buttons */
.feedback-row {
    padding: 0 16px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #f5f7fb;
}

.feedback-row button {
    border: none;
    padding: 8px 12px;
    border-radius: 18px;
    background: #e8f1ff;
    color: #155eef;
    cursor: pointer;
}

@media (max-width: 600px) {
    .chat-widget {
        right: 10px;
        left: 10px;
        bottom: 84px;
        width: auto;
        height: calc(100vh - 110px);
    }

    .chat-widget-launcher {
        right: 16px;
        bottom: 16px;
    }

    .messages {
        height: 360px;
    }
}

.dashboard-shell {
    display: flex;
    min-height: 100vh;
    background: #f4f7fb;
}

.dashboard-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1598ee, #167fe0);
    color: #fff;
    padding: 24px 18px;
    box-shadow: 2px 0 20px rgba(0,0,0,0.08);
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.dashboard-brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    color: #167fe0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.dashboard-brand-title {
    font-size: 22px;
    font-weight: bold;
}

.dashboard-brand-subtitle {
    font-size: 14px;
    opacity: 0.95;
}

.dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-nav-link {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,0.08);
    transition: 0.2s ease;
}

.dashboard-nav-link:hover,
.dashboard-nav-link.active {
    background: rgba(255,255,255,0.18);
}

.dashboard-main {
    flex: 1;
    padding: 28px;
    overflow-x: auto;
}

.dashboard-topbar h1 {
    margin: 0 0 6px;
    color: #173b67;
}

.dashboard-topbar p {
    margin: 0 0 24px;
    color: #6a7c92;
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(7, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-kpi-card {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 24px rgba(23, 59, 103, 0.06);
    border: 1px solid #edf2f8;
}

.dashboard-kpi-card span {
    display: block;
    color: #70839b;
    font-size: 13px;
    margin-bottom: 10px;
}

.dashboard-kpi-card strong {
    font-size: 28px;
    color: #173b67;
}

.dashboard-kpi-card.success strong {
    color: #138a4b;
}

.dashboard-kpi-card.warning strong {
    color: #c58912;
}

.dashboard-kpi-card.danger strong {
    color: #d64545;
}

.dashboard-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.dashboard-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(23, 59, 103, 0.06);
    border: 1px solid #edf2f8;
    margin-bottom: 24px;
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.dashboard-card-header h2 {
    margin: 0;
    color: #173b67;
    font-size: 20px;
}

.table-wrap {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dashboard-table th {
    text-align: left;
    background: #f3f7fc;
    color: #49627e;
    padding: 12px 14px;
    border-bottom: 1px solid #e6edf5;
    white-space: nowrap;
}

.dashboard-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef3f8;
    color: #25364b;
    vertical-align: top;
}

.dashboard-table tr:hover td {
    background: #fafcff;
}

.recent-table td:nth-child(5) {
    min-width: 260px;
}

.recent-table td:nth-child(6) {
    min-width: 180px;
}

@media (max-width: 1400px) {
    .dashboard-kpis {
        grid-template-columns: repeat(4, minmax(140px, 1fr));
    }
}

@media (max-width: 1024px) {
    .dashboard-shell {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
    }

    .dashboard-grid-two {
        grid-template-columns: 1fr;
    }

    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media (max-width: 640px) {
    .dashboard-main {
        padding: 16px;
    }

    .dashboard-kpis {
        grid-template-columns: 1fr;
    }
}