:root {
    --violet: #764897;
    --blue: #A2D9F0;
    --dark: #18213f;
    --text: #17213d;
    --muted: #7b8194;
    --bg: #f6f3fa;
    --white: #ffffff;
    --danger: #d94b6a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Circe, "Segoe UI", Arial, sans-serif;
    color: var(--text);
}

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(162,217,240,.55), transparent 34%),
        linear-gradient(135deg, #764897 0%, #8b5aad 52%, #a2d9f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-page {
    width: 100%;
    max-width: 430px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    margin-bottom: 24px;
}

.core-logo {
    height: 46px;
    width: auto;
    display: block;
}

.login-logo {
    max-width: 260px;
    width: 100%;
    height: auto;
    display: block;
}

.brand-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
}

.brand-subtitle {
    font-size: 14px;
    opacity: .86;
    margin-top: 5px;
}

.login-card {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(16px);
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 25px 70px rgba(30,20,60,.28);
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 30px;
    color: var(--dark);
}

.login-card p {
    margin: 0 0 26px;
    color: var(--muted);
}

.login-card label {
    display: block;
    margin: 16px 0 7px;
    font-weight: 700;
    font-size: 14px;
}

.login-card input {
    width: 100%;
    border: 1px solid #e3d8ee;
    background: #fbf9fe;
    border-radius: 16px;
    padding: 15px 16px;
    font-size: 16px;
    outline: none;
    transition: .2s;
}

.login-card input:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgba(118,72,151,.12);
}

.login-card button {
    width: 100%;
    margin-top: 24px;
    border: none;
    border-radius: 18px;
    padding: 16px;
    font-size: 16px;
    font-weight: 800;
    color: white;
    cursor: pointer;
    background: linear-gradient(135deg, var(--violet), #9c65bf);
    box-shadow: 0 14px 28px rgba(118,72,151,.28);
}

.alert {
    padding: 13px 15px;
    background: #fff0f4;
    color: var(--danger);
    border-radius: 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

.core-body {
    min-height: 100vh;
    background: var(--bg);
}

.topbar {
    min-height: 76px;
    padding: 16px 32px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 30px rgba(30,20,60,.07);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-brand strong {
    display: block;
    font-size: 20px;
}

.topbar-brand span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 700;
}

.topbar-user a {
    color: var(--violet);
    text-decoration: none;
}

.core-main {
    padding: 34px;
    max-width: 1180px;
    margin: 0 auto;
}

.hero {
    background:
        radial-gradient(circle at top right, rgba(162,217,240,.75), transparent 30%),
        linear-gradient(135deg, var(--violet), #8f5fb2);
    color: white;
    border-radius: 32px;
    padding: 42px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.hero:after {
    content: "";
    position: absolute;
    width: 480px;
    height: 480px;
    right: -150px;
    top: -190px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.35);
    box-shadow:
        0 0 0 24px rgba(255,255,255,.05),
        0 0 0 48px rgba(255,255,255,.05),
        0 0 0 72px rgba(255,255,255,.05),
        0 0 0 96px rgba(255,255,255,.05);
}

.hero h1 {
    margin: 0;
    font-size: 36px;
}

.hero p {
    margin: 10px 0 0;
    opacity: .9;
    font-size: 17px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.service-card {
    background: white;
    border-radius: 26px;
    padding: 28px;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 14px 34px rgba(30,20,60,.08);
    transition: .2s;
    border: 1px solid rgba(118,72,151,.08);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 46px rgba(30,20,60,.13);
}

.service-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: #f0e6f7;
    color: var(--violet);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    margin-bottom: 18px;
}

.service-card h2 {
    margin: 0 0 10px;
    font-size: 22px;
}

.service-card p {
    color: var(--muted);
    line-height: 1.5;
    min-height: 66px;
}

.service-card span {
    color: var(--violet);
    font-weight: 800;
}
/*styles for calls pages*/
.call-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 28px;
}

.stat-card,
.panel {
    background: #fff;
    border-radius: 26px;
    padding: 26px;
    box-shadow: 0 14px 34px rgba(30,20,60,.08);
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 36px;
    color: var(--dark);
}

.page-actions {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 800;
}

.primary-btn {
    background: var(--violet);
    color: #fff;
}

.secondary-btn {
    background: #efe6f7;
    color: var(--violet);
}

.core-table {
    width: 100%;
    border-collapse: collapse;
}

.core-table th,
.core-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #eee8f5;
    text-align: left;
}

.core-table th {
    color: var(--muted);
    font-size: 14px;
}

.empty-text {
    color: var(--muted);
}
.call-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin: 28px 0;
}

.stat-card,
.panel {
    background: #fff;
    border-radius: 26px;
    padding: 26px;
    box-shadow: 0 14px 34px rgba(30,20,60,.08);
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 36px;
    color: var(--dark);
}
/*pagination style*/
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 35px 0 10px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    box-sizing: border-box;
}

.pagination a {
    background: #fff;
    color: #7440B0;
    border: 1px solid #e6dff3;
    transition: 0.2s;
}

.pagination a:hover {
    background: #7440B0;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(116, 64, 176, 0.18);
}

.pagination a.active {
    background: #7440B0;
    color: #fff;
    border-color: #7440B0;
    box-shadow: 0 8px 18px rgba(116, 64, 176, 0.25);
}

.pagination-dots {
    min-width: auto !important;
    padding: 0 4px !important;
    color: #8b8499;
}
/*paginatin style*/

.page-actions {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    padding: 14px 20px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 800;
}

.primary-btn {
    background: var(--violet);
    color: #fff;
}

.secondary-btn {
    background: #efe6f7;
    color: var(--violet);
}

.core-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #e3d8ee;
    background: #fbf9fe;
    border-radius: 16px;
    padding: 15px 16px;
    font-size: 16px;
    outline: none;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgba(118,72,151,.12);
}

button.primary-btn {
    border: none;
    cursor: pointer;
}

.call-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 20px;
}

.call-info-grid div {
    background: #fbf9fe;
    border: 1px solid #eee8f5;
    border-radius: 18px;
    padding: 18px;
}

.call-info-grid span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.call-info-grid strong {
    color: var(--dark);
    font-size: 18px;
}

.audio-box {
    margin-top: 26px;
    background: #f7f1fb;
    border-radius: 22px;
    padding: 22px;
}

.audio-box audio {
    width: 100%;
}
.transcript-box {
    margin-top: 26px;
    background: #fbf9fe;
    border: 1px solid #eee8f5;
    border-radius: 22px;
    padding: 22px;
}

.transcript-box pre {
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.6;
    margin: 0;
}
.analysis-box {
    margin-top: 26px;
    background: #fff;
    border: 1px solid #eee8f5;
    border-radius: 26px;
    padding: 26px;
    box-shadow: 0 14px 34px rgba(30,20,60,.06);
}

.score-main {
    background: linear-gradient(135deg, var(--violet), #9b74c7);
    color: #fff;
    border-radius: 22px;
    padding: 22px;
    margin: 18px 0;
}

.score-main span {
    display: block;
    opacity: .85;
}

.score-main strong {
    font-size: 38px;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: 22px;
}

.score-grid div {
    background: #fbf9fe;
    border: 1px solid #eee8f5;
    border-radius: 20px;
    padding: 20px;
}

.score-grid span {
    color: var(--muted);
}

.score-grid strong {
    display: block;
    font-size: 24px;
    margin: 8px 0;
}
.table-link {
    color: var(--violet);
    !font-weight: 800;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination a,
.pagination-dots {
    min-width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 800;
}

.pagination a {
    background: #f1e8f8;
    color: var(--violet);
}

.pagination a.active {
    background: var(--violet);
    color: #fff;
}

.pagination-dots {
    color: var(--muted);
}

@media (max-width: 800px) {
    .call-stats {
        grid-template-columns: 1fr;
    }

    .page-actions {
        flex-direction: column;
    }

    .table-wrap {
        overflow-x: auto;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .call-info-grid {
        grid-template-columns: 1fr;
    }
    .score-grid {
        grid-template-columns: 1fr;
    }
}
/*calls and*/

@media (max-width: 800px) {
    .topbar {
        padding: 14px 18px;
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .core-main {
        padding: 18px;
    }

    .hero {
        padding: 28px;
        border-radius: 24px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 26px;
        border-radius: 24px;
    }

    .brand-title {
        font-size: 25px;
    }
}


/* Symmetrica Core system status dashboard */
.core-dashboard-grid {
    align-items: start;
}

.core-dashboard-grid .system-status-card {
    grid-column: 1 / -1;
    width: 100%;
    padding: 26px;
    cursor: default;
    transform: none;
}

.core-dashboard-grid .system-status-card:hover {
    transform: none;
    box-shadow: 0 14px 34px rgba(30,20,60,.08);
}

.system-status-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 20px;
}

.system-status-head > div {
    min-width: 0;
}

.system-status-head .service-icon {
    margin-bottom: 12px;
}

.system-status-head h2 {
    margin: 0 0 6px;
}

.system-status-head p {
    min-height: 0;
    margin: 0;
}

.system-refresh-note {
    flex: 0 0 auto;
    color: var(--muted) !important;
    font-size: 12px;
    font-weight: 700 !important;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f3edf8;
}

.system-service-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.system-service-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px 16px;
    background: #fbf9fe;
    border: 1px solid #eee8f5;
    border-radius: 16px;
}

.system-service-row > div {
    min-width: 0;
}

.system-service-row strong {
    display: block;
    font-size: 14px;
    line-height: 1.2;
}

.system-service-row small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.system-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #a7a2ad;
    box-shadow: 0 0 0 4px rgba(167,162,173,.14);
}

.system-dot.ok {
    background: #719584;
    box-shadow: 0 0 0 4px rgba(113,149,132,.14);
}

.system-dot.warning {
    background: #b69358;
    box-shadow: 0 0 0 4px rgba(182,147,88,.14);
}

.system-dot.error {
    background: #c66b7b;
    box-shadow: 0 0 0 4px rgba(198,107,123,.14);
}

.system-label {
    justify-self: end;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    padding: 6px 9px;
    border-radius: 999px;
    background: #f2eff4;
    color: #777;
}

.system-label.ok {
    color: #507764;
    background: #edf5f0;
}

.system-label.warning {
    color: #8b6b35;
    background: #faf4e8;
}

.system-label.error {
    color: #a9485b;
    background: #fff0f3;
}

.system-queue-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.system-queue-grid div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    padding: 15px 16px;
    background: #f3edf8;
    border: 1px solid #eadff3;
    border-radius: 16px;
}

.system-queue-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.system-queue-grid strong {
    display: block;
    color: var(--dark);
    font-size: 25px;
    line-height: 1;
}

.system-chart-wrap {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eee8f5;
    overflow: hidden;
}

.system-chart-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
}

.system-chart-title b {
    color: var(--violet);
}

#openAiStatusChart {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 130px;
}

.system-chart-empty {
    min-height: 0 !important;
    margin: 18px 0 4px !important;
    text-align: center;
    font-size: 13px;
}

@media (max-width: 800px) {
    .core-dashboard-grid .system-status-card {
        padding: 20px;
    }

    .system-status-head {
        flex-direction: column;
        gap: 12px;
    }

    .system-refresh-note {
        white-space: normal;
    }

    .system-service-list {
        grid-template-columns: 1fr;
    }

    .system-service-row {
        grid-template-columns: 12px minmax(0, 1fr);
    }

    .system-label {
        grid-column: 2;
        justify-self: start;
    }

    .system-queue-grid {
        grid-template-columns: 1fr;
    }

    #openAiStatusChart {
        height: 120px;
    }
}


/* Collapsible system status header */
.system-status-card {
    overflow: hidden;
}

.system-status-head {
    margin-bottom: 0;
    align-items: center;
}

.system-status-title {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.system-status-title .service-icon {
    flex: 0 0 auto;
    margin: 0;
}

.system-status-title h2 {
    margin: 0 0 5px;
}

.system-status-title p {
    margin: 0;
}

.system-status-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex: 0 0 auto;
}

.system-mini-indicators {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid #eadff3;
    border-radius: 999px;
    background: #fbf9fe;
}

.system-mini-dot {
    width: 10px;
    height: 10px;
    display: block;
    border-radius: 50%;
    background: #a7a2ad;
    box-shadow: 0 0 0 3px rgba(167,162,173,.12);
}

.system-mini-dot.ok {
    background: #719584;
    box-shadow: 0 0 0 3px rgba(113,149,132,.14);
}

.system-mini-dot.warning {
    background: #b69358;
    box-shadow: 0 0 0 3px rgba(182,147,88,.14);
}

.system-mini-dot.error {
    background: #c66b7b;
    box-shadow: 0 0 0 3px rgba(198,107,123,.14);
}

.system-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e7dbf0;
    border-radius: 14px;
    background: #f3edf8;
    color: var(--violet);
    cursor: pointer;
    transition: background .2s, transform .2s, box-shadow .2s;
}

.system-toggle:hover {
    background: #eadff3;
    box-shadow: 0 8px 18px rgba(118,72,151,.12);
}

.system-toggle-arrow {
    width: 11px;
    height: 11px;
    display: block;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .22s ease;
}

.system-toggle[aria-expanded="true"] .system-toggle-arrow {
    transform: rotate(225deg) translate(-2px, -2px);
}

.system-status-content {
    padding-top: 20px;
}

.system-status-content[hidden] {
    display: none !important;
}

@media (max-width: 800px) {
    .system-status-head {
        flex-direction: row;
        align-items: center;
    }

    .system-status-title {
        align-items: center;
    }

    .system-status-title p {
        display: none;
    }

    .system-status-controls {
        gap: 8px;
    }

    .system-refresh-note {
        display: none;
    }

    .system-mini-indicators {
        gap: 6px;
        padding: 7px 9px;
    }

    .system-toggle {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }
}

@media (max-width: 520px) {
    .system-status-title .service-icon {
        width: 46px;
        height: 46px;
        border-radius: 15px;
    }

    .system-status-title h2 {
        font-size: 19px;
    }

    .system-mini-indicators {
        display: none;
    }
}
