* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; margin: 0; background: #0f0f12; color: #e4e4e7; min-height: 100vh; }
a { color: #7c9cff; text-decoration: none; }
a:hover { text-decoration: underline; }

.topnav { background: #18181b; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #27272a; }
.topnav a { color: #e4e4e7; }
.topnav .user { color: #71717a; font-size: 0.9rem; }
.topnav .user a { margin-left: 8px; }

.main { max-width: 1100px; margin: 0 auto; padding: 24px; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: 32px; width: 100%; max-width: 360px; }
.login-box h1 { margin: 0 0 4px; font-size: 1.5rem; }
.login-box .subtitle { color: #71717a; margin: 0 0 24px; }
.login-box label { display: block; margin-bottom: 16px; }
.login-box input { width: 100%; padding: 10px 12px; border: 1px solid #3f3f46; border-radius: 6px; background: #27272a; color: #e4e4e7; margin-top: 4px; }
.login-box button { width: 100%; padding: 10px; background: #7c9cff; color: #0f0f12; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; margin-top: 8px; }
.login-box button:hover { background: #93abff; }
.login-box .error { color: #f87171; margin-bottom: 12px; font-size: 0.9rem; }

.dashboard h1 { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin: 24px 0; }
.card { background: #18181b; border: 1px solid #27272a; border-radius: 8px; padding: 20px; }
.card .num { font-size: 1.75rem; font-weight: 700; color: #7c9cff; display: block; }

.section { margin: 32px 0; }
.section h2 { font-size: 1.1rem; margin-bottom: 12px; color: #a1a1aa; }
.form label { display: block; margin-bottom: 12px; }
.form input[type="text"], .form input[type="password"], .form input[type="number"], .form input[type="datetime-local"], .form select, .form textarea { width: 100%; max-width: 400px; padding: 8px 12px; border: 1px solid #3f3f46; border-radius: 6px; background: #27272a; color: #e4e4e7; }
.form textarea { min-height: 120px; }
.form button { padding: 10px 20px; background: #7c9cff; color: #0f0f12; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; }
.form button:hover { background: #93abff; }
.form label.inline { display: inline; margin-right: 16px; }
.form fieldset { border: 1px solid #3f3f46; border-radius: 6px; padding: 12px; margin-bottom: 12px; max-width: 600px; }
.form fieldset legend { padding: 0 8px; }

.table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #27272a; }
.table th { color: #71717a; font-weight: 600; }
.table tr.expired { opacity: 0.6; }
.table code { font-size: 0.85rem; background: #27272a; padding: 2px 6px; border-radius: 4px; }
.btn-link { background: none; border: none; color: #f87171; cursor: pointer; padding: 0; font-size: inherit; }
.btn-link:hover { text-decoration: underline; }

.success { color: #6ee7b7; }
.message { margin: 16px 0; padding: 12px; background: #27272a; border-radius: 6px; }
pre { background: #18181b; padding: 16px; border-radius: 8px; overflow-x: auto; font-size: 0.9rem; border: 1px solid #27272a; }

/* Landing page – Electron-style */
.landing { background: #0a0a0c; color: #e4e4e7; position: relative; min-height: 100vh; }
.landing-bg {
    position: fixed; inset: 0; z-index: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}
.landing-nav { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 20px 32px; max-width: 1280px; margin: 0 auto; }
.landing-nav .logo { font-weight: 700; font-size: 1.35rem; color: #fff; }
.landing-nav .nav-links { display: flex; align-items: center; gap: 28px; }
.landing-nav .nav-links a { color: #a1a1aa; font-size: 0.95rem; }
.landing-nav .nav-links a:hover { color: #fff; }
.btn { display: inline-block; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: opacity 0.2s; }
.btn:hover { opacity: 0.9; }
.btn-sm { padding: 8px 16px; font-size: 0.9rem; }
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-white { background: #fff; color: #0f0f12; }
.btn-white:hover { background: #f4f4f5; }
.btn-outline { background: transparent; color: #7c9cff; border: 2px solid #7c9cff; }
.btn-outline:hover { background: rgba(124,156,255,0.1); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.hero-split { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; max-width: 1280px; margin: 0 auto; padding: 60px 32px 100px; min-height: 75vh; }
@media (max-width: 900px) { .hero-split { grid-template-columns: 1fr; text-align: center; } }
.hero-content { max-width: 520px; }
.hero-title { font-size: clamp(2.25rem, 5vw, 3.25rem); font-weight: 800; margin: 0 0 20px; line-height: 1.15; color: #fff; letter-spacing: -0.02em; }
.hero-tagline { color: #a1a1aa; font-size: 1.15rem; line-height: 1.6; margin: 0 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
@media (max-width: 900px) { .hero-cta { justify-content: center; } }
.hero-trusted { color: #71717a; font-size: 0.9rem; margin: 0; }

.hero-preview { display: flex; justify-content: flex-end; }
@media (max-width: 900px) { .hero-preview { justify-content: center; } }
.preview-panel {
    background: rgba(24,24,27,0.95); border: 1px solid #27272a; border-radius: 16px; padding: 24px; width: 100%; max-width: 380px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto 1fr;
    gap: 20px;
}
.preview-stats { grid-column: 1; }
.preview-stat-big { font-size: 2rem; font-weight: 700; color: #3b82f6; }
.preview-stat-label { font-size: 0.85rem; color: #71717a; margin-top: 4px; }
.preview-chart { grid-column: 1; height: 60px; }
.preview-chart .chart-line { width: 100%; height: 100%; color: #3b82f6; opacity: 0.8; }
.preview-mini-stats { grid-column: 1; display: flex; gap: 20px; font-size: 0.9rem; color: #a1a1aa; }
.preview-mini-stats .num { color: #e4e4e7; font-weight: 600; margin-right: 4px; }
.preview-sidebar { grid-row: 1 / -1; grid-column: 2; border-left: 1px solid #27272a; padding-left: 16px; }
.preview-sidebar-title { font-size: 0.7rem; text-transform: uppercase; color: #71717a; margin-bottom: 10px; }
.preview-sidebar-item { display: block; font-size: 0.85rem; color: #a1a1aa; margin-bottom: 6px; }
.preview-sidebar-item:hover { color: #fff; }

.section-landing { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 64px 24px; }
.section-landing h2 { text-align: center; margin: 0 0 16px; font-size: 1.75rem; color: #fff; }
.section-desc { text-align: center; color: #a1a1aa; margin: 0 0 40px; max-width: 560px; margin-left: auto; margin-right: auto; }
.section-alt { background: rgba(18,18,20,0.6); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; margin-top: 32px; }
.feature-card { background: rgba(24,24,27,0.8); border: 1px solid #27272a; border-radius: 12px; padding: 24px; }
.feature-card h3 { margin: 0 0 8px; font-size: 1.1rem; color: #fff; }
.feature-card p { margin: 0; color: #a1a1aa; font-size: 0.95rem; line-height: 1.5; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; justify-content: center; margin-top: 32px; }
.pricing-card { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: 28px; position: relative; }
.pricing-card.featured { border-color: #3b82f6; }
.pricing-card .badge { position: absolute; top: -10px; right: 16px; background: #3b82f6; color: #fff; font-size: 0.75rem; padding: 4px 10px; border-radius: 6px; font-weight: 600; }
.pricing-card h3 { margin: 0 0 8px; color: #fff; }
.pricing-card .price { font-size: 1.25rem; color: #3b82f6; font-weight: 600; margin: 8px 0 16px; }
.pricing-card p { color: #a1a1aa; font-size: 0.95rem; line-height: 1.5; margin-bottom: 24px; }
.cta-section { text-align: center; }
.cta-section h2 { margin-bottom: 24px; color: #fff; }
.landing-footer { position: relative; z-index: 1; text-align: center; padding: 32px; border-top: 1px solid #27272a; color: #71717a; font-size: 0.9rem; }
.landing-footer a { margin: 0 12px; color: #a1a1aa; }
.landing-footer a:hover { color: #fff; }

/* Customer panel – Electron-style sidebar layout */
.panel-customer { background: #0f0f12; min-height: 100vh; }
.panel-topbar { background: #18181b; border-bottom: 1px solid #27272a; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; }
.panel-logo { font-weight: 700; color: #e4e4e7; font-size: 1.1rem; }
.panel-user { color: #71717a; font-size: 0.9rem; }
.panel-user a { color: #7c9cff; margin-left: 8px; }
.panel-wrap { display: flex; min-height: calc(100vh - 49px); }
.panel-sidebar { width: 220px; min-width: 220px; background: #18181b; border-right: 1px solid #27272a; padding: 20px 0; }
.panel-nav { display: flex; flex-direction: column; gap: 2px; }
.panel-nav-group { font-size: 0.7rem; text-transform: uppercase; color: #71717a; padding: 8px 20px 4px; }
.panel-nav-item { padding: 10px 20px; color: #a1a1aa; font-size: 0.95rem; border-left: 3px solid transparent; }
.panel-nav-item:hover { color: #e4e4e7; background: rgba(255,255,255,0.03); }
body.customer-licenses .panel-nav-item[href*="licenses"],
body.customer-settings .panel-nav-item[href*="licenses"],
body.customer-api_key .panel-nav-item[href*="api_key"],
body.customer-license_edit .panel-nav-item[href*="licenses"],
body.customer-dashboard .panel-nav-item[href*="dashboard"],
body.customer-logs .panel-nav-item[href*="logs"] { color: #7c9cff; border-left-color: #7c9cff; background: rgba(124,156,255,0.08); }
.panel-main { flex: 1; padding: 24px; overflow: auto; }
.panel-main .main { max-width: none; padding: 0; }
@media (max-width: 768px) {
    .panel-sidebar { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid #27272a; padding: 12px; }
    .panel-wrap { flex-direction: column; }
    .panel-nav { flex-direction: row; flex-wrap: wrap; }
    .panel-nav-group { width: 100%; padding: 4px 12px; }
    .panel-nav-item { padding: 8px 12px; border-left: none; border-bottom: 2px solid transparent; }
}

/* Settings (Electron-style triggers – category grid) */
.settings-page-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.settings-page-header h1 { margin: 0 0 4px; }
.settings-subtitle { margin: 0; font-size: 0.9rem; color: #a1a1aa; }
.settings-saved-msg { margin-bottom: 16px; }
.settings-intro { margin-bottom: 24px; }
.settings-form { max-width: none; }
.settings-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 900px) { .settings-form-grid { grid-template-columns: 1fr; } }
.settings-form-actions { grid-column: 1 / -1; margin-top: 8px; }
.settings-category { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: 20px; margin-bottom: 0; }
.settings-category-card { display: flex; flex-direction: column; }
.settings-category-title { margin: 0 0 4px; font-size: 1.1rem; font-weight: 600; color: #e4e4e7; }
.settings-category-desc { margin: 0 0 16px; font-size: 0.85rem; color: #71717a; line-height: 1.4; }
.settings-triggers { display: flex; flex-direction: column; gap: 12px; }
.settings-trigger-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.settings-trigger-name { flex: 1; min-width: 140px; color: #e4e4e7; }
.settings-trigger-name .trigger-code { font-size: 0.9rem; background: #27272a; padding: 4px 8px; border-radius: 6px; border: 1px solid #3f3f46; font-weight: 500; }
.settings-trigger-action { padding: 6px 10px; border-radius: 6px; border: 1px solid #3f3f46; background: #27272a; color: #e4e4e7; min-width: 90px; font-size: 0.9rem; }
.settings-trigger-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin-left: auto; }
.settings-trigger-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #3f3f46; border-radius: 24px; transition: 0.2s; }
.toggle-slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.settings-trigger-toggle input:checked + .toggle-slider { background: #3b82f6; }
.settings-trigger-toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.settings-form .btn { margin-top: 8px; }
.settings-help-btn { align-self: center; }
.settings-defaults-section { margin-bottom: 0; }
.settings-defaults-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; }
.settings-defaults-row label { display: flex; flex-direction: column; gap: 6px; }
.settings-defaults-label { font-size: 0.9rem; color: #a1a1aa; }
.settings-ban-duration-input { width: 120px; padding: 8px 12px; border: 1px solid #3f3f46; border-radius: 6px; background: #27272a; color: #e4e4e7; }
.form-note { font-size: 0.9rem; color: #71717a; margin: 8px 0 16px; }

/* Triggers overview (admin read-only grid) */
.triggers-overview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 24px; }
@media (max-width: 900px) { .triggers-overview-grid { grid-template-columns: 1fr; } }
.triggers-overview-card { margin-bottom: 0; }
.triggers-overview-list { margin: 0; padding-left: 20px; list-style: none; }
.triggers-overview-list li { margin-bottom: 8px; font-size: 0.95rem; color: #a1a1aa; }
.triggers-overview-list .trigger-code { margin-right: 8px; }
.triggers-overview-label { color: #e4e4e7; }

.license-edit-form .section { margin-bottom: 32px; }
.license-edit-triggers { margin-top: 16px; }

.monitoring-placeholder { max-width: 560px; }
.monitoring-card { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: 28px; }
.monitoring-card h2 { margin: 0 0 16px; font-size: 1.25rem; }
.monitoring-card ul { margin: 12px 0; padding-left: 24px; color: #a1a1aa; }
body.customer-monitoring .panel-nav-item[href*="monitoring"] { color: #7c9cff; border-left-color: #7c9cff; background: rgba(124,156,255,0.08); }

/* Admin panel – Electron-style sidebar + dashboard */
.panel-admin { background: #0f0f12; min-height: 100vh; }
body.admin-dashboard .panel-nav-item[href*="dashboard"],
body.admin-licenses .panel-nav-item[href*="licenses"],
body.admin-logs .panel-nav-item[href*="logs"],
body.admin-users .panel-nav-item[href*="users"],
body.admin-customers .panel-nav-item[href*="customers"],
body.admin-triggers .panel-nav-item[href*="triggers"],
body.admin-events .panel-nav-item[href*="events"],
body.admin-settings .panel-nav-item[href*="settings"],
body.admin-license_edit .panel-nav-item[href*="licenses"],
body.admin-players .panel-nav-item[href*="players"],
body.admin-monitoring .panel-nav-item[href*="monitoring"] { color: #7c9cff; border-left-color: #7c9cff; background: rgba(124,156,255,0.08); }

.admin-dashboard-title { margin: 0 0 24px; font-size: 1.5rem; font-weight: 600; color: #e4e4e7; }
.admin-server-block { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: 20px 24px; margin-bottom: 24px; max-width: 560px; }
.admin-server-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.admin-server-status { font-size: 0.75rem; padding: 4px 8px; border-radius: 6px; font-weight: 600; }
.admin-server-online { background: #166534; color: #bbf7d0; }
.admin-server-meta { display: flex; gap: 20px; font-size: 0.9rem; color: #71717a; margin-bottom: 16px; }
.admin-server-actions { display: flex; gap: 10px; }
.admin-server-btn { padding: 8px 16px; border-radius: 6px; font-size: 0.9rem; font-weight: 500; background: #3b82f6; color: #fff; text-decoration: none; }
.admin-server-btn:hover { background: #2563eb; }
.admin-server-btn-outline { background: transparent; border: 1px solid #3f3f46; color: #e4e4e7; }
.admin-server-btn-outline:hover { background: #27272a; }
.admin-chart-block { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: 20px 24px; margin-bottom: 24px; }
.admin-chart-title { margin: 0 0 16px; font-size: 1rem; font-weight: 600; color: #e4e4e7; }
.admin-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.admin-chart-bar { min-width: 24px; flex: 1; background: #3b82f6; border-radius: 4px 4px 0 0; transition: height 0.2s; }
.admin-chart-labels { display: flex; gap: 6px; margin-top: 8px; font-size: 0.7rem; color: #71717a; }
.admin-chart-labels span { flex: 1; min-width: 24px; text-align: center; }
.admin-stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-stat-card { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: 20px; text-align: center; }
.admin-stat-num { display: block; font-size: 2rem; font-weight: 700; color: #3b82f6; }
.admin-stat-label { font-size: 0.8rem; color: #71717a; text-transform: uppercase; letter-spacing: 0.02em; }
.admin-actions-block { background: #18181b; border: 1px solid #27272a; border-radius: 12px; padding: 20px 24px; max-width: 560px; }
.admin-actions-title { margin: 0 0 4px; font-size: 1rem; font-weight: 600; color: #e4e4e7; }
.admin-actions-desc { margin: 0 0 16px; font-size: 0.85rem; color: #71717a; }
.admin-action-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-action-btn { padding: 10px 18px; border-radius: 6px; font-size: 0.9rem; font-weight: 500; background: #27272a; border: 1px solid #3f3f46; color: #e4e4e7; cursor: pointer; }
.admin-action-btn:hover:not(:disabled) { background: #3f3f46; }
.admin-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.form-row-inline { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.form-row-inline input { flex: 1; max-width: 320px; }
.license-created-box { margin-bottom: 24px; }
.license-created-box pre.license-key-display { margin-top: 12px; word-break: break-all; font-size: 0.95rem; }
