* {
    box-sizing: border-box;
}

:root {
    --bg: #f7f7fb;
    --surface: #ffffff;
    --surface-soft: #f2f1f8;

    --primary: #6957c8;
    --primary-dark: #5140ad;
    --primary-soft: #eeeafd;

    --accent: #df7ca5;

    --text: #24222d;
    --muted: #777381;

    --border: #e7e5ed;

    --success: #42ad7b;

    --shadow: 0 20px 60px rgba(32,25,62,.10);
}

html,
body {
    margin: 0;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);
}

button,
input,
textarea {
    font: inherit;
}


/* LOGIN */

.login-page {
    min-height: 100vh;
    background: var(--bg);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 46% 54%;
}

.login-hero {
    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(255,255,255,.18),
            transparent 35%
        ),
        linear-gradient(
            145deg,
            #5544ac,
            #7562cf 60%,
            #9a70c6
        );

    color: white;

    display: flex;
    flex-direction: column;

    padding: 50px 64px;

    position: relative;
    overflow: hidden;
}

.login-hero::after {
    content: "✦";
    position: absolute;

    right: -50px;
    bottom: 50px;

    font-size: 340px;

    opacity: .035;
}

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

.brand-symbol {
    width: 46px;
    height: 46px;

    border-radius: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;
    font-size: 22px;

    color: #6654bc;
    background: white;

    box-shadow:
        0 8px 25px rgba(0,0,0,.12);
}

.brand h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: .04em;
}

.brand span {
    display: block;
    margin-top: 2px;

    font-size: 12px;
    opacity: .72;
}

.hero-content {
    margin: auto 0;
    max-width: 560px;
}

.hero-tag {
    display: inline-block;

    padding: 8px 13px;

    border-radius: 99px;

    background: rgba(255,255,255,.12);

    font-size: 13px;
}

.hero-content h2 {
    margin:
        26px 0 20px;

    font-size:
        clamp(42px,5vw,68px);

    line-height: 1.02;

    letter-spacing: -.045em;
}

.hero-content h2 span {
    color: #f5c2d8;
}

.hero-content p {
    max-width: 480px;

    line-height: 1.7;

    font-size: 16px;

    opacity: .87;
}

.hero-points {
    margin-top: 32px;

    display: grid;
    gap: 11px;

    font-size: 14px;

    opacity: .88;
}

.hero-footer {
    font-size: 12px;
    opacity: .55;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 50px;
}

.login-card {
    width: min(430px,100%);
}

.mobile-brand {
    display: none;
}

.login-heading span {
    color: var(--primary);
    font-weight: 700;

    font-size: 13px;
}

.login-heading h3 {
    margin: 10px 0;

    font-size: 31px;

    letter-spacing: -.03em;
}

.login-heading p {
    margin: 0 0 32px;

    color: var(--muted);

    line-height: 1.5;
}

label {
    display: block;

    margin: 20px 0;

    font-size: 13px;
    font-weight: 650;
}

input {
    width: 100%;

    margin-top: 8px;

    padding: 15px 16px;

    border: 1px solid var(--border);
    border-radius: 12px;

    outline: none;

    background: white;

    transition: .2s;
}

input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px
        rgba(105,87,200,.10);
}

.password-box {
    position: relative;
}

.password-box input {
    padding-right: 50px;
}

.show-password {
    position: absolute;

    right: 8px;
    top: 15px;

    background: transparent;
    border: none;

    cursor: pointer;

    opacity: .55;
}

.primary-button {
    width: 100%;

    margin-top: 8px;

    padding: 15px 18px;

    border: none;
    border-radius: 13px;

    background: var(--primary);
    color: white;

    font-weight: 700;

    display: flex;
    justify-content: space-between;

    cursor: pointer;

    transition: .2s;
}

.primary-button:hover {
    background: var(--primary-dark);

    transform: translateY(-1px);
}

.login-help {
    margin-top: 28px;

    text-align: center;

    color: var(--muted);

    font-size: 12px;

    line-height: 1.5;
}

.login-help span {
    color: var(--primary);
}

.preview-warning {
    margin-top: 35px;

    text-align: center;

    color: #aaa5b1;

    font-size: 10px;
}


/* APP */

.app-page {
    background: var(--bg);
    min-height: 100vh;
}

.app-shell {
    display: grid;

    grid-template-columns:
        275px 1fr;

    min-height: 100vh;
}

.sidebar {
    position: fixed;

    width: 275px;
    height: 100vh;

    background: #24202f;

    color: white;

    padding: 25px 19px;

    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 0 7px 26px;
}

.brand-symbol.small {
    width: 38px;
    height: 38px;

    font-size: 17px;

    border-radius: 11px;
}

.sidebar-brand strong {
    display: block;
}

.sidebar-brand span {
    display: block;

    margin-top: 3px;

    font-size: 10px;

    color: #a9a4b3;
}

.project-card {
    background: #312c3d;

    padding: 17px;

    border-radius: 16px;

    margin-bottom: 19px;
}

.eyebrow {
    display: block;

    margin-bottom: 12px;

    font-size: 9px;

    letter-spacing: .1em;

    color: #9d98aa;
}

.project-card strong {
    font-size: 17px;
}

.project-meta {
    margin: 9px 0;

    display: flex;
    gap: 7px;
}

.project-meta span {
    background: #443d53;

    padding: 5px 8px;

    border-radius: 6px;

    font-size: 10px;

    color: #d7d2df;
}

.progress,
.usage-bar {
    height: 5px;

    background: #494354;

    border-radius: 99px;

    overflow: hidden;

    margin-top: 15px;
}

.progress-bar,
.usage-bar div {
    height: 100%;

    background:
        linear-gradient(
            90deg,
            #a79ae8,
            #e096ba
        );
}

.project-card small,
.usage-mini small {
    display: block;

    margin-top: 7px;

    color: #96909f;

    font-size: 9px;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
}

.nav-item {
    border: 0;

    background: transparent;

    color: #bdb8c5;

    padding: 11px 12px;

    border-radius: 10px;

    text-align: left;

    display: flex;
    align-items: center;

    gap: 11px;

    cursor: pointer;
}

.nav-item.active {
    background: #393344;

    color: white;
}

.nav-item:hover {
    background: #302b3a;
}

.sidebar-bottom {
    margin-top: auto;
}

.usage-mini {
    padding: 13px;
}

.usage-mini > div:first-child {
    display: flex;
    justify-content: space-between;

    align-items: center;
}

.usage-mini span {
    font-size: 10px;

    color: #aaa5b2;
}

.usage-mini strong {
    font-size: 14px;
}

.logout {
    width: 100%;

    padding: 10px;

    background: transparent;

    border: 1px solid #3d3748;

    color: #a9a4b1;

    border-radius: 9px;

    cursor: pointer;
}

.workspace {
    grid-column: 2;

    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

.topbar {
    height: 85px;

    padding: 19px 38px;

    border-bottom:
        1px solid var(--border);

    background:
        rgba(255,255,255,.85);

    backdrop-filter: blur(14px);

    display: flex;
    justify-content: space-between;

    align-items: center;

    position: sticky;
    top: 0;

    z-index: 10;
}

.section-label {
    font-size: 9px;

    color: var(--primary);

    font-weight: 800;

    letter-spacing: .1em;
}

.topbar h1 {
    font-size: 20px;

    margin: 5px 0 0;

    letter-spacing: -.025em;
}

.seika-status {
    padding: 8px 12px;

    background: #eef9f3;

    border-radius: 99px;

    color: #478465;

    font-size: 11px;

    display: flex;
    align-items: center;

    gap: 7px;
}

.online-dot {
    width: 7px;
    height: 7px;

    background: var(--success);

    border-radius: 50%;
}

.chat-area {
    flex: 1;

    display: flex;
    flex-direction: column;

    width: min(890px,100%);

    margin: 0 auto;

    padding: 45px 28px 22px;
}

.conversation {
    flex: 1;
}

.seika-intro {
    display: flex;

    gap: 14px;

    margin-bottom: 20px;
}

.seika-avatar {
    width: 38px;
    min-width: 38px;
    height: 38px;

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            #7462cc,
            #a871bf
        );

    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;

    box-shadow:
        0 7px 16px
        rgba(87,66,175,.18);
}

.message-bubble {
    max-width: 720px;

    padding: 17px 19px;

    line-height: 1.6;

    font-size: 14px;
}

.seika-message {
    background: white;

    border: 1px solid var(--border);

    border-radius:
        5px 17px 17px 17px;

    box-shadow:
        0 5px 20px
        rgba(35,29,60,.035);
}

.message-author {
    display: block;

    margin-bottom: 9px;

    color: var(--primary);

    font-weight: 750;

    font-size: 11px;
}

.seika-message p {
    margin: 7px 0;
}

.user-row {
    display: flex;
    justify-content: flex-end;

    margin: 20px 0;
}

.user-message {
    background: var(--primary);

    color: white;

    border-radius:
        17px 17px 5px 17px;
}

.suggestions {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin:
        12px 0 35px 52px;
}

.suggestions button {
    padding: 9px 12px;

    background: white;

    border:
        1px solid var(--border);

    border-radius: 9px;

    color: #615d68;

    font-size: 11px;

    cursor: pointer;

    transition: .2s;
}

.suggestions button:hover {
    border-color: #c3bae8;

    background: var(--primary-soft);

    color: var(--primary);
}

.composer {
    position: sticky;

    bottom: 0;

    padding-top: 18px;

    background:
        linear-gradient(
            transparent,
            var(--bg) 20%
        );
}

.composer-box {
    background: white;

    border:
        1px solid var(--border);

    border-radius: 16px;

    box-shadow: var(--shadow);

    display: flex;
    align-items: flex-end;

    padding: 9px;
}

textarea {
    flex: 1;

    resize: none;

    border: none;

    outline: none;

    padding: 10px 12px;

    line-height: 1.5;

    max-height: 150px;
}

.send-button {
    width: 39px;
    height: 39px;

    border: none;
    border-radius: 11px;

    background: var(--primary);

    color: white;

    font-size: 19px;

    cursor: pointer;
}

.composer-footer {
    padding: 8px 6px 0;

    display: flex;
    justify-content: space-between;

    color: #9e99a6;

    font-size: 9px;
}


/* RESPONSIVE */

@media (max-width: 850px) {

    .login-shell {
        display: block;
    }

    .login-hero {
        display: none;
    }

    .login-panel {
        min-height: 100vh;

        padding: 28px;
    }

    .mobile-brand {
        display: flex;
        align-items: center;

        gap: 10px;

        margin-bottom: 50px;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .workspace {
        display: flex;

        min-height: 100vh;
    }

    .topbar {
        padding:
            15px 18px;

        height: 72px;
    }

    .topbar h1 {
        font-size: 16px;
    }

    .seika-status {
        font-size: 0;
        padding: 9px;
    }

    .chat-area {
        padding:
            27px 15px 16px;
    }

    .suggestions {
        margin-left: 0;
    }

    .message-bubble {
        font-size: 13px;
    }

    .composer-footer span:first-child {
        display: none;
    }

    .composer-footer {
        justify-content: flex-end;
    }
}

/* ===== SEIKA AVATAR ===== */

.brand-avatar {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35);
    box-shadow: 0 8px 25px rgba(0,0,0,.12);
    background: white;
}

.mobile-brand-avatar {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(80,60,160,.18);
    background: white;
}

.sidebar-avatar {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    background: white;
}

.seika-avatar-img {
    width: 42px;
    min-width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 7px 16px rgba(87,66,175,.18);
    background: white;
}

.tutor-visual {
    position: absolute;
    right: 32px;
    bottom: 42px;
    width: 220px;
    z-index: 1;
    pointer-events: none;
}

.hero-tutor {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.25);
    box-shadow: 0 18px 36px rgba(20,12,55,.32);
    background: rgba(255,255,255,.08);
}

.login-hero .brand,
.login-hero .hero-content,
.login-hero .hero-footer {
    position: relative;
    z-index: 2;
}

@media (max-width: 850px) {
    .tutor-visual {
        display: none;
    }
}

/* ===== AJUSTE LOGIN SEIKA ===== */

.brand-avatar {
    width: 68px;
    height: 68px;
    border: 2px solid rgba(255,255,255,.45);
}

.brand {
    gap: 16px;
}

.brand h1 {
    font-size: 34px;
    line-height: 1;
}

.brand span {
    font-size: 14px;
    opacity: .82;
}

.tutor-visual {
    display: none !important;
}

.login-error {
    margin-top: 14px;
    padding: 11px 13px;
    border-radius: 10px;
    background: #fff0f3;
    color: #a9415c;
    font-size: 12px;
    line-height: 1.4;
}

.primary-button:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
}


/* ========================================
   SEIKA ADMIN PANEL
======================================== */

.admin-page {
    margin: 0;
    min-height: 100vh;
    background: #f6f5fa;
    color: #262330;
}

.admin-shell {
    min-height: 100vh;
}

.admin-header {
    height: 76px;
    padding: 0 42px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    background: #ffffff;
    border-bottom: 1px solid #e8e6ee;

    position: sticky;
    top: 0;
    z-index: 20;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-brand img {
    width: 43px;
    height: 43px;
    border-radius: 50%;
    object-fit: cover;

    box-shadow:
        0 5px 16px rgba(83,66,165,.16);
}

.admin-brand strong {
    display: block;
    font-size: 17px;
}

.admin-brand span {
    display: block;
    margin-top: 2px;

    color: #8d8996;
    font-size: 10px;
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-secondary {
    border: 1px solid #e3e0e9;
    background: #fff;
    color: #635e6b;

    padding: 9px 13px;

    border-radius: 9px;

    text-decoration: none;

    cursor: pointer;

    font-size: 11px;
}

.admin-secondary:hover {
    background: #f5f3fb;
    color: #6957c8;
}

.admin-content {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 46px 0 70px;
}

.admin-welcome > span,
.admin-card-heading > div > span {
    color: #6957c8;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: .12em;
}

.admin-welcome h1 {
    margin: 7px 0;
    font-size: 32px;

    letter-spacing: -.035em;
}

.admin-welcome h1 strong {
    font-weight: 750;
}

.admin-welcome p {
    color: #807b89;
    margin: 0;
}

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0,1fr));

    gap: 14px;

    margin: 33px 0;
}

.stat-card {
    background: white;

    padding: 20px;

    border: 1px solid #e9e7ee;
    border-radius: 15px;
}

.stat-card span {
    display: block;

    color: #8b8692;

    font-size: 11px;

    margin-bottom: 12px;
}

.stat-card strong {
    font-size: 27px;

    letter-spacing: -.03em;
}

.admin-card {
    background: white;

    border: 1px solid #e9e7ee;

    border-radius: 17px;

    margin-top: 17px;

    overflow: hidden;
}

.admin-card-heading {
    padding: 21px 23px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    border-bottom: 1px solid #efedf2;
}

.admin-card-heading h2 {
    margin: 4px 0 0;

    font-size: 18px;

    letter-spacing: -.02em;
}

.admin-primary {
    background: #6957c8;
    color: white;

    border: none;

    border-radius: 9px;

    padding: 10px 15px;

    font-weight: 700;

    cursor: pointer;

    font-size: 11px;
}

.admin-primary:hover {
    background: #5745b6;
}

.create-user-form {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 17px;

    padding: 23px;

    background: #faf9fc;
}

.create-user-form.hidden {
    display: none;
}

.admin-field label {
    display: block;

    margin: 0 0 7px;

    color: #605c67;

    font-size: 10px;
}

.admin-field input {
    margin: 0;
}

.create-actions {
    grid-column: 1 / -1;

    display: flex;
    align-items: center;

    gap: 14px;
}

#createMessage {
    color: #6957c8;

    font-size: 11px;
}

.admin-search {
    width: 210px;

    margin: 0;

    padding: 10px 12px;

    font-size: 11px;
}

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

.users-table {
    width: 100%;

    border-collapse: collapse;

    font-size: 12px;
}

.users-table th {
    padding: 12px 19px;

    text-align: left;

    color: #928d99;
    background: #faf9fc;

    font-size: 9px;
    letter-spacing: .06em;

    font-weight: 750;
}

.users-table td {
    padding: 15px 19px;

    border-top: 1px solid #efedf2;

    vertical-align: middle;
}

.user-identity strong {
    display: block;
    font-size: 12px;
}

.user-identity span,
.usage-cell span {
    display: block;

    margin-top: 3px;

    color: #99949f;

    font-size: 9px;
}

.usage-cell strong {
    font-size: 11px;
}

.status-pill {
    display: inline-block;

    padding: 5px 8px;

    border-radius: 99px;

    font-size: 9px;

    font-weight: 700;
}

.status-active {
    background: #ebf8f1;
    color: #418362;
}

.status-inactive {
    background: #f3f1f4;
    color: #89848d;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.table-actions button {
    border: 1px solid #e2dfe7;

    background: white;

    color: #66616d;

    padding: 6px 8px;

    border-radius: 7px;

    cursor: pointer;

    font-size: 9px;
}

.table-actions button:hover {
    background: #f2effb;
    color: #6957c8;
    border-color: #d5cef5;
}


@media (max-width: 850px) {

    .admin-header {
        padding: 0 18px;
    }

    .admin-content {
        width: calc(100% - 28px);
        padding-top: 28px;
    }

    .admin-welcome h1 {
        font-size: 25px;
    }

    .stats-grid {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }

    .create-user-form {
        grid-template-columns: 1fr;
    }

    .create-actions {
        grid-column: auto;
    }

    .admin-actions a {
        display: none;
    }

    .admin-card-heading {
        align-items: flex-start;
        gap: 14px;
    }

    .admin-search {
        width: 130px;
    }
}


/* ========================================
   SEIKA · PROJECT SETUP
======================================== */

.project-modal {
    position: fixed;
    inset: 0;

    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(26, 22, 38, .58);

    backdrop-filter: blur(8px);
}

.project-modal.hidden {
    display: none;
}

.project-modal-card {
    width: min(440px, 100%);

    background: white;

    padding: 34px;

    border-radius: 22px;

    box-shadow:
        0 30px 90px
        rgba(24,18,50,.25);

    text-align: left;
}

.project-modal-avatar img {
    width: 58px;
    height: 58px;

    border-radius: 50%;

    object-fit: cover;

    box-shadow:
        0 8px 22px
        rgba(90,68,180,.20);

    margin-bottom: 18px;
}

.project-modal-label {
    display: block;

    color: #6957c8;

    font-size: 9px;
    font-weight: 800;

    letter-spacing: .11em;

    margin-bottom: 7px;
}

.project-modal-card h2 {
    margin: 0;

    font-size: 27px;

    letter-spacing: -.035em;
}

.project-modal-card > p {
    margin: 10px 0 25px;

    color: #817c89;

    line-height: 1.6;

    font-size: 13px;
}

.project-modal-card label {
    margin: 16px 0;

    color: #55515d;

    font-size: 11px;
}

.project-modal-card select {
    display: block;

    width: 100%;

    margin-top: 8px;

    padding: 14px 15px;

    border: 1px solid #e3e0e9;

    border-radius: 11px;

    background: white;

    color: #312d38;

    outline: none;

    font: inherit;
}

.project-modal-card select:focus {
    border-color: #6957c8;

    box-shadow:
        0 0 0 4px
        rgba(105,87,200,.09);
}

.project-save-button {
    width: 100%;

    margin-top: 10px;

    padding: 14px 17px;

    border: none;

    border-radius: 11px;

    background: #6957c8;

    color: white;

    font-weight: 700;

    cursor: pointer;
}

.project-save-button:hover {
    background: #5746b4;
}

#projectFormMessage {
    margin-top: 12px;

    min-height: 16px;

    text-align: center;

    color: #6957c8;

    font-size: 10px;
}


/* ========================================
   SEIKA · LIVE CHAT
======================================== */

.send-button:disabled {
    opacity: .5;
    cursor: wait;
}

.seika-typing {
    color: #777381;
}

.typing-text {
    display: block;
    margin-top: 7px;
}

.typing-dots {
    display: inline-block;
    animation: seikaPulse 1.15s infinite;
}

@keyframes seikaPulse {

    0%, 100% {
        opacity: .30;
    }

    50% {
        opacity: 1;
    }
}

.rich-message .seika-content {
    line-height: 1.65;
}

.rich-message .seika-content > *:first-child {
    margin-top: 0;
}

.rich-message .seika-content > *:last-child {
    margin-bottom: 0;
}

.rich-message p {
    margin: 9px 0;
}

.rich-message h1,
.rich-message h2,
.rich-message h3,
.rich-message h4 {
    margin: 18px 0 8px;
    line-height: 1.25;
}

.rich-message h2 {
    font-size: 17px;
}

.rich-message h3 {
    font-size: 15px;
}

.rich-message ul,
.rich-message ol {
    margin: 10px 0;
    padding-left: 23px;
}

.rich-message li {
    margin: 5px 0;
}

.rich-message blockquote {
    margin: 13px 0;

    padding: 9px 14px;

    border-left:
        3px solid #8d7ddd;

    background:
        #f7f5fd;

    border-radius:
        0 8px 8px 0;
}

.rich-message table {
    width: 100%;

    margin: 15px 0;

    border-collapse:
        collapse;

    font-size: 12px;
}

.rich-message th,
.rich-message td {
    padding: 9px 10px;

    border:
        1px solid #e5e1ef;

    text-align: left;
}

.rich-message th {
    background: #f5f2fc;
    color: #54479c;
}

.rich-message code {
    padding: 2px 5px;

    border-radius: 5px;

    background: #f1eff5;
}

.rich-message pre {
    overflow-x: auto;

    padding: 13px;

    background: #272331;
    color: #f5f3fa;

    border-radius: 10px;
}

.rich-message pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

@media (max-width: 850px) {

    .rich-message table {
        display: block;
        overflow-x: auto;
    }
}


/* =====================================
   SEIKA · API COST DASHBOARD
===================================== */

.api-cost-panel {
    margin: 28px;
    padding: 26px;

    background: #fff;

    border:
        1px solid #ebe7f4;

    border-radius: 18px;

    box-shadow:
        0 8px 30px
        rgba(57, 45, 90, .07);
}

.cost-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 20px;
}

.cost-heading h2 {
    margin: 4px 0;
}

.cost-heading p {
    margin: 0;
    opacity: .65;
}

.cost-eyebrow {
    font-size: 11px;
    font-weight: 700;

    letter-spacing: .12em;

    color: #6957c8;
}

.cost-refresh {
    border: 0;
    border-radius: 10px;

    padding: 10px 15px;

    background: #6957c8;
    color: white;

    cursor: pointer;
}

.cost-kpis {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 14px;

    margin-bottom: 17px;
}

.cost-card {
    padding: 17px;

    background: #f8f6fd;

    border-radius: 13px;
}

.cost-card span {
    display: block;

    margin-bottom: 7px;

    font-size: 12px;

    opacity: .7;
}

.cost-card strong {
    font-size: 21px;

    color: #40376f;
}

.cost-secondary {
    display: flex;
    flex-wrap: wrap;

    gap: 20px;

    padding: 12px 2px 18px;

    font-size: 12px;

    opacity: .8;
}

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

.cost-table {
    width: 100%;

    border-collapse: collapse;
}

.cost-table th,
.cost-table td {
    padding: 11px 10px;

    border-bottom:
        1px solid #eeeaf5;

    text-align: left;
}

.cost-table th {
    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: .04em;

    opacity: .6;
}

.cost-table td small {
    display: block;

    margin-top: 3px;

    opacity: .55;
}

.cost-note {
    margin:
        14px 0 0;

    font-size: 11px;

    opacity: .55;
}


@media (
    max-width: 900px
) {

    .cost-kpis {
        grid-template-columns:
            repeat(2, 1fr);
    }
}


@media (
    max-width: 520px
) {

    .api-cost-panel {
        margin: 14px;
        padding: 17px;
    }

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


/* ======================================
   SEIKA · MI PROYECTO
====================================== */

.project-memory-trigger {
    position: fixed;
    top: 92px;
    right: 22px;
    z-index: 800;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 10px 15px;

    border: 1px solid #e7e1f4;
    border-radius: 999px;

    background: rgba(255,255,255,.96);
    color: #554697;

    font-weight: 700;

    box-shadow:
        0 8px 24px
        rgba(64,48,103,.12);

    cursor: pointer;

    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.project-memory-trigger:hover {
    transform: translateY(-1px);

    box-shadow:
        0 10px 28px
        rgba(64,48,103,.18);
}


.project-memory-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;

    background:
        rgba(25,20,36,.25);

    backdrop-filter:
        blur(2px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity .22s ease,
        visibility .22s ease;
}

.project-memory-overlay.open {
    opacity: 1;
    visibility: visible;
}


.project-memory-drawer {
    position: fixed;

    top: 0;
    right: 0;
    bottom: 0;

    z-index: 999;

    width: min(
        390px,
        94vw
    );

    padding: 25px;

    overflow-y: auto;

    background: #fcfbff;

    box-shadow:
        -18px 0 50px
        rgba(48,38,78,.16);

    transform:
        translateX(105%);

    transition:
        transform .24s ease;
}

.project-memory-drawer.open {
    transform: translateX(0);
}


.project-memory-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;

    margin-bottom: 22px;
}

.project-memory-header h2 {
    margin: 4px 0 5px;

    color: #453979;

    font-size: 24px;
}

.project-memory-header p {
    margin: 0;

    max-width: 275px;

    color: #777184;
    font-size: 13px;
    line-height: 1.45;
}

.project-memory-eyebrow {
    color: #8b72d7;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: .1em;
    text-transform: uppercase;
}

.project-memory-close {
    width: 34px;
    height: 34px;

    border: 0;
    border-radius: 50%;

    background: #f0edf7;
    color: #655b75;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}


.project-memory-loading,
.project-memory-error {
    padding: 20px;

    border-radius: 12px;

    background: #f6f3fc;

    color: #746d80;

    font-size: 13px;
}


.project-memory-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;

    margin-bottom: 18px;
}

.project-memory-summary > div {
    padding: 13px;

    border:
        1px solid #eae5f4;

    border-radius: 12px;

    background: white;
}

.project-memory-summary span {
    display: block;

    margin-bottom: 5px;

    color: #8a8492;
    font-size: 11px;
}

.project-memory-summary strong {
    color: #4e426f;
    font-size: 14px;
}


.project-memory-section {
    margin-bottom: 13px;

    padding: 15px;

    border:
        1px solid #ebe6f4;

    border-radius: 13px;

    background: white;
}

.project-memory-label {
    display: block;

    margin-bottom: 8px;

    color: #7560bc;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: .03em;
}

.project-memory-value {
    color: #4d4854;

    font-size: 13px;
    line-height: 1.55;
}


.project-memory-4e {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-memory-4e-item {
    padding: 10px;

    border-radius: 9px;

    background: #f8f6fd;
}

.project-memory-4e-item strong {
    display: block;

    margin-bottom: 3px;

    color: #5f50a0;

    font-size: 11px;
}

.project-memory-4e-item span {
    color: #5b5661;

    font-size: 12px;
    line-height: 1.45;
}


.project-memory-list {
    margin: 0;
    padding-left: 19px;

    color: #58525f;

    font-size: 12px;
    line-height: 1.5;
}

.project-memory-list li {
    margin: 6px 0;
}


.project-memory-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    margin-top: 19px;
    padding-top: 16px;

    border-top:
        1px solid #ebe6f4;
}

.project-memory-footer span {
    color: #918b99;

    font-size: 10px;
    line-height: 1.4;
}

.project-memory-footer button {
    flex-shrink: 0;

    padding: 8px 11px;

    border: 0;
    border-radius: 8px;

    background: #efeafb;
    color: #6754ad;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;
}


body.project-memory-open {
    overflow: hidden;
}


@media (max-width: 700px) {

    .project-memory-trigger {
        top: auto;
        right: 14px;
        bottom: 88px;

        padding: 9px 12px;

        font-size: 12px;
    }

    .project-memory-drawer {
        padding: 20px;
    }
}
