/* TGD SEO Console — CES Branded Stylesheet */

:root {
    --clr-primary:      #0f172a;
    --clr-primary-dk:   #080d17;
    --clr-accent:       #4ade80;
    --clr-accent-dk:    #22c55e;
    --clr-accent-lt:    #86efac;
    --clr-accent-glow:  rgba(74, 222, 128, 0.18);
    --clr-bg:           #f8fafc;
    --clr-surface:      #ffffff;
    --clr-border:       #e2e8f0;
    --clr-text:         #1e293b;
    --clr-text-muted:   #64748b;
    --clr-text-faint:   #94a3b8;
    --clr-ok:           #16a34a;
    --clr-ok-bg:        #dcfce7;
    --clr-warn:         #d97706;
    --clr-warn-bg:      #fef9c3;
    --clr-danger:       #dc2626;
    --clr-danger-bg:    #fee2e2;
    --font-sans:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display:     'Space Grotesk', 'Inter', sans-serif;
    --r-sm:  4px;
    --r-md:  8px;
    --r-lg:  12px;
    --r-xl:  16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.07);
    --shadow-md: 0 4px 12px rgba(0,0,0,.10);
    --t-base: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    background: var(--clr-bg);
    color: var(--clr-text);
    font-size: 15px;
    line-height: 1.6;
}

/* ── Header ─────────────────────────────────────────────────────── */
.app-header {
    background: var(--clr-primary);
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.app-header .brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}
.app-header .brand img {
    height: 30px;
    width: auto;
    opacity: .92;
}
.app-header .brand-divider {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,.18);
}
.app-header .app-name {
    font-family: var(--font-display);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: .01em;
}
.app-header .app-name span {
    color: var(--clr-accent);
}
.app-header nav a {
    color: var(--clr-text-faint);
    text-decoration: none;
    font-size: 0.82rem;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    transition: color var(--t-base), background var(--t-base);
}
.app-header nav a:hover,
.app-header nav a.active {
    color: var(--clr-accent);
    background: rgba(74,222,128,.08);
}
.app-header nav {
    display: flex;
    gap: 4px;
}

/* ── Env badge ───────────────────────────────────────────────────── */
.env-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: rgba(74,222,128,.12);
    color: var(--clr-accent);
    border: 1px solid rgba(74,222,128,.25);
}

/* ── Page body ───────────────────────────────────────────────────── */
.page-body {
    max-width: 960px;
    margin: 36px auto;
    padding: 0 24px;
}

/* ── Section label ───────────────────────────────────────────────── */
.section-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 14px;
}

/* ── Status cards ────────────────────────────────────────────────── */
.cards-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--r-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    flex: 0 0 260px;
    transition: box-shadow var(--t-base), transform var(--t-base);
}
.card.card-wide {
    flex: 1 1 calc(50% - 8px);
    max-width: calc(50% - 8px);
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.card .card-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.card .card-label::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--clr-accent);
}
.card .card-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--clr-text);
    word-break: break-all;
}
.card .card-value.ok     { color: var(--clr-ok); }
.card .card-value.warn   { color: var(--clr-warn); }
.card .card-value.danger { color: var(--clr-danger); }

/* ── Nav tiles ───────────────────────────────────────────────────── */
.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}
.tile {
    display: flex;
    flex-direction: column;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    text-decoration: none;
    color: var(--clr-text);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base);
}
.tile:hover {
    border-color: var(--clr-accent);
    box-shadow: 0 0 0 3px var(--clr-accent-glow), var(--shadow-md);
    transform: translateY(-2px);
}
.tile.disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}
.tile .tile-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--clr-accent-dk);
}
.tile .tile-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.tile .tile-desc {
    font-size: 0.78rem;
    color: var(--clr-text-muted);
}
.tile .tile-phase {
    margin-top: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--clr-accent-dk);
}
.tile.disabled .tile-phase { color: var(--clr-text-faint); }

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert {
    border-radius: var(--r-md);
    padding: 12px 16px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.alert.danger { background: var(--clr-danger-bg); color: var(--clr-danger); border: 1px solid #fca5a5; }
.alert.warn   { background: var(--clr-warn-bg);   color: var(--clr-warn);   border: 1px solid #fcd34d; }

/* ── Tables ──────────────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
    font-size: 0.88rem;
}
th {
    background: var(--clr-bg);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--clr-text-muted);
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--clr-border);
}
td {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--clr-text);
}
tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.badge.publish  { background: var(--clr-ok-bg);   color: var(--clr-ok); }
.badge.draft    { background: var(--clr-warn-bg);  color: var(--clr-warn); }
.badge.private  { background: #f3e8ff;             color: #7e22ce; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--r-md);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--t-base), box-shadow var(--t-base);
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: var(--clr-accent);
    color: var(--clr-primary);
}
.btn-primary:hover {
    background: var(--clr-accent-dk);
    box-shadow: 0 0 0 3px var(--clr-accent-glow);
}
.btn-ghost {
    background: transparent;
    color: var(--clr-text-muted);
    border: 1px solid var(--clr-border);
}
.btn-ghost:hover {
    background: var(--clr-bg);
    border-color: var(--clr-accent);
    color: var(--clr-accent-dk);
}
.btn-danger {
    background: transparent;
    color: var(--clr-danger);
    border: 1px solid #fca5a5;
}
.btn-danger:hover {
    background: var(--clr-danger-bg);
    border-color: var(--clr-danger);
}
.btn-danger:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.btn.disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Section spacing ─────────────────────────────────────────────── */
.section { margin-bottom: 36px; }

/* ── Loading modal ───────────────────────────────────────────────── */
.loading-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-card {
    background: var(--clr-surface);
    border-radius: var(--r-xl);
    padding: 44px 52px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    min-width: 320px;
    max-width: 440px;
    border: 1px solid var(--clr-border);
}
.loading-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--clr-border);
}
.loading-brand img { height: 22px; opacity: .85; }
.loading-brand .lb-name {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--clr-primary);
}
.loading-brand .lb-name span { color: var(--clr-accent-dk); }
.loading-spinner {
    width: 54px;
    height: 54px;
    border: 4px solid var(--clr-border);
    border-top-color: var(--clr-accent);
    border-radius: 50%;
    animation: lm-spin 0.72s linear infinite;
    margin: 0 auto 24px;
}
@keyframes lm-spin { to { transform: rotate(360deg); } }
.loading-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--clr-primary);
    margin-bottom: 8px;
}
.loading-msg {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
    line-height: 1.55;
}
