/* License server shell: sidebar + main */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body.ls-app {
    margin: 0;
    min-height: 100vh;
    display: flex;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
}

/* ----- Sidebar ----- */
.ls-sidebar {
    width: 260px;
    min-width: 260px;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
}

.ls-sidebar-brand {
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.ls-sidebar-brand a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ls-sidebar-brand span {
    opacity: 0.85;
    font-weight: 500;
    font-size: 0.75rem;
    display: block;
    margin-top: 0.25rem;
    color: #94a3b8;
}

.ls-nav {
    padding: 1rem 0;
    flex: 1;
}

.ls-nav-section {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 1.25rem 0.35rem;
}

.ls-nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.ls-nav a:hover {
    background: rgba(30, 41, 59, 0.85);
    color: #f8fafc;
}

.ls-nav a.ls-active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.2), transparent);
    border-left-color: #667eea;
    color: #fff;
    font-weight: 600;
}

.ls-nav-icon {
    width: 1.25rem;
    text-align: center;
    opacity: 0.9;
}

.ls-sidebar-foot {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    font-size: 0.8rem;
    color: #64748b;
}

.ls-sidebar-foot .ls-user {
    color: #cbd5e1;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.ls-sidebar-foot a {
    color: #94a3b8;
    text-decoration: none;
}

.ls-sidebar-foot a:hover {
    color: #f87171;
}

/* ----- Main ----- */
.ls-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ls-topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ls-topbar h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.ls-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ls-topbar-actions a,
.ls-topbar-actions button {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.ls-btn-ghost {
    background: #f1f5f9;
    color: #334155;
}

.ls-btn-ghost:hover {
    background: #e2e8f0;
}

.ls-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.ls-btn-primary:hover {
    filter: brightness(1.05);
}

.ls-content {
    padding: 1.5rem 1.75rem 2.5rem;
    flex: 1;
}

/* ----- Index / marketing blocks ----- */
.ls-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 12px;
    padding: 2rem 2.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.25);
}

.ls-hero h2 {
    margin: 0 0 0.5rem;
    font-size: 1.65rem;
}

.ls-hero p {
    margin: 0;
    opacity: 0.92;
    line-height: 1.55;
    max-width: 52rem;
}

.ls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ls-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem 1.35rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ls-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #0f172a;
}

.ls-card p {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

.ls-card a {
    display: inline-block;
    margin-top: 0.75rem;
    color: #667eea;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
}

.ls-card a:hover {
    text-decoration: underline;
}

.ls-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: #0f172a;
}

.ls-api-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
}

.ls-api-table th,
.ls-api-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.ls-api-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}

.ls-api-table code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.ls-api-table tr:last-child td {
    border-bottom: none;
}

/* ----- Login (installations guest) ----- */
.ls-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem 1rem;
}

.ls-login-box {
    background: #fff;
    padding: 2.25rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 380px;
    border: 1px solid #e2e8f0;
}

.ls-login-box h2 {
    margin: 0 0 1.5rem;
    text-align: center;
    color: #0f172a;
    font-size: 1.25rem;
}

.ls-login-box input {
    width: 100%;
    padding: 0.75rem 0.85rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.ls-login-box button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.ls-login-box button[type="submit"]:hover {
    filter: brightness(1.05);
}

.ls-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* ----- Admin dashboard (installations) — keep existing utility class names working ----- */
.ls-content .stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.ls-content .stat-card {
    background: #fff;
    padding: 1.15rem 1.25rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ls-content .stat-card h3 {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.ls-content .stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
}

.ls-content .installations {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ls-content .installations h2 {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1.05rem;
    margin: 0;
}

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

.ls-content th {
    background: #f8fafc;
    padding: 0.65rem 0.85rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.ls-content td {
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    border-bottom: 1px solid #f1f5f9;
}

.ls-content tr:hover {
    background: #f8fafc;
}

.ls-content .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.ls-content .badge.trial { background: #fff3cd; color: #856404; }
.ls-content .badge.paid { background: #d4edda; color: #155724; }
.ls-content .badge.active { background: #d1ecf1; color: #0c5460; }
.ls-content .badge.expired { background: #f8d7da; color: #721c24; }
.ls-content .badge.suspended { background: #e2e3e5; color: #383d41; }

.ls-content .btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin: 2px;
}

.ls-content .btn-activate { background: #28a745; color: white; }
.ls-content .btn-activate:hover { background: #218838; }
.ls-content .btn-extend { background: #8b5cf6; color: white; }
.ls-content .btn-extend:hover { background: #7c3aed; }
.ls-content .btn-suspend { background: #ffc107; color: #333; }
.ls-content .btn-suspend:hover { background: #e0a800; }
.ls-content .btn-delete { background: #dc3545; color: white; }
.ls-content .btn-delete:hover { background: #c82333; }

.ls-content .online { color: #28a745; font-weight: 600; }
.ls-content .offline { color: #dc3545; font-weight: 600; }

@media (max-width: 900px) {
    body.ls-app {
        flex-direction: column;
    }

    .ls-sidebar {
        width: 100%;
        min-width: 100%;
        min-height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.5rem 0;
    }

    .ls-sidebar-brand {
        border-bottom: none;
        padding: 0.75rem 1rem;
    }

    .ls-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 0.25rem 0.5rem;
        flex: 1;
    }

    .ls-nav-section {
        display: none;
    }

    .ls-nav a {
        border-left: none;
        border-radius: 8px;
        padding: 0.5rem 0.85rem;
    }

    .ls-nav a.ls-active {
        border-left: none;
        background: rgba(102, 126, 234, 0.25);
    }

    .ls-sidebar-foot {
        width: 100%;
        border-top: 1px solid rgba(148, 163, 184, 0.15);
    }
}
