:root {
    --accent: #00a8cc;
    --accent-strong: #0099bb;
    --text-main: #ffffff;
    --text-muted: #b8d4e8;
    --danger: #ff6b6b;
    --radius: 10px;
    --shadow-soft: 0 14px 45px rgba(0, 31, 63, 0.7),
        0 10px 18px rgba(0, 31, 63, 0.6);
    --shadow-card: 0 10px 25px rgba(0, 31, 63, 0.6);
}

/* --- Base Styles --- */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #003366 0%, #001f3f 50%, #001a33 100%);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

body:not(.ready) main {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

body.ready main {
    opacity: 1;
}


.page a {
    color: #ffffff;
    /* bright white */
    background: rgba(0, 168, 204, 0.35);
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}

.page a:hover {
    background: rgba(0, 168, 204, 0.55);
    color: #ffffff;
}



/* --- Header --- */
header.site-header {
    border-bottom: 1px solid rgba(0, 168, 204, 0.3);
    backdrop-filter: blur(16px);
    background: linear-gradient(to bottom,
            rgba(0, 51, 102, 0.95),
            rgba(0, 51, 102, 0.8));
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.brand-title {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.brand-title-main {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: #003366;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(0, 168, 204, 0.6);
    background: var(--accent);
    color: #003366;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.user-btn:hover {
    background: var(--accent-strong);
    transform: translateY(-1px);
}

.user-btn.secondary {
    background: rgba(0, 64, 128, 0.8);
    color: var(--text-muted);
    border-color: rgba(0, 168, 204, 0.5);
}

.user-btn.secondary:hover {
    background: rgba(0, 64, 128, 0.95);
    color: var(--text-main);
}

.user-name {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
}

.ext-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ext-link {
    font-size: 0.78rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 168, 204, 0.5);
    background: rgba(0, 64, 128, 0.8);
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ext-link span.icon {
    font-size: 0.9rem;
}

.ext-link:hover {
    border-color: var(--accent);
    color: var(--text-main);
}

/* --- Main Content --- */
main.page {
    max-width: 1150px;
    margin: 0 auto;
    padding: 1.7rem 1rem 2.8rem;
    width: 100%;
    flex: 1 1 auto;
}

/* --- Hero Section --- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 880px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hero-main {
    padding-right: 0.5rem;
}

.hero-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.17em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}


.hero-sub {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- Platform Summary Card --- */
.hero-secondary {
    background: radial-gradient(circle at top left,
            rgba(0, 168, 204, 0.12),
            rgba(0, 64, 128, 0.9) 55%);
    border-radius: 18px;
    border: 1px solid rgba(0, 168, 204, 0.45);
    box-shadow: var(--shadow-card);
    padding: 1.25rem;
    font-size: 0.9rem;
}

.platform-summary-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}

dl.platform-details {
    margin: 0;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 1rem;
    row-gap: 0.65rem;
    font-size: 0.88rem;
}

dl.platform-details dt {
    margin: 0;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

dl.platform-details dd {
    margin: 0;
    color: var(--text-main);
}

dl.platform-details a {
    color: var(--accent);
    text-decoration: none;
}

dl.platform-details a:hover {
    text-decoration: underline;
}

.platform-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.platform-tag {
    font-size: 0.7rem;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(0, 168, 204, 0.5);
    background: rgba(0, 64, 128, 0.9);
    color: var(--text-muted);
}

/* --- Tabs --- */
.tabs-container {
    margin-bottom: 2rem;
}

.tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid rgba(0, 168, 204, 0.3);
    margin-bottom: 1.5rem;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--text-main);
    background: rgba(0, 168, 204, 0.05);
}

.tab-button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Tables --- */
.services-table {
    background: rgba(0, 30, 60, 0.95);
    border: 1px solid rgba(0, 168, 204, 0.5);
    border-radius: var(--radius);
    overflow: hidden;
}

.service-row {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr auto;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(0, 168, 204, 0.2);
    align-items: center;
    transition: background 0.15s;
}

.service-row:hover {
    background: rgba(0, 168, 204, 0.08);
}

.service-row:last-child {
    border-bottom: none;
}

.service-row-header {
    background: rgba(0, 168, 204, 0.15);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
}

.service-row-header:hover {
    background: rgba(0, 168, 204, 0.15);
}

.service-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
}

.service-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.service-type-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    background: rgba(0, 168, 204, 0.2);
    border: 1px solid rgba(0, 168, 204, 0.4);
    border-radius: 4px;
    color: #c0d9e8;
}

.service-desc {
    font-size: 0.85rem;
    color: #c0d9e8;
    line-height: 1.4;
}

.service-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.action-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    background: rgba(0, 168, 204, 0.15);
    border: 1px solid rgba(0, 168, 204, 0.4);
    color: var(--accent);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.action-btn:hover {
    background: rgba(0, 168, 204, 0.25);
    transform: translateY(-1px);
}

.action-btn.primary {
    background: var(--accent);
    color: #003366;
    border-color: transparent;
    font-weight: 600;
}

.action-btn.primary:hover {
    background: var(--accent-strong);
}

.card-version {
    font-size: 0.74rem;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 168, 204, 0.25);
    border: 1px solid rgba(0, 168, 204, 0.6);
    color: #ffffff;
    white-space: nowrap;
    font-weight: 600;
}

/* --- CANARIE Table --- */
.canarie-row {
    display: grid;
    grid-template-columns: 1.5fr 3.5fr;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(0, 168, 204, 0.2);
    align-items: center;
    transition: background 0.15s;
}

.canarie-row:hover {
    background: rgba(0, 168, 204, 0.08);
}

.canarie-row:last-child {
    border-bottom: none;
}

.canarie-name-col {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.canarie-service-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
}

.canarie-service-name a {
    color: #ffffff;
    text-decoration: none;
}

.canarie-service-name a:hover {
    color: var(--accent);
}

.canarie-actions-inline {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* --- Status Messages --- */
.status {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0.2rem 0 0.5rem;
}

.status.error {
    color: var(--danger);
}

/* --- Footer --- */
footer.site-footer {
    border-top: 1px solid rgba(0, 168, 204, 0.3);
    padding: 0.7rem 1rem 0.9rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.footer-inner {
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.footer-inner a {
    color: var(--accent);
    text-decoration: none;
}

.footer-inner a:hover {
    text-decoration: underline;
}

/* --- Auth Wall (Login Gate) --- */
.auth-wall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #003366 0%, #001f3f 50%, #001a33 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.auth-container {
    background: linear-gradient(to bottom right,
            rgba(0, 30, 60, 0.98),
            rgba(0, 40, 80, 0.98));
    border: 1px solid rgba(0, 168, 204, 0.6);
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-form h2 {
    margin: 0 0 0.5rem 0;
    color: var(--text-main);
    font-size: 1.75rem;
}

.auth-subtitle {
    margin: 0 0 2rem 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 20, 40, 0.8);
    border: 1px solid rgba(0, 168, 204, 0.4);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin: 0.75rem 0;
    min-height: 1.2rem;
}

.auth-form .btn-primary {
    width: 100%;
    padding: 0.85rem;
    background: var(--accent);
    color: #003366;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.auth-form .btn-primary:hover {
    background: var(--accent-strong);
    transform: translateY(-1px);
}

.form-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.form-switch a:hover {
    text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .service-row {
        grid-template-columns: 1fr;
    }

    .canarie-row {
        grid-template-columns: 1fr;
    }

    .service-actions,
    .canarie-actions-inline {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .hero-secondary {
        order: -1;
    }
}