/* Xaya Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.xaya-header {
    width: 90vw;
    max-width: 90vw;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.xaya-header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.xaya-header .tagline {
    color: #95a5a6;
    font-size: 0.9rem;
}

.xaya-header .user-info {
    margin-left: auto;
    font-size: 0.9rem;
}

.xaya-header .user-info a {
    color: #3498db;
    text-decoration: none;
}

main {
    width: 90vw;
    max-width: 90vw;
    margin: 2rem auto;
    padding: 0 2rem;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    color: #0066cc;
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

button[type="submit"]:hover {
    background: #2980b9;
}

/* Auth Layout + Login Skins */
body.auth-layout {
    min-height: 100vh;
    margin: 0;
    background: #061242;
    color: #0f172a;
}

body.auth-layout .alert {
    max-width: min(92vw, 680px);
    margin: 0 auto 1rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.auth-bg {
    position: absolute;
    inset: 0;
}

.auth-bg-legacy {
    background: url('/assets/images/login-bg.png') center center / cover no-repeat;
    transform: scale(1.03);
}

.auth-bg-modern-mask {
    background:
        linear-gradient(120deg, rgba(5, 16, 74, 0.92) 0%, rgba(9, 34, 118, 0.76) 42%, rgba(3, 11, 52, 0.84) 100%),
        radial-gradient(circle at 18% 20%, rgba(82, 206, 255, 0.18), transparent 28%),
        radial-gradient(circle at 85% 76%, rgba(53, 127, 255, 0.16), transparent 30%);
}

.auth-bg-split-mask {
    background:
        linear-gradient(90deg, rgba(5, 16, 74, 0.94) 0%, rgba(8, 28, 96, 0.86) 54%, rgba(241, 247, 255, 0.9) 54%, rgba(241, 247, 255, 0.95) 100%);
}

.auth-bg-legacy-mask {
    background: linear-gradient(180deg, rgba(3, 11, 52, 0.1), rgba(3, 11, 52, 0.36));
}

.auth-stage {
    position: relative;
    z-index: 1;
    width: min(100%, 1220px);
    margin: 0 auto;
}

.auth-stage-modern {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(340px, 1.1fr) minmax(360px, 460px);
    align-items: center;
    gap: clamp(2rem, 4vw, 4.5rem);
    padding: 3rem clamp(1.25rem, 4vw, 3rem);
}

.auth-stage-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(380px, 1.15fr) minmax(360px, 450px);
    align-items: stretch;
    gap: 0;
    padding: 0 clamp(1rem, 2vw, 1.5rem);
}

.auth-stage-legacy {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 2rem clamp(1rem, 5vw, 4rem);
}

.auth-panel {
    position: relative;
}

.auth-panel-modern-copy,
.auth-panel-content-hero {
    color: #fff;
}

.auth-panel-modern-copy {
    max-width: 620px;
    padding: clamp(1rem, 2vw, 2rem) 0;
}

.auth-panel-form {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-panel-form-modern {
    justify-content: flex-end;
}

.auth-panel-form-split {
    background: rgba(248, 251, 255, 0.48);
    backdrop-filter: blur(4px);
}

.auth-panel-split-hero {
    display: flex;
    align-items: center;
    padding: 3rem clamp(1.2rem, 4vw, 4rem);
}

.auth-panel-content-hero {
    max-width: 600px;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-panel-modern-copy h1,
.auth-panel-content-hero h1 {
    margin: 0 0 0.85rem;
    font-size: clamp(2.4rem, 4vw, 4.5rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.auth-lead {
    max-width: 46rem;
    margin: 0 0 1.75rem;
    color: rgba(255, 255, 255, 0.84);
    font-size: clamp(1rem, 1.4vw, 1.16rem);
}

.auth-copy-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.auth-copy-chip {
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f8fbff;
    font-size: 0.92rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
}

.auth-feature-stack {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.auth-feature-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(6px);
}

.auth-feature-card strong {
    font-size: 0.98rem;
    color: #fff;
}

.auth-feature-card span {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.45;
}

.auth-card {
    position: relative;
    z-index: 1;
}

.auth-card-modern,
.auth-card-split {
    width: min(100%, 440px);
    padding: clamp(1.5rem, 2.3vw, 2.2rem);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 28px 70px rgba(4, 18, 71, 0.32);
}

.auth-card-modern {
    max-width: 440px;
}

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

.auth-card-legacy {
    width: min(100%, 420px);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(247, 250, 255, 0.975));
    border: 1px solid rgba(166, 193, 231, 0.95);
    box-shadow: 0 26px 70px rgba(2, 10, 42, 0.4);
    overflow: hidden;
}

.auth-legacy-topbar {
    height: 10px;
    background: linear-gradient(90deg, #4fb6ff, #2a71e6 52%, #4fb6ff);
}

.auth-card-header {
    margin-bottom: 1.4rem;
}

.auth-card-header-split {
    margin-bottom: 1.25rem;
}

.auth-card-header h2 {
    margin: 0 0 0.45rem;
    color: #0b2545;
    font-size: clamp(1.6rem, 2vw, 2rem);
}

.auth-card-header p {
    margin: 0;
    color: #52657b;
    line-height: 1.55;
}

.auth-brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.95rem;
}

.auth-brand-mark,
.auth-legacy-avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #2e79f4 0%, #31c0ff 100%);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(39, 121, 244, 0.32);
}

.auth-brand-mark-small {
    width: 3rem;
    height: 3rem;
    font-size: 1.1rem;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.45rem;
    color: #29415b;
    font-weight: 700;
    font-size: 0.95rem;
}

.auth-form input {
    width: 100%;
    padding: 0.92rem 1rem;
    border: 1px solid #bfd0e2;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: #55a8ff;
    box-shadow: 0 0 0 4px rgba(85, 168, 255, 0.18);
    background: #fff;
}

.auth-submit {
    width: 100%;
    margin-top: 0.7rem;
    padding: 0.95rem 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2d77f2 0%, #27b9ff 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(34, 116, 240, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(34, 116, 240, 0.3);
    filter: saturate(1.04);
}

.auth-form-legacy {
    padding: 0 1.25rem 1.35rem;
}

.auth-form-legacy label {
    color: #233a59;
}

.auth-form-legacy input {
    border-radius: 7px;
    border-color: #afc6e3;
}

.auth-submit-legacy {
    border-radius: 7px;
    background: linear-gradient(180deg, #3b8cff 0%, #2d6fe0 100%);
    box-shadow: 0 12px 24px rgba(29, 93, 201, 0.22);
}

.auth-legacy-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    padding: 1.2rem 1.25rem 0.9rem;
}

.login-box .user-img {
    position: relative;
    float: left;
    width: 80px;
    height: 80px;
    margin-right: 15px;
}

.login-box .user-info span {
    display: block;
    padding: 0.15rem 0 0.85rem;
    color: #112b49;
    font-size: 1.1rem;
    font-weight: 700;
}

.login-box .user-info span i {
    display: block;
    margin-top: 0.3rem;
    color: #5f7690;
    font-size: 0.85rem;
    font-style: normal;
    font-weight: 500;
    opacity: 0.92;
}

@media (max-width: 1040px) {
    .auth-stage-modern,
    .auth-stage-split {
        grid-template-columns: 1fr;
    }

    .auth-panel-form-modern,
    .auth-panel-form-split,
    .auth-stage-legacy {
        justify-content: center;
    }

    .auth-panel-modern-copy,
    .auth-panel-content-hero {
        max-width: 720px;
        margin: 0 auto;
        text-align: center;
    }

    .auth-copy-grid {
        justify-content: center;
    }

    .auth-stage-split {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

@media (max-width: 720px) {
    body.auth-layout .alert {
        max-width: calc(100vw - 2rem);
    }

    .auth-stage-modern,
    .auth-stage-split,
    .auth-stage-legacy {
        width: 100%;
        padding: 1.25rem 1rem;
    }

    .auth-panel-modern-copy h1,
    .auth-panel-content-hero h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .auth-card-modern,
    .auth-card-split,
    .auth-card-legacy {
        width: 100%;
    }

    .auth-card-modern,
    .auth-card-split {
        padding: 1.25rem;
        border-radius: 18px;
    }

    .auth-card-legacy {
        border-radius: 10px;
    }

    .auth-brand-lockup {
        align-items: flex-start;
    }
}

/* Dashboard */
.dashboard {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.muted {
    color: #6c757d;
}

.dashboard h2 {
    margin-bottom: 1.5rem;
}

.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.widget {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.widget h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.widget ul {
    list-style: none;
}

.widget li {
    margin-bottom: 0.5rem;
}

.widget a {
    color: #3498db;
    text-decoration: none;
}

.widget a:hover {
    text-decoration: underline;
}

/* Plugin Catalog */
.plugin-catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.plugin-catalog-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.plugin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.plugin-filter-input {
    flex: 1;
    min-width: 280px;
    padding: 0.75rem 0.9rem;
    border: 1px solid #d7dce1;
    border-radius: 6px;
    font-size: 0.95rem;
}

.plugin-count {
    font-size: 0.95rem;
    color: #6c757d;
}

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

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

.plugin-table th,
.plugin-table td {
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
    vertical-align: top;
}

.plugin-table th {
    color: #2c3e50;
    font-size: 0.9rem;
}

.plugin-egg {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.plugin-desc,
.plugin-subtle {
    color: #6c757d;
    font-size: 0.9rem;
}

.plugin-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plugin-badge-enabled {
    background: #d4edda;
    color: #155724;
}

.plugin-badge-disabled {
    background: #f8d7da;
    color: #721c24;
}

.plugin-btn {
    display: inline-block;
    padding: 0.55rem 0.9rem;
    border-radius: 6px;
    text-decoration: none;
    background: #3498db;
    color: #fff;
    font-weight: 600;
}

.plugin-btn:hover {
    background: #2980b9;
    text-decoration: none;
}

.plugin-btn-secondary {
    background: #eef2f6;
    color: #2c3e50;
}

.plugin-btn-secondary:hover {
    background: #dde5ec;
}

/* Kairos Scheduler / Operations */
.kairos-main {
    max-width: 1600px;
}

/* Modern Card & Header Styling for Kairos */
.kairos-main .card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    margin-bottom: 2rem;
}

.kairos-main .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid #edf2f7;
}

.kairos-main .card-header .eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0f62fe;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.kairos-main .card-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 0.35rem 0;
}

.kairos-main .card-header .muted {
    font-size: 0.9rem;
    color: #718096;
    margin: 0;
}

/* Consistent Padding for the Panel Content */
.kairos-main .panel {
    padding: 1.5rem 2rem 2rem 2rem;
}

/* Modernized Buttons inside Kairos Toolbar */
.kairos-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.kairos-toolbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    line-height: 1.25rem;
}

.kairos-toolbar .btn-primary {
    background-color: #0f62fe;
    color: #ffffff !important;
    border: 1px solid #0f62fe;
    box-shadow: 0 2px 4px rgba(15, 98, 254, 0.15);
}

.kairos-toolbar .btn-primary:hover {
    background-color: #0353e9;
    border-color: #0353e9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 98, 254, 0.25);
}

.kairos-toolbar .btn-primary:active {
    background-color: #002d9c;
    border-color: #002d9c;
    transform: translateY(0);
}

.kairos-toolbar .btn-secondary {
    background-color: #ffffff;
    color: #393939 !important;
    border: 1px solid #c1c7cd;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.kairos-toolbar .btn-secondary:hover {
    background-color: #f2f4f8;
    border-color: #8d939d;
    color: #161616 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.kairos-toolbar .btn-secondary:active {
    background-color: #e8ebf1;
    border-color: #8d939d;
    transform: translateY(0);
}

.kairos-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card {
    border-radius: 12px;
    padding: 1rem 1.1rem;
    border: 1px solid #e6ebf1;
    background: linear-gradient(180deg, #fff, #f8fbff);
    box-shadow: 0 6px 16px rgba(27, 39, 51, 0.04);
}

.metric-card-success {
    border-color: #cdebd7;
    background: linear-gradient(180deg, #f8fff9, #f1fbf4);
}

.metric-card-warning {
    border-color: #ffe1b8;
    background: linear-gradient(180deg, #fffaf2, #fff5e8);
}

.metric-card-info {
    border-color: #d6e4ff;
    background: linear-gradient(180deg, #f8fbff, #eff5ff);
}

.metric-label {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-value {
    font-size: 2rem;
    line-height: 1;
    font-weight: 700;
    color: #1f2d3d;
}

.metric-note {
    color: #6c757d;
    margin-top: 0.4rem;
    font-size: 0.92rem;
}

.scheduler-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.scheduler-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0f62fe;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.scheduler-meta-pill {
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 98, 254, 0.14);
    background: rgba(15, 98, 254, 0.08);
    color: #0f62fe;
    font-size: 0.9rem;
    white-space: nowrap;
    font-weight: 700;
}

.scheduler-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid #dbe5ef;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.scheduler-toolbar-row {
    display: grid;
    gap: 0.9rem;
    align-items: end;
}

.scheduler-toolbar-primary {
    grid-template-columns: minmax(180px, 210px) minmax(280px, 1fr) minmax(
            320px,
            auto
        );
}

.scheduler-toolbar-filters {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.scheduler-control {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.scheduler-control label {
    display: block;
    font-size: 0.77rem;
    color: #617086;
    margin-bottom: 0;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.scheduler-control .form-control {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid #cfd8e3;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.scheduler-control .form-control:hover {
    border-color: #b6c4d5;
}

.scheduler-control .form-control:focus {
    border-color: #0f62fe;
    box-shadow: 0 0 0 4px rgba(15, 98, 254, 0.12);
    outline: none;
}

.scheduler-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.scheduler-actions .btn {
    min-height: 46px;
    border-radius: 999px;
    padding-left: 1rem;
    padding-right: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

.scheduler-actions .btn.btn-primary {
    box-shadow: 0 10px 18px rgba(15, 98, 254, 0.15);
}

.scheduler-actions .btn.btn-secondary {
    background: #f7f9fc;
    border-color: #d8e1ec;
    color: #1f2a37;
}

.scheduler-actions .btn.btn-secondary:hover {
    background: #eef3f8;
    border-color: #c9d5e3;
}

.scheduler-toolbar-filters .scheduler-control:last-child {
    grid-column: span 2;
}

.scheduler-filter-help {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: #718096;
    line-height: 1.4;
}

.scheduler-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(320px, 0.95fr);
    gap: 1rem;
    align-items: start;
}

.scheduler-main {
    min-width: 0;
}

.scheduler-sidebar .panel-stack {
    display: grid;
    gap: 1rem;
}

.sidebar-card {
    background: #fff;
    border: 1px solid #e9edf3;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 14px rgba(27, 39, 51, 0.04);
}

.sidebar-card h3 {
    margin-bottom: 0.85rem;
}

.compact-table th,
.compact-table td {
    padding: 0.55rem 0.45rem;
}

.coverage-list {
    display: grid;
    gap: 0.9rem;
}

.coverage-row-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.coverage-bar {
    height: 10px;
    border-radius: 999px;
    background: #eef2f6;
    overflow: hidden;
}

.coverage-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f62fe, #23b26d);
}

.coverage-note {
    color: #6c757d;
    font-size: 0.86rem;
    margin-top: 0.35rem;
}

.timeline-feed {
    list-style: none;
    display: grid;
    gap: 0.7rem;
}

.timeline-feed li {
    padding-left: 0.9rem;
    position: relative;
    color: #34495e;
}

.timeline-feed li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: #0f62fe;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-chip-high {
    background: #ffe3e6;
    color: #b42318;
}

.status-chip-medium {
    background: #fff1da;
    color: #9a6700;
}

.status-chip-low {
    background: #e8f5e9;
    color: #1e6f3d;
}

.status-chip-confirmed {
    background: #dff3e3;
    color: #175c34;
}

.status-chip-planned {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-chip-draft {
    background: #eceef2;
    color: #4b5563;
}

.pipeline-stages {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.pipeline-stage,
.trend-card {
    border: 1px solid #e9edf3;
    background: #fbfcfe;
    border-radius: 12px;
    padding: 0.9rem;
}

.pipeline-stage span,
.trend-card span,
.trend-card small {
    color: #6c757d;
    display: block;
}

.pipeline-stage strong,
.trend-card strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.4rem;
}

.planner-notes {
    list-style: disc;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.55rem;
    color: #34495e;
}

.kairos-feature-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 1rem;
}

.scheduler-preview-card .mini-agenda {
    display: grid;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.scheduler-preview-card .mini-agenda div {
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: #f7f9fc;
    border: 1px solid #e6ebf1;
}

.scheduler-preview-card .mini-agenda strong {
    display: block;
    color: #0f62fe;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.scheduler-preview-card .mini-agenda span {
    color: #34495e;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.summary-grid strong {
    display: block;
    font-size: 1.8rem;
    line-height: 1;
    color: #0f62fe;
}

.summary-grid span {
    display: block;
    margin-top: 0.3rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.scheduler-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.trend-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

/* Server Controls */
.server-controls {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.server-controls h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.server-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.btn-server {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    color: white;
    transition:
        background 0.2s,
        opacity 0.2s;
}

.btn-server:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-start {
    background: #27ae60;
}

.btn-start:hover:not(:disabled) {
    background: #219a52;
}

.btn-stop {
    background: #e74c3c;
}

.btn-stop:hover:not(:disabled) {
    background: #c0392b;
}

.btn-restart {
    background: #f39c12;
}

.btn-restart:hover:not(:disabled) {
    background: #d68910;
}

.server-status {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    display: inline-block;
}

.server-status.running {
    background: #d4edda;
    color: #155724;
}

.server-status.stopped {
    background: #f8d7da;
    color: #721c24;
}

.server-status.loading {
    background: #fff3cd;
    color: #856404;
}

.server-status-detail {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
    max-height: 260px;
}

.server-status-detail[hidden] {
    display: none;
}

.app-sync-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-sync-field {
    margin-bottom: 0;
}

.app-sync-field input {
    background: #fff;
}

.app-sync-target {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: #eef2f6;
    color: #2c3e50;
    font-size: 0.95rem;
}

.app-sync-log-wrap {
    margin-top: 1rem;
    border: 1px solid #d7dce1;
    border-radius: 6px;
    background: #111827;
    overflow: hidden;
}

.app-sync-log-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #1f2937;
    color: #f9fafb;
    font-size: 0.9rem;
    border-bottom: 1px solid #374151;
}

.app-sync-log-header .muted {
    color: #cbd5e1;
}

.app-sync-log {
    margin: 0;
    padding: 1rem;
    min-height: 180px;
    max-height: 420px;
    overflow: auto;
    background: #0b1220;
    color: #d1fae5;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (max-width: 900px) {
    .plugin-catalog-header,
    .plugin-toolbar,
    .server-buttons,
    .xaya-header,
    .scheduler-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .scheduler-toolbar,
    .scheduler-layout,
    .scheduler-bottom-grid,
    .summary-grid,
    .trend-cards,
    .pipeline-stages,
    .kairos-feature-grid {
        grid-template-columns: 1fr;
    }

    .scheduler-toolbar-row,
    .scheduler-toolbar-primary,
    .scheduler-toolbar-filters {
        grid-template-columns: 1fr;
    }

    .scheduler-actions {
        justify-content: stretch;
    }

    .scheduler-actions .btn {
        width: 100%;
    }

    .scheduler-toolbar-filters .scheduler-control:last-child {
        grid-column: auto;
    }

    .plugin-filter-input {
        min-width: 0;
        width: 100%;
    }
}
