:root {
    --bg: #0a0e13;
    --bg-soft: #0f151d;
    --panel: #131b25;
    --panel-2: #18222e;
    --border: #22303f;
    --text: #e6edf3;
    --muted: #8b98a7;
    --accent: #4f8cff;
    --accent-2: #2f6fe0;
    --ok: #2ea043;
    --danger: #f85149;
    --warn: #d29922;
    --radius: 12px;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    background: radial-gradient(1200px 600px at 20% -10%, #142034 0%, var(--bg) 55%) no-repeat, var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
.muted { color: var(--muted); }
.ok { color: var(--ok); font-weight: 600; }
.ko { color: var(--danger); font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }
.mt { margin-top: 1rem; }

/* Buttons & Inputs */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    padding: 0.55rem 1.05rem; border-radius: 8px; border: 1px solid var(--border);
    background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: 0.15s ease; text-decoration: none;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { background: rgba(248, 81, 73, 0.14); border-color: rgba(248, 81, 73, 0.45); color: #ff8b85; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }

input, select, textarea {
    width: 100%; padding: 0.6rem 0.8rem; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
    font-size: 0.95rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; font-weight: 600; }
.form-group { margin-bottom: 1rem; }

/* Cards & Tables */
.card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem;
    min-width: 0; overflow: hidden;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
}

.kpi-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; }
.kpi-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: 1.65rem; font-weight: 700; margin-top: 0.25rem; color: var(--text); }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.65rem 0.75rem; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
.kv-table th, .kv-table td { white-space: normal; word-break: break-word; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: rgba(79, 140, 255, 0.04); }

.badge {
    display: inline-block; padding: 0.18rem 0.55rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 600; background: var(--panel-2); border: 1px solid var(--border);
}
.badge-ok { background: rgba(46, 160, 67, 0.15); border-color: rgba(46, 160, 67, 0.4); color: #56d364; }
.badge-warn { background: rgba(210, 153, 34, 0.15); border-color: rgba(210, 153, 34, 0.4); color: #e3b341; }
.badge-danger { background: rgba(248, 81, 73, 0.15); border-color: rgba(248, 81, 73, 0.4); color: #ff8b85; }
.badge-accent { background: rgba(79, 140, 255, 0.15); border-color: rgba(79, 140, 255, 0.4); color: var(--accent); }

.alert { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; border: 1px solid var(--border); }
.alert-ok { background: rgba(46, 160, 67, 0.12); border-color: rgba(46, 160, 67, 0.45); color: #7ee787; }
.alert-error { background: rgba(248, 81, 73, 0.12); border-color: rgba(248, 81, 73, 0.45); color: #ffa198; }

/* App Shell (Sidebar + Topbar + tema dark RevoPlayer) */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px; flex-shrink: 0; background: var(--bg-soft);
    border-inline-end: 1px solid var(--border); display: flex; flex-direction: column;
    padding: 1rem;
}
.sidebar-brand { display: flex; align-items: center; gap: 0.65rem; padding: 0.4rem 0.5rem 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.sidebar-brand img { height: 34px; width: auto; }
.sidebar-brand span { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.nav-link {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem;
    border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 0.92rem;
}
.nav-link:hover, .nav-link.active { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-link.active { border-inline-start: 3px solid var(--accent); color: var(--accent); }

.nav-group { margin-top: 0.25rem; }
.nav-group-title {
    list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
    padding: 0.55rem 0.8rem; border-radius: 8px; color: var(--text);
    font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    user-select: none;
}
.nav-group-title::-webkit-details-marker { display: none; }
.nav-group-title::after { content: '▸'; font-size: 0.75rem; color: var(--muted); transition: transform 0.15s ease; }
.nav-group[open] > .nav-group-title::after { transform: rotate(90deg); }
.nav-group-title:hover { background: var(--panel-2); }
.nav-group-items { display: flex; flex-direction: column; gap: 0.15rem; padding-inline-start: 0.5rem; margin-top: 0.15rem; }

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.85rem 1.5rem; background: rgba(15, 21, 29, 0.9); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar-right { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.content { padding: 1.5rem; flex: 1; max-width: 1320px; width: 100%; margin: 0 auto; }
.footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

/* Language Switcher with SVG Flags */
.lang-dd { position: relative; display: inline-block; }
.lang-dd-btn {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.4rem 0.7rem; border-radius: 8px; border: 1px solid var(--border);
    background: var(--panel); color: var(--text); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.lang-dd-btn:hover { border-color: var(--accent); }
.lang-dd-menu {
    display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 155px;
    background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
    padding: 0.35rem; box-shadow: 0 10px 25px rgba(0,0,0,0.45); z-index: 50;
}
[dir="rtl"] .lang-dd-menu { right: auto; left: 0; }
.lang-dd.open .lang-dd-menu { display: flex; flex-direction: column; gap: 0.15rem; }
.lang-dd-item {
    display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.65rem;
    border-radius: 6px; color: var(--text); font-size: 0.85rem; text-decoration: none;
}
.lang-dd-item:hover, .lang-dd-item.active { background: var(--panel-2); color: var(--accent); text-decoration: none; }

/* Login Page & Legal Disclaimer */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 2rem 1rem; }
.login-shell { width: 100%; max-width: 440px; }
.login-header { text-align: center; margin-bottom: 1.25rem; }
.login-header img { height: 48px; margin-bottom: 0.5rem; }
.disclaimer-box {
    margin-top: 1rem; padding: 0.85rem 1rem; border-radius: 8px;
    border: 1px solid rgba(248, 81, 73, 0.55); background: rgba(248, 81, 73, 0.08);
    color: #ffb4ae; font-size: 0.82rem; line-height: 1.45;
}
.disclaimer-box a { color: #fff; text-decoration: underline; font-weight: 600; }

/* Landing Page (OrbixPlay inspired + orig1 dark style) */
.lp-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(10, 14, 19, 0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.lp-nav {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    max-width: 1180px; margin: 0 auto; padding: 0.85rem 1.5rem;
}
.lp-menu {
    display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
    background: rgba(19, 27, 37, 0.75);
    border: 1px solid var(--border);
    padding: 0.3rem;
    border-radius: 10px;
}
.lp-menu-link {
    padding: 0.42rem 0.85rem;
    border-radius: 7px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.lp-menu-link:hover {
    background: var(--panel-2);
    color: var(--text);
    text-decoration: none;
}
.lp-nav-actions { display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
.lp-brand { display: flex; align-items: center; gap: 0.65rem; font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; flex-shrink: 0; }
.lp-brand:hover { text-decoration: none; color: var(--text); }
.lp-brand img { height: 38px; }
.lp-hero { max-width: 1180px; margin: 0 auto; padding: 4rem 1.5rem 3rem; text-align: center; }
.lp-hero h1 { font-size: clamp(1.85rem, 4.5vw, 3.2rem); margin: 1rem 0; line-height: 1.15; }
.lp-hero p { max-width: 680px; margin: 0 auto 2rem; color: var(--muted); font-size: 1.1rem; }
.lp-hero-cta { display: flex; justify-content: center; gap: 0.85rem; flex-wrap: wrap; margin-top: 1.75rem; }
.lp-section { max-width: 1180px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.platform-pill {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 1rem; border-radius: var(--radius); background: var(--panel);
    border: 1px solid var(--border); font-weight: 600;
}
.platform-featured {
    border-color: rgba(46, 160, 67, 0.65);
    background: linear-gradient(135deg, rgba(46, 160, 67, 0.12), var(--panel));
}
.vega-banner {
    display: inline-flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; justify-content: center;
    margin: 0.5rem auto 0; padding: 0.65rem 1.1rem; border-radius: 999px;
    background: rgba(46, 160, 67, 0.12); border: 1px solid rgba(46, 160, 67, 0.45);
    font-size: 0.9rem;
}

/* Contact & Feature Icons */
.contact-card, .feature-card {
    text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.contact-card:hover, .feature-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.icon-circle {
    width: 56px; height: 56px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 0.85rem; border: 1px solid var(--border);
}
.icon-mail { background: rgba(79, 140, 255, 0.14); border-color: rgba(79, 140, 255, 0.4); color: #79b0ff; }
.icon-tg { background: rgba(34, 158, 217, 0.15); border-color: rgba(34, 158, 217, 0.45); color: #4ec3ff; }
.icon-channel { background: rgba(46, 160, 67, 0.14); border-color: rgba(46, 160, 67, 0.45); color: #56d364; }
.step-num {
    width: 42px; height: 42px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 0.75rem; font-weight: 800; font-size: 1.05rem;
    background: rgba(79, 140, 255, 0.16); border: 1px solid rgba(79, 140, 255, 0.45); color: var(--accent);
}

@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; border-inline-end: none; border-bottom: 1px solid var(--border); }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 960px) {
    .lp-nav { flex-wrap: wrap; justify-content: space-between; padding: 0.85rem 1rem; }
    .lp-menu { order: 3; width: 100%; justify-content: center; }
}

@media (max-width: 680px) {
    body { font-size: 14px; }
    .lp-nav { gap: 0.65rem; }
    .lp-menu { gap: 0.25rem; padding: 0.25rem; }
    .lp-menu-link { padding: 0.38rem 0.65rem; font-size: 0.82rem; }
    .lp-nav-actions { gap: 0.45rem; }
    .lp-hero { padding: 2.2rem 1rem 1.75rem; }
    .lp-hero-logo { height: 64px !important; }
    .lp-hero p { font-size: 0.98rem; margin-bottom: 1.35rem; }
    .lp-hero-cta { flex-direction: column; gap: 0.65rem; }
    .lp-hero-cta .btn { width: 100%; }
    .vega-banner { border-radius: 14px; font-size: 0.82rem; padding: 0.65rem 0.9rem; }
    .lp-section { padding: 1.6rem 1rem; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 0.85rem; }
    .card { padding: 1.05rem; margin-bottom: 1rem; }
    .footer { flex-direction: column; align-items: center; text-align: center; padding: 1.1rem 1rem; }
}
